2008-01-24 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / mcs / ChangeLog
1 2008-01-24  Marek Safar  <marek.safar@gmail.com>
2
3         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
4         Fixed user operator conversions.
5         
6 2008-01-24  Marek Safar  <marek.safar@gmail.com>
7
8         * generic.cs: Do nullable type to null comparison optimization during
9         resolve phase.
10         
11 2008-01-24  Marek Safar  <marek.safar@gmail.com>
12
13         A fix for bug #355163
14         * generic.cs: Enabled l-value resolve on nullable expressions.
15         
16 2008-01-24  Marek Safar  <marek.safar@gmail.com>
17
18         A fix for bug #353986
19         * class.cs: Ingore static ctors with parameters for any further checks.
20         
21 2008-01-24  Marek Safar  <marek.safar@gmail.com>
22
23         A fix for bug #354310
24         * namespace.cs: Removed redundant check.
25
26 2008-01-24  Marek Safar  <marek.safar@gmail.com>
27
28         A fix for bug #354928
29         * expression.cs: ElementInitializers can be resolved only once.
30         
31 2008-01-24  Marek Safar  <marek.safar@gmail.com>
32
33         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
34         Condition expressions.
35         
36 2008-01-23  Marek Safar  <marek.safar@gmail.com>
37
38         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
39
40 2008-01-22  Marek Safar  <marek.safar@gmail.com>
41
42         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
43         not allowed.
44         
45         * generic.cs: Implemented coalesce expression.
46
47 2008-01-22  Marek Safar  <marek.safar@gmail.com>
48
49         A fix for bug #355145
50         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
51         expression tree type inference.
52
53 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
54
55         Fix #354663
56         * expression.cs (Binary.IsUnsignedType): Fix typo.
57         
58 2008-01-22  Marek Safar  <marek.safar@gmail.com>
59
60         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
61         
62 2008-01-22  Marek Safar  <marek.safar@gmail.com>
63
64         A fix for bug #355161
65         * ecore.cs, expression.cs: Wider range of extension method supported
66         expressions.
67  
68 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
69
70         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
71         AssemblyBuilder to operate in compiler context. Fixes mcs part of
72         bug #354970.
73
74 2008-01-22  Marek Safar  <marek.safar@gmail.com>
75
76         A fix for bug #355148
77         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
78         
79 2008-01-22  Miguel de Icaza  <miguel@novell.com>
80
81         * expression.cs (CreateExpressionTree): Add support for or and
82         logical or, and indent following the coding conventions.
83
84         * typemanager.cs (LinqExpression): renamed from
85         ExpressionTreeManager, for a shorter name.
86
87         Use TypeManager.CoreLookupType to lookup types from our core
88         assemblies and turn those into "Type" variables.
89
90         Consumers that previously used "Namespace" and "Type" from this
91         class should instead use the TypeExpression which is a type that
92         is fully resolved (without involving the regular C# resolution
93         rules). 
94
95         This typically looks like this:
96
97         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
98         new MemberAccess (texpr, name, type_arguments, loc)
99
100         This avoids the problem in: #355178
101
102 2008-01-21  Marek Safar  <marek.safar@gmail.com>
103
104         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
105         feature in parser only as we do in other cases.
106         
107 2008-01-21  Marek Safar  <marek.safar@gmail.com>
108
109         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
110         typemanager.cs: A refactoring of params arguments to reuse existing
111         expressions (params -> array initializer) to emit params argument instead
112         of specialized handling.
113         It was required by expression tree implementation and it has other benefits
114         as well, we now apply same optimization for params arguments as we do for
115         array initializers.
116         
117 2008-01-18  Marek Safar  <marek.safar@gmail.com>
118
119         A fix for bug #353526
120         * generic.cs: A type inference of params arguments may not required any
121         temporary array creation.
122         
123 2008-01-18  Marek Safar  <marek.safar@gmail.com>
124
125         A fix for bug #353534
126         * generic.cs, ecore.cs, expression.cs: A method group type inference is
127         supported for delegates only.
128         
129 2008-01-18  Marek Safar  <marek.safar@gmail.com>
130
131         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
132         type for more than 1 candidates.
133         
134 2008-01-18  Marek Safar  <marek.safar@gmail.com>
135
136         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
137         expressions.
138         
139 2008-01-16  Marek Safar  <marek.safar@gmail.com>
140
141         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
142         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
143         operator) expressions. 
144                 
145 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
146
147         * statement.cs: Avoid declaring an IL variable for this_variable since it is
148         not accessed from the generated IL.
149
150 2008-01-14  Marek Safar  <marek.safar@gmail.com>
151
152         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
153         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
154         statement.cs: The first expression tree implementation drop, mostly
155         infrastructure work.
156
157 2008-01-14  Marek Safar  <marek.safar@gmail.com>
158
159         * ecore.cs (IsNestedChild): Refactored.
160
161 2008-01-11  Marek Safar  <marek.safar@gmail.com>
162
163         * lambda.cs: Don't use a cast on unknown expression statement.
164
165 2008-01-10  Geoff Norton  <gnorton@novell.com>
166
167         * cs-tokenizer.cs: One more token to distinguish between method and lambda
168         arguments
169
170 2008-01-09  Marek Safar  <marek.safar@gmail.com>
171
172         * doc.cs: Report better /doc crash details.
173         
174 2008-01-09  Marek Safar  <marek.safar@gmail.com>
175
176         A fix for bug #352536
177         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
178
179 2008-01-08  Marek Safar  <marek.safar@gmail.com>
180
181         A fix for bug #352287
182         * ecore.cs, expression.cs: Do `this' access checking in all member access
183         expressions.
184         
185 2008-01-08  Marek Safar  <marek.safar@gmail.com>
186
187         * rootcontext.cs, driver.cs: Switch to linq mode by default.
188         
189         * report.cs: Reset message stacks.
190         
191 2008-01-08  Marek Safar  <marek.safar@gmail.com>
192
193         * generic.cs (InferInPhases): Correctly calculate params position.
194         
195 2008-01-08  Marek Safar  <marek.safar@gmail.com>
196
197         * cs-tokenizer.cs: No need to parse full string when parsing lambda
198         arguments.
199
200 2008-01-07  Marek Safar  <marek.safar@gmail.com>
201
202         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
203         
204         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
205         
206         * driver.cs: Updated --help option.
207         
208 2008-01-07  Marek Safar  <marek.safar@gmail.com>
209
210         * generic.cs (InferParamsTypeArguments): Removed.
211         (InferInPhases): Add params type inference.
212         (LowerBoundInference): Fixed scoring mechanism.
213         
214         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
215         
216 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
217
218         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
219         byte array for unsigned "baked" assemblies.
220
221 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
222
223         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
224         array for assemblies that are not strongnamed.
225
226 2008-01-04  Marek Safar  <marek.safar@gmail.com>
227
228         A fix for bug #351481
229         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
230         declaring type for nested generic types.
231         
232 2008-01-04  Marek Safar  <marek.safar@gmail.com>
233
234         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
235         instead of ToString.
236         
237 2008-01-03  Marek Safar  <marek.safar@gmail.com>
238
239         A fix for bug #351047
240         * expression.cs (Binary.ResolveOperator): Allow equality operators between
241         null and structs only when equality and inequality operators are defined
242         either as an user-operators or predefined operators.
243         
244 2008-01-03  Marek Safar  <marek.safar@gmail.com>
245
246         A fix for bug #351047
247         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
248         
249 2008-01-03  Marek Safar  <marek.safar@gmail.com>
250
251         A fix for bug #351257
252         * cs-tokenizer.cs: Advance line number for '\r' correctly.
253         
254 2008-01-03  Marek Safar  <marek.safar@gmail.com>
255
256         A fix for bug #351157
257         * class.cs (Using): Fixed yet another broken cloning.
258         
259         (Block): Put back more sensible default value for statements.
260         
261 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
262
263         * codegen.cs: Allow AssemblyVersion with only major version component.
264         Fixes bug #351055.
265
266 2007-12-29  Marek Safar  <marek.safar@gmail.com>
267
268         A fix for bug #324654
269         * class.cs: Use FullName property as member name.
270
271 2007-12-28  Marek Safar  <marek.safar@gmail.com>
272
273         A fix for bug #342117
274         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
275         constructor constraint.
276
277 2007-12-28  Marek Safar  <marek.safar@gmail.com>
278
279         A fix for bug #338273
280         * class.cs (ProbertyBase): Access modifier checks are required for overrides
281         only.
282
283 2007-12-28  Marek Safar  <marek.safar@gmail.com>
284
285         A fix for bug #350839
286         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
287
288 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
289
290         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
291         GHOP:
292         
293         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
294
295         * statement.cs: Changed some Hashtables to use HybridDictionaries
296         instead. It was observed that some HashTables only contained a few
297         items in the vast majority of cases. Since HybridDictionary is
298         more efficient on small sets (<10 elements), "known_variables"
299         from class ExplicitBlock as well as "labels" and "constants " from
300         class Block were changed to HybridDictionaries. 
301
302         Atsai results: (56216kb->54987kb)
303
304         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
305
306
307 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
308
309         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
310         GHOP:
311         
312         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
313         
314         * expression.cs: foreach loop to for loop, saved on allocation of
315         enumerator (59333kb->59141kb)
316
317         * statement.cs. Changed foreach loops to for loops, saved on
318         allocation of enumerator (59141kb->59006kb)
319
320         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
321         when constructed with no specified capacity. This was causing a
322         few ArrayLists to allocate more memory than they would potentially
323         need in the Block class and MemberCache class. Setting the
324         ArrayLists to construct with a capacity of 1 saves some
325         memory. (56216kb->55585kb)
326
327 2007-12-27  Marek Safar  <marek.safar@gmail.com>
328
329         A fix for bug #347189 (2nd issue)
330         * expression.cs (MemberAccess): Nested type can be found in base non-generic
331         type.
332
333 2007-12-27  Miguel de Icaza  <miguel@novell.com>
334         
335         * report.cs: Do not use colors if stdout and stderr are not a
336         terminal.
337
338 2007-12-27  Marek Safar  <marek.safar@gmail.com>
339
340         A fix for bug #346998
341         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
342         overloads.
343
344 2007-12-27  Marek Safar  <marek.safar@gmail.com>
345
346         A fix for bug #343465
347         * class.cs: Explicit method name for nested types uses dots only.
348
349 2007-12-27  Marek Safar  <marek.safar@gmail.com>
350
351         A fix for bug #343707
352         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
353
354 2007-12-27  Marek Safar  <marek.safar@gmail.com>
355
356         * ecore.cs: Report type inference errors only when arguments count matches
357         parameter count.
358         
359         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
360         
361         * expression.cs, report.cs: New warning.
362         
363         * typemanager.cs: Catch anonymous method type too.
364
365 2007-12-23  Marek Safar  <marek.safar@gmail.com>
366
367         A fix for bug #346379
368         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
369
370 2007-12-23  Marek Safar  <marek.safar@gmail.com>
371
372         A fix for bug #347359
373         * expression.cs (Invocation): Don't resolve already resolved expression.
374
375 2007-12-23  Marek Safar  <marek.safar@gmail.com>
376
377         A fix for bug #347189
378         * class.cs (FixedField): Use non-dependent code only in the define phase.
379
380 2007-12-23  Marek Safar  <marek.safar@gmail.com>
381
382         A fix for bug #348076
383         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
384
385 2007-12-22  Marek Safar  <marek.safar@gmail.com>
386
387         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
388         discovered extension methods.
389
390 2007-12-22  Marek Safar  <marek.safar@gmail.com>
391
392         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
393         method.
394
395 2007-12-21  Miguel de Icaza  <miguel@novell.com>
396
397         * report.cs (ErrorMessage): Add support for using colors on
398         terminals that support it. 
399
400 2007-12-21  Marek Safar  <marek.safar@gmail.com>
401
402         * ecore.cs: Use information about expanded params for error reporting.
403
404 2007-12-21  Marek Safar  <marek.safar@gmail.com>
405
406         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
407         and logic for params overloads.
408         
409 2007-12-15  Miguel de Icaza  <miguel@novell.com>
410
411         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
412         as this is also created from the parser.  Fixes #349034
413
414 2007-12-12  Miguel de Icaza  <miguel@novell.com>
415
416         * statement.cs (Throw.CloneTo): it is valid to have empty
417         expressions for throw. 
418
419 2007-12-03  Marek Safar  <marek.safar@gmail.com>
420
421         * cs-parser.jay: Set delegate constraint parsing region correctly.
422
423 2007-12-03  Marek Safar  <marek.safar@gmail.com>
424
425         A fix for bug #345467
426         * typemanager.cs (IsEqual): Compare generic parameters position only.
427         
428 2007-11-28  Marek Safar  <marek.safar@gmail.com>
429
430         * expression.cs (BaseAccess): Type arguments can be null.
431
432 2007-11-27  Raja R Harinath  <harinath@gmail.com>
433
434         * statement.cs (Block.Resolve): Ensure flow-branching tree is
435         consistent even when an error has occured.
436         (Switch.Resolve): Likewise.
437
438 2007-11-22  Marek Safar  <marek.safar@gmail.com>
439
440         A fix for bug #334505
441         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
442         overrides.
443         
444 2007-11-22  Marek Safar  <marek.safar@gmail.com>
445
446         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
447         refactorings required to resolve extension methods correctly when mixing
448         generics and non-generics members.
449         
450 2007-11-20  Marek Safar  <marek.safar@gmail.com>
451
452         A fix for bug #342584
453         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
454         conversion.
455         
456 2007-11-19  Marek Safar  <marek.safar@gmail.com>
457
458         A fix for bug #342512
459         * delegate.cs: Use delegate argument expression when is available. Don't
460         emit virtual call when class is sealed.
461         
462 2007-11-16  Marek Safar  <marek.safar@gmail.com>
463
464         A fix for bug #325423
465         * assign.cs (FieldInitializer): Use resolved expression for emit.
466         
467         * class.cs: Print less confusing error message.
468         
469 2007-11-16  Marek Safar  <marek.safar@gmail.com>
470
471         * cs-tokenizer.cs: Removed GMCS ifdefs.
472         
473         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
474         mcs.
475         
476         * cs-parser.jay: Disabled nullable check.
477         
478         * generic-mcs: Copied more generic stuff.
479                 
480 2007-11-16  Marek Safar  <marek.safar@gmail.com>
481
482         * gcs-parser.jay: Merged to cs-parser.jay.
483         
484         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
485         * *.csproj, *.sources: Updated to use only jay parser file.
486
487 2007-11-16  Marek Safar  <marek.safar@gmail.com>
488
489         * gcs-parser.jay: Added nullable and default expression feature checks.
490         
491 2007-11-16  Marek Safar  <marek.safar@gmail.com>
492
493         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
494         it fixes many TODOs and hidden bugs.
495         
496         * expression: Removed duplicate error check.
497
498 2007-11-15  Marek Safar  <marek.safar@gmail.com>
499
500         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
501         implicitly type local variable only when it is used in a declaration.
502
503 2007-11-15  Marek Safar  <marek.safar@gmail.com>
504
505         * attribute.cs: Use CS0612 for empty strings.
506
507 2007-11-14  Marek Safar  <marek.safar@gmail.com>
508
509         * lambda.cs, statement.cs: Contextual return may act as a statement.
510
511 2007-11-14  Marek Safar  <marek.safar@gmail.com>
512
513         A fix for a regression cause by #324222
514         * class.cs: Don't report unused even when it implements an interface.
515         
516 2007-11-13  Marek Safar  <marek.safar@gmail.com>
517
518         A fix for bug #341205
519         * ecore.cs, expression.cs: Method group expression cannot do static
520         method access with an instance reference check before overloading takes
521         a place.
522         
523 2007-11-13  Marek Safar  <marek.safar@gmail.com>
524
525         A fix for bug #325359
526         * class.cs: Use predictable name for automatically generated property.
527         
528 2007-11-12  Marek Safar  <marek.safar@gmail.com>
529
530         A fix for bug #324996
531         * expression.cs (Is): Handle case where D is nullable and T is not
532         correctly.
533         
534         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
535         
536 2007-11-12  Marek Safar  <marek.safar@gmail.com>
537
538         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
539         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
540         Flush small error reporting changes.
541         
542 2007-11-09  Marek Safar  <marek.safar@gmail.com>
543
544         A fix for bug #324996
545         * expression.cs: Rewrote Is expression implementation to work with
546         generics, nullable types, anonymous method. A const result expression 
547         uses existing infrastructure instead of custom not fully-featured one.
548         
549 2007-11-08  Marek Safar  <marek.safar@gmail.com>
550
551         A fix for bug #340202
552         * class.cs: Consider generics for volatile field.
553
554 2007-11-08  Marek Safar  <marek.safar@gmail.com>
555
556         A fix for bug #335594
557         * expression.cs: Use conversion rules when handling string addition.
558         
559 2007-11-07  Marek Safar  <marek.safar@gmail.com>
560
561         A fix for bug #336651
562         * expression.cs: Fixed a crash when probing is on.
563         
564 2007-11-07  Marek Safar  <marek.safar@gmail.com>
565
566         A fix for bug #324242
567         * covert.cs: Added a conversion from any nullable-type with an 
568         underlying enum-type to the type System.Enum.
569         
570 2007-11-07  Marek Safar  <marek.safar@gmail.com>
571
572         A fix for bug #324222
573         * class.cs: Report all non-used event fields.
574         
575 2007-11-07  Marek Safar  <marek.safar@gmail.com>
576
577         A fix for bug #325161
578         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
579         qualifier for generic types.
580         
581 2007-11-07  Marek Safar  <marek.safar@gmail.com>
582
583         A fix for bug #322971
584         * expression.cs, ecore.cs: Added intermediate result value check for
585         indexers. 
586         
587 2007-11-07  Marek Safar  <marek.safar@gmail.com>
588
589         A fix for bug #324754
590         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
591         when it was requested.
592
593 2007-11-07  Marek Safar  <marek.safar@gmail.com>
594
595         A fix for bug #325101
596         * expression.cs: Do type not value comparison for `is' expression.
597
598 2007-11-07  Marek Safar  <marek.safar@gmail.com>
599
600         A fix for bug #320236
601         * convert.cs: Don't apply user conversion on underlying target type.
602
603 2007-11-06  Marek Safar  <marek.safar@gmail.com>
604
605         * expression.cs: Don't use unresolved expression for error reporting.
606  
607 2007-11-06  Marek Safar  <marek.safar@gmail.com>
608
609         A fix for bugs #337712, #324490
610         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
611         overloading resolution too.
612         
613         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
614         the process consistent and more robust.
615         
616         * expression.cs, linq.cs, report.cs: Update.
617
618 2007-11-02  Marek Safar  <marek.safar@gmail.com>
619
620         A fix for bug #332909
621         * attribute.cs: Resolve attributes in correct context using error
622         handling procedure.
623         
624         * rootcontext.cs: Define Obsolete attribute members as core members.
625         
626 2007-11-02  Marek Safar  <marek.safar@gmail.com>
627
628         * statement.cs: Removed unused methods.
629         
630 2007-10-31  Wade Berrier  <wberrier@novell.com>
631
632         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
633         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
634         during 'make dist')
635
636 2007-10-31  Marek Safar  <marek.safar@gmail.com>
637
638         A fix for bug #338102
639         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
640         methods registered as non-generics.
641         
642 2007-10-31  Marek Safar  <marek.safar@gmail.com>
643
644         A fix for bugs #337712, #324490
645         * delegate.cs: Delegate covariance and contravariance is not allowed for
646         value types.
647         
648 2007-10-31  Marek Safar  <marek.safar@gmail.com>
649
650         A fix for bug #337719 
651         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
652         `from' keyword.
653         
654 2007-10-30  Marek Safar  <marek.safar@gmail.com>
655  
656         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
657
658 2007-10-29  Marek Safar  <marek.safar@gmail.com>
659  
660         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
661         query expressions.
662
663 2007-10-29  Raja R Harinath  <rharinath@novell.com>
664
665         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
666
667 2007-10-29  Marek Safar  <marek.safar@gmail.com>
668  
669         A fix for bug #334652
670         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
671         extension methods when we have not found the best candidate in normal
672         container.
673
674 2007-10-27  Marek Safar  <marek.safar@gmail.com>
675
676         * AssemblyInfo.cs: Keep up-to-date.
677
678 2007-10-27  Marek Safar  <marek.safar@gmail.com>
679
680         * Makefile: Fixed generics compiler name.
681         
682 2007-10-27  Marek Safar  <marek.safar@gmail.com>
683
684         * lambda.test: removed, lambda parsing is done differently.
685         
686         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
687
688 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
689
690         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
691
692 2007-10-27  Marek Safar  <marek.safar@gmail.com>
693
694         * Makefile, *.sources : All C# compilers are in mcs folder.
695         
696         * *.cs: Use existing 2_1 define for smcs.
697
698 2007-10-26  Marek Safar  <marek.safar@gmail.com>
699
700         A fix for bug #335847
701         * assign.cs, expression.cs: Couple of changes to avoid creating a
702         temporary variable for each object initializer assignment statement. It
703         simplifies struct initialization too, otherwise two temporary variables
704         would be required.
705         Implemented optimization of redundant default element initializers.
706         
707 2007-10-25  Marek Safar  <marek.safar@gmail.com>
708
709         A fix for bug #336766
710         * expression.cs (Class.CheckBase): Use generic name when method is
711         generic.
712         
713 2007-10-25  Marek Safar  <marek.safar@gmail.com>
714
715         A fix for bug #334737
716         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
717         variable and not variable argument for prepared copies.
718
719 2007-10-24  Marek Safar  <marek.safar@gmail.com>
720
721         A fix for bug #325110
722         * class.cs, expression.cs, attribute.cs: Use open generic method when
723         checking conditional attribute.
724         
725 2007-10-24  Marek Safar  <marek.safar@gmail.com>
726
727         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
728         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
729         FeatureIsNotAvailable.
730
731 2007-10-24  Marek Safar  <marek.safar@gmail.com>
732
733         ** C# 3.0 Partial methods
734         
735         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
736         methods support. Because of member cache issue with generics only
737         non-generics partial methods are fully supported.
738         
739 2007-10-23  Marek Safar  <marek.safar@gmail.com>
740         
741         * class.cs, decl.cs: Rewrote member overloads check to cope with 
742         generics and to use member cache for member checking. It also improves
743         performance and fixes remaining overloads issues.
744         
745 2007-10-20  Marek Safar  <marek.safar@gmail.com>
746         
747         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
748         roottypes.cs, typemanager.cs:
749                 
750         A member cache creation logic changed to add members immediately and
751         not rely on fallback. The member cache is now only prefered way
752         how to access and find type declaration members. It saves 5 MB of memory
753         during MWF compilation and makes code ready for more optimizations and
754         clean-ups, it's also a pre-requirement for partial methods.
755         
756 2007-10-18  Raja R Harinath  <harinath@gmail.com>
757
758         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
759         handling for generic parameters.
760
761 2007-10-15  Marek Safar  <marek.safar@gmail.com>
762         
763         * class.cs (FixedField): Removed redundant volatile check.
764         
765 2007-10-15  Marek Safar  <marek.safar@gmail.com>
766         
767         * class.cs, decl.cs: Fixed overload members verification to do only one
768         check per possible collision.
769         
770 2007-10-13  Marek Safar  <marek.safar@gmail.com>
771         
772         A fix for bug #325478
773         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
774         and create only one disposable flags container.
775         
776 2007-10-12  Marek Safar  <marek.safar@gmail.com>
777         
778         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
779         * statement.cs (Fixed): Fixed variables cloning.
780         
781 2007-10-12  Marek Safar  <marek.safar@gmail.com>
782         
783         A fix for bug #333342
784         * class.cs (EventField): Don't mark value type event as synchronized. 
785         
786 2007-10-12  Marek Safar  <marek.safar@gmail.com>
787         
788         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
789         inference to identify best candidate method correctly.
790         (ProperyExpr): A range variable is read only and cannot be modified.
791         
792 2007-10-11  Marek Safar  <marek.safar@gmail.com>
793         
794         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
795         logic to identify best candidate method correctly.
796         
797 2007-10-11  Marek Safar  <marek.safar@gmail.com>
798         
799         * location.cs (Equals, GetHashCode): Removed.
800         
801 2007-10-11  Marek Safar  <marek.safar@gmail.com>
802         
803         * report.cs: Implemented message recorder. It is used mainly for lambda
804         expressions to capture otherwise swallowed error messages.
805         
806         * anonymous.cs, lambda.cs.cs: Do full parameters check.
807
808         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
809         and not at the top.
810         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
811                 
812         * expression.cs (MemberAccess): Always report lookup failure.
813         
814         * location.cs: Implemented Equals, GetHashCode.
815         
816         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
817         
818 2007-10-10  Jb Evain  <jbevain@novell.com>
819
820         * codegen.cs: re-enable assembly version check.
821
822 2007-10-09  Marek Safar  <marek.safar@gmail.com>
823         
824         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
825         checks.
826         
827         * namespace.cs (UsingAlias): Do correct version check.
828         
829 2007-10-08  Marek Safar  <marek.safar@gmail.com>
830         
831         * expresison.cs, ecore.cs: Issue extension method error message when
832         appropriate.
833         
834         * rootcontext.cs: Added ISO_2 compiler mode option.
835
836 2007-10-08  Marek Safar  <marek.safar@gmail.com>
837         
838         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
839          message.
840         
841 2007-10-08  Marek Safar  <marek.safar@gmail.com>
842         
843         * attribute.cs (GetString, GetBoolean): Work with both literal and
844         constant.
845         
846         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
847         Moved method overload specific methods to MethodGroupExpr.
848         
849         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
850         it should be less memory consuming.
851         
852 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
853
854         * codegen.cs: remove the assembly version check until the buildbot is
855         fixed.
856
857 2007-10-07  Jb Evain  <jbevain@novell.com>
858
859         * attribute.cs (Attribute.GetString): if the value
860         expression is a StringConstant, return its string value.
861
862 2007-10-07  Jb Evain  <jbevain@novell.com>
863
864         * typemanager.cs: add `assembly_version_attribute_type`.
865         * codegen.cs: on attribute emission, check that the
866         AssemblyVersionAttribute doesn't overflow.
867
868 2007-10-05  Marek Safar  <marek.safar@gmail.com>
869         
870         A fix for bug #324677
871         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
872         parent container of a scope container with currently resolved one. 
873         
874 2007-10-05  Marek Safar  <marek.safar@gmail.com>
875         
876         A fix for bug #325534
877         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
878         only.
879         
880 2007-10-05  Marek Safar  <marek.safar@gmail.com>
881         
882         A fix for bug #327504
883         * class.cs (Operator.Define): Refactored implicit and explicit user
884         operator conversion rules.
885         
886 2007-10-05  Marek Safar  <marek.safar@gmail.com>
887         
888         A fix for bug #327520
889         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
890         
891 2007-10-04  Marek Safar  <marek.safar@gmail.com>
892         
893         A fix for bug #328022
894         * class.cs (MethodData.Define): Use correct method to check whether
895         a method implementents an accessor.
896         
897 2007-10-04  Marek Safar  <marek.safar@gmail.com>
898         
899         A fix for bug #330069
900         * statement.cs (Fixed.Resolve): Read the first array element only when
901         an array is instantiated. 
902         
903 2007-10-04  Marek Safar  <marek.safar@gmail.com>
904         
905         * expression.cs, assign.cs, generics.cs: Print correct operator when
906         compound assignment is used.
907         
908 2007-10-04  Marek Safar  <marek.safar@gmail.com>
909         
910         A fix for bug #325841
911         * expression.cs (ArrayAccess): Use full argument cloning only for
912         string compound concatenation.
913         
914 2007-10-03  Marek Safar  <marek.safar@gmail.com>
915         
916         A fix for bug #328774
917         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
918         assignment.
919         (PropertyExpr.EmitAssign): Fixed string concatenation compound
920         assignment.
921
922 2007-10-03  Raja R Harinath  <rharinath@novell.com>
923
924         Fix #328490
925         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
926         Event accessibility checks here.  Remove some bogus code that
927         accidently made GenericMethods work.
928         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
929
930 2007-09-25  Marek Safar  <marek.safar@gmail.com>
931         
932         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
933         
934         * statement.cs (Block): Refactored AddVariable to allow error handling
935         customization.
936         
937         * generic.cs: New stub.
938         
939 2007-09-23  Marek Safar  <marek.safar@gmail.com>
940         
941         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
942         flag.
943         
944 2007-09-17  Marek Safar  <marek.safar@gmail.com>
945
946         * class.cs: Use partial container to record whether any partial part
947         contains static field initializer and therefore default contructor has
948         to be defined.
949         
950 2007-09-14  Marek Safar  <marek.safar@gmail.com>
951
952         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
953         mono-list when only one of two partial parts has defined accessibility
954         modifier.
955         
956 2007-09-14  Marek Safar  <marek.safar@gmail.com>
957
958         A fix for bug #82845
959         
960         * class.cs (TypeContainer): Set correct resolve context for all field
961         initializers.
962         
963 2007-09-13  Marek Safar  <marek.safar@gmail.com>
964
965         * assign.cs: Fixed a crash when field is resolved twice with an error.
966         
967         * codegen.cs: Changed InFieldInitializer to be flag.
968         
969         * anonymous.cs, ecore.cs, expression.cs: Update after
970         IsInFieldInitializer rename.
971         
972         * const.cs: Removed unused parameter.
973         
974         * class.cs: Changed the way how we resolve and emit field initializers.
975         The field initilizers have to have access to contructor block to emit
976         compiler generated code.
977
978 2007-09-13  Marek Safar  <marek.safar@gmail.com>
979
980         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
981         generics use TypeContainer instead.
982         
983 2007-09-12  Marek Safar  <marek.safar@gmail.com>
984         
985         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
986
987         * lambda.cs (ResolveParameters): Use more powerful
988         InflateGenericArgument.
989         
990         * parameters.cs: Better exception message.
991                 
992 2007-09-10  Marek Safar  <marek.safar@gmail.com>
993
994         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
995         correct expression block type. 
996         
997         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
998         
999         * expression.cs (Invocation): Extracted method group resolve to
1000         DoResolveOverload.
1001         
1002 2007-09-07  Marek Safar  <marek.safar@gmail.com>
1003
1004         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
1005         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
1006         
1007         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
1008         generic extension methods.
1009
1010 2007-09-06  Marek Safar  <marek.safar@gmail.com>
1011
1012         A fix for bug #82676 (Do I get it right now?)
1013         * convert.cs (Binary.ResolveOperator): An interface is converted to the
1014         object before a standard conversion is applied.
1015         
1016 2007-09-06  Marek Safar  <marek.safar@gmail.com>
1017
1018         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
1019         #82676.
1020         
1021 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1022
1023         A fix for bug #82676
1024         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
1025         non-generic interface types.
1026         
1027 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1028
1029         A fix for bug #82690
1030         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
1031         
1032 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1033
1034         A fix for bug #82571
1035         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
1036         modifier for container based methods.
1037         
1038 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1039
1040         A fix for bug #82676
1041         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
1042         any interface-type T means to any of interface type T.
1043
1044 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1045
1046         * namespace.cs: We have 2 versions of System.Core assembly.
1047
1048 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1049
1050         A fix for bug #82652
1051         * class.cs (Class.GetClassBases): Compare types and not expressions.
1052
1053 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1054
1055         A fix for bug #82620
1056         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
1057         actually never worked before.
1058         (IndexerAccess): Emit prepared arguments before they are modified.
1059         
1060 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1061
1062         A fix for bug #82563
1063         * assign.cs: Revert wrong fix.
1064         
1065         * expression.cs (VariableReference.EmitAssign): Handle ref reference
1066         correctly.
1067         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
1068         Instead of ldelema/stdind we have to use temporary variables to handle
1069         cases like String.Concat (params string[]).
1070         
1071 2007-08-31  Marek Safar  <marek.safar@gmail.com>
1072
1073         * class.cs: EmitAttributes to Emit rename.
1074         
1075         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
1076         null.
1077         (MemberCore.HasClsCompliantAttribute): Don't depend on 
1078         GetClsCompliantAttributeValue execution.
1079         
1080 2007-08-31  Marek Safar  <marek.safar@gmail.com>
1081
1082         * anonymous.cs: Use shorter type prefix.
1083         
1084         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
1085         when exist.
1086         
1087         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
1088         variables when probing is on.
1089         
1090         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
1091         unresolved variables.
1092         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
1093         handle transparent identifiers.
1094         
1095 2007-08-26  Marek Safar  <marek.safar@gmail.com>
1096
1097         * attribute.cs (IsClsCompliant): Add nullable types test.
1098         
1099 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
1100
1101         * doc.cs : catch other types of exception than XmlException to
1102           report CS1570. Fixed bug #82565.
1103
1104 2007-08-23  Marek Safar  <marek.safar@gmail.com>
1105
1106         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
1107         The number of delegate parameters has to match.
1108         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
1109         arrays.
1110
1111 2007-08-21  Marek Safar  <marek.safar@gmail.com>
1112
1113         * anonymous.cs (AnonymousMethod): Generate private anonymous method
1114         to fix problem with private arguments.
1115
1116 2007-08-20  Marek Safar  <marek.safar@gmail.com>
1117
1118         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
1119         
1120         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
1121         
1122         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
1123         empty. Add cloning suport.
1124         
1125         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
1126
1127 2007-08-20  Marek Safar  <marek.safar@gmail.com>
1128
1129         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
1130         to create EmptyCast. It handles EmptyConstantCast specialization for
1131         constants.
1132         
1133 2007-08-18  Marek Safar  <marek.safar@gmail.com>
1134
1135         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
1136         (EmitArrayArgument): One routine for array arguments.
1137         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
1138         
1139 2007-08-17  Marek Safar  <marek.safar@gmail.com>
1140
1141         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
1142
1143 2007-08-17  Marek Safar  <marek.safar@gmail.com>
1144
1145         * anonymous.cs: MemberLookupFinal update.
1146
1147         * class.cs (ConstructorInitializer): Is expression based.
1148         
1149         * delegate.cs: MethodGroupExpr update.
1150         
1151         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
1152         messages.
1153         (Error_MemberLookupFailed): Customizable error override.
1154         (MethodGroupExpr): Keep queried type for later usage.
1155         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
1156         resolve.
1157         
1158         * expression.cs: Error_MemberLookupFailed refactoring.
1159         (New.DoResolve): Resolve as much as possible.
1160         (ElementInitializer.Error_MemberLookupFailed): Object initializer
1161         customization for invalid member types.
1162
1163         * statement.cs: MethodGroupExpr update.
1164         
1165 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1166
1167         * modifier.cs (Check): Check all modifiers and not only accessibility
1168         ones.
1169
1170 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1171
1172         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
1173         type and not an expression.
1174
1175 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1176
1177         * statement.cs (Catch.Clone): Type and variable can be null.
1178
1179 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1180
1181         A fix for bug #81979
1182         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
1183         I am really not sure whether this is the best fix.
1184         
1185         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
1186         only once.
1187         
1188 2007-08-14  Marek Safar  <marek.safar@gmail.com>
1189
1190         ** C# 3.0 Object and collection initializers (major re-write)
1191         
1192         * assign.cs (DoResolve): Initializers are not assign related.
1193         
1194         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
1195         used during collection or object initialization.
1196         
1197         * expression.cs (Error_InvalidArguments): Add initializers specific
1198         messages. More will come later because it requires some general
1199         refactoring.
1200         (New.DoResolve): Better error handling for unsafe types.
1201         (EmptyExpressionStatement): New class.
1202         (ElementInitializer): An object initializer expression.
1203         (CollectionElementInitializer): A collection initializer expression.
1204         (CollectionOrObjectInitializers): A block of object or collection
1205         initializers.
1206         (NewInitialize): New expression with element/object initializers.
1207         
1208         * statement.cs: Reverted object/collection initializer hacks.
1209         
1210         * typemanager.cs (CSharpName): Filter __arglist type.
1211         
1212 2007-08-09  Marek Safar  <marek.safar@gmail.com>
1213
1214         ** C# 3.0 Anonymous Types (update to the latest standard)
1215         
1216         * expression.cs (Binary.ResolveOperator): Threat all null based types
1217         same.
1218         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
1219         (AnonymousTypeParameter): Updated.
1220         
1221         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
1222         (AnonymousTypeClass): New anonymous type container.
1223         
1224         * class.cs (AddField): Return operation result.
1225         
1226         * generic.cs: Another empty TypeArguments overload.
1227         
1228         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
1229         are stored at top of normal hierarchy.
1230         
1231         * typemanager.cs (CSharpName): Filter anonymous types.
1232         
1233 2007-08-09  Marek Safar  <marek.safar@gmail.com>
1234
1235         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
1236         as single Concat call. How could we miss that :-(
1237         
1238 2007-08-08  Marek Safar  <marek.safar@gmail.com>
1239
1240         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
1241         
1242 2007-08-07  Miguel de Icaza  <miguel@novell.com>
1243
1244         * expression.cs: Fix the previous commit, the creation of the
1245         arguments array list needs also to be conditional on the arguments
1246         not being null.
1247
1248         * class.cs: Add a little bit of help to help narrow down problems.
1249
1250         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
1251         not try to copy in that case. 
1252
1253         * driver.cs: When building SMCS, include a new different set of
1254         default assemblies here.   Do this here so we can control whether
1255         to include the default assemblies with /noconfig.
1256
1257 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1258
1259         A fix for bug #81979
1260         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
1261         only.
1262
1263 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1264
1265         A fix for bug #82300
1266
1267         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
1268         we are in probing scope.
1269
1270 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1271
1272         A fix for bug #82301
1273
1274         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
1275         (Statement.CloneTo): Clone and not map children blocks.
1276
1277 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1278
1279         A fix for bug #82299
1280
1281         * expression.cs (LocalVariableReference.CloneTo): Remap local info
1282         variable too.
1283         
1284         * statement.cs (Statement.CloneTo): Clone variables before statements
1285         to allow remaping of local variables.
1286
1287 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1288
1289         A fix for bug #82296
1290
1291         * anonymous.cs,
1292         * report.cs: Log crash details for future clone problems.
1293         
1294         * statement.cs (Return.Clone): Don't clone non-existent expression.
1295
1296 2007-08-03  Raja R Harinath  <harinath@gmail.com>
1297
1298         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
1299         (Class.AddBasesForPart): Move CS0537 check here from ...
1300         * cs-parser.jay (class_declaration): ... here.  Move calling of
1301         'AddBasesForPart' to ...
1302         (class_bases): ... here.
1303         (struct_declaration, interface_declaration): Update to changes.
1304
1305 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1306
1307         A fix for bug #81923
1308
1309         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
1310         conversion is allowed.
1311
1312 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1313
1314         A fix for bug #81564
1315
1316         * ecore.cs (EventExpr): Add IsBase handling.
1317
1318         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
1319         too.    
1320         
1321 2007-08-02  Raja R Harinath  <harinath@gmail.com>
1322
1323         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
1324         * cs-parser.jay: Some whitespace cleanups.
1325         (current_delegate): New.
1326         (type_name): New.
1327         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
1328         a dummy code block, and use 'type_name' instead of 'member_name'.
1329         (interface_declaration, class_declaration): Likewise.
1330         (delegate_declaration): Likewise.  Rearrange slightly and use
1331         'current_delegate'.
1332         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
1333         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
1334
1335 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1336
1337         A fix for bug #82039
1338
1339         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
1340         available.
1341
1342         * typemanager.cs (CSharpName): Split to string overload.
1343
1344 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1345
1346         * expression.cs,
1347         * report.cs: Updated warning CS0472.
1348
1349 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1350
1351         A fix for bug #82181
1352         * cs-parser.jay,
1353         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
1354
1355 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1356
1357         A fix for bug #82277
1358         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
1359
1360 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1361
1362         ** C# 3.0 Type Inference (major bits are working)
1363         
1364         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
1365         (.ImplicitStandardConversionExists): Uses compatible.
1366         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
1367         (.InferReturnType): New method.
1368         (.Compatible): Refactored.
1369         (.ResolveParameters): Uses factory to create resolved parameters.
1370         (.CompatibleMethod): Add probing mode support.
1371         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
1372         clearly distinguish between 2 different operations.
1373         (LambdaMethod): Moved to lambda.cs.
1374         (AnonymousMethod): Removed unused fields and methods.
1375         (AnonymousDelegate): Simplified.
1376         
1377         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
1378         
1379         * convert. cs (ImplicitConversionStandard): Compatible works differently.
1380         
1381         * delegate.cs (Delegate): New mehods to reduce code duplication.
1382         (.GetConstructor): New method.
1383         (.GetInvokeMethod): New method.
1384         (DelegateCreation): Updated.
1385         
1386         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
1387         does not exist.
1388         (OverloadResolve): Made probing little bit faster.
1389         
1390         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
1391         when probing is on.
1392         
1393         * generic.cs (TypeInferenceContext): Dummy implementation.
1394         
1395         * iterators.cs: Updated after Resolve/Define rename.
1396         
1397         * lambda.cs (LambdaExpression)
1398         (.ResolveParameters): Handles both type of arguments and type inference too.
1399         
1400         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
1401         (InflateTypes): Updated.
1402         
1403         * support.cs (InflateTypes): Changed signature and updated.
1404         
1405         * typemanager.cs (LookupMemberCache): Better dynamic type check.
1406         (MemberLookup_FindMembers): More MS tricks.
1407         (GetParameterData): Ditto.
1408         (GetDelegateParameters): Uses quick path for dynamic types.
1409         
1410 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1411
1412         * class.cs (MethodData.Define): EmitContext is required for generic stuff
1413         only.
1414
1415 2007-07-31  Marek Safar  <marek.safar@gmail.com>
1416
1417         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
1418         syntax.
1419         
1420 2007-07-26  Jb Evain  <jbevain@novell.com>
1421
1422         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
1423         which takes a boolean 'report_errors', similar to the GetMethod.
1424         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
1425         in .net 2.1, do not report errors here.
1426
1427         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
1428         System.Runtime.CompilerServices.RequiredAttributeAttribute and
1429         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
1430         in .net 2.1.
1431
1432         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
1433         of the type InternalsVisibleToAttribute before the first call
1434         to CoreLookupType which is allowed to fail (third boolean parameter
1435         to true). Because, during the resolution for a type that is not
1436         immediately found, we try to check if the type is not defined in
1437         a friend assembly, and to do so, we need the
1438         InternalVisibleToAttribute.
1439
1440 2007-07-23  Miguel de Icaza  <miguel@novell.com>
1441
1442         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
1443         feature that allows structs to be compared against null and inline
1444         the result as true or false.
1445
1446         Notice that the same code is not permitted inside a generic block
1447         of code that would do:
1448
1449         class Foo<T> where T : struct {
1450             bool Eval (T x)
1451             {
1452                  return x == null;
1453             }
1454         }
1455
1456         It is only allowed if the type of T is not bound (no where
1457         clause).   In my opinion, this CSC 2 behavior is broken but people
1458         seem to be using it (IronRuby does, a few bug reports on bugzilla
1459         have it and some people have complained about it).
1460
1461         All of the users that depend on this behavior have code that is
1462         very likely broken. 
1463         
1464         * report.cs (Warning, Error): make these take object arguments,
1465         not strings, as that allows us to take advantage of Format.
1466
1467 2007-07-20  William Holmes  <billholmes54@gmail.com>
1468
1469         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
1470           Left member variable for the Count.
1471         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
1472           MemberName.CountTypeArguments to avoid a NRE. 
1473
1474         This code is contributed under the MIT X11 license
1475
1476 2007-07-18  Marek Safar  <marek.safar@gmail.com>
1477
1478         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
1479
1480 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
1481
1482         * doc.cs : generic method arguments are written as ``x while generic
1483           type arguments are `x. Combined with the previous change, fixed bug
1484           #79706.
1485
1486 2007-07-18  Raja R Harinath  <rharinath@novell.com>
1487
1488         Fix #82120
1489         * expression.cs (Binary.ResolveOperator): When converting
1490         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
1491
1492 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
1493
1494         * doc.cs : when T: or whatever x: is specified, it does not really
1495           check the doc comment's syntax correctness. Fixed bug #82006.
1496
1497 2007-07-18  Marek Safar  <marek.safar@gmail.com>
1498
1499         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
1500         LambdaExpression better.
1501         
1502         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
1503         
1504         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
1505         
1506         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
1507         as it can be generated.
1508         
1509         * expression.cs (Invocation.Error_InvalidArguments): Show correct
1510         modifiers.
1511         
1512         * lambda.cs (LambdaExpression): Refactored to share same code with
1513         AnonymousMethodExpression.
1514         
1515 2007-07-17  Marek Safar  <marek.safar@gmail.com>
1516
1517         * anonymous.cs (MakeName): Include host name for easier debugging.
1518         (LambdaMethod): New class for lambda spcecific stuff.
1519         
1520         * attribute.cs: Set EmitContext return type.
1521
1522         * class.cs: Set EmitContext return type.
1523         
1524         * codegen.cs (EmitContext): Return type cannot be null to stop messing
1525         with null/void meaning.
1526         
1527         * iterators.cs (ContainerType): Implemented.
1528         
1529         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
1530         
1531         * statement.cs (Return): Updated to lambda expressions.
1532         (Block.CloneTo): Parent can be null.
1533                 
1534 2007-07-13  Marek Safar  <marek.safar@gmail.com>
1535
1536         A fix for bug #81917
1537         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
1538         
1539         * class.cs (FixedField): Check whether field is in unsafe scope.
1540
1541         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
1542         (FieldExpr.Emit): Fixed buffers cannot be volatile.
1543
1544         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
1545         FieldExpr.
1546         
1547         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
1548                 
1549 2007-07-13  Marek Safar  <marek.safar@gmail.com>
1550
1551         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
1552         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
1553         from Report class.
1554
1555 2007-07-13  Marek Safar  <marek.safar@gmail.com>
1556
1557         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
1558         
1559 2007-07-13  Marek Safar  <marek.safar@gmail.com>
1560
1561         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
1562         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
1563         
1564         * codegen.cs(EmitContext): Add ProbingMode flag.
1565         
1566         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
1567         
1568         * driver.cs: For now set both warning values.
1569         
1570         * ecore.cs (SimpleName): Name is readonly.
1571         (MethodGroup.OverloadResolve): One quick path for probing.
1572         
1573         * expression.cs (Unary): Set Oper r/o.
1574         (Binary): Set Oper r/o.
1575         (ParameterReference): Set few instance variables as r/o.
1576         (ParameterReference.DoResolveBase): Don't capture aruments when 
1577         the probing is on.
1578         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
1579         (Arglist): arguments are private.
1580         (SizeOf): type is private and r/o.
1581         (MemberAccess): arguments are private.
1582
1583         * report.cs: Enhanced reporting on/off capabilities.
1584         
1585         * lambda.cs: Uses ec.IsInProbingMode.
1586         (ContextualReturn): Derives from return.
1587         
1588         * rootcontext.cs: For now set both warning values.
1589         
1590         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
1591         copy if one exists.
1592         (Return.Resolve): Don't die immediately.
1593         (Block.Resolve): Speed-up probing.
1594         (Block.CloneTo): Clone only child blocks.
1595
1596 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
1597
1598         * iterators.cs: reverted Miguel's latest change (r81925) as it
1599         breaks the build in System.
1600
1601 2007-07-13  Miguel de Icaza  <miguel@novell.com>
1602
1603         * iterators.cs (Yield.CheckContext): Check for the iterator type
1604         also here as we can call into Yield even in codepaths that are not
1605         directly checked by
1606         (MethodOrOperator is the only path that was checked).
1607
1608         In addition to the standard check, use a more specific check for
1609         constructors to report a more verbose error. 
1610
1611 2007-07-12  Miguel de Icaza  <miguel@novell.com>
1612
1613         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
1614         report the warning and continue 
1615
1616         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
1617         values on the stack on the call to Emit.   Use EmitStatement if
1618         possible, or using Emit + Pop if not possible.   Fixes #82064
1619
1620 2007-07-12  Raja R Harinath  <rharinath@novell.com>
1621
1622         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
1623         avoid try...finally in some cases.
1624
1625 2007-07-10  Marek Safar  <marek.safar@gmail.com>
1626
1627         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
1628         
1629         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
1630         instead of method. Re-use standard error handling.
1631         (ConstructorInitializer.Emit): Simplified.
1632         
1633         * delegate.cs: Updated after Invocation.EmitCall change.
1634         
1635         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
1636         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
1637         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
1638         method and don't permanently changing input arguments.
1639         (MethodGroupExpr): Introduced resolved best_candidate, when method group
1640         is resolved it has one of the candidates is the best one which is later
1641         used to emit. Removed a few unused method.
1642         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
1643
1644         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
1645         (Binary.ResolveOperator): Ditto.
1646         (ConditionalLogicalOperator.DoResolve): Ditto.
1647         (Invocation): Uses method group.
1648         (Invocation.DoResolve): Simplified.
1649         (Invocation.EmitCall): Removed useless is_static.
1650         (Invocation.Emit): Delegate to method group.
1651         (Invocation.EmitStatement): Simplified.
1652         (New): Uses method group.
1653         (MemberAccess.DoResolve): Don't destroy original expression.
1654         
1655         * statement.cs (ForEach.Resolve): Use null for no method arguments.
1656         
1657 2007-07-04  Marek Safar  <marek.safar@gmail.com>
1658
1659         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
1660         
1661         * anonymous.cs,
1662         * lambda.cs: Add custom error message type.
1663
1664 2007-07-03  Marek Safar  <marek.safar@gmail.com>
1665
1666         * lambda.cs: Simplified little bit.
1667         
1668         * parameter.cs: Introduced ImplicitLambdaParameter.
1669         (Parameters.CreateFullyResolved): New factory instead of ctor.
1670         
1671         * anonymous.cs,
1672         * class.cs,
1673         * delegate.cs: Updated parameter creation.
1674         
1675 2007-07-03  Marek Safar  <marek.safar@gmail.com>
1676
1677         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
1678         arguments.
1679         
1680         * generic.cs: Synchronized with gmcs.
1681         
1682 2007-07-03  Marek Safar  <marek.safar@gmail.com>
1683
1684         * class.cs (Indexer): Check return type as soon as possible.
1685         
1686         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
1687         members too.
1688         
1689         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
1690         
1691         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
1692         
1693         * parameter.cs (Parameter): Use expression type when it is available.
1694         
1695         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
1696         method modifier for the first parameter only.
1697
1698 2007-06-24  Marek Safar  <marek.safar@gmail.com>
1699
1700         A fix for bug #81938
1701         * typemanager.cs (ChangeType): Fixed couple of char conversions.
1702         
1703         * constant.cs: Tide up an exception message.
1704
1705 2007-06-22  Marek Safar  <marek.safar@gmail.com>
1706
1707         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
1708         an uninitialized variable is used.
1709         
1710         * expression.cs (LocalVariableReference.DoResolve): Ditto.
1711
1712 2007-06-22  Marek Safar  <marek.safar@gmail.com>
1713
1714         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
1715         not found error handling.
1716
1717         * expression.cs (ArrayCreation): Removed redundant fields and little bit
1718         simplified.
1719         (ArrayCreation.ResolveArrayElement): To be ready to customization.
1720         (ArrayCreation.DoResolve): Simplified.
1721         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
1722         its own resolve process.
1723         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
1724
1725 2007-06-20  Marek Safar  <marek.safar@gmail.com>
1726
1727         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
1728         more error details.
1729         
1730 2007-06-20  Marek Safar  <marek.safar@gmail.com>
1731
1732         * cs-tokenizer.cs: Removed var related stuff.
1733         
1734         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
1735         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
1736         a type and a keyword at same time.
1737         
1738         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
1739         matches to "var".
1740         
1741         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
1742         implicitly typed arrays, more changes will follow.
1743         
1744         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
1745         
1746 2007-06-19  Marek Safar  <marek.safar@gmail.com>
1747
1748         * ecore.cs (VarExpr): Removed Handled field.
1749         
1750         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
1751         build-in assign functionality.
1752         (ForEach.Resolve): Removed all implicitly typed local variable code and
1753         simplified.
1754         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
1755         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
1756
1757 2007-06-18  Marek Safar  <marek.safar@gmail.com>
1758
1759         * assign.cs: Removed implicitly typed local variable check.
1760         
1761         * expression.cs (LocalVariableReference.DoResolve): Add check for self
1762         referencing implicitly typed local variable.
1763         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
1764         variable here.
1765         
1766         * statement.cs (Fixed): Removed unsupported implicitly typed local
1767         variable code.
1768
1769 2007-06-15  Marek Safar  <marek.safar@gmail.com>
1770
1771         * decl.cs (MemberName): Moved all Unbound stuff to parser.
1772
1773 2007-06-14  Marek Safar  <marek.safar@gmail.com>
1774
1775         A fix for bugs #81855 and #76274
1776         * attribute.cs (AttachTo): Always set owner for global attributes to
1777         prefined owner.
1778         
1779         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
1780         usefull too.
1781         
1782         * cs-parser.jay: Assembly and module attributes must precede all other
1783         elements except using clauses and extern alias declarations.
1784
1785 2007-06-13  Marek Safar  <marek.safar@gmail.com>
1786
1787         A fix for bug #81748
1788         * cs-tokenizer.cs,
1789         * expression.cs: More checks for non ISO-1 features.
1790
1791 2007-06-12  Marek Safar  <marek.safar@gmail.com>
1792
1793         A fix for bug #81807
1794         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
1795         present inside switch statement and it is required by nullable check.
1796
1797 2007-06-12  Marek Safar  <marek.safar@gmail.com>
1798
1799         A fix for bug #81840
1800         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
1801         when type matching fails.
1802         
1803         * namespace.cs: Tiny error message change.
1804
1805 2007-06-12  Marek Safar  <marek.safar@gmail.com>
1806
1807         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
1808         reporting. Added automatic property check.
1809         
1810         * class.cs: Updated after CheckAbstractAndExtern relocation.
1811         (AEventPropertyAccessor.GetSignatureForError): Customized.
1812         
1813 2007-06-11  Marek Safar  <marek.safar@gmail.com>
1814
1815         * class.cs (DefineBaseTypes): Base type can be undefined.
1816         
1817         * ecore.cs (TypeLookup): Minor refactoring.
1818         (DoResolveAsTypeStep): Removed redundant check.
1819
1820         * namespace.cs (Lookup): Removed redundant check.
1821                 
1822         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
1823         ResolveAsTypeTerminal step.
1824         (BootstrapCorlib_*): Simplified.
1825         (PopulateCoreType): Core types can be now external.
1826
1827 2007-06-07  Marek Safar  <marek.safar@gmail.com>
1828
1829         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
1830          verification only.
1831          (InferTypeArguments): Infers anonymous expression type arguments.
1832          (Compatible): Split to Compatible and InferTypeArguments. 
1833         
1834         * lambda.cs: Updated.
1835
1836 2007-06-08  Marek Safar  <marek.safar@gmail.com>
1837
1838         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
1839
1840 2007-06-07  Raja R Harinath  <harinath@gmail.com>
1841
1842         Fix #80477, cs0135-2.cs, cs0135-3.cs
1843         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
1844         names to the "known" variables list.
1845         (Block.CheckInvariantMeaningInBlock): Handle the fact the
1846         parameter names are also "known".
1847         (Block.CheckError136): Remove.
1848         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
1849         null.
1850
1851 2007-06-07  Marek Safar  <marek.safar@gmail.com>
1852
1853         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
1854
1855 2007-06-06  Marek Safar  <marek.safar@gmail.com>
1856
1857         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
1858         internal error not an user error.
1859          
1860         * expression.cs (IsApplicable): Refactored to make debugging easier.
1861
1862         * support.cs: More tricks for non-mono runtimes.
1863         
1864         * typemanager.cs (CoreLookupType): Made public.
1865         (InitSystemCore): All linq specific stuff moved to linq.cs
1866
1867 2007-06-05  Marek Safar  <marek.safar@gmail.com>
1868
1869         * typemanager.cs (CSharpSignature): One more missing build-in types
1870         replacement.
1871         More tricks for non-mono runtime.
1872
1873 2007-06-05  Raja R Harinath  <harinath@gmail.com>
1874
1875         * statement.cs (Block.CheckError136_InParents): Remove.
1876         (Block.AddVariable): Use GetParameterInfo instead.
1877         (ToplevelBlock.ProcessArguments): Likewise.
1878
1879 2007-06-04  Raja R Harinath  <rharinath@novell.com>
1880
1881         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
1882         information too.
1883         (ToplevelBlock.GetParameterInfo): Split out of ...
1884         (ToplevelBlock.GetParameterRefernce): ... this.
1885         (ToplevelBlock.ParameterMap): Remove.
1886         * expression.cs (ParameterReference): Update to use
1887         ToplevelParameterInfo.
1888
1889         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
1890         regression.
1891
1892         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
1893         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
1894
1895         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
1896         (ToplevelBlock.ProcessParameters) ... here.
1897         (ToplevelBlock..ctor): Invoke it.
1898
1899         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
1900         new parameters.
1901
1902         * statement.cs (IKnownVariable): New interface.
1903         (LocalInfo): Implement it.
1904         (ToplevelParameterInfo): New class.
1905         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
1906         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
1907         GetKnownVariableInfo.
1908
1909 2007-06-03  Raja R Harinath  <harinath@gmail.com>
1910
1911         Partly speed up CS0136 error checks.
1912         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
1913         'recurse' parameter.
1914         (Block.DoCheckError136): Only check errors in parameters.  Move
1915         local variable checks ...
1916         (Block.AddVariable): ... here, and ...
1917         (ToplevelBlock.ResolveMeta): ... here.
1918
1919 2007-06-02  Raja R Harinath  <harinath@gmail.com>
1920
1921         * statement.cs (Block.IsChildOf): Remove.
1922
1923         * statement.cs (Statement.Clone): Move special case code ...
1924         (Block.CloneTo): ... here.
1925
1926 2007-05-29  Raja R Harinath  <rharinath@novell.com>
1927
1928         * statement.cs (ToplevelBlock.container): Remove field.  It's
1929         redundant with 'Parent'.
1930         (ToplevelBlock.ContainerBlock): Remove accessor.
1931         (ToplevelBlock..ctor): Update to changes.  Register anonymous
1932         child with parent here, ...
1933         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
1934         current_block.
1935         (start_anonymous): Don't save current_block.
1936         (top_current_block): Remove.
1937
1938         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
1939         (Block.Resolve): Update to changes.
1940         (Block..ctor): Move setting of "correct" 'Toplevel'
1941         and 'Explicit' fields to ...
1942         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
1943
1944 2007-05-27  Raja R Harinath  <harinath@gmail.com>
1945
1946         Kill Block.Implicit
1947         * statement.cs (Block.Implicit): Remove.
1948         (Block): Update to changes.
1949         * flowanalysis.cs: Likewise.
1950
1951         Mildly speed up CheckInvariantMeaningInBlock
1952         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
1953         Recursively call AddKnownVariable to all enclosing blocks.
1954         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
1955         Remove recursive calls.
1956         (Block): Update to changes.
1957
1958         New ExplicitBlock invariants
1959         * statement.cs (Block.Explicit): New field.  It points to the
1960         immediately enclosing non-implicit block.
1961         (Block..ctor): Maintain the invariant.
1962         * cs-parser.jay: Take advantage of invariant.
1963
1964         Introduce ExplicitBlock
1965         * statement.cs (ExplicitBlock): New.
1966         (ToplevelBlock): Derive from it.
1967         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
1968         sense of flag.
1969         (Block.Implicit): Update to changes.
1970         * cs-parser.jay: Update to changes.
1971
1972         Remove unused field
1973         * codegen.cs (EmitContext.IsLastStatement): Remove.
1974         * statement.cs (Block.DoEmit): Update to changes.
1975
1976 2007-05-25  Raja R Harinath  <rharinath@novell.com>
1977
1978         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
1979         modifying current_block directly.
1980
1981 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
1982         
1983         * class.cs: Implemented automatic properties (C# 3.0)
1984           Thanks to Marek for the help.
1985
1986 2007-05-23  Raja R Harinath  <rharinath@novell.com>
1987
1988         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
1989         variable as assigned, note also that all its components are
1990         assigned too.
1991         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
1992
1993 2007-05-19  Marek Safar  <marek.safar@gmail.com>
1994
1995         * anonymous.cs, class.cs: Emit Compiler generated attribute when
1996         member is marked as compiler generated.
1997         
1998         * decl.cs (MemberCore): Refactored ModFlags into property.
1999
2000         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
2001         (Check): Check only accessibility modifiers.
2002
2003 2007-05-18  Raja R Harinath  <rharinath@novell.com>
2004
2005         Track all assignable slots in one bit array
2006         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
2007         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
2008         logic from VariableMap constructor here.  Use the same 'offset'
2009         variable that's later used for computing offsets of local
2010         variables.
2011         * flowanalysis.cs (UsageVector.parameters): Remove.
2012         (UsageVector): Update to changes.
2013         (VariableMap): Remove.
2014
2015         Avoid creating ParameterMap in every block
2016         * statement.cs (Block.ParameterMap): Move ...
2017         (ToplevelBlock.ParameterMap): ... here.
2018         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
2019         only once.
2020         * flowanalysis.cs (FlowBranching.param_map): Remove.
2021         (FlowBranching.UsageVector): Update to changes.
2022         (FlowBranchingToplevel.CheckOutParameters): Likewise.
2023
2024         * statement.cs (Block.CloneTo): Clone Toplevel field too.
2025
2026         * expression.cs (ParameterReference): Distinguish between block
2027         where parameter was referenced and declared.
2028
2029 2007-05-18  Marek Safar  <marek.safar@gmail.com>
2030
2031         * flowanalysis.cs, statement.cs: Put back improved error handling.
2032
2033 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
2034         
2035         * assign.cs:
2036         * expression.cs:
2037           Imporved object and collection initialization (C# 3.0).
2038
2039 2007-05-15  Marek Safar  <marek.safar@gmail.com>
2040
2041         A fix for bug #81380
2042         * expression.cs (Is.DoResolve): Only value types have constant `is'
2043         behaviour.
2044
2045 2007-05-15  Raja R Harinath  <rharinath@novell.com>
2046
2047         * statement.cs (ToplevelBlock.child): Remove.
2048
2049 2007-05-15  Raja R Harinath  <harinath@gmail.com>
2050
2051         Rationalize ResolveMeta: refactoring
2052         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
2053         out constant handling code into ...
2054         (Block.DoResolveConstants): ... this.
2055
2056         Rationalize ResolveMeta: kill local_map
2057         * statement.cs (Block.local_map, Block.LocalMap): Remove.
2058         (Block.AssignableSlots): New.
2059         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
2060         for locals -- move code from VariableMap here.  Avoid unnecessary
2061         allocations.
2062         * flowanalysis.cs (FlowBranching.local_map): Remove.
2063         (FlowBranching..ctor): Use Block.AssignableSlots.
2064         (VariableMap): Remove unused constructors.
2065
2066 2007-05-11  Raja R Harinath  <rharinath@novell.com>
2067
2068         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
2069
2070 2007-05-11  Marek Safar  <marek.safar@gmail.com>
2071
2072         * typemanager.cs (IsFriendAssembly): Should not be called for building
2073         assembly.
2074
2075 2007-05-09  Marek Safar  <marek.safar@gmail.com>
2076
2077         * literal.cs (NullConstant): Print null in all cases.
2078         
2079         * expression.cs (Binary.ResolveOperator): Implemented delegate
2080          comparison based on C# 2.0 changes.
2081
2082 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
2083
2084         This code is contributed under the MIT X11 license
2085         
2086         The following enables support for several C# 3.0 language features:
2087         
2088         * cs-tokenizer.cs: Added support for the "var" keyword.
2089         
2090         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
2091           Added VarExpr class to facilitate type inferencing.
2092         
2093         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
2094           to support anonymous types.
2095         
2096         * assign.cs: Added support for type inferencing and initialization.
2097         
2098         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
2099         
2100         * expression.cs: Added implicit array support to ArrayCreation.
2101           Added 5 types and 1 interface:
2102           
2103           IInitializable                Implementing classes can inject initializing
2104                                         statements after object instantiation.
2105           
2106           Initializer                   Stores data for object initialization.
2107           
2108           AnonymousType                 An expression for anonymous types.
2109           
2110           AnonymousTypeParameter        Stores data about an anonymous type's field.
2111           
2112           NewInitialize                 An expression for object initialization.
2113           
2114           CollectionInitialize          An expression for collection initialization.
2115         
2116         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
2117           statements.
2118
2119 2007-05-06  Marek Safar  <marek.safar@gmail.com>
2120
2121         A fix for bug #81500
2122         * cs-tokenizer.cs: Add special handling for coalescing operator.
2123
2124 2007-05-06  Marek Safar  <marek.safar@gmail.com>
2125
2126         A fix for bug #81529
2127         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
2128         its value from base class until it is redefined.
2129
2130 2007-05-02  Raja R Harinath  <rharinath@novell.com>
2131
2132         Fix regression in cs0631-3.cs
2133         * cs-parser.jay (operator_declarator): Add opt_attributes to error
2134         fallback.  Make error fallback catch more cases.
2135
2136 2007-05-01  Miguel de Icaza  <miguel@novell.com>
2137
2138         * cs-parser.jay: Allow parameters in operator declarations to have
2139         attributes. 
2140
2141 2007-04-27  Miguel de Icaza  <miguel@novell.com>
2142
2143         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
2144         exists. 
2145
2146         * lambda.cs (ContextualReturn.Resolve): An expression is valid
2147         inside the ContextualReturn, it does not have to be an
2148         ExpressionStatement. 
2149
2150 2007-04-24  Miguel de Icaza  <miguel@novell.com>
2151
2152         * lambda.cs (ContextualReturn.Resolve): if the return type is not
2153         set, set it.
2154
2155 2007-04-23  Miguel de Icaza  <miguel@novell.com>
2156
2157         * anonymous.cs (AnonymousContainer): split the virtual Resolve
2158         method in two methods: ResolveNoDefine and Resolve.
2159
2160         ResolveNoDefine will stop just after ResolveTopBlock has been
2161         called.   
2162
2163         Resolve will then continue by creating a method and issuing the
2164         call to method.Define ().
2165
2166         (AnonymousMethod): Split and implement the new Resolve and
2167         ResolveNoDefine as well.
2168
2169         * lambda.cs (LambdaExpression): Split the anonymous method
2170         resolution code into a separate routine (CoreCompatibilityTest)
2171         from DoCompatibleTest.
2172
2173         (LambdaExpression.TryBuild): New method, this method tries to
2174         build the LambdaExpression with the given set of types to be used
2175         as the types for the various parameters of the lambda expression. 
2176
2177         If the compilation succeed with the given types, the infered type
2178         of the Anonymous method is returned, otherwise null is returned.
2179
2180 2007-04-23  Marek Safar  <marek.safar@gmail.com>
2181
2182         A fix for bug #81414
2183         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
2184
2185 2007-04-22  Miguel de Icaza  <miguel@novell.com>
2186
2187         * cs-tokenizer.cs: Change various identifiers here from the
2188         camelCasing to the recommended Linux-like style for instance
2189         variables from the Coding Guidelines. 
2190
2191 2007-04-19  Martin Baulig  <martin@ximian.com>
2192
2193         * convert.cs
2194         (Convert.ImplicitReferenceConversionCore): Allow conversions from
2195         System.Enum to System.ValueType.
2196
2197 2007-04-13  Martin Baulig  <martin@ximian.com>
2198
2199         Rewrote implicit reference conversions.  We need to distinguish
2200         between implicit reference conversions (13.1.4) and implicit
2201         boxing conversions (13.1.5).
2202
2203         According to the spec, there's an an implicit conversion
2204         "From a one-dimensional array-type S[] to IList<T> and base
2205         interfaces of this interface, provided there is an implicit
2206         reference conversion from S to T."  Note that this does not
2207         include boxing conversions.
2208
2209         * convert.cs
2210         (Convert.ImplicitTypeParameterBoxingConversion): New method.
2211         (Convert.ImplicitReferenceConversion): Split into
2212         ImplicitReferenceConversionCore() and
2213         ImplicitBoxingConversionExist().
2214         (Convert.ImplicitReferenceConversionExists): Use the new
2215         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
2216
2217 2007-04-12  Martin Baulig  <martin@ximian.com>
2218
2219         * convert.cs (Convert.ImplicitReferenceConversion): Move the
2220         `TypeManager.null_type' checks up to the top of the method.
2221
2222 2007-04-11  Marek Safar  <marek.safar@gmail.com>
2223
2224         A fix for bug #81350
2225         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
2226         extension methods.
2227
2228 2007-04-11  Martin Baulig  <martin@ximian.com>
2229
2230         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
2231         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
2232         to make this work for generic classes; fixes #79561.
2233
2234 2007-04-11  Martin Baulig  <martin@ximian.com>
2235
2236         * expression.cs (As): Add support for nullable types; fixes #79371.
2237
2238 2007-04-11  Martin Baulig  <martin@ximian.com>
2239
2240         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
2241         `type.FullName' is null; fixes #80243.
2242
2243 2007-04-11  Martin Baulig  <martin@ximian.com>
2244
2245         * expression.cs (Invocation.IsApplicable): Don't modify the method
2246         if type inference succeeded, but the method was not applicable.
2247         Fixes #81250.
2248
2249 2007-04-10  Marek Safar  <marek.safar@gmail.com>
2250
2251         A fix for bug #81324
2252         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
2253         internal and external namespaces containers.
2254
2255 2007-04-10  Martin Baulig  <martin@ximian.com>
2256
2257         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
2258         TypeManager.DropGenericMethodArguments() so we also call
2259         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
2260
2261 2007-04-10  Martin Baulig  <martin@ximian.com>
2262
2263         * iterators.cs (Iterator.CreateIterator): Don't crash if
2264         `method.ReturnType' is null.  This happens if something went wrong
2265         while resolving that typ (we already reported an error in this case).
2266
2267 2007-04-10  Martin Baulig  <martin@ximian.com>
2268
2269         * expression.cs (New.DoResolve): Don't call CheckComImport() on
2270         generic interfaces; report the CS0144 directly.
2271
2272 2007-04-10  Martin Baulig  <martin@ximian.com>
2273
2274         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
2275         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
2276
2277 2007-04-10  Martin Baulig  <martin@ximian.com>
2278
2279         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
2280
2281 2007-04-09  Raja R Harinath  <rharinath@novell.com>
2282
2283         A better fix
2284         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
2285         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
2286
2287         Fix #81338
2288         * statement.cs (For.Resolve): If resolution fails, use
2289         KillFlowBranching.
2290
2291 2007-04-08  Marek Safar  <marek.safar@gmail.com>
2292
2293         * anonymous.cs (MakeName): Make faster and zero-based.
2294         (VerifyExplicitParameterCompatibility): Back to mode where generic
2295         parameter is ignored.
2296         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
2297
2298         * class.cs (EmitType): Method can emit another new method.
2299
2300         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
2301
2302         * driver.cs: Updated.
2303
2304         * lambda.cs: Reuse predefined empty parameters.
2305
2306         * parameter.cs: Updated
2307
2308         * support.cs: Implemented InflateTypes.
2309
2310         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
2311         (InitSystemCore): Introduced to isolate 3.0 dependencies.
2312
2313 2007-04-03  Martin Baulig  <martin@ximian.com>
2314
2315         Fix #80632.
2316
2317         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
2318         version of TypeManager.IsOverride() which also works with generic
2319         types.  
2320
2321 2007-04-03  Martin Baulig  <martin@ximian.com>
2322
2323         Fix #81044.
2324
2325         * convert.cs
2326         (Convert.ExplicitReferenceConversion): We need to cast when
2327         converting from IList<T> to S[].
2328
2329 2007-04-01  Marek Safar  <marek.safar@gmail.com>
2330
2331         * decl.cs (FindExtensionMethods): Consider all candidates with same name
2332         at this level.
2333         
2334         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
2335
2336 2007-03-31  Marek Safar  <marek.safar@gmail.com>
2337
2338         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
2339         argument and return type inferring.
2340
2341         * codegen.cs (InferReturnType): Flag whether return can be inferred.
2342         (ReturnType): Turned to property.
2343
2344         * statement.cs (Return): Implemented return type inferring.
2345
2346         * support.cs (ReflectionParameters): Use local types if possible.
2347
2348 2007-03-30  Raja R Harinath  <rharinath@novell.com>
2349
2350         * flowanalysis.cs (FlowBranching.Reachability): Remove.
2351         (FlowBranching.UsageVector): Update to changes.
2352
2353         Prepare to kill 'Reachability'
2354         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
2355         argument of constructor.
2356
2357 2007-03-29  Raja R Harinath  <rharinath@novell.com>
2358
2359         Prepare to kill 'Reachability'
2360         * flowanalysis.cs (UsageVector.is_unreachable): New.
2361         (UsageVector): Update to maintain 'is_unreachable' in parallel to
2362         'reachability', and verify they're consistent.
2363
2364         Fix #81121
2365         * expression.cs (New.EmitStatement): Handle type parameters here too.
2366
2367 2007-03-29  Martin Baulig  <martin@ximian.com>
2368
2369         Fix #79148.
2370
2371         * anonymous.cs
2372         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
2373         CompilerGeneratedClass.
2374         (ScopeInfo.EmitScopeInstance): Make this protected.
2375         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
2376         `ec.CurrentAnonymousMethod.Scope == Scope'.
2377
2378         * statement.cs (Block.ScopeInfo): Make this a property.
2379
2380 2007-03-27  Raja R Harinath  <harinath@gmail.com>
2381
2382         Prepare to kill 'Reachability'
2383         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
2384         (FlowBranching.UsageVector.Reachability): Remove property.
2385         (FlowBranching.UsageVector.IsUnreachable): New property.
2386         (FlowBranching.UsageVector.ResetBarrier): New.
2387         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
2388         * codegen.cs, statement.cs: Update to changes.
2389
2390 2007-03-27  Martin Baulig  <martin@ximian.com>
2391
2392         Fix #81209.
2393
2394         * decl.cs
2395         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
2396         generic types.
2397
2398 2007-03-26  Raja R Harinath  <rharinath@novell.com>
2399
2400         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
2401         instead of TriState.  Remove all mention of TriState.
2402
2403         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
2404         replaced by a boolean.  Add boolean 'is_unreachable' field, check
2405         and maintain invariants.
2406
2407 2007-03-25  Marek Safar  <marek.safar@gmail.com>
2408
2409         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
2410
2411 2007-03-25  Marek Safar  <marek.safar@gmail.com>
2412
2413         * expression.cs: Stop using obsolete 2.0 opcodes.
2414
2415 2007-03-25  Marek Safar  <marek.safar@gmail.com>
2416
2417         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
2418         one of the latests Martin's fixes.
2419
2420 2007-03-23  Miguel de Icaza  <miguel@novell.com>
2421
2422         * expression.cs: On BigEndian systems, swap the bytes, temporary
2423         solution until we get a new bitconverter class.
2424
2425 2007-03-23  Martin Baulig  <martin@ximian.com>
2426
2427         Fix #81158.
2428
2429         * decl.cs (MemberCache.AddMembers): Add generic methods both as
2430         "Method" and "Method`1".  Normally, a cache lookup is done on the
2431         "Method" form (ie. without the generic arity), but this one makes
2432         lookups on the full form work as well.
2433
2434 2007-03-22  Raja R Harinath  <rharinath@novell.com>
2435
2436         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
2437         unused properties.
2438
2439 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
2440         * class.cs: 
2441         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
2442         ordered_member_list, to TypeBuilder to store members to be defined
2443         in the order they were parsed in.
2444         - ordered_explicit_member_list contains all properties indexers
2445           and methods that are defined as explicit implementation of an
2446           interface or base class.
2447         - ordered_member_list contains all properties indexers and methods
2448           that are not defined as explicit implementation of an interface
2449           or base class.
2450
2451         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
2452         functionality in these removed classes has been replaced with 
2453         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
2454         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
2455
2456         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
2457         to CheckForDuplications inside GetMethod and SetMethod Define Method
2458         to handle method property and indexer name conflicts.
2459
2460         Fixes #79434
2461
2462         All code is contributed under the MIT/X11 license.
2463
2464 2007-03-20  Martin Baulig  <martin@ximian.com>
2465
2466         * class.cs (TypeContainer.Interfaces): Removed; they're now
2467         included in `TypeContainer.Types'.
2468
2469 2007-03-20  Martin Baulig  <martin@ximian.com>
2470
2471         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
2472
2473         * class.cs (TypeContainer.CreateType): New public method.  This is
2474         now called before DefineType() to create the TypeBuilders.
2475         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
2476         has already been created by CreateType().
2477         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
2478         don't resolve our base classes here; this has been moved into
2479         DefineBaseTypes().  We're now called from CreateType().
2480         (TypeContainer.DefineBaseTypes): New private method; resolve our
2481         base classes here.  We're now called from DefineType().
2482
2483         * rootcontext.cs
2484         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
2485         our types first to create all the TypeBuilders.  After that, call
2486         TypeContainer.DefineType() on all the types which'll resolve their
2487         base classes and setup the resolve order.
2488
2489 2007-03-20  Martin Baulig  <martin@ximian.com>
2490
2491         * class.cs (TypeContainer.Enums): Removed; they're now included in
2492         `TypeContainer.Types'.  
2493
2494 2007-03-20  Martin Baulig  <martin@ximian.com>
2495
2496         * class.cs
2497         (TypeContainer.DefineType): Don't call ResolveMembers() here.
2498         (TypeContainer.DoResolveMembers): Call DefineType() on our
2499         `compiler_generated' classes; moved here from DefineNestedTypes().
2500
2501         * rootcontext.cs
2502         (RootContext.ResolveTree): Call ResolveMembers() on all
2503         TypeContainer's in the `type_container_resolve_order'.
2504
2505 2007-03-19  Marek Safar  <marek.safar@gmail.com>
2506
2507         * class.cs: Use corlib to handle InternalMethodImplAttribute.
2508
2509 2007-03-17  Marek Safar  <marek.safar@gmail.com>
2510
2511         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
2512         implementation flags.
2513
2514 2007-03-17  Marek Safar  <marek.safar@gmail.com>
2515
2516         * class.cs: More optimizations for type parameters.
2517
2518 2007-03-15  Marek Safar  <marek.safar@gmail.com>
2519
2520         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
2521
2522         * ecore.cs, parameter.cs: More common code for both corlibs.
2523
2524         * typemanager.cs (IsGenericMethod): Simplified.
2525
2526 2007-03-15  Raja R Harinath  <rharinath@novell.com>
2527
2528         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2529         'returns'.
2530         * statement.cs, iterators.cs, lambda.cs: Update to changes.
2531
2532         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
2533         unconditionally.  Simplify explanation.
2534         (Try.Resolve, Using.Resolve): Likewise.
2535
2536 2007-03-15  Martin Baulig  <martin@ximian.com>
2537
2538         Fix #80731.
2539
2540         * decl.cs (DeclSpace): If we're a partial class, use our
2541         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
2542
2543 2007-03-15  Raja R Harinath  <rharinath@novell.com>
2544
2545         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2546         'throws'.
2547         (FlowBranching.UsageVector): Update to changes.
2548         (FlowBranching.MergeSiblings): Likewise.
2549         * statement.cs: Likewise.
2550
2551 2007-03-15  Martin Baulig  <martin@ximian.com>
2552
2553         Fix #79302.
2554
2555         * decl.cs
2556         (MemberCache): Added a special .ctor for type parameters.
2557
2558         * typemanager.cs
2559         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
2560         `MemberCache'.  
2561
2562 2007-03-09  Martin Baulig  <martin@ximian.com>
2563
2564         * enum.cs (Enum): Make this a TypeContainer.
2565         (EnumMember): Derive from `Const'.
2566
2567         * const.cs
2568         (Const.DoResolveValue): New protected virtual method; move most of
2569         the functionality of ResolveValue() here so we can override it in
2570         `EnumMember'.
2571         (Const.CreateConstantReference): Make this virtual.
2572
2573         * class.cs (Kind): Add `Kind.Enum'.
2574         (TypeContainer.Emit): Don't emit the enums here; they're already
2575         in the `RootContext.typecontainer_resolve_order'.
2576
2577         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
2578         here; they're already in the `typecontainer_resolve_order'.
2579
2580         * ecore.cs (EnumConstant.ConvertImplicitly): Add
2581         TypeManager.DropGenericTypeArguments().
2582
2583         * typemanager.cs
2584         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
2585         (TypeManager.IsEnumType): Likewise.
2586         (TypeManager.EnumToUnderlying): Likewise.
2587         (TypeManager.IsEqual): Add support for enums.
2588
2589 2007-03-12  Raja R Harinath  <rharinath@novell.com>
2590
2591         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
2592         DefaultParameterValueAttribute to be undefined, say if System.dll
2593         is not referenced.
2594
2595 2007-03-11  Marek Safar  <marek.safar@gmail.com>
2596
2597         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
2598         any mscorlib.
2599
2600 2007-03-10  Marek Safar  <marek.safar@gmail.com>
2601
2602         * class.cs, parameter.cs: Unified parameters verification.
2603
2604 2007-03-08  Martin Baulig  <martin@ximian.com>
2605
2606         * cs-parser.jay (constructor_header): Pass the location to the
2607         newly created TopLevelBlock.
2608
2609 2007-03-07  Martin Baulig  <martin@ximian.com>
2610
2611         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
2612
2613 2007-03-06  Miguel de Icaza  <miguel@novell.com>
2614
2615         * convert.cs (ExplicitReferenceConversionExists): Sync this method
2616         with the changes from David, fixes the build.
2617
2618 2007-03-05  David Mitchell  <dmitchell@logos.com>
2619
2620         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
2621         and its base interfaces to a one-dimensional array type S[],
2622         provided there is an implicit or explicit reference conversion
2623         from S to T.
2624
2625 2007-03-03  Marek Safar  <marek.safar@gmail.com>
2626
2627         * cs-tokenizer.cs: Implemented basic linq grammar.
2628
2629         * driver.cs: Set linq lang version on demand.
2630
2631 2007-02-26  Marek Safar  <marek.safar@gmail.com>
2632
2633         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
2634
2635 2007-02-25  Marek Safar  <marek.safar@gmail.com>
2636
2637         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
2638         (Fixes #80455)
2639
2640         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
2641         here.
2642         Check property and event extern attributes.
2643
2644         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
2645         charset.
2646
2647 2007-02-24  Marek Safar  <marek.safar@gmail.com>
2648
2649         A fix for bug #80407
2650         * ecore.cs: Don't report ambiguity error when methods have same parent.
2651
2652 2007-02-23  Marek Safar  <marek.safar@gmail.com>
2653
2654         A fix for bug #80878
2655         * class.cs, cs-parser.jay: Event property can host anonymous methods.
2656
2657 2007-02-22  Marek Safar  <marek.safar@gmail.com>
2658
2659         * attribute.cs: Enable ExtensionAttribute presence test.
2660
2661 2007-02-22  Marek Safar  <marek.safar@gmail.com>
2662
2663         * class.cs: Warn about missing GetHashCode only when Equals is override.
2664
2665         * decl.cs: Check accessibility of type arguments.
2666
2667         * typemanager.cs: Correctly report nullable array.
2668
2669 2007-02-20  Marek Safar  <marek.safar@gmail.com>
2670
2671         * class.cs, report.cs: Capture more details when things go wrong.
2672
2673 2007-02-20  Marek Safar  <marek.safar@gmail.com>
2674
2675         A fix for bug #80650
2676         * cs-parser.jay: Anonymous container starts at constructor declaration
2677         and not at block beginning because it has to be usable in constructor
2678         initializer.
2679
2680         * statement.cs: Use context location and not block one for error reporting.
2681
2682 2007-02-18  Marek Safar  <marek.safar@gmail.com>
2683
2684         A fix for bug #78712
2685         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
2686         too.
2687
2688 2007-02-18  Marek Safar  <marek.safar@gmail.com>
2689
2690         A fix for bug #80493 by Atsushi Enomoto
2691         * cs-parser.jay: Ignore invalid attribute target.
2692
2693 2007-02-18  Marek Safar  <marek.safar@gmail.com>
2694  
2695         * cs-tokenizer.cs: Ignore '\0' as white space character.
2696
2697 2007-02-17  Miguel de Icaza  <miguel@novell.com>
2698
2699         * cs-parser.jay: Add support for lambda expressions to the mcs
2700         compiler as well.
2701
2702         * lambda.cs: Only clone when we are probing, not on the final call
2703         (Compatible is the final call). 
2704
2705         * statement.cs (CloneContext): Introduce class to provide block
2706         remapping during clone.
2707
2708         All statements Clone themselves now.
2709
2710         (Clone): special handling for blocks, when we clone a block, we
2711         register the block inside this routine, as children of the block
2712         might trigger a lookup. 
2713         
2714         * expression.cs: Add support for CloneContext in all expressions. 
2715         
2716 2007-02-17  Marek Safar  <marek.safar@gmail.com>
2717  
2718         A fix for bug #80493
2719         * statement.cs: Report ambiguous warning when interfaces are not related.
2720
2721 2007-02-15  Marek Safar  <marek.safar@gmail.com>
2722
2723         C# 3.0 extension methods.
2724
2725         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
2726         cannot be used directly.
2727
2728         * class.cs (Class.Emit): Emit extension attribute if any class method
2729         is extension method.
2730         (Method.Define): Add basic extension method validation conditions.
2731         (Method.Emit): Emit extension attribute for method.
2732
2733         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
2734         extension method exists. Currently we follow same approach as Microsoft
2735         does, emit even if a method or a class are private but this can change
2736         later.
2737
2738         * cs-parser.jay: Add handling of `this' keyword in method parameters
2739         context.
2740
2741         * decl.cs (DeclSpace.IsStaticClass): New property.
2742         (MemberCache.FindExtensionMethods): Looks for extension methods with
2743         defined name and extension type.
2744
2745         * doc.cs: Updated after OverloadResolve changes.
2746
2747         * driver.cs: Add new soft reference to System.Core.dll.
2748
2749         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
2750         (ExtensionMethodGroupExpr): Represents group of extension methods.
2751
2752         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
2753         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
2754         to MethodGroupExpr and made non-static for easier customization.
2755         (Invocation.DoResolve): Add extension method lookup when no standard
2756         method was found.
2757         (MemberAccess.DoResolve): Try extension methods if no member exists.
2758
2759         * modifiers.cs: Add METHOD_EXTENSION modifier.
2760
2761         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
2762         as well as candidate extension type.
2763         (ComputeNamespaces): When assembly constains extension methods registers
2764         them.
2765         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
2766         extension method lookup.
2767         (Namespace.LookupExtensionMethod): Looks for extension method in this
2768         namespace.
2769         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
2770         find a method which matches name and extensionType.
2771
2772         * parameter.cs (Parameter): Add This modifer.
2773         (HasExtensionMethodModifier): New property.
2774         (Resolve): Add extension parameter check.
2775         (ModFlags): turned to property to exclude this modifier as it is not real
2776         parameter modifier.
2777         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
2778
2779         * support.cs (ParameterData): Add ExtensionMethodType.
2780         (ReflectionParameters): Implemented ExtensionMethodType interface property.
2781
2782         * typemanager.cs: Add type and ctor extension attribute type.
2783
2784 2007-02-15  Miguel de Icaza  <miguel@novell.com>
2785
2786         * report.cs (DisableErrors, EnableErrors): used to prevent error
2787         output when we are "trying" to compile various methods with
2788         different types. 
2789
2790         * ecore.cs (Expression): Add Clone method that calls the virtual
2791         CloneTo method.  The current CloneTo method in Expression throws
2792         an exception so we can track down all the places where this must
2793         be implemented (not using abstract, because that would be a lot of
2794         up-front-work before we can start testing the implementation
2795         idea). 
2796
2797         Important: we only need Clone capabilities for expressions created
2798         by the parser, as the expressions we will be cloning are
2799         expressions in the pre-resolved state.   This vastly simplifies
2800         the work required. 
2801         
2802         (SimpleName): Add CloneTo that does nothing.
2803         (EmptyCast): Add CloneTo.
2804         
2805         * expression.cs (Binary): Implement CloneTo.
2806         (Invocation.IsApplicable): Store the current ec in
2807         EmitContext.TempEc and restore it on return.  This is used so we
2808         do not have to sprinkle hundres of methods with an extra
2809         EmitContext, we know that the only user is the lambda expression
2810         ImplicitConversionExists code. 
2811         
2812         (Argument): Add Cloning capabilities.
2813         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
2814         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
2815         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
2816         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
2817         IndexerAccess): Add Clone capability.
2818
2819         (LocalVariableReference, This): TODO: needs cloned Block mapping.
2820
2821         (Argument): Add cloning capability.
2822
2823         * assign.cs (Assign): Implement CloneTo.
2824
2825         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
2826         
2827         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
2828         version by calling Convert with the EmitContext (that we are
2829         currently storing in ec, this is not great, but will do for now,
2830         to avoid passing EmitContext parameters to hundreds of functions
2831         that do not need them now).
2832
2833         (SetExpression): Remove, it is not needed.
2834         
2835         (ContextualReturn): Implement CloneTo.
2836
2837         * statement.cs (Statement): Implement cloning infrastructure,
2838         similar to expressions.
2839
2840         (Block): Partial implementation of Clone for statements.
2841
2842         (Return): Implement clone.
2843         
2844         * constant.cs (Constant.CloneTo): New method, does nothing.
2845
2846         * codegen.cs (TempEc): Add a static EmitContext as a temporary
2847         solution, until we decide how to exactly do this.  
2848         
2849 2007-02-14  Marek Safar  <marek.safar@gmail.com>
2850  
2851         A fix for bug #80493
2852         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
2853         a property is override we need to use second accessor.
2854
2855 2007-02-13  Marek Safar  <marek.safar@gmail.com>
2856  
2857         A fix for bug #80418
2858         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
2859         methods.
2860
2861 2007-02-13  Marek Safar  <marek.safar@gmail.com>
2862
2863         Another fix for bug #80749
2864         * pending.cs: Abstract class has priority over interfaces.
2865
2866 2007-02-13  Marek Safar  <marek.safar@gmail.com>
2867
2868         Another fix for bug #80749
2869         * pending.cs: Abstract class has priority over interfaces.
2870
2871 2007-02-13  Marek Safar  <marek.safar@gmail.com>
2872
2873         Another fix for bug #80749
2874         * pending.cs: Abstract class has priority over interfaces.
2875
2876 2007-02-13  Marek Safar  <marek.safar@gmail.com>
2877
2878         Another fix for bug #80749
2879         * pending.cs: Abstract class has priority over interfaces.
2880
2881 2007-02-13  Marek Safar  <marek.safar@gmail.com>
2882
2883         * class.cs Better error message.
2884
2885         * driver.cs: Add shorter versions of -optimize option.
2886
2887 2007-02-13  Martin Baulig  <martin@ximian.com>
2888
2889         * class.cs (Constructor.Emit): Check the return value of
2890         ec.ResolveTopBlock() and return on error.
2891
2892 2007-02-13  Raja R Harinath  <rharinath@novell.com>
2893
2894         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
2895         message to fix error message regression.
2896
2897 2007-02-12  Marek Safar  <marek.safar@gmail.com>
2898
2899         * delegate.cs: Delegate creation expression cannot be of Nullable type.
2900
2901 2007-02-12  Marek Safar  <marek.safar@gmail.com>
2902
2903         A fix for bug #80749
2904         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
2905         its parent container.
2906
2907         * class.cs (DefineFieldInitializers): Each initializer can has different
2908         resolve context.
2909
2910         * const.cs: Updated.
2911
2912 2007-02-11  Miguel de Icaza  <miguel@novell.com>
2913
2914         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
2915         now all the heavy lifting to check that embedded statements or
2916         expressions have the right form is done in the ContextualReturn.
2917
2918         (ContextualReturn): New class.  
2919
2920         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
2921         method that can be invoked to report 201, so we do not replicate
2922         this everywhere.
2923
2924         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
2925         
2926         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
2927         treating tabs as spaces. 
2928
2929 2007-02-09  Marek Safar  <marek.safar@gmail.com>
2930
2931         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
2932         * assign.cs: Use full implicit conversion for right side check.
2933
2934 2007-02-09  Marek Safar  <marek.safar@gmail.com>
2935
2936         * statement.cs (Switch): Switch over boolean type is not standardized.
2937
2938 2007-02-08  Marek Safar  <marek.safar@gmail.com>
2939
2940         A fix for bug #80755
2941         * decl.cs (FindBaseEvent): Don't use method cache for events.
2942
2943 2007-02-07  Marek Safar  <marek.safar@gmail.com>
2944
2945         * cs-parser.jay: Better syntax error handling.
2946
2947         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
2948         instead of underlying type value.
2949
2950 2007-02-06  Marek Safar  <marek.safar@gmail.com>
2951
2952         * driver.cs: Check define identifier before is registered.
2953
2954         * namespace.cs: Use existing error message.
2955
2956         * report.cs: New warning.
2957
2958 2007-02-06  Marek Safar  <marek.safar@gmail.com>
2959
2960         A fix for bug #80742
2961         * expression.cs: Delegate Invoke method can be called directly.
2962
2963 2007-02-06  Marek Safar  <marek.safar@gmail.com>
2964
2965         A fix for bug #80676
2966         * class.cs (IsEntryPoint): The Main method can have params modifier.
2967
2968 2007-02-04  Miguel de Icaza  <miguel@novell.com>
2969
2970         * parameter.cs (Parameter, Parameters): Add Clone method.
2971
2972         * anonymous.cs (Compatible): Turn method into virtual method, so
2973         LambdaExpression can implement a different behavior.
2974
2975         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
2976         out the basic checking here, so it can be used by
2977         LambdaExpressions.
2978         
2979         * lambda.cs: Introduce "Compatible" function that will do the
2980         heavy lifting.
2981
2982 2007-02-02  Marek Safar  <marek.safar@gmail.com>
2983
2984         * attribute.cs: Unified one error message.
2985
2986         * class.cs (Class): Use type attributes and not properties to test static
2987         class.
2988         (IsEntryPoint): Don's pass local variable.
2989
2990         * convert.cs: Removed duplicate check.
2991
2992         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
2993
2994         * driver.cs: Don't crash when soft reference does not exist.
2995
2996         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
2997         (UsingEntry): Removed redundant allocation.
2998
2999         * parameter.cs: Add fast path for type parameters.
3000
3001         * support.cs: Don't allocate attribute when it's not used.
3002
3003 2007-01-30  Miguel de Icaza  <miguel@novell.com>
3004
3005         * anonymous.cs
3006         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
3007         this into a virtual method, so we can override it in LambdaExpression.
3008
3009         * driver.cs: Improve diagnostics in case of failure. 
3010
3011         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
3012         write a function that is slightly more complex and that parses:
3013
3014         type identifier [, type identifier]* )
3015
3016         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
3017         this expression:
3018
3019                 (canEmpty ? i >= 0 : i > 0)
3020
3021 2007-01-30  Raja R Harinath  <rharinath@novell.com>
3022
3023         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
3024         exception on possibly valid code.
3025
3026 2007-01-29  Raja R Harinath  <rharinath@novell.com>
3027
3028         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
3029         Push/PopPosition.
3030         (parse_opt_type_arguments): Remove.  It's almost the same as
3031         parse_less_than.
3032         (parse_namespace_or_typename): Use parse_less_than.
3033
3034 2007-01-28  Miguel de Icaza  <miguel@novell.com>
3035
3036         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
3037         this bug took a few hours to find, because the state saved and
3038         restored by PushPosition and PopPosition was ignoring the state of
3039         parse_generic_less_than.
3040
3041         I can also now remove the handling of OP_LT and OP_GT, this solves
3042         the big mistery.
3043         
3044         * cs-tokenizer.cs: store the location for the ARROW token, we use
3045         that in the parser.
3046
3047         (PushPosition, PopPosition): save/restore also `current_token',
3048         restore `parse_generic_less_than' (was missing).
3049
3050         (parse_opt_type_arguments): use parse_type, not
3051         parse_namespace_or_typename to parse types.
3052
3053         * lambda.cs: Empty new file, will eventually have the lambda
3054         expression implementation.
3055
3056         * lambda.test: used to test the internal tokenizer. 
3057
3058         * report.cs (FeatureIsNotISO1): Rename from
3059         FeatureIsNotStandardized, because it was about the language level
3060         (1 vs 2) it was not about standarization.
3061
3062         (FeatureRequiresLINQ): New.
3063
3064         * support.cs (SeekableStreamReader): Only require that the reader
3065         is a TextReader, not a StreamReader, so we can plug StringReader. 
3066
3067         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
3068         given position in the input stream the following tokens can be
3069         parsed as a type followed by an identifier.
3070
3071         (is_punct): after a '(' if parse_type_and_parameter returns true,
3072         then return a special token OPEN_PARENS_LAMBDA which is used to
3073         avoid reduce/reduce errors in the grammar for the
3074         lambda_expression rules.
3075
3076         (parse_type): implement a type parser inside the
3077         tokenizer, the parser only returns true or false depending on
3078         whether the input at a given position can be parsed as a type.
3079
3080         (peek_token): new method used during type parsing.
3081
3082 2007-01-28  Raja R Harinath  <rharinath@novell.com>
3083
3084         Fix #80531
3085         * anonymous.cs (ScopeInfo.InflateParameters): New.
3086         (AnonymousContainer.Resolve): Use it to redirect types of
3087         delegate parameters.
3088
3089 2007-01-27  Raja R Harinath  <rharinath@novell.com>
3090
3091         Fix #80530
3092         * expression.cs (Error_InvalidArguments): Don't use two different
3093         messages for CS1503.  Use ExtraInformation and
3094         SymbolRelatedToPreviousError instead.
3095
3096         Fix #80358
3097         * decl.cs (DeclSpace.initialize_type_params): Don't access
3098         'type_params' of a partial class directly.
3099
3100 2007-01-26  Miguel de Icaza  <miguel@novell.com>
3101
3102         * constant.cs: Removed a handful of out-of-range checks that were
3103         not necessary. 
3104
3105 2007-01-25  Marek Safar  <marek.safar@gmail.com>
3106
3107         * expression.cs (CheckUselessComparison): Add additional check for char
3108         constants.
3109
3110         * namespace.cs: Fixed typo.
3111
3112 2007-01-23  Miguel de Icaza  <miguel@novell.com>
3113
3114         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
3115         gone, instead we inline the test, preventing the needless casts to
3116         longs, ulongs and doubles for the parameters, avoiding calls to
3117         methods that overchecked stuff, and instead inlined things
3118         nicely. 
3119
3120 2007-01-20  Marek Safar  <marek.safar@gmail.com>
3121
3122         * cs-parser.jay: Better parameter error handling.
3123
3124 2007-01-17  Marek Safar  <marek.safar@gmail.com>
3125
3126         A fix for bug #80368, #80522
3127         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
3128         whether array initializer contains constants only.
3129         (ArrayCreation.Emit): Use better formula to decide when
3130         are array initializers for static initialization.
3131         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
3132         have to emit even constants otherwise they are pre-initialized.
3133
3134 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
3135             Raja R Harinath  <rharinath@novell.com>
3136
3137         Fix emit order of 'get' vs. 'set'.
3138         * support.cs (Accessors): New.
3139         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
3140         Note the order in which accessors are declared in the source.
3141         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
3142         Refactored from Property.Define and Indexer.Define.
3143         (PropertyBase.DefineAccessors): New helper that calls the above in
3144         appropriate order as noted by the parser.
3145         (Property.Define, Indexer.Define): Update to changes.
3146         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
3147
3148 2007-01-17  Raja R Harinath  <rharinath@novell.com>
3149
3150         Fix cs0029-6.cs and gcs0029-2.cs (regression)
3151         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
3152         there's an implicit conversion from the current type to the target
3153         type before converting the underlying constant.
3154
3155 2007-01-16  Marek Safar  <marek.safar@gmail.com>
3156
3157         * const.cs (ResolveValue): Updated after constant conversion was made more
3158         generic.
3159
3160         * constant.cs (GetAttributableValue): constant to object conversion is
3161         used for attributes only.
3162         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
3163         constant conversions.
3164         (LongConstant.ConvertImplicitly): Ditto.
3165
3166         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
3167         (ImplicitConversionStandard): Handle constant conversion as extra step.
3168         It solves the issue when constant conversion was called indirectly like
3169         inside array initializer and constant folding was skipped.
3170
3171         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
3172         this change.
3173
3174         * statement.cs(ImplicitConversionStandard): Updated after constant
3175         conversion was made more generic.
3176
3177 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
3178
3179         * expression.cs (As.DoResolve): Use GenericConstraints instead of
3180         Constraints, solves the problem where the compiler incorrectly
3181         reported that a type parameter was not constrained to a class (Bug
3182         80518)
3183
3184 2007-01-14  Marek Habersack  <grendello@gmail.com>
3185
3186         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
3187
3188 2007-01-14  Marek Safar  <marek.safar@gmail.com>
3189
3190         A fix for bug #80368
3191         * assign.cs (FieldInitializer): New class implements field
3192         initializer statement.
3193
3194         * attribute.cs: Update after FieldMember rename.
3195
3196         * class.cs (PropertyBasedMember): New common class for property based
3197         types.
3198         (InterfaceMemberBase): New base class for all members which can be used as
3199         an interface members.
3200         (MethodCore): Moved really common code to InterfaceMemberBase.
3201         (Method.Define): Equal and GetHasCode detection is relevant for methods
3202         only.
3203         (MethodData.Define): Don't assume that public event implements an
3204         interface automatically.
3205         (MethodData.DefineMethodBuilder): Issue an error even if only extern
3206         modifier is used.
3207         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
3208         (FieldMember): Merged with FieldBase.
3209         (EventProperty.AEventPropertyAccessor): New specialization to check whether
3210         event extern modifier can be used.
3211         (EventField.EventFieldAccessor): Moved event field specific code here.
3212         (Event.AllowedModifiers): Even event can be extern.
3213         (Event.FindOutBaseMethod): New override specific to events.
3214         (Indexer.parameters): Reintroduce parameters because base class holds
3215         only properties common data.
3216         (Indexer.CheckForDuplications): Indexers are threated as methods so we
3217         need do extra parameters check.
3218
3219         * const.cs: Update after FieldMember rename.
3220
3221         * decl.cs (MemberCache.FindBaseEvent): New method.
3222
3223         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
3224         to reflect that indexer is now derived from PropertyBased.
3225
3226         * ecore.cs (GetMemberType): Made public.
3227         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
3228         obsolete event.
3229
3230         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
3231         
3232         * typemanager.cs (CSharpSignature): Correctly print event accessors.
3233         (RegisterEvent): Removed.
3234         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
3235         (GetPrivateFieldOfEvent): Renamed to GetEventField.
3236
3237 2007-01-11  Raja R Harinath  <rharinath@novell.com>
3238
3239         Fix #80249
3240         * statement.cs (CollectionForeach.TryType): Prefer generic
3241         GetEnumerator over non-generic variant.  Fix code to follow comments.
3242
3243 2007-01-09  Raja R Harinath  <rharinath@novell.com>
3244
3245         Fix #80446
3246         * support.cs (ReflectionParameter): Don't use an invalid index on
3247         the generic parameter data.
3248
3249 2007-01-08  Miguel de Icaza  <miguel@novell.com>
3250
3251         * driver.cs: Just add a tiny bit of infrastructure.
3252
3253 2007-01-02  Marek Safar  <marek.safar@gmail.com>
3254
3255         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
3256         where field type is struct from current assembly.
3257         
3258         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
3259         it is possible.
3260
3261 2007-01-02  Marek Safar  <marek.safar@gmail.com>
3262
3263         A fix for bug #80381
3264         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
3265         the core types.
3266
3267         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
3268         messages.
3269         (Namespace.LookupType): Always use core types from corlib when speficied.
3270
3271         * report.cs: A new warning.
3272
3273         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
3274         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
3275         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
3276
3277         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
3278         (InitCoreTypes): Set expression type of object_type and value_type
3279         immediately after lookup.
3280
3281 2007-01-01  Miguel de Icaza  <miguel@novell.com>
3282
3283         * cs-tokenizer.cs: Accept Pc class characters (Connector
3284         Punctuation) as valid identifiers.  Fixes #78259
3285
3286         * expression.cs (Invocation.DoResolve): Moved the check for the
3287         use of `this' for doing method calls to the Invocation resolution
3288         step, after overload resolution has taken place instead of doing
3289         the check at the low-level `This.DoResolve' level.
3290
3291         The `This.DoResolve'(appens before overload resolution, so it has
3292         no way of knowing if the method that will be called will be
3293         instace or static, triggering an erroneous report for cs0188 (Bug
3294         78113).
3295
3296         We now do the check for instance method invocations after we know
3297         what method will be called.
3298
3299         (This.CheckThisUsage): Move the actual use of this structure
3300         checking into its own method and expose it. 
3301
3302         * Everywhere that called Error_ValueCannotBeConverted: pass a new
3303         EmitContext.
3304
3305         Exceptions: Null.ConvertImplicitly,
3306         Constant.ImplicitConversionRequired as there are too many call
3307         sites for passing the ec. 
3308
3309         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
3310         EmitContext, if the value is null, then we do not try to provide
3311         the extra information from the error (If a userdefined conversion
3312         exists, as UserDefinedConversion requires a non null-EmitContext).
3313
3314         Fixes: #80347
3315
3316 2006-12-30  Raja R Harinath  <rharinath@novell.com>
3317
3318         * flowanalysis.cs (MyBitVector): Document some invariants.
3319         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
3320         introduced below, and add a couple of others, 
3321
3322 2006-12-30  Marek Safar  <marek.safar@gmail.com>
3323
3324         * attribute.cs (GetMethodObsoleteAttribute): Uses new
3325         GetPropertyFromAccessor and GetEventFromAccessor.
3326         
3327         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
3328         overrides non-obsolete one.
3329         (Indexer.Define): Error message has been moved to the parser.
3330
3331         * cs-parser.jay: Better syntax errors handling.
3332
3333         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
3334         when an invocation has no arguments.
3335
3336         * ecore.cs: Removed not used caching.
3337
3338         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
3339         implementation.
3340
3341         * report.cs: Add a new warning.
3342
3343         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
3344
3345         * typemanager.cs (enumeration_type): Removed.
3346         (CSharpSignature): Reuses IsSpecialMethod.
3347         (IsEqual): Hack for MS BCL.
3348         (GetPropertyFromAccessor): New method.
3349         (GetEventFromAccessor): New method.
3350         (IsSpecialMethod): Fixed to handle more cases.
3351
3352 2006-12-30  Marek Safar  <marek.safar@gmail.com>
3353
3354         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
3355         Made white spaces array static.
3356
3357         * ecore.cs (RemoveGenericArity): Optimized.
3358
3359         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
3360         10 times faster).
3361         (MyBitVector.initialize_vector): Simplified.
3362
3363 2006-12-22  Miguel de Icaza  <miguel@novell.com>
3364
3365         * ecore.cs: Am not entirely happy with this hack, but it seems to
3366         address the issue in 80257 (a small test case for
3367         CreativeDocs.NET). 
3368
3369         I set the MethodGroupExpr.Type to an internal compiler type
3370         (itself in this case) to force the resolution to take place.   Why
3371         it does not take place with a null is beyond me.
3372
3373 2006-12-20  Marek Safar  <marek.safar@gmail.com>
3374
3375         A fix for bug #80288
3376         * expression.cs (ResolveOperator): Consider user defined conversion for
3377         logical and operator too.
3378         (EmitBranchable): Optimization for logical and when full constant folding
3379         could not be applied but one operand is constant.
3380
3381 2006-12-19  Marek Safar  <marek.safar@gmail.com>
3382
3383         * class.cs (GetClassBases): Write 5 times every day, will never use
3384         FullName for error reporting.
3385
3386         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
3387
3388 2006-12-19  Martin Baulig  <martin@ximian.com>
3389
3390         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
3391         the symbol file info here.
3392
3393 2006-12-18  Marek Safar  <marek.safar@gmail.com>
3394
3395         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
3396         of `elseif' is taking then following sections are not taking.
3397         Fixes an issue reported on mono mailing list.
3398
3399 2006-12-18  Marek Safar  <marek.safar@gmail.com>
3400
3401         A fix for bug #80300
3402         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
3403         a caller is not taking.
3404
3405 2006-12-18  Raja R Harinath  <rharinath@novell.com>
3406
3407         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
3408         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
3409         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
3410         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
3411         * class.cs: Update to changes.
3412
3413 2006-12-17  Marek Safar  <marek.safar@gmail.com>
3414
3415         A fix for bug #79934
3416         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
3417         partial container.
3418
3419         * class.cs (ResolveMembers): Register an iterator in current container and
3420         not in shared one.
3421
3422 2006-12-16  Raja R Harinath  <rharinath@novell.com>
3423
3424         Fix test-543.cs
3425         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
3426         satisfy a params annotated parameter.
3427
3428 2006-12-16  Marek Safar  <marek.safar@gmail.com>
3429
3430         A fix for bug #77014
3431         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
3432         paramters correctly and not rely on hacks in Parameters class.
3433         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
3434         at any possition.
3435         (Invocation.VerifyArgumentsCompat): Ditto.
3436         (Invocation.EmitArguments): Changed to correctly emit params arguments at
3437         any possition.
3438
3439         * parameter.cs (HasParams): Don't assume that params is the last one.
3440
3441         * support.cs (ReflectionParameters.ctor): Look for params attribute
3442         correctly.
3443         (ReflectionParameters.ParameterType): Removed hack when we returned last
3444         parameter for out of range parameters.
3445         (ParameterName, ParameterModifier): Ditto.
3446
3447 2006-12-14  Marek Safar  <marek.safar@gmail.com>
3448
3449         A fix for bug #79987
3450         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
3451         when assembly is not CLS compliant but type is. I have no idea why is this
3452         allowed.
3453
3454         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
3455
3456 2006-12-13  Miguel de Icaza  <miguel@novell.com>
3457
3458         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
3459         in struct constructors, they are basically no-ops.
3460
3461 2006-12-12  Marek Safar  <marek.safar@gmail.com>
3462
3463         * cs-tokenizer.cs (Position): Save preprocessor status too.
3464
3465 2006-12-12  Marek Safar  <marek.safar@gmail.com>
3466
3467         A fix for bug #77794
3468         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
3469
3470 2006-12-12  Marek Safar  <marek.safar@gmail.com>
3471
3472         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
3473         Fixes #69299.
3474         (pp_expr): Report error for an invalid expression.
3475         (handle_preprocessing_directive): Simplified; add more error checking.
3476
3477 2006-12-11  Marek Safar  <marek.safar@gmail.com>
3478
3479         A fix for bug #74939
3480         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
3481         directives handling.
3482
3483 2006-12-10  Marek Safar  <marek.safar@gmail.com>
3484
3485         A fix for bugs #80093, and #75984
3486         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
3487         logic, it seems to me as it worked before "by coincidence".
3488         (xtoken): Simplified to use reworked handle_preprocessing_directive.
3489         (cleanup): Enabled endif check.
3490
3491 2006-12-09  Marek Safar  <marek.safar@gmail.com>
3492
3493         A fix for bug #80162
3494         * statement.cs (CollectionForeach.TryType): Generics and non-generics
3495         enumerators are never ambiguous.
3496
3497 2006-12-08  Raja R Harinath  <rharinath@novell.com>
3498
3499         Fix #80060
3500         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
3501
3502 2006-12-06  Marek Safar  <marek.safar@gmail.com>
3503
3504         A fix for bug #80144
3505         * class.cs (EventProperty.Define): Explicit implementation means
3506         that an even is used.
3507
3508 2006-12-06  Marek Safar  <marek.safar@gmail.com>
3509
3510         Fixes the operators implementation (part II)
3511
3512         * cfold.cs (DoConstantNumericPromotions): Renamed to
3513         DoBinaryNumericPromotions and simplified.
3514         (BinaryFold): Couple of conversion fixes; simplified.
3515
3516         * constant.cs, ecore.cs, literal.cs
3517         (ToType): Renamed to ConvertImplicitly.
3518         (Reduce): Renamed to ConvertExplicitly.
3519
3520         * class.cs, convert.cs: Updated.
3521
3522         * expression.cs: TryReduce doesn't throw an exception.
3523
3524 2006-12-01  Marek Safar  <marek.safar@gmail.com>
3525
3526         A fix for bug #80108
3527         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
3528         compatible.
3529
3530 2006-11-30  Marek Safar  <marek.safar@gmail.com>
3531
3532         Fixes unary operators implementation (part I)
3533         Also fixes #80026
3534
3535         * cfold.cs (Error_CompileTimeOverflow): Made internal
3536
3537         * const.cs (IConstant): Changed to use reference to constant and
3538         not constant itself.
3539         Updated IConstant implementations.
3540
3541         * constant.cs (CreateConstant): New factory method.
3542         Updated IConstant implementation.
3543
3544         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
3545
3546         * ecore.cs: Updated to use CreateConstantReference.
3547
3548         * enum.cs: Reflects IConstant changes.
3549
3550         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
3551
3552         * literal.cs (NullConstant): Change to be independently usable.
3553
3554 2006-11-29  Martin Baulig  <martin@ximian.com>
3555
3556         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
3557         we need to emit the scope initializer before calling the base .ctor.
3558
3559         * anonymous.cs: Merged back from the new anonymous methods branch.
3560         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
3561
3562         * expression.cs (ParameterReference.DoResolveBase): Create a
3563         "normal" ScopeInfo when capturing parameters rather than using the
3564         root scope; this makes things work with anonymous methods having
3565         parameters.
3566
3567         * statement.cs
3568         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
3569
3570 2006-11-22  Marek Safar  <marek.safar@gmail.com>
3571
3572         A fix for bug #79987
3573         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
3574         check to a base class.
3575         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
3576         only when assembly has missing attribute.
3577         * report.cs: Update.
3578
3579 2006-11-21  Marek Safar  <marek.safar@gmail.com>
3580
3581         * cs-tokenizer.cs: Merged with gmcs version.
3582
3583 2006-11-20  Marek Safar  <marek.safar@gmail.com>
3584
3585         * cs-tokenizer.cs,
3586         * cs-parser.jay: Better error message when partial keyword is misplaced.
3587
3588 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
3589
3590         A fix for bug #79810
3591         report.cs: CS1058 only applies to 2.0 profile (gmcs).
3592         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
3593         a RuntimeWrappedException by default.
3594
3595 2006-11-18  Marek Safar  <marek.safar@gmail.com>
3596
3597         A fix for bug #79843
3598         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
3599         implementation.
3600         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
3601
3602 2006-11-18  Marek Safar  <marek.safar@gmail.com>
3603
3604         * driver.cs, namespace.cs: Uses faster IndexOf version.
3605
3606 2006-11-17  Marek Safar  <marek.safar@gmail.com>
3607
3608         A fix for bug #79941
3609         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
3610         operators.
3611         (Operator.Define): Implicit/Explicit operator of same type is duplicate
3612         even if internal name is different.
3613         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
3614         (UserDefinedConversion): Simplified as the operators cannot be internal.
3615         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
3616         conversions.
3617         (MethodLookup): Replaced EmitContext with parentType.
3618         * expression.cs: Updated.
3619
3620 2006-11-09  Raja R Harinath  <rharinath@novell.com>
3621
3622         * driver.cs (BadAssembly): Handle all the ugliness of
3623         DefineDynamicAssembly.
3624
3625 2006-11-08  Raja R Harinath  <rharinath@novell.com>
3626
3627         Address parts of #58244 -- most of what's left is in the runtime
3628         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
3629         CS1509 error checks, and handle them for all assembly loads, not
3630         just the first invocation.
3631         (LoadModule): Likewise.  Move handling of 'adder_method' ...
3632         * codegen.cs (AssemblyClass.AddModule): ... here.
3633
3634 2006-11-02  Marek Safar  <marek.safar@gmail.com>
3635
3636         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
3637         IEnumerable<T> is ambiguous.
3638
3639 2006-10-31  Marek Safar  <marek.safar@gmail.com>
3640
3641         A fix for bug #67689
3642         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
3643         GetEnumerator is ambiguous.
3644
3645         * report.cs: Add new warning.
3646
3647 2006-10-29  Marek Safar  <marek.safar@gmail.com>
3648
3649         A fix for bug #78602
3650         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
3651         to protected member can be nested type.
3652
3653 2006-10-28  Marek Safar  <marek.safar@gmail.com>
3654
3655         A fix for bug #78965
3656         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
3657         to protected member must derive from current type.
3658
3659 2006-10-27  Marek Safar  <marek.safar@gmail.com>
3660
3661         assign.cs: Reuses error method.
3662
3663         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
3664         instead of type for constants.
3665         (Expression.Error_ValueAssignment): Common error method.
3666
3667         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
3668         for any assignment.
3669
3670 2006-10-27  Marek Safar  <marek.safar@gmail.com>
3671
3672         A fix for bug #79081
3673         * expression.cs (MemberAccess.DoResolve): Check nested type
3674         accessibility.
3675
3676 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
3677
3678         * doc.cs : nested delegates were not handled. Fixed bug #79754.
3679
3680 2006-10-26  Marek Safar  <marek.safar@gmail.com>
3681
3682         A fix for bug #76591
3683         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
3684
3685 2006-10-26  Marek Safar  <marek.safar@gmail.com>
3686
3687         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
3688         type forwarder of the same type multiple times.
3689
3690 2006-10-26  Raja R Harinath  <rharinath@novell.com>
3691
3692         Fix #78820
3693         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
3694         instance as an rvalue, even when we later resolve as an lvalue.
3695
3696 2006-10-25  Martin Baulig  <martin@ximian.com>
3697
3698         * anonymous.cs: Fix #79673.
3699
3700 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
3701
3702         A fix for bug #79666
3703         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
3704         ignored when is optimized (= default value) as its value is already set.
3705
3706 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
3707
3708         A fix for bug #79724
3709         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
3710         TypeContainer for type lookup.
3711
3712 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
3713
3714         A fix for bug #79231
3715         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
3716         * expression.cs (OverloadResolve): Always convert type name for
3717         an error message.
3718         (ResolveNamespaceOrType): Don't confuse a nested type with any 
3719         other member.
3720
3721 2006-10-18  Martin Baulig <martin@ximian.com>
3722
3723         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
3724
3725 2006-10-17  Miguel de Icaza  <miguel@novell.com>
3726
3727         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
3728         an int32, but requesting an int64 from the conversion
3729
3730 2006-10-12  Martin Baulig  <martin@ximian.com>
3731
3732         * anonymous.cs
3733         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
3734         
3735 2006-10-12  Martin Baulig  <martin@ximian.com>
3736
3737         * statement.cs
3738         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
3739
3740 2006-10-11  Miguel de Icaza  <miguel@novell.com>
3741
3742         * convert.cs: Remove broken code: I was doing the "Existance"
3743         tests for Implicit conversions.
3744
3745 2006-10-10  Miguel de Icaza  <miguel@novell.com>
3746
3747         * convert.cs: Added one missing case in
3748         ImplicitStandardConversionExists uint64 to intptr.
3749
3750         Fixes #59800
3751         
3752         * typemanager.cs (uintptr_type): another core known type.   
3753
3754         * ecore.cs (OperatorCast): routine used to do cast operations that
3755         depend on op_Explicit.  We could change some of the Decimal
3756         conversions to use this.
3757
3758         This one has a probe mechanism that checks both types for an op_
3759         which it coudl be used to eliminate two classes: CastToDecimal
3760         and CastFromDecimal.
3761
3762         * convert.cs: Implement the conversions documented in #59800
3763         
3764 2006-10-10  Martin Baulig  <martin@ximian.com>
3765
3766         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
3767         before RootScope.ResolveMembers().
3768
3769         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
3770         `CurrentType' if appropriate.
3771
3772 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
3773
3774         A fix for bug #78568
3775         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
3776         when contains binary operators.
3777         * cs-parser.jay: Updated.
3778
3779 2006-10-09  Martin Baulig  <martin@ximian.com>
3780
3781         * delegate.cs
3782         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
3783         moved that into Define() and also do the other type parameter
3784         checks there.  Fixes #79094.  Added gtest-292.cs.
3785
3786         * expression.cs
3787         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
3788         since that doesn't include type parameters; don't use `Ldelema'
3789         for type parameters.  Fixes #78980.  Added gtest-293.cs.
3790
3791 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
3792
3793         A fix for #77796
3794         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
3795         conversion is allowed.
3796
3797 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
3798
3799         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
3800         error reporting when no error occurs.
3801
3802 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
3803
3804         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
3805         does not exist.
3806
3807 2006-10-06  Raja R Harinath  <rharinath@novell.com>
3808
3809         Fix #79584
3810         * class.cs (DefineTypeBuilder): Check circular dependencies before
3811         setting the parent of the TypeBuilder.
3812         (CheckRecursiveDefinition): Don't use 'BaseType', since
3813         it may not be valid until after DefineTypeBuilder.  Use
3814         'base_type' instead.
3815
3816 2006-10-04  Martin Baulig  <martin@ximian.com>
3817
3818         Merged the Anonymous Methods patch.
3819
3820         * anonymous.cs, iterators.cs: The new anonymous methods code.
3821
3822         * statement.cs (Variable): New public abstract class.
3823         (LocalInfo.Variable): New public property.
3824         (LocalInfo.ResolveVariable): New public method.
3825         (Block.Flags): Add `IsIterator'.
3826         (Block.AddVariable): Improved the CS0136 check.
3827         (Block.AnonymousChildren): New public property.
3828         (Block.AddAnonymousChild): New public method.
3829         (ToplevelBlock): Update to use the new anonymous method framework.
3830         (ToplevelBlock.ctor): `container' is now a `Block' and not a
3831         `ToplevelBlock'; this is required to correctly implement the
3832         CS0136 check.
3833         (Fixed, Using): Use `TemporaryVariable' instead of directly
3834         creating the `LocalBuilder'.
3835
3836         * parameter.cs (Parameter.ResolveVariable): New public method.
3837         (Parameters.ResolveVariable): Likewise.
3838
3839         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
3840
3841         * class.cs (TypeContainer): Replaced the `iterators' list and
3842         corresponding methods with a list of `CompilerGeneratedClass'es.
3843         (TypeContainer.ResolveMembers): New public method.
3844         (Method): `IIteratorContainer' has been replaced by
3845         `IAnonymousHost'.
3846
3847         * expression.cs (VariableReference): New public abstract base
3848         class for `LocalVariableReference', `ParameterReference' and
3849         `This'.
3850
3851         * codegen.cs (EmitContext): Removed `capture_context',
3852         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
3853         (EmitContext.EmitThis): Removed.
3854
3855         * cs-parser.jay: Replace `iterator_container' with
3856         `anonymous_host'.       
3857
3858 2006-10-04  Martin Baulig  <martin@ximian.com>
3859
3860         * generic.cs (GenericMethod): Don't make this abstract.
3861         (Constraints.Clone): Added dummy implementation.
3862
3863 2006-10-04  Raja R Harinath  <harinath@gmail.com>
3864
3865         Fix #79577
3866         * namespace.cs (LookForAnyGenericType): Avoid nullref on
3867         'declspaces'.  Avoid allocating arrays willy-nilly.
3868
3869         Fix #79553
3870         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
3871         cases out of the switch.
3872
3873 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
3874
3875         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
3876         message when non-generic type is used with the type arguments.
3877         * expression.cs: Updated.
3878
3879 2006-09-28  Raja R Harinath  <rharinath@novell.com>
3880
3881         Fix #79013
3882         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
3883         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3884         Change semantics slightly.  Don't insist on having only one
3885         temporary EmptyExpression -- just throttle the creation of new ones.
3886
3887         Fix #79451
3888         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
3889         non-interfaces too.  If no methods are found, don't try to create
3890         a MethodGroupExpr.
3891
3892 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
3893
3894         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
3895         generic type.
3896
3897         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
3898         us produce better error message.
3899
3900 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
3901
3902         * expression.cs (Binary.ResolveOperator): Warn about a side effect
3903         of the `|' operator.
3904
3905         * report.cs: A new warning added.
3906
3907 2006-09-27  Martin Baulig  <martin@ximian.com>
3908
3909         * generic.cs (GenericMethod): Don't make this abstract.
3910
3911 2006-09-27  Martin Baulig  <martin@ximian.com>
3912
3913         * report.cs
3914         (InternalErrorException): Added overloaded ctor taking a params array.
3915
3916 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
3917
3918         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
3919         Fixed the cases when same error was reported twice.
3920
3921         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
3922         now report symbol information.
3923
3924 2006-09-25  Martin Baulig  <martin@ximian.com>
3925
3926         * class.cs: Completely unified with the gmcs version.
3927
3928 2006-09-25  Martin Baulig  <martin@ximian.com>
3929
3930         * typemanager.cs (TypeManager.IsNullableType): New public function.
3931         (TypeManager.IsNullableTypeOf): Likewise.
3932         (TypeManager.IsNullableValueType): Likewise.
3933
3934         * class.cs (MethodCore): Added the `GenericMethod' argument from
3935         gmcs and also unified all classes derived from `MethodCore' with gmcs.
3936
3937 2006-09-24  Raja R Harinath  <harinath@gmail.com>
3938
3939         * convert.cs: Unify with gmcs version.
3940
3941 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
3942
3943         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
3944         verify them as well.
3945
3946         * report.cs: New warning.
3947
3948 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
3949
3950         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
3951         for anonymous block with out argument.
3952
3953 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
3954
3955         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
3956         not used private events only.
3957
3958 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
3959
3960         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
3961
3962         * const.cs (Const.Define): Check for constant type.
3963         (Const.IsConstantTypeValid): Looks for valid constant types.
3964
3965         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
3966
3967         * ecore.cs (EmptyConstantCast): New common class for all constant based
3968         EmptyCast(s).
3969
3970         * expression.cs (Is.DoResolve): Handle null constant especially.
3971         (New.DoResolve): Check for new void().
3972         (MemberAccess.DoResolve): Cope with all kind of nulls.
3973
3974         * literal.cs (NullConstant): Uses EmptyConstantCast.
3975         (NullDefault): Based on EmptyConstantCast.
3976         (NullLiteral): Uses EmptyConstantCast.
3977
3978         * statement.cs (Block.ResolveMeta): Check for constant type.
3979
3980 2006-09-22  Martin Baulig  <martin@ximian.com>
3981
3982         * delegate.cs, attribute.cs: Merged with the gmcs versions.
3983
3984 2006-09-22  Raja R Harinath  <rharinath@novell.com>
3985
3986         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
3987         not the null type.
3988
3989         Fix part of #79451
3990         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
3991         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
3992         code slightly.
3993
3994 2006-09-22  Martin Baulig  <martin@ximian.com>
3995
3996         * ecore.cs: Merged with the gmcs version.
3997
3998         * generic.cs (ConstructedType): New dummy class.
3999         (TypeArguments): Don't make this abstract.
4000
4001         * typemanager.cs
4002         (TypeManager.IsGenericTypeDefinition): New method.
4003         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
4004
4005 2006-09-22  Raja R Harinath  <rharinath@novell.com>
4006
4007         * expression.cs (ComposedCast): Check for arrays of TypedReference
4008         before creating the type, not after.
4009
4010 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
4011
4012         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
4013         after ToType change.
4014
4015         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
4016         when constant must be implicitly convertible.
4017
4018         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
4019
4020         * ecore.cs (NullCast): Derives from NullConstant.
4021
4022         * expression.cs (Is.DoResolve): Removed useless variables.
4023         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
4024         (New.Constantify): Add enum support.
4025         (MemberAccess.DoResolve): Add warning when accessing null constant or
4026         variable.
4027
4028         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
4029         property.
4030
4031         * literal.cs (NullConstant): New abstract class with common
4032         functionality for all null specializations.
4033         (NullDefault): Represents default(X) when result can be
4034         reduced to null.
4035         (NullLiteral): Updated.
4036
4037         * report.cs: Add new warning.
4038
4039 2006-09-21  Martin Baulig  <martin@ximian.com>
4040
4041         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
4042
4043 2006-09-21  Martin Baulig  <martin@ximian.com>
4044
4045         * generic.cs (GenericConstraints): New dummy class.
4046         (Constraints): Likewise.
4047         (TypeParameter): Likewise.
4048         (TypeParameterName): Likewise.
4049         (GenericMethod): Likewise.
4050
4051         * typemanager.cs (TypeManager.GetGenericArguments): New method.
4052
4053         * decl.cs: Merged with the gmcs version.
4054
4055 2006-09-21  Raja R Harinath  <rharinath@novell.com>
4056
4057         * generic.cs (TypeParameter): Implement IMemberContainer.
4058         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
4059
4060         * rootcontext.cs: Unify with gmcs version.
4061
4062         * report.cs: Unify with gmcs version.
4063         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
4064         from gmcs/generics.cs.
4065         * generics.cs (TypeParameter): New dummy class.
4066
4067         * support.cs: Unify with gmcs version.
4068
4069 2006-09-20  Raja R Harinath  <rharinath@novell.com>
4070
4071         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
4072         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
4073
4074         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
4075         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
4076         * mcs.exe.sources: Add generic.cs.
4077
4078         * codegen.cs: Unify with gmcs version.
4079
4080         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
4081         (EmitContext): Add GenericDeclContainer implementation.
4082         * decl.cs (MemberCore, DeclSpace): Likewise.
4083         * namespace.cs: Remove #ifdef GMCS_SOURCE.
4084
4085         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
4086         MCS TypeManager has a corresponding dummy method.
4087
4088 2006-09-19  Martin Baulig  <martin@ximian.com>
4089
4090         * expression.cs: Completely merged with the gmcs version.
4091
4092 2006-09-19  Martin Baulig  <martin@ximian.com>
4093
4094         * expression.cs (Invocation): Merged with the gmcs version.
4095         (ArrayAccess.GetStoreOpcode): Likewise.
4096
4097 2006-09-19  Martin Baulig  <martin@ximian.com>
4098
4099         * typemanager.cs
4100         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
4101         (TypeManager.IsGenericMethodDefinition): Likewise.
4102
4103 2006-09-19  Martin Baulig  <martin@ximian.com>
4104
4105         * typemanager.cs
4106         (TypeManager.IsEqual): Moved the gmcs implementation here.
4107         (TypeManager.DropGenericTypeArguments): Likewise.
4108         (TypeManager.DropGenericMethodArguments): Likewise.
4109         (TypeManager.GetTypeArguments): Moved here from gmcs.
4110         (TypeManager.HasGenericArguments): Likewise.
4111
4112 2006-09-19  Martin Baulig  <martin@ximian.com>
4113
4114         * expression.cs (Binary): Merged with the gmcs version.
4115
4116 2006-09-19  Martin Baulig  <martin@ximian.com>
4117
4118         * expression.cs (Probe, As, Is): Merged with the gmcs version.
4119
4120 2006-09-19  Martin Baulig  <martin@ximian.com>
4121
4122         * typemanager.cs: Merged with the gmcs version.
4123
4124 2006-09-16  Raja R Harinath  <rharinath@novell.com>
4125
4126         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
4127         * driver.cs: Likewise.
4128
4129 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
4130
4131         A fix for #79401
4132         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
4133         only if parent type is class.
4134         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
4135         update.
4136
4137 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
4138
4139         * cs-parser.jay,
4140         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
4141         keywords are used.
4142         * typemanager.cs(CSharpName): Converts NullType to null.
4143
4144 2006-09-15  Martin Baulig  <martin@ximian.com>
4145
4146         * typemanager.cs
4147         (TypeManager.GetMethodName): Added mcs implementation.
4148         (TypeManager.IsEqual): Likewise.
4149
4150         * ecore.cs
4151         (SimpleName.RemoveGenericArity): Added dummy implementation.
4152
4153         * pending.cs: Merged with the gmcs version.     
4154
4155 2006-09-15  Martin Baulig  <martin@ximian.com>
4156
4157         * statement.cs: Merge with the gmcs version.
4158
4159 2006-09-15  Martin Baulig  <martin@ximian.com>
4160
4161         * statement.cs (Switch): Merge with the gmcs implementation
4162         (without nullables), which is newer.
4163
4164 2006-09-15  Martin Baulig  <martin@ximian.com>
4165
4166         * statement.cs (Block.Variables): Make this public.
4167         (ToplevelBlock.Parameters): Make this a property.
4168         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
4169
4170 2006-09-15  Martin Baulig  <martin@ximian.com>
4171
4172         * namespace.cs: Merge with the gmcs version.
4173
4174 2006-09-15  Martin Baulig  <martin@ximian.com>
4175
4176         * decl.cs (MemberName): Minor code cleanups.
4177
4178 2006-09-15  Martin Baulig  <martin@ximian.com>
4179
4180         * parameter.cs: Merge with the gmcs version.
4181
4182 2006-09-15  Martin Baulig  <martin@ximian.com>
4183
4184         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
4185         and an error in mcs.
4186
4187 2006-09-15  Martin Baulig  <martin@ximian.com>
4188
4189         * flowanalysis.cs: Merged from GMCS; added the generics code into
4190         a `GMCS_SOURCE' conditional so we can share this file.
4191
4192 2006-09-08  Martin Baulig  <martin@ximian.com>
4193
4194         * typemanager.cs (TypeManager.interlocked_type): New public field.
4195         (TypeManager.int_interlocked_compare-exchange): New public field.
4196         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
4197         enumerator types here and call InitGenericCoreTypes().
4198         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
4199         after calling InitEnumUnderlyingTypes().
4200
4201         * rootcontext.cs
4202         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
4203         `classes_second_stage'. 
4204
4205 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
4206
4207         * assign.cs, ecore.cs, expression.cs: Share error message text.
4208         * class.cs (FieldMember.Define): Check for varible of static type.
4209         * driver.cs (LoadAssembly): Uses error output for errors.
4210         * statement.cs: Updated.
4211
4212 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
4213
4214         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
4215         type instance.
4216
4217 2006-09-07  Martin Baulig  <martin@ximian.com>
4218
4219         * driver.cs
4220         (MainDriver): Revert r62663 from Marek; see #70506 for details.
4221
4222 2006-08-29  Miguel de Icaza  <miguel@novell.com>
4223
4224         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
4225         
4226 2006-08-17  Miguel de Icaza  <miguel@novell.com>
4227
4228         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
4229         #52019 and #79064, the use of the \uXXXX sequence in source code
4230         to represent unicode characters.
4231
4232 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
4233
4234         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
4235         support.
4236         * class.cs, ecore.cs, statement.cs: Merged to one error message.
4237
4238 2006-08-13  Miguel de Icaza  <miguel@novell.com>
4239
4240         * assign.cs: Catch attempts to assign to a method groups in += and
4241         report as 1656
4242
4243 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
4244
4245         A fix for #79056
4246         * cs-parser.jay: Don't destroy current array type by typeof of array's.
4247
4248 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
4249
4250         * class.cs (Method.Define): Issue a warning when generic method looks like
4251         an entry point.
4252         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
4253         as well.
4254
4255 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
4256  
4257         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
4258         looking for ctor.
4259         * decl.cs (MemberCache.FindMembers): When container is interface we need to
4260         search all base interfaces as a member can be ambiguous.
4261         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
4262         Constructor member type filter. 
4263         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
4264         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
4265         reporting for returned memberinfos.
4266         * report.cs: Updated.
4267         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
4268         version to work on all runtimes.
4269         (TypeManager.RealMemberLookup): Removed members filtering.
4270
4271 2006-08-08  Raja R Harinath  <rharinath@novell.com>
4272
4273         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
4274         (PropertyExpr.EmitAssign): Likewise.
4275         * expression.cs (Indirection.EmitAssign): Likewise.
4276         (LocalVariableReference.EmitAssign): Likewise.
4277         (ParameterReference.EmitAssign): Likewise.
4278         (Invocation.EmitArguments): Likewise.
4279         (ArrayAccess.EmitAssign): Likewise.
4280         (IndexerAccess.EmitAssign): Likewise.
4281         (This.EmitAssign): Likewise.
4282         (ConditionalLogicalOperator.Emit): Likewise.
4283
4284         Fix #79026
4285         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
4286         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
4287         leave it in after returning it.
4288         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
4289
4290 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
4291
4292         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
4293         message.
4294
4295 2006-08-03  Raja R Harinath  <rharinath@novell.com>
4296
4297         Fix cs0146-3.cs and cs0146-4.cs.
4298         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
4299         enclosing types don't depend on the current type.
4300
4301 2006-08-02  Raja R Harinath  <rharinath@novell.com>
4302
4303         Fix #77963
4304         * class.cs (TypeContainer.DoDefineMembers): Use
4305         FindBaseMemberWithSameName on Parent, since we're interested in
4306         whether we hide inherited members or not.
4307         (FindBaseMemberWithSameName): Make slightly more robust.
4308
4309         Fix the non-generic testcase from #77396
4310         * decl.cs (DeclSpace.DeclContainer): Remove override.
4311
4312         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
4313         declspaces for doppelgangers too.
4314         (UsingEntry): Implement IResolveContext.
4315         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
4316         'this' as the resolve context.
4317         (LocalAliasEntry): Likewise.
4318
4319         Implement parts of #77403
4320         * roottypes.cs (RootDeclSpace): New.  Used to represent the
4321         toplevel declaration space.  Each namespace declaration introduces
4322         a "partial" root declaretion space.
4323         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
4324         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
4325         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
4326         from 'current_namespace.SlaveDeclSpace'.
4327         (namespace_declaration): Likewise.
4328         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
4329         check.  It can't happen now.
4330         * decl.cs (DeclSpace.LookupType): Likewise.
4331         * driver.cs (MainDriver): Sanity check.
4332
4333 2006-08-01  Raja R Harinath  <rharinath@novell.com>
4334
4335         * decl.cs (DeclSpace.FindNestedType): Remove.
4336         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
4337         LookupTypeContainer to get the container of the nested type.
4338         * class.cs (TypeContainer.FindNestedType): Make non-override.
4339
4340 2006-07-31  Raja R Harinath  <rharinath@novell.com>
4341
4342         * decl.cs (DeclSpace.PartialContainer): Move field from ...
4343         * class.cs (TypeContainer.PartialContainer): ... here.
4344         (TypeContainer.AddBasesForPart): New helper.
4345         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
4346         instead.
4347         * cs-parser.jay (current_class): Convert to DeclSpace.
4348         (struct_declaration, interface_declaration, class_declaration):
4349         Use AddBasesForPart instead of .Bases directly.
4350         * const.cs, iterators.cs: Update to changes.
4351
4352 2006-07-28  Raja R Harinath  <rharinath@novell.com>
4353
4354         * class.cs (TypeContainer.AddMemberType): Rename from
4355         AddToTypeContainer.
4356         (TypeContainer.AddMember): Rename from AddToMemberContainer.
4357         (AddTypeContainer): New.  Combine AddClassOrStruct and
4358         AddInterface.
4359         (AddPartial): Update.  Add 'is_partial' argument.
4360         * roottypes.cs: Update to changes.
4361         * cs-parser.jay (push_current_class): New helper for handling
4362         current_container and current_class.
4363         (struct_declaration, interface_declaration, class_declaration):
4364         Use it.
4365
4366 2006-07-26  Raja R Harinath  <rharinath@novell.com>
4367
4368         * roottypes.cs: Rename from tree.cs.
4369
4370         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
4371         * tree.cs (Tree, ITreeDump): Remove types.
4372         * rootcontext.cs (tree, Tree): Remove fields.
4373         (root, ToplevelTypes): New.
4374         * *.cs: Update to rename.
4375
4376         * tree.cs (Tree.RecordDecl): Remove.
4377         (RootTypes.AddToTypeContainer): Record the toplevel type in its
4378         namespace here.
4379         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
4380
4381 2006-07-23  Raja R Harinath  <harinath@gmail.com>
4382
4383         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
4384         DoFlowAnalysis and OmitStructFlowAnalysis here.
4385         (ec.With): Rename from WithUnsafe and generalize.
4386         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
4387         (ec.WithFlowAnalyis): New.
4388         * ecore.cs, expression.cs, statement.cs: Update.
4389
4390 2006-07-22  Raja R Harinath  <harinath@gmail.com>
4391
4392         * statement.cs (Block.ResolveMeta): Simplify slightly.
4393
4394         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
4395         multiple boolean fields.  Convert InUnsafe, constant_check_state,
4396         check_state to flags.
4397         (CheckState, ConstantCheckState): Update.
4398         (InUnsafe): New read-only property.
4399         (FlagsHandle): Rename from CheckStateHandle and convert to handle
4400         arbitrary flags.
4401         (WithUnsafe): New helper similar to WithCheckState.
4402         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
4403         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
4404
4405 2006-07-21  Raja R Harinath  <rharinath@novell.com>
4406
4407         Make comparisons use the same IL irrespective of whether they're
4408         in a 'checked' or 'unchecked' context: one of the issues in #78899
4409         * codegen.cs (EmitContext.CheckState): Make read-only property.
4410         (EmitContext.ConstantCheckState): Likewise.
4411         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
4412         helper that implement a save/restore stack for CheckState
4413         values.  This is the only way to change check-state.
4414         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
4415         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
4416         (CheckedExpr.EmitBranchable): New forwarding method.
4417         (UnCheckedExpr): Likewise.
4418         * statement.cs (Block.ResolveMeta): Use WithCheckState.
4419         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
4420         (Checked.Resolve, checked.DoEmit): Likewise.
4421
4422 2006-07-20  Miguel de Icaza  <miguel@novell.com>
4423
4424         * anonymous.cs: Cache the resolved anonymous delegate, and return
4425         this so that the ResolveTopBlock is only triggered once, not
4426         twice.
4427
4428         Currently we trigger ResolvetopBlock twice due to a first pass of
4429         argument check compatibility, and a second pass that does the
4430         actual resolution.   
4431         
4432 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
4433
4434         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
4435         modifiers.
4436         * rootcontext.cs (Reset): Add helper_classes.
4437
4438 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
4439
4440         A fix for #78860
4441         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
4442         correctly.
4443
4444 2006-07-13  Miguel de Icaza  <miguel@novell.com>
4445
4446         * statement.cs (Lock): Handle expressions of type
4447         TypeManager.null_type specially.  Fixes #78770
4448
4449 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
4450
4451         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
4452         to an event.
4453
4454 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
4455
4456         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
4457         for accessors as well.
4458         * ecore.cs (EventExpr): Add AccessorTable.
4459
4460 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
4461
4462         A fix for #78738
4463         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
4464         for CS0122 where appropriate.
4465         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
4466         level attributes.
4467         (Filter): Assembly can be null in the case of top level attributes.
4468
4469 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
4470
4471         A fix for #78690
4472
4473         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
4474         is done at global level.
4475
4476 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
4477
4478         A fix for #77002, Implemented TypeForwarder support.
4479
4480         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
4481         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
4482         * typemanager.cs (): Add type_forwarder_attr_type.
4483
4484 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
4485
4486         * report.cs: Add CS0469 warning.
4487
4488 2006-06-21  Martin Baulig  <martin@ximian.com>
4489
4490         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
4491         the `try'-block, so we also report CS0016 etc. there.
4492
4493 2006-06-21  Martin Baulig  <martin@ximian.com>
4494
4495         * delegate.cs
4496         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
4497
4498 2006-06-21  Martin Baulig  <martin@ximian.com>
4499
4500         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
4501         also report CS1686 for parameters.
4502
4503 2006-06-21  Martin Baulig  <martin@ximian.com>
4504
4505         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
4506         instead of an error if the value is not implicitly convertible to
4507         the switch types; fixes #77964.
4508
4509 2006-06-21  Raja R Harinath  <rharinath@novell.com>
4510
4511         Fix #78673
4512         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
4513         FieldBuilder is null.
4514
4515         Fix #78662
4516         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
4517         'left' and 'right' before error-checking.
4518
4519 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
4520
4521         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
4522         Fixed bug #78601.
4523         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
4524         (FieldExpr.DoResolve): likewise.
4525         (PropertyExpr.InstanceResolve): likewise.
4526         (EventExpr.InstanceResolve): likewise. 
4527
4528 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
4529
4530         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
4531         attribute applicable tests for attribute argument.
4532
4533 2006-06-02  Raja R Harinath  <rharinath@novell.com>
4534
4535         Fix #78079
4536         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
4537         (Binary.OverloadResolve_PredefinedIntegral): New.
4538         (Binary.OverloadResolve_PredefinedFloating): New.
4539         (Binary.OverloadResolve_PredefinedString): New.
4540         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
4541         Follow the standard more closely, and treat numeric promotions in
4542         terms of overload resolution.
4543         (Binary.CheckShiftArguments): Simplify.
4544
4545 2006-06-01  Raja R Harinath  <rharinath@novell.com>
4546
4547         * flowanalysis.cs (MyBitVector): Simplify representation.
4548         (MyBitVector.Clone): Avoid allocating BitArray.
4549         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
4550         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
4551         (*): Update.  Change all references to MyBitVector.And and
4552         MyBitVector.Or to &= and |=.
4553
4554 2006-05-29  Raja R Harinath  <rharinath@novell.com>
4555
4556         Fix cs0231-[34].cs.
4557         * cs-parser.jay (formal_parameter_list): Extend the pattern below
4558         to param arguments too.
4559
4560 2006-05-26  Miguel de Icaza  <miguel@novell.com>
4561
4562         * cs-parser.jay: Catch another parsing form for arglist being
4563         followed by other arguments.  Fixes #78313.
4564
4565 2006-05-24  Raja R Harinath  <rharinath@novell.com>
4566
4567         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
4568         checking of out parameters to ...
4569         (FlowBranchingToplevel.Merge): ... here.
4570         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
4571         set, propagate the origin upward, and only complain if there was
4572         no other error.
4573         (FlowBranchingException.AddContinueOrigin): Likewise.
4574         (FlowBranchingException.AddReturnOrigin): Likewise.
4575         (FlowBranchingException.AddGotoOrigin): Likewise.       
4576
4577 2006-05-23  Raja R Harinath  <rharinath@novell.com>
4578
4579         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
4580         unreachable, skip it.
4581         (FlowBranchingException.Merge): Always propagate jumps, even if
4582         the finally block renders subsequent code unreachable.
4583
4584 2006-05-18  Raja R Harinath  <rharinath@novell.com>
4585
4586         Fix #77601
4587         * statement.cs (Goto.Resolve): Move responsibility for resolving
4588         'goto' to FlowBranching.AddGotoOrigin.
4589         (Goto.SetResolvedTarget): New.  Callback to set the
4590         LabeledStatement that's the target of the goto.
4591         (Goto.DoEmit): Use Leave instead of Br when crossing an
4592         unwind-protect boundary.
4593         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
4594         LookupLabel and adjust to new semantics.
4595         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
4596         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
4597         Goto.SetResolvedTarget to update target.
4598         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
4599         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
4600         AddBreakOrigin & co.  Delay propagation until ...
4601         (FlowBranchingException.Merge): ... this.
4602
4603         * statement.cs (Block.Resolve): Always depend on flow-branching to
4604         determine unreachability.  Kill workaround that originally emitted
4605         only one statement after an "unreachable" label (see infloop in
4606         test-515.cs).
4607
4608         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
4609         This is still "wrong", but anything better would probably need a
4610         multi-pass algorithm.
4611         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
4612         usage vector.  Force current usage vector to be reachable, to
4613         optimistically signify backward jumps.
4614         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
4615         detected.
4616         (FlowBranchingLabeled.Merge): New.  If no backward jump was
4617         detected, return the original salted-away usage vector instead,
4618         updated with appropriate changes.  Print unreachable warning if
4619         necessary.
4620         * statement.cs (Block.Resolve): Don't print unreachable warning on
4621         a labeled statement.
4622
4623 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
4624
4625         * driver.cs: Pass filename without path to AssemblyBuilder's 
4626         AddResourceFile. Fixes bug #78407.
4627
4628 2006-05-17  Raja R Harinath  <rharinath@novell.com>
4629
4630         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
4631         * flowanalysis.cs (FlowBranchingLabeled): ... here.
4632         (FlowBranching.MergeChild): Overwrite
4633         reachability information from Labeled branchings too.
4634
4635 2006-05-16  Raja R Harinath  <rharinath@novell.com>
4636
4637         * statement.cs (Goto.Resolve): Merge jump origins here ...
4638         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
4639
4640         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
4641         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
4642         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
4643         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
4644         here, ...
4645         * statement.cs (Goto.Resolve): ... not here.
4646         (Goto.Emit): Remove CS1632 check.
4647
4648 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
4649
4650         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
4651         error message.
4652
4653 2006-05-11  Raja R Harinath  <rharinath@novell.com>
4654
4655         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
4656         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
4657         (FlowBranchingException.Label): Likewise.
4658
4659         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
4660         given value.
4661         (MyBitVector.Or): Use it to avoid losing information (Count).
4662         (FlowBranching.MergeOrigins): Likewise.
4663
4664         * flowanalysis.cs (UsageVector.IsDirty): Remove.
4665         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
4666         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
4667         (UsageVector.ToString): Simplify.
4668         (UsageVector.MergeSiblings): Move here from ...
4669         (FlowBranching.Merge): ... here.
4670         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
4671         not a MyBitVector.
4672
4673 2006-05-10  Raja R Harinath  <rharinath@novell.com>
4674
4675         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
4676         null bitvector is treated as all-true.
4677
4678         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
4679         (MyBitVector): Rationalize invariants.  'vector != null' implies
4680         that we have our own copy of the bitvector.  Otherwise,
4681         'InheritsFrom == null' implies all inherited bits are true.
4682
4683 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
4684
4685         * statement.cs (LocalInfo): Add IsConstant.
4686         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
4687         local variable for constants.
4688
4689 2006-05-09  Raja R Harinath  <rharinath@novell.com>
4690
4691         * flowanalysis.cs (MyBitVector.Empty): New.
4692         (MyBitVector): Don't allow InheritedFrom to be null.
4693         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
4694         (UsageVector, FlowBranching): Update to changes.
4695
4696         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
4697         recursion.  The 'Parent == null' condition isn't sufficient for
4698         anonymous methods.
4699         (FlowBranching.AddBreakOrigin): Likewise.
4700         (FlowBranching.AddContinueOrigin): Likewise.
4701         (FlowBranching.AddReturnOrigin): Likewise.
4702         (FlowBranching.StealFinallyClauses): Likewise.
4703         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
4704         (FlowBranching.CheckOutParameters): Likewise.
4705         (FlowBranchingToplevel): Terminate all the above recursions here.
4706         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
4707         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
4708
4709         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
4710         toplevel block.
4711         (FlowBranchingToplevel): New.  Empty for now.
4712         (FlowBranching.MergeTopBlock): Update.
4713         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
4714         branching for the anonymous delegate.
4715         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
4716
4717         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
4718         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
4719         information at the start of the merge.  Reorganize.
4720
4721 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
4722
4723         * class.cs (MethodData.Define): Method cannot implement interface accessor.
4724
4725 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
4726
4727         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
4728         to newly introduced ctor.
4729
4730         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
4731         message to one place.
4732         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
4733         global namespace.
4734
4735 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
4736
4737         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
4738
4739         * ecore.cs (Expression.ResolveAsConstant): Updated.
4740
4741         * statement.cs (ResolveMeta): Updated.
4742
4743 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
4744
4745         * cs-parser.jay: __arglist cannot be used in initializer.
4746
4747 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
4748
4749         A fix for #77879
4750         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
4751         private types.
4752
4753 2006-05-05  Raja R Harinath  <rharinath@novell.com>
4754
4755         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
4756         (LabeledStatement): Add 'name' parameter.
4757         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
4758         (Block.AddLabel): Update to changes.
4759         * cs-parser.jay (labeled_statement): Likewise.
4760
4761         * flowanalysis.cs (BranchingType.Labeled): New.
4762         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
4763         (FlowBranchingLabeled): New.  Does nothing for now, but will
4764         eventually handle 'goto' flows.
4765         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
4766         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
4767         that's terminated ...
4768         (Block.Resolve): ... here.
4769
4770         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
4771         (UsageVector.MergeFinallyOrigins): Likewise.
4772         (FlowBranching.InTryOrCatch): Likewise.
4773         (FlowBranching.AddFinallyVector): Likewise.
4774         (FlowBranchingException): Update to changes.
4775
4776         Fix #78290
4777         * statement.cs (Return.Resolve): Move error checking to ...
4778         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
4779         (FlowBranchingException): Handle return origins like break and
4780         continue origins.
4781         (FlowBranching.UsageVector.CheckOutParameters): Remove.
4782
4783 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
4784
4785         A fix for #76122
4786         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
4787         filter.
4788
4789 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
4790
4791         A fix for #77543
4792         * class.cs (MethodData.Define): Do public accessor check only when method
4793         implements an interface.
4794
4795 2006-05-04  Raja R Harinath  <rharinath@novell.com>
4796
4797         Remove special handling of 'break'
4798         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
4799         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
4800         (UsageVector.Break): Remove.
4801         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
4802         reachability.
4803         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
4804
4805         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
4806         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
4807
4808 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
4809
4810         A fix for #75726
4811         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
4812         be the interface member.
4813
4814 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
4815
4816         A fix for #60069
4817         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
4818         for emitting small (int) values.
4819
4820 2006-05-03  Raja R Harinath  <rharinath@novell.com>
4821
4822         Fix #59427
4823         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
4824         control-flow passes through the 'finally' after merging-in all the
4825         control-flows from 'try' and the 'catch' clauses.
4826
4827         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
4828         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
4829         always true at the only non-recursive entry point.
4830         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
4831         FlowBranchingBreakable.
4832         (FlowBranchingLoop): Remove.
4833         * statement.cs (Return.DoResolve): Update to changes.
4834
4835         Fix #76471, #76665
4836         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
4837         (FlowBranching.CreateBranching): Handle it: create a
4838         FlowBranchingContinuable.
4839         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
4840         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
4841         except that it handles the 'continue' command.
4842         (FlowBranching.UsageVector.MergeOrigins): Rename from
4843         MergeBreakOrigins.
4844         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
4845         except that it overrides AddContinueOrigin.
4846         (FlowBranchingException): Override AddContinueOrigin, similar to
4847         AddBreakOrigin.
4848         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
4849         Create a new branching around the embedded statement.
4850         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
4851         control flow after the embedded statement.
4852         (Continue.Resolve): Move all error checking to AddContinueOrigin.
4853
4854         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
4855         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
4856         FlowBranchingBreakable.
4857         (FlowBranchingSwitch): Remove.
4858
4859         Fix test-503.cs
4860         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
4861         error reporting to ...
4862         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
4863         Rename from 'AddBreakVector'.  Add new location argument.  Return
4864         a bool indicating whether the 'break' crosses an unwind-protect.
4865         (FlowBranchingException.AddBreakOrigin): Add.
4866         (FlowBranchingException.Merge): Propagate 'break's to surrounding
4867         flowbranching after updating with the effects of the 'finally'
4868         clause.
4869         (FlowBranchingBreakable): New common base class for
4870         FlowBranchingLoop and FlowBranchingSwitch.
4871
4872         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
4873         embedded statement.
4874         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
4875
4876 2006-05-02  Raja R Harinath  <rharinath@novell.com>
4877
4878         * statement.cs (Do.Resolve): If the loop is infinite, set the
4879         barrier.
4880         (While.Resolve, For.Resolve): Set a barrier after the embedded
4881         statement.  There's no direct control flow that goes from the end
4882         of the embedded statement to the end of the loop.
4883         * flowanalysis.cs (FlowBranching.Infinite): Remove.
4884         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
4885         above ensure that the reachability is correctly computed.
4886
4887         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
4888         (UsageVector.MergeBreakOrigins): If the current path is
4889         unreachable, treat it as if all parameters/locals are initialized.
4890         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
4891         infinite loops before merging-in break origins.
4892
4893         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
4894         (Reachability.Reachable): Split part into ...
4895         (Reachability.Unreachable): ... this.  Simplify.
4896         (Reachability.IsUnreachable): Use 'Unreachable' instead.
4897
4898         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
4899         (Reachability.SetThrowsSometimes): Likewise.
4900         (FlowBranchingBlock.MergeTopBlock): Don't compare against
4901         TriState.Always, use corresponding property.
4902         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
4903         (Block.Resolve): Likewise.  Remove some redundant checks.
4904
4905 2006-05-02  Raja R Harinath  <harinath@gmail.com>
4906
4907         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
4908         (Reachability.Meet): Don't bother checking AlwaysThrows --
4909         barrier is always set.
4910         (FlowBranchingBlock.Merge): Likewise.
4911
4912 2006-05-01  Raja R Harinath  <harinath@gmail.com>
4913
4914         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
4915         checks for unreachable.
4916
4917 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
4918
4919         A fix for #77980
4920         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
4921
4922         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
4923         whether field is really assigned.
4924
4925 2006-04-30  Raja R Harinath  <harinath@gmail.com>
4926
4927         * flowanalysis.cs (Reachability): Make 4-argument constructor
4928         private.
4929         (Reachability.Meet): Rename from 'And'.  Remove static variant.
4930         (Reachability.Always): Rename from the highly misleading
4931         'Reachability.Never'.
4932         (FlowBranching.Merge): Update to changes.  Mark an impossible
4933         situation with a 'throw'.
4934         (*): Update to changes.
4935
4936 2006-04-29  Raja R Harinath  <harinath@gmail.com>
4937
4938         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
4939         Remove 'Undefined'.
4940         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
4941         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
4942         (*): Update to changes.
4943         * statement.cs: Update to changes.
4944
4945 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
4946
4947         A fix for #78049
4948         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
4949
4950 2006-04-28  Raja R Harinath  <harinath@gmail.com>
4951
4952         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
4953         dummy UsageVector.
4954
4955         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
4956         argument to two arguments: an usage-vector and a bool.  Move call
4957         to FlowBranching.Merge () ...
4958         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
4959
4960         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
4961         handling of loop and switch reachability to ...
4962         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
4963
4964 2006-04-27  Raja R Harinath  <harinath@gmail.com>
4965
4966         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
4967         handling to FlowBranchingLoop.InLoop.
4968         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
4969
4970 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
4971
4972         A fix for #78115
4973         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
4974         anonymous method is allowed from AnonymousContainer here.
4975
4976         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
4977
4978 2006-04-24  Raja R Harinath  <rharinath@novell.com>
4979
4980         Fix #78156
4981         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
4982
4983 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
4984
4985         A fix for #49011.
4986         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
4987         (DoubleConstant.Reduce): Ditto.
4988
4989 2006-04-23  Raja R Harinath  <rharinath@novell.com>
4990
4991         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
4992         Remove 'lvalue_right_side' argument.  Move parts to ...
4993         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
4994         (LocalVariable.DoResolveLValue): ... these.
4995
4996 2006-04-21  Raja R Harinath  <rharinath@novell.com>
4997
4998         Fix cs1655.cs
4999         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
5000         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
5001         (LocalVariableReference.DoResolveBase): Use it to implement new
5002         CS1655 check.
5003         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
5004         (Argument.Resolve): Simplify.  Move CS1510 check ...
5005         * ecore.cs (Expression.ResolveLValue): ... here.
5006         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
5007         (PropertyExpr.DoResolveLValue): Likewise.
5008         (FieldExpr.Report_AssignToReadonly): Likewise.
5009         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
5010         LValueMemberAccess or LValueMemberOutAccess on instance depending
5011         on it.
5012         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
5013         DoResolve as appropriate.
5014
5015 2006-04-20  Raja R Harinath  <rharinath@novell.com>
5016
5017         Fix #75800
5018         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
5019         implicit conversions on 'out' and 'ref' arguments.
5020
5021         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
5022         improve clarity.  Remove dead code.
5023
5024         Fix #66031
5025         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
5026         (Catch.Resolve): Resolve VarBlock if it exists.
5027
5028 2006-04-19  Miguel de Icaza  <miguel@novell.com>
5029
5030         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
5031         twice, this was some residual code, the enumerator was emitted
5032         properly in the two branche of if later.
5033
5034 2006-04-19  Raja R Harinath  <rharinath@novell.com>
5035
5036         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
5037         cast is never an lvalue.
5038         (Cast.DoResolve, Cast.ResolveRest): Combine.
5039         (Argument.Emit): Simplify slightly.  Move 'Expr is
5040         IMemoryLocation' check ...
5041         (Argument.Resolve): ... here.
5042         (Argument.Error_LValueRequired): Remove.  Inline into only user.
5043
5044         Simplifications.  Fix cs0191-2.cs
5045         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
5046         CS1649 and CS1651 to ...
5047         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
5048         the actual selection of the error code and message to a lookup
5049         table.  Add a dummy return value to simplify callsites.
5050         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
5051         readonly fields of other instances of the same type.  Move CS0197
5052         warning from ...
5053         * expression.cs (Argument.Resolve): ... here.  Simplify code.
5054         Ensure that ec.InRefOutArgumentResolving is only set during LValue
5055         resolution of an out or ref argument.  The code simplification
5056         above uses this invariant.
5057
5058 2006-04-18  Raja R Harinath  <rharinath@novell.com>
5059
5060         Possibly fix #77752.  Fix cs1690-[4-7].cs.
5061         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
5062         CheckMarshallByRefAccess.  Drop parameter.
5063         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
5064         warning.
5065         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
5066         InstanceExpression.
5067         * report.cs (AllWarnings): Add CS1690.
5068         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
5069         for ref access too.
5070         (LocalVariableReference.DoResolveBase): Update.
5071
5072 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5073
5074         * class.cs (MethodOrOperator): Moved common parts from method class.
5075         detect obsolete attributes.
5076         (Method.Define): Simplified as it reuses code from base.
5077         (Constructor.ValidAttributeTargets): Fixed issue found during
5078         refactoring.
5079         (Destructor.ValidAttributeTargets): Fixed issue found during
5080         refactoring.
5081         (Operator): Finished refactoring set off by #78020. Operator class is now
5082         ordinary method class.
5083
5084         * anonymous.cs: Updated.
5085
5086         * decl.cs (DeclSpace): Add IsGeneric
5087
5088 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5089
5090         * class.cs (Constructor.Emit): Don't emit the attributes twice.
5091
5092 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5093
5094         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
5095         detect obsolete attributes.
5096         (Method.CreateEmitContext): Moved to MethodOrOperator.
5097
5098 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5099
5100         A fix for #78048.
5101         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
5102         customized exception to make crash detection easier.
5103         (MethodOrOperator): Started to work on new base class for methods and
5104         operators.
5105         (Method): Derives from MethodOrOperator.
5106         (Constructor.Emit): Emits its own attributes.
5107         (AbstractPropertyEventMethod.Emit): Ditto.
5108         (Operator): Derives from MethodOrOperator, will refactor fully in extra
5109         patch.
5110         (Operator.Emit): It's temporary more tricky than should be.
5111         
5112         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
5113
5114         * report.cs (InternalErrorException): Add ctor with inner exception.
5115
5116 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
5117
5118         A fix for #76744.
5119         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
5120         only not visible.
5121
5122 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
5123
5124         A fix for #77916.
5125         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
5126         array.
5127
5128 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
5129
5130         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
5131         attribute is present and Guid not.
5132         (Interface.ApplyAttributeBuilder): Ditto.
5133
5134         * attribute.cs: Add error message.
5135
5136 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
5137
5138         A fix for #78020.
5139
5140         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
5141         sources (it's composite) so hold them in extra array as they are used in
5142         Emit phase only. It worked in the previous versions by mistake.
5143         (Attribute.Emit): Emit attribute for more owners when exist.
5144
5145         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
5146         it has now different behaviour.
5147
5148 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
5149
5150         * constant.cs (Constant.IsDefaultInitializer): New method.
5151
5152         * class.cs: Updated.
5153
5154         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
5155         re-initialize default values. It saves KBs almost for every assembly.
5156         Thanks Zoltan for the idea.
5157         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
5158         (ArrayCreation.DoResolve): Resolve only once.
5159         (ArrayCreation.Emit): Emit static initializer only when it is faster.
5160         (ArrayCreation.GetAttributableValue): Cope with optimized values.
5161
5162 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
5163
5164         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
5165         From #77961.
5166
5167 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
5168
5169         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
5170         in an embedded statement too.
5171
5172 2006-04-01  Raja R Harinath  <rharinath@novell.com>
5173
5174         Fix #77958
5175         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
5176
5177 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
5178
5179         A fix for #77966.
5180
5181         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
5182         was not specified.
5183
5184         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
5185
5186 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
5187
5188         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
5189         phase.
5190
5191         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
5192         LocalTemporary change.
5193
5194         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
5195         TypeContainer.
5196         (ClassOrStruct.DefineFieldInitializers): Implemented static field
5197         initializers optimization.
5198         (ClassOrStruct.TypeAttr): Moved from modifiers.
5199         (Constructor.CheckBase): Don't crash when static ctor has parameters.
5200         (FieldBase.ResolveInitializer): Resolves initializer.
5201         (FieldBase.HasDefaultInitializer): New property.
5202
5203         * cs-parser.jay: Removed message.
5204
5205         * expression.cs (CompilerGeneratedThis): New specialization.
5206
5207         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
5208
5209 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
5210
5211         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
5212
5213 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
5214
5215         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
5216         be now EnumConstants only.
5217
5218 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
5219
5220         * attribute.cs, driver.cs: Reset more caches.
5221
5222 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5223
5224         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
5225
5226 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5227
5228         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
5229         for easier reuse. Updated all overrides.
5230         (IntegralConstant): New base class for all integral constants.
5231         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
5232         of the constant range, report custom error.
5233         (UIntConstant.Reduce): Fixed uint conversion.
5234
5235         * ecore.cs, literal.cs: Reduce updates.
5236
5237 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5238
5239         A fix for #75813.
5240
5241         * class.cs (Constructor.Define): Removed extra if for default ctors.
5242         A patch from Atsushi Enomoto.
5243
5244 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5245
5246         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
5247         GetAttributableValue.
5248
5249         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
5250         when required.
5251
5252         * convert.cs (ImplicitConversionRequired): Error message moved to
5253         DoubleLiteral.
5254
5255         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
5256         automatic implicit conversion of an output value.
5257         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
5258
5259         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
5260         conversion.
5261         (TypeOf.GetAttributableValue): Add extra handling for object type.
5262
5263         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
5264         special error message.
5265
5266 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
5267
5268         * class.cs (Constructor.Emit): Don't crash when struct ctor is
5269         InternalCall.
5270         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
5271         compatible with MS runtime.
5272
5273 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
5274
5275         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
5276         attribute arguments here.
5277
5278         * class.cs (Indexer.Define): The check was moved to attribute class.
5279
5280 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
5281
5282         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
5283         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
5284         easier.
5285
5286 2006-03-22  Raja R Harinath  <rharinath@novell.com>
5287
5288         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
5289         mcs to keep code differences small.
5290         * attribute.cs (Attribute.GetParameterDefaultValue): New.
5291         * typemanager.cs (parameter_default_value_attribute_type): New.
5292         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
5293         CS1908 check.
5294
5295 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
5296
5297         * expression.cs (StringConcat.Append): Reverted back to no warning state.
5298
5299 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
5300
5301         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
5302
5303         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
5304         the blocks too.
5305
5306 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
5307
5308         * doc-bootstrap.cs : fix build.
5309
5310 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
5311
5312         * expression.cs (StringConcat.Append): Issue a warning when empty string
5313         is going to append.
5314
5315 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
5316
5317         * assign.cs (CompoundAssign.ResolveSource): Removed.
5318
5319         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
5320         clean up.
5321
5322         * class.cs (TypeContainer.FindMethods): Removed.
5323         (TypeContainer.CheckMemberUsage): Made static.
5324
5325         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
5326
5327         * constant.cs (CheckRange): Removed unused type argument.
5328         (CheckUnsigned): Removed unused type argument.
5329
5330         * cs-parser.jay: Updated after MemberAccess clean up.
5331         Uses Length for empty string test.
5332
5333         * cs-tokenizer.cs: Uses Length for empty string test.
5334         (IsCastToken): Made static.
5335         (is_hex): Made static.
5336         (real_type_suffix): Made static.
5337
5338         * decl.cs (SetupCache): Made static.
5339         (OnGenerateDocComment): Removed unused ds argument.
5340
5341         * delegate.cs (VerifyDelegate): Removed unused argument.
5342
5343         * doc.cs: Uses Length for empty string test.
5344
5345         * driver.cs: Uses Length for empty string test.
5346
5347         * enum.cs (IsValidEnumType): Made static
5348
5349         * expression.cs (EnumLiftUp): Removed unused argument.
5350         (ResolveMethodGroup): Ditto.
5351         (BetterConversion): Ditto.
5352         (GetVarargsTypes): Ditto.
5353         (UpdateIndices): Ditto.
5354         (ValidateInitializers): Ditto.
5355         (MemberAccess.ctor): Ditto.
5356         (GetIndexersForType): Ditto.
5357
5358         * flowanalysis.cs: (MergeFinally): Removed unused argument.
5359
5360         * iterators.cs: Updated after MemberAccess clean up.
5361
5362         * location.cs: Uses Length for empty string test.
5363
5364         * namespace.cs: Uses Length for empty string test.
5365
5366          * report.cs (CheckWarningCode): Made static.
5367
5368         * statement.cs (LabeledStatement): Removed unused argument.
5369
5370         * typemanager.cs (FilterNone): Removed.
5371
5372 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5373
5374         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
5375         obsolete.
5376
5377         * class.cs: Updated.
5378
5379 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5380
5381         * cs-parser.jay.cs: __arglist is not allowed for delegates.
5382
5383 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5384
5385         A fix for #77822.
5386
5387         * expression.cs (VerifyArgumentsCompat): Reverted to double error
5388         reporting, it's more tricky than I thought.
5389
5390 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5391
5392         A fix for #77816.
5393
5394         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
5395         host container.
5396         (AnonymousMethod.ImplicitStandardConversionExists): New method.
5397         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
5398         Add more error reporting; Fixed issue with params.
5399
5400         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
5401
5402         * cs-parser.jay: AnonymousMethod requires host container.
5403
5404         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
5405
5406 2006-03-18  Raja R Harinath  <harinath@gmail.com>
5407
5408         * class.cs: Change 'TypeContainer ds' constructor argument to
5409         'DeclSpace parent'.  Some classes were missed below due to
5410         different naming convention.
5411
5412         * class.cs (MemberCore.Parent): Delete.  This makes the
5413         ParentContainer changes below enforceable by the compiler.
5414
5415         Treat pointers to enclosing declaration space as 'DeclSpace', not
5416         'TypeContainer'.
5417         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
5418         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
5419
5420         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
5421         of TypeContainer.
5422         (Block.AddThisVariable): Likewise.
5423         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
5424         (AbstractPropertyEventMethod.Emit): Likewise.
5425         (AbstractPropertyEventMethod.EmitMethod): Likewise.
5426         (GetMethod.Define, SetMethod.Define): Likewise.
5427         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
5428         (DelegateMethod.EmitMethod): Likewise.
5429
5430         Fix regression test-partial-13.cs.
5431         Rationalize use of PartialContainer.  Ensure that the partial
5432         class semantics can be tied to type-correctness, i.e., any
5433         violation will cause a compile error.
5434         * class.cs, const.cs: Access all fields that belong to class
5435         TypeContainer via ParentContainer.  Arguments of EmitContexts and
5436         Resolve()-like functions still use 'Parent'.
5437
5438         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
5439         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
5440         (PropertyMethod.CheckModifiers): Remove unused argument.
5441         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
5442         DeclSpace.
5443
5444 2006-03-17  Raja R Harinath  <harinath@gmail.com>
5445
5446         Make semantics of PartialContainer simpler.
5447         * decl.cs (DeclSpace.IsPartial): Remove.
5448         * class.cs (TypeContainer.IsPartial): Likewise.
5449         (TypeContainer..ctor): Set PartialContainer to point to self.
5450         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
5451         (TypeContainer.FindNestedType): Likewise.
5452         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
5453
5454 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
5455
5456         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
5457
5458 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
5459
5460         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
5461         classes.
5462
5463 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
5464
5465         * class.cs (Operator.Define): An error for base conversion was not
5466         reported correctly.
5467
5468 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
5469
5470         * iterator.cs : yield break is allowed in try statement which has
5471           catch clauses. Fixed bug #77767.
5472
5473 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
5474
5475         A fix for #77593, #77574.
5476
5477         * class.cs (MethodCore.CheckBase): Another if for operator.
5478
5479 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
5480
5481         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
5482         were not resolved
5483
5484         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
5485         (DelegateCreation.ImplicitStandardConversionExists): New method for just
5486         conversion test.
5487         
5488         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
5489         not needed.
5490
5491         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
5492         Updated after another emitcontext usage was clean up. It should help us to
5493         synchronize with gmcs easier.
5494
5495 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
5496
5497         A fix for #77353.
5498
5499         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
5500         (Event.Define): ditto
5501         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
5502
5503         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
5504         Removed redundant code and set NewSlot for Invoke method too.
5505
5506         * parameter.cs (Parameters.ctor): Add custom, type ctor.
5507         (Parameters.MergeGenerated): New method. Use this method when you merge
5508         compiler generated argument with user arguments.
5509
5510 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
5511
5512         * attribute.cs (ResolveAsTypeTerminal): Removed.
5513
5514         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
5515         specialization for predefined types; 30% speed up.
5516         Finally placed obsolete check to right place.
5517         (Expression.ResolveType): Removed.
5518
5519         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
5520         Updated after ResolveType was removed.
5521
5522         * expression.cs (Cast.ctor): Check void cast.
5523         (Binary.ResolveAsTypeTerminal): Is never type.
5524         (Conditional.ResolveAsTypeTerminal): Is never type.
5525
5526         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
5527
5528 2006-03-01  Raja R Harinath  <rharinath@novell.com>
5529
5530         Fix #77679.
5531         * expression.cs (ParameterReference.DoResolveBase): Change return
5532         type to bool.
5533         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
5534         Update.
5535
5536         Fix #77628.
5537         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
5538
5539         Fix #77642.
5540         * typemanager.cs (GetFullNameSignature): Don't nullref on
5541         protected accessors.
5542
5543 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
5544
5545         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
5546         these two separated members to simplify the code.
5547         (Attribute.Resolve): Refactored to use new fields and methods.
5548         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
5549         implemented obsolete attribute checking.
5550         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
5551         implemented obsolete checking again. It look line never ending quest ;-)
5552         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
5553
5554         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
5555
5556         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
5557
5558         *class.cs (Property.Define): Add RegisterProperty call.
5559
5560         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
5561         argument groups (only 2).
5562
5563         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
5564         encoding expression to arguments.
5565         (Expression.ExprClassToResolveFlags): Just turned to property.
5566
5567         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
5568         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
5569         optimized as well as implemented support for zero-length attributes.
5570
5571         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
5572         Add caching of PropertyInfo's.
5573
5574 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
5575
5576         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
5577         error multiple times.
5578
5579 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
5580
5581         New partial class implementation.
5582         A fix for #77027, #77029, #77403
5583
5584         * attribute.cs (Attributable): Made attributes protected.
5585
5586         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
5587         the replacements of ClassPart and PartialContainer.
5588         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
5589         (TypeContainer.AddInterface): Ditto.
5590         (TypeContainer.AddPartial): The main method for partial classes. It checks
5591         for errors and merges ModFlags and attributes. At the end class is added to
5592         partial_parts list.
5593         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
5594         required here.
5595         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
5596         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
5597         from the rest of partial classes.
5598         (TypeContainer.GetClassBases): Simplified.
5599         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
5600         DefineType.
5601         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
5602         (TypeContainer.HasExplicitLayout): Uses Flags now.
5603         (PartialContainer): Removed.
5604         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
5605         (StaticClass): Was merged with Class.
5606         (Class.GetClassBases): class and static class bases are verified here.
5607         (Class.TypeAttr): Added static attributes when class is static.
5608         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
5609         (MemberBase): In some cases we need to call parent container for partial
5610         class. It should be eliminated but it's not easy now.
5611
5612         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
5613
5614         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
5615         partial classed to accumulate class comments.
5616         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
5617
5618         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
5619
5620         * driver.cs (MainDriver): Tree.GetDecl was removed.
5621
5622         * modifiers.cs (Modifiers): Add partial modifier.
5623
5624         * tree.cs (Tree.decl): Removed.
5625         (RootTypes): Started to use this class more often for root types
5626         specializations.
5627
5628 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
5629
5630         A fix for #77615
5631
5632         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
5633         external interface does not have an attribute.
5634
5635 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
5636
5637         Another prerequisites for new partial classs implementation.
5638         
5639         * attribute.cs (Attribute.Equal): Implemented.
5640         (Attribute.Emit): Changed as attributes can be applied more than twice.
5641         (Attributes.Emit): Check for duplicate attributes here.
5642
5643         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
5644         as a parameter, clean-up.
5645
5646 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
5647
5648         A fix for #77485
5649
5650         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
5651         contains obsolete attribute check which can in some cases look for base
5652         type of current class which is not initialized yet.
5653         (TypeContainer.BaseType): Replacement of ptype.
5654
5655         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
5656
5657 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
5658
5659         First of prerequisites for new partial classs implemention.
5660         
5661         * attribute.cs (Attributable): Extended by ResolveContext;
5662         Attributes finally have correct context for resolving in all cases.
5663         (AttachTo): Attribute owner is assigned here.
5664
5665         * codegen.cs (IResolveContext): Introduce new interface to hold
5666         all information needed in resolving phase.
5667         (EmitContext): Implements IResolveContext; more clean-up needed here.
5668         
5669         * decl.cs (MemberCore): Implemented IResolveContext.
5670
5671         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
5672         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
5673         parameter.cs, statement.cs, tree.cs, typemanager.cs:
5674         Refactored to use new IResolveContext instead of EmitContext; cleanup
5675
5676 2006-02-06  Miguel de Icaza  <miguel@novell.com>
5677
5678         * codegen.cs (EmitScopeInitFromBlock): check here the
5679         capture_context, there is no need to make two calls to the
5680         EmitContext. 
5681
5682         * anonymous.cs: Add some debugging messages that might help me
5683         track other instances of this problem in the future (the
5684         regression of test 467).
5685
5686         * cs-parser.jay: track the variable block, as we need to initalize
5687         any captured variables declared in this block for the "catch"
5688         portion of the "Try" statement.
5689
5690         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
5691         scope initialization for captured variables. 
5692
5693         Also, move the emit for the variables after the block location has
5694         been marked.
5695
5696 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
5697
5698         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
5699
5700 2006-02-02  Miguel de Icaza  <miguel@novell.com>
5701
5702         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
5703         commit yesterday, the initialization for the roots is necessary.
5704         What is not necessary is the scope activation.
5705
5706 2006-02-02  Raja R Harinath  <rharinath@novell.com>
5707
5708         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
5709         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
5710         CS0206 checks.
5711         (Argument.Resolve): Remove CS0206 checks.
5712
5713 2006-02-01  Miguel de Icaza  <miguel@novell.com>
5714
5715         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
5716         scopes for all the roots, the scopes will now be emitted when the
5717         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
5718
5719         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
5720         code.  This reduces a lot of existing cruft.
5721         
5722         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
5723         that the ScopeInfo is generated as we enter the scope, not at the
5724         time of use, which is what we used to do before.
5725
5726         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
5727         every time a Block is about to be emitted if we have a
5728         CaptureContext. 
5729
5730 2006-02-01  Raja R Harinath  <rharinath@novell.com>
5731
5732         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
5733         (Reset): Update.
5734         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
5735
5736         * typemanager.cs (cons_param_array_attribute): Make private.
5737         (Reset): Set it to null.
5738         (InitCoreHelpers): Don't initialize it.
5739         (ConsParamArrayAttribute): New.  Initialize it as needed.
5740         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
5741
5742 2006-01-31  Miguel de Icaza  <miguel@novell.com>
5743
5744         * expression.cs: There might be errors reported during the
5745         selection of applicable methods.  If there are errors, do not
5746         continue execution as it will lead the compiler to crash.
5747
5748 2006-01-30  Miguel de Icaza  <miguel@novell.com>
5749
5750         * expression.cs: Member access is not allowed on anonymous
5751         methods.  Fixes #77402.
5752
5753 2006-01-30  Raja R Harinath  <rharinath@novell.com>
5754
5755         Fix #77401
5756         * cs-parser.jay (VariableDeclaration): Don't set
5757         current_array_type to null.
5758         (field_declaration, event_declaration, declaration_statement):
5759         Set it to null here.
5760
5761 2006-01-28  Raja R Harinath  <harinath@gmail.com>
5762
5763         * typemanager.cs (GenericParameterPosition): New.
5764         * doc.cs: Use it.
5765
5766 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
5767
5768         * doc.cs : To process "include" elements, first we should create
5769           another list than XmlNodeList, because it could result in node
5770           removal, which could result in that the XmlNodeList gives up
5771           yielding next node.
5772
5773           (Also made code identical to gmcs again.)
5774
5775 2006-01-25  Miguel de Icaza  <miguel@novell.com>
5776
5777         * ecore.cs: Introduce an error report that we were not catching
5778         before, if not silent, we must report the error.  Gonzalo ran into
5779         it.
5780
5781 2006-01-23  Miguel de Icaza  <miguel@novell.com>
5782
5783         A fix for bug: #76957
5784         
5785         * iterators.cs (MoveNextMethod.CreateMethodHost): call
5786         ComputeMethodHost before creating the method, this is a new
5787         requirement. 
5788
5789         * anonymous.cs (AnonymousContainer): Now we track all the scopes
5790         that this method references (RegisterScope).  The actual scope
5791         where the method is hosted is computed with the ComputeMethodHost
5792         before we create the method.
5793
5794         Moved the Deepest routine here.
5795
5796         (AnonymousContainer.ComputeMethodHost): New routine used to
5797         compute the proper ScopeInfo that will host the anonymous method.
5798
5799         (ScopeInfo): Deal with multiple roots.  The problem was that we
5800         did not have a unique root where all ScopeInfos could be hanged
5801         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
5802         of roots.  
5803
5804         Remove AdjustMethodScope which is now computed at the end.  Remove
5805         LinkScope which did a partial link, instead link all ScopeInfos
5806         before code generation from the new "LinkScopes" routine. 
5807
5808         Simplify all the Add* routines as they no longer need to maintain
5809         the tree, they just need to record that they are using variables
5810         from a ScopeInfo.
5811
5812         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
5813         routines to produce the forest of ScopeInfo trees.
5814
5815         * class.cs (TypeContainer.AppendMethod): This is just like
5816         AddMethod, but ensures that an interface implementation method
5817         (IEnumerable.XXX) is not inserted at the beginning of the queue of
5818         methods, but at the end.
5819
5820         We use this functionality to ensure that the generated MoveNext
5821         method in the iterator class is resolved/emitted before the
5822         enumerator methods created.   
5823
5824         This is required because the MoveNext method computes the right
5825         ScopeInfo for the method.  And the other methods will eventually
5826         need to resolve and fetch information computed from the anonymous
5827         method. 
5828
5829 2006-01-21  Raja R Harinath  <harinath@gmail.com>
5830             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
5831
5832         Fix rest of #76995.
5833         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
5834         the 'aliases' hash.
5835         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
5836         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
5837
5838 2006-01-18  Raja R Harinath  <rharinath@novell.com>
5839
5840         Fix #76656, cs0231-2.cs.
5841         * cs-parser.jay (formal_parameter_list): Make error case catch
5842         more issues.
5843         (parenthesized_expression_0): Add CS1026 check.
5844         (invocation_expression): Remove unused { $$ = lexer.Location }.
5845
5846 2006-01-17  Raja R Harinath  <rharinath@novell.com>
5847
5848         Fix #76824.
5849         * cs-parser.jay (statement_expression): Don't list out the
5850         individual statement-expressions.  Convert syntax error into
5851         CS0201 check.
5852
5853 2006-01-16  Raja R Harinath  <rharinath@novell.com>
5854
5855         Fix #76874.
5856         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
5857         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
5858         CheckIntermediateModification.
5859         (FieldExpr.DoResolve): Add new two-argument version that
5860         allows us to resolve the InstanceExpression as an lvalue.
5861         The one-argument variant is now just a wrapper.
5862         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
5863         Resolve the lhs as an lvalue if the it has a value type.
5864         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
5865         from Assign.DoResolve.
5866         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
5867         resolved as an lvalue.
5868         (PropertyExpr.DoResolve): Update.
5869         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
5870         has a value type.  Move CS1612 check here from
5871         CheckIntermediateModification.
5872         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
5873         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
5874         'right_side' of a ResolveLValue on an 'out' argument.
5875         (EmptyExpression.LValueMemberAccess): New.  Used as the
5876         'right_side' of a propagated ResolveLValue on a value type.
5877         (LocalVariableReference.DoResolveBase): Recognize
5878         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
5879         Add CS1654 check.
5880         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
5881         EmptyExpression.Null.
5882
5883 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
5884
5885         * typemanager.cs : added IsGenericParameter(). In mcs it always
5886           return false.
5887         * doc.cs : for generic parameters, use GenericParameterPosition,
5888           not FullName.
5889
5890 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
5891
5892         * expression.cs: Fix Console.WriteLine ((this = x).foo);
5893
5894 2006-01-12  Miguel de Icaza  <miguel@novell.com>
5895
5896         This fixes the problem where we used ldfld instead of ldflda to
5897         load the "THIS" pointer on captured parameters, when THIS is a
5898         value type.  See bug #77205.
5899         
5900         * iterators.cs (CapturedThisReference.Emit): Pass false to
5901         EmitThis (we do not need the address).
5902
5903         * codegen.cs (EmitThis): it needs to know whether we need the
5904         address of `this' or not.  This is used by value types.  
5905
5906         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
5907         every other call passes false.
5908
5909 2006-01-12  Raja R Harinath  <rharinath@novell.com>
5910
5911         Fix #77221.
5912         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
5913         GetOverride.
5914         * expression.cs (Invocation.OverloadResolve): Update.
5915         (Invocation.DoResolve): Avoid double resolution of invocation.
5916
5917 2006-01-11  Raja R Harinath  <rharinath@novell.com>
5918
5919         Fix #77180.
5920         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
5921         unary negation of floating point types as 0-expr; negation cannot
5922         overflow in floating point types.
5923
5924         Fix #77204.
5925         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
5926         on operands of 'void' type.
5927
5928         Fix #77200.
5929         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
5930         and ExclusiveOr for boolean constants too.
5931
5932 2006-01-09  Raja R Harinath  <rharinath@novell.com>
5933
5934         Fix #75636.
5935         * expression.cs (Invocation.OverloadResolve): Replace reflected
5936         override methods with their base virtual methods, rather than
5937         skipping over them.
5938         * typemanager.cs (TypeManager.GetOverride): New.
5939
5940 2006-01-05  Jb Evain  <jbevain@gmail.com>
5941
5942         * class.cs (Property.Define, Indexer.Define): do not tag the
5943         properties as SpecialName | RTSpecialName.
5944
5945 2006-01-04  Miguel de Icaza  <miguel@novell.com>
5946
5947         * class.cs (MethodCore.IsDuplicateImplementation): This method was
5948         doing a low-level comparission of parameter types.  It was lacking
5949         a check for __argslist. 
5950
5951 2005-12-30  Miguel de Icaza  <miguel@novell.com>
5952
5953         * expression.cs (ParameterReference.DoResolveBase): Allow
5954         reference parameters if they are local to this block. 
5955
5956         This allows the ref and out parameters of a delegate to be used in
5957         an anonymous method, for example:
5958
5959         delegate void set (out int x);
5960
5961         set s = delegate (out int x){
5962                 x = 0;
5963         };
5964
5965         This is used by functionality introduced late in the C# language.
5966         
5967         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
5968         method that take ref and out parameters. 
5969
5970         Fixes #77119 which was a late change in the spec.
5971
5972 2005-12-23  Miguel de Icaza  <miguel@novell.com>
5973
5974         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
5975         parent if its the same scope.  Fixes #77060.
5976
5977 2005-12-21  Miguel de Icaza  <miguel@novell.com>
5978
5979         * driver.cs: Report the case of no source files and no -out:
5980         argument provided.
5981
5982 2005-12-20  Raja R Harinath  <rharinath@novell.com>
5983
5984         Fix #77035.
5985         * expression.cs (ComposedCast.GetSignatureForError): Define.
5986
5987 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
5988
5989         Fix #76995
5990
5991         * namespace.cs (NamespaceEntry): Add extern_aliases as a
5992         ListDictionary, to contain the ExternAliasEntry entries (in
5993         addition to the NamespaceEntry.aliases hashtable). This field is
5994         shared between the original entry and its doppelganger (bodyless 
5995         copy of it).
5996         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
5997         extern_aliases field.
5998         (NamespaceEntry.Lookup): Move the IsImplicit check after the
5999         lookup in extern_aliases.
6000
6001 2005-12-16  Raja R Harinath  <rharinath@novell.com>
6002
6003         Fix #77006.
6004         * class.cs (TypeContainer.Mark_HasEquals): New.
6005         (TypeContainer.Mark_HasGetHashCode): New.
6006         (ClassPart): Override them.
6007         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
6008
6009         Fix #77008.
6010         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
6011         'parent' argument to the base constructor.
6012
6013         Remove all mention of TypeContainer from decl.cs.
6014         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
6015         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
6016         (DeclSpace.DeclSpace): Likewise.
6017         (DeclSpace.DefineMembers): Remove unused argument.
6018         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
6019         debugging check -- we don't care if the debug code throws an
6020         InvalidCastException instead of an InternalErrorException.
6021         * class.cs (TypeContainer.DefineMembers): Update to changes.
6022         (TypeContainer.DoDefineMembers): Likewise.
6023         (TypeContainer.GetMethods): Likewise.
6024         (PropertyMember.Define): Likewise.
6025         (MemberBase.Parent): New property that forwards to
6026         MemberCore.Parent, but ensures that we get a TypeContainer.
6027         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
6028         (RootContext.PopulateTypes): Likewise.  Remove special case code
6029         for !RootContext.StdLib: DefineMembers is idempotent.
6030
6031 2005-12-14  Miguel de Icaza  <miguel@novell.com>
6032
6033         * convert.cs (ExplicitConversionCore): Check the return value from
6034         ExplicitConversionCore which can return null on failure.  Fixes #76914
6035
6036 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
6037
6038         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
6039
6040 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
6041
6042         * doc.cs : The search for referenced namespace was insufficient to
6043           get global one as it used to do. Fixed bug #76965.
6044
6045 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
6046
6047         * doc.cs : check name in cref in the last phase that whether it is
6048           namespace or not.
6049
6050 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
6051
6052         * cs-tokenizer.cs : reverted the latest change: it somehow broke
6053           Mono.C5.
6054
6055 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
6056
6057         * doc.cs : so it turned out that we cannot skip override check for 
6058           interface members. Fixed bug #76954.
6059
6060 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
6061
6062         * cs-tokenizer.cs : fixed bug #75984:
6063           - #warning and #error should not be handled when the source line
6064             is disabled.
6065           - #line is not checked strictly when the source line is disabled.
6066           - #define and #undef is on the other hand checked strictly at any
6067             state.
6068
6069 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
6070
6071         * cs-tokenizer.cs : missing Location (actually, filename) in one of
6072           CS1027 report.
6073
6074 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
6075
6076         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
6077
6078         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
6079         event initializers.
6080         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
6081         (FieldBase.Initializer): Initializer is now optional.
6082         (EventField.Define): Only event field can have initializer.
6083
6084         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
6085
6086         * const.cs (Const): Reuse initializer.
6087
6088         * cs-parser.jay: Updated after FieldBase changes.
6089         Added current_array_type to simplify array initializers.
6090
6091         * ecore.cs (NullCast.IsDefaultValue): Implemented.
6092
6093         * expression.cs, iterators.cs: Updated.
6094
6095         * namespace.cs (NamespaceEntry): Made UsingFound private.
6096
6097 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
6098
6099         * parameterCollection.cs: Obsolete, removed.
6100         * parser.cs: Obsolete, removed.
6101
6102 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
6103
6104         Fix #76849.
6105         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
6106
6107         * enum.cs (Enum.Define): Set obsolete context here.
6108
6109 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
6110
6111         * doc.cs :
6112           - FindDocumentedMember() now expects 1) paramList as null
6113             when "we don't have to check the number of parameters" and
6114             2) Type.EmptyTypes when "there is no arguments".
6115           - Introduced FoundMember struct to hold the exact type which was
6116             used to find the documented member (the above change broke
6117             test-xml-044; it might be better just to use DeclaringType than
6118             what MS does, like this change does, but it depends on usage.)
6119
6120 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
6121
6122         * doc.cs : documented member might be from DeclaringType for nested
6123           types. Fixed bug #76782.
6124
6125 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
6126
6127         * anonymous.cs: Have the param code handle leaving copies on the
6128         stack etc. Allows anonymous params to take part in the assignment
6129         code (++, +=, etc). Fixes bug #76550
6130
6131         * expression.cs: Handle the prepare_for_load/leave_copy by passing
6132         it down to the anon code.
6133
6134         * iterators.cs: Use dummy var here
6135
6136         * codegen.cs: Handle new vars
6137
6138 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
6139
6140         Fix #76849.
6141         * class.cs (MethodData.Define): Set proper Obsolete context.
6142
6143         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
6144         obsolete context.
6145         (FieldExpr.DoResolve): Ditto.
6146
6147 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
6148
6149         Fix #76849.
6150         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
6151         parent is not obsolete.
6152
6153 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
6154
6155         * doc.cs : (FindDocumentedMember) find parameterless members first
6156           and get CS0419 in the early stage. Fixed first case of bug #76727.
6157
6158 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
6159
6160         Fix #76859.
6161         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
6162         no error was reported.
6163
6164         *expression.cs (Binary.DoResolve): left can be null.
6165
6166 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
6167
6168         Fix #76783.
6169         * class.cs (MethodData.Emit): Parameters should be labeled first.
6170
6171 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
6172
6173         Fix #76761.
6174         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
6175
6176 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
6177
6178         * attribute.cs (AreParametersCompliant): Moved to Parameter.
6179
6180         * class.cs (MethodCore): Parameter clean up.
6181         (IMethodData): Added ParameterInfo.
6182         (MethodData): Parameter clean up.
6183         (Indexer.Define): Parameter clean up.
6184
6185         * anonymous.cs,
6186         * codegen.cs,
6187         * cs-parser.jay,
6188         * decl.cs,
6189         * doc.cs,
6190         * ecore.cs,
6191         * flowanalysis.cs,
6192         * iterators.cs,
6193         * pending.cs,
6194         * statement.cs,
6195         * typemanager.cs: Parameter clean up.
6196
6197         * delegate.cs (Define): Get rid of duplicated code.
6198
6199         * expression.cs (ParameterReference): Removed useless parameters
6200         and simplified.
6201         (Invocation): Ditto.
6202
6203         * parameter.cs (ParamsParameter): New class, params specialization.
6204         (ArglistParameter): Attemp to separate arglist.
6205         (Parameter): Refactored to be reusable and faster.
6206         (Parameter.Modifier): Made understandable.
6207         (Parameters): Changed to be used as a class for `this' assembly
6208         parameters. Refactored to use new specialized classes.
6209
6210         * support.cs (ParameterData): Added Types property.
6211         (InternalParameters): Deleted.
6212
6213 2005-08-20  Martin Baulig  <martin@ximian.com>
6214
6215         Merging this patch from GMCS to fix #75867.
6216
6217         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
6218         scope if we don't already have it.
6219
6220 2005-11-17  Martin Baulig  <martin@ximian.com>
6221
6222         * anonymous.cs
6223         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
6224         inherit the scope from our parent.  Fixes #76653.
6225
6226 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
6227
6228         * doc.cs : the previous patch does not actually fix the bug.
6229           PropertyInfo override check is now implemented and really fixed it.
6230         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
6231
6232 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
6233
6234         * doc.cs : apply "override filter" also to properties.
6235           Fixed bug #76730.
6236
6237 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
6238
6239         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
6240           no need to check overrides. For classes, omit those results from 
6241           interfaces since they must exist in the class. Fixed bug #76726.
6242
6243 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
6244
6245         * typemanager.cs : (GetFullNameSignature) differentiate indexers
6246           with different parameters. Fixed the second problem in #76685.
6247
6248 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
6249
6250         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
6251           get expected 'protected' access in CheckValidFamilyAccess()).
6252           Fixed bug #76692.
6253
6254 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
6255
6256         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
6257           Fixed bug #76705.  CS1569 was incorrectly commented out.
6258
6259 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
6260
6261         * doc.cs : use Invocation.IsOverride() to do real override check.
6262         * expression.cs : made Invocation.IsOverride() internal.
6263
6264 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
6265
6266         * doc.cs : use TypeManager.FindMembers() instead of (possible)
6267           TypeBuilder.FindMembers() and filter overriden base members out.
6268           Fixed bug #76990.
6269
6270 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6271
6272         * doc.cs : ref/out parameters are represented as '@' (instead of
6273           '&' in type FullName). Fixed bug #76630 (additionally crefs).
6274
6275 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6276
6277         * doc.cs : when there was no '.' in cref to methods in doc comment,
6278           then parameters were missing in the output. Fixed bug #76691.
6279
6280 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6281
6282         * driver.cs : don't output docs when there is an error.
6283           Fixed bug #76693.
6284
6285 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6286
6287         * doc.cs :
6288           Now it should detect indexers. Fixed primary concern in bug #76685.
6289           Fixed CS0419 message to not show the identical member signature in
6290           the message.
6291
6292 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6293
6294         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
6295           instead of Type.FindMembers() since it does not handle events.
6296           Fixed bug #71604.
6297
6298 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
6299
6300         * codegen.cs: Fixed typo (speficied -> specified).
6301
6302 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
6303
6304         Fix #76369.
6305         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
6306
6307 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
6308
6309         * attribute.cs: Changed error message.
6310
6311         * cs-tokenizer.cs: One more check.
6312
6313 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
6314
6315         * statement.cs (Block.Resolve): Ignore empty statement.
6316
6317 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
6318
6319         * report.cs: Made error/warning methods more strict to avoid
6320         their misuse.
6321
6322         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
6323         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
6324         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
6325         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
6326
6327 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
6328
6329         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
6330         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
6331
6332         * class.cs (TypeContainer.IsComImport): New property.
6333         (Constructor.Define): Create proper ctor for ComImport types.
6334
6335         * expression.cs (New.CheckComImport): Fixed.
6336
6337 2005-11-07  Miguel de Icaza  <miguel@novell.com>
6338
6339         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
6340         that a parameter has been captured does not mean that we do not
6341         have to do the rest of the processing.  This fixes the second part
6342         of #76592.  If there was another anonymous method capturing
6343         values in the past, the Scope would never be set for the second
6344         method that captured the same parameter.
6345
6346         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
6347         properly manipulate the stack.   Second part of fix for #76592.
6348
6349         * expression.cs (New): Add support for invoking "new" on
6350         interfaces that have been flagged with the ComImport attribute and
6351         the CoClass.  Fixes #76637 
6352
6353         * statement.cs (Try.DoEmit): When a variable is captured, do not
6354         try to emit the vi.LocalBuilder variable as it has been captured.
6355         Create a temporary variable and store the results on the
6356         FieldBuilder.  Fixes #76642
6357
6358 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
6359
6360         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
6361
6362         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
6363
6364         * expression.cs (Binary.DoResolve): Added && optimalization.
6365     
6366         * typemanager.cs (AddUserType): Removed useless argument.
6367
6368 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
6369
6370         * statement.cs (Block.variables): Uses ListDictionary.
6371
6372 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
6373
6374         Fix #75969.
6375         * class.cs (PartialContainer.EmitType): Customized to emit
6376         security attributes.
6377         (ClassPart.ApplyAttributeBuilder): Transform security attribute
6378         for partial classes.
6379
6380 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
6381
6382         Fix #76599.
6383         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
6384         access has to be fixed.
6385         
6386         * typemanager.cs (IsUnmanagedType): Wrong common field type.
6387
6388 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
6389
6390         Fix #76590.
6391         * ecore.cs (NullCast.Reduce): Implemented.
6392
6393         * expression.cs (ArrayCreation.CheckIndices): Correcly check
6394         constant type.
6395         
6396         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
6397         properly.
6398         (Foreach.Resolve): Catch null properly.
6399
6400 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
6401  
6402         * cs-tokenizer.cs: Warning text fix.
6403
6404         * driver.cs: AllWarningNumbers exposed on public interface.
6405
6406         * report.cs (): Reviewed warning numbers.
6407         (IsValidWarning): Use binary search.
6408
6409 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
6410  
6411         * driver.cs: Implemeted resource visibility.
6412         (Resources): New class for code sharing between /res: and
6413         /linkres:
6414  
6415 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
6416
6417         Fix #76568.
6418         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
6419         folding.
6420         
6421         * convert (Convert.ImplicitReferenceConversion): NullCast holds
6422         contants only.
6423         
6424         * ecore.cs (NullCast): Child is contant only.
6425         
6426         * literal.cs (NullLiteral.Reduce): null can be converted to any
6427         reference type.
6428
6429 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
6430
6431         * driver.cs: Use Encoding.Default as default code page instead
6432           of ISO-28591.
6433
6434 2005-10-27  Raja R Harinath  <rharinath@novell.com>
6435
6436         Fix #76085.
6437         * expression.cs (Invocation.Error_InvalidArguments): Handle
6438         __arglist parameters.
6439         (Invocation.VerifyArgumentsCompat): Likewise.
6440         * support.cs (ReflectionParameters.GetSignatureForError): Print
6441         __arglist parameters.
6442         (InternalParamters.GetSignatureForError): Likewise.
6443         * parameter.cs (Parameters.GetSignatureForError): Likewise.
6444
6445 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
6446
6447         * attribute.cs (GetPropertyValue): Made public.
6448
6449         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
6450         Resolve.
6451         Add new property WrapNonExceptionThrows to handle 2.0 assembly
6452         attribute.
6453         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
6454         is not defined.
6455         
6456         * driver.cs: Reflect method name change.
6457         
6458         * statement.cs (Try.Resolve): Warn when try has both general
6459         exception handlers.
6460         
6461         * typemanager.cs: runtime_compatibility_attr_type new predefined
6462         type.
6463
6464 2005-10-26  Raja R Harinath  <harinath@gmail.com>
6465
6466         Fix #76419.
6467         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
6468         treat it as an empty parameter list.
6469
6470 2005-10-26  Raja R Harinath  <rharinath@novell.com>
6471
6472         Fix #76271.     
6473         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
6474         ResolveAsTypeStep silent.
6475         * statement.cs (Block.AddConstant): Mark block as used.
6476         (Block.ResolveMeta): Avoid piling on error messages
6477         if a constant initializer resolution fails.
6478
6479 2005-10-25  Raja R Harinath  <rharinath@novell.com>
6480
6481         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
6482         Remove.
6483         (NamespaceEntry.VerifyAllUsing): New.
6484         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
6485         behaviour.  Delegates actual resolution of alias to ...
6486         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
6487         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
6488         Update.
6489         * driver.cs (Driver.MainDriver): Update.
6490         
6491         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
6492         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
6493         property.
6494         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
6495         Remove.
6496         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
6497         RootNamespace.DefineNamespacesForAll.
6498
6499 2005-10-24  Raja R Harinath  <harinath@gmail.com>
6500
6501         * typemanager.cs (assemblies, external_aliases, modules)
6502         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
6503         (ComputeNamespaces, GetRootNamespace): Remove extra staging
6504         overhead.  Move resposibility ...
6505         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
6506         * driver.cs, attribute.cs, codegen.cs: Update to changes.
6507
6508 2005-10-23  Raja R Harinath  <harinath@gmail.com>
6509
6510         * namespace.cs (RootNamespace.all_namespaces): Renamed from
6511         cached_namespaces.  Improve usage.
6512         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
6513         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
6514         Move from GlobalRootNamespace and simplify.
6515         (RootNamespace.Global): Make instance variable.
6516         (RootNamespace.RootNamespace): Add "alias name" parameter.
6517         (GlobalRootNamespace): Simplify drastically.
6518         (Namespace.Lookup): Don't use GetNamespace.
6519         * typemanager.cs (GetRootNamespace): Rename from
6520         ComputeNamespaceForAlias.
6521         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
6522
6523 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
6524
6525         * anonymous.cs (AnonymousContainer): Don't crash when container
6526         doesn't exist.
6527
6528 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
6529
6530         * expression.cs (Binary.DoResolve): Warn when comparing same
6531         values.
6532
6533 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
6534
6535         Fix #76486.
6536         * expression.cs (Binary.DoResolve): It looks like there are no
6537         convetsion rules in enum context.
6538
6539 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6540
6541         Add support for extern alias qualifiers.
6542         * typemanager.cs: Move some LookupTypeReflection code
6543         to namespace.cs, to have cleaner code. Added some methods
6544         to help us keep track of the extern aliased references.
6545         * driver.cs: Add suport for extern alias assemblies on command
6546         line and check for their warnings/errors. Also keep track of the
6547         extern aliased assemblies.
6548         * namespace.cs: Move the global functionality of Namespace
6549         to GlobalRootNamespace/RootNamespace. Now the global namespace
6550         is GlobalRootNamespace.Globa. Also the code moved from 
6551         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
6552         Finally added LocalAliasEntry (AliasEntry before) and
6553         ExternAliasEntry, to handle alias statements.
6554         * cs-parser.jay: Add support in the grammar for extern alias
6555         statement.
6556         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
6557         Update callings to Namespace (now in GlobalRootNamespace).
6558
6559 2005-10-18  Raja R Harinath  <rharinath@novell.com>
6560
6561         Fix #76371.
6562         * class.cs (TypeContainer.DefineType): Move updating of
6563         topological sort earlier in the code.
6564         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
6565
6566 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
6567
6568         Fix #76273.
6569         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
6570         
6571         * constant.cs (Constant.TryReduce): Moved from Cast class.
6572         (Reduce): Made little bit more OO and fixed missing conversions.
6573         
6574         * ecore.cs (Reduce): Implemented.
6575         (Binary.EnumLiftUp): New method to upgrade values to enum values.
6576         
6577         * literal.cs (Reduce): Implemented.
6578         
6579         * class.cs: Reverted Miguel's wrong commit.
6580
6581 2005-10-14  Miguel de Icaza  <miguel@novell.com>
6582
6583         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
6584
6585 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
6586
6587         * cs-parser.jay, expression.cs : CS0214 was missing error location
6588           for constants. Fixed bug #76404.
6589
6590 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
6591
6592         Fix #76370.
6593         * convert.cs (ExplicitConversionCore): Fixed object->enum
6594         conversion.
6595
6596 2005-10-10  Raja R Harinath  <rharinath@novell.com>
6597
6598         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
6599         InstanceExpression.
6600         (PropertyExpr.EmitCall): Likewise.
6601         * expression.cs (Invocation.EmitArguments): Handle case where
6602         arguments == null.
6603         (Invocation.EmitCall): Avoid allocating temporary variable if
6604         there are no arguments.
6605
6606 2005-10-07  Raja R Harinath  <rharinath@novell.com>
6607
6608         Fix #76323.
6609         * convert.cs (ImplicitConversionStandard): Move conversion of
6610         void* to arbitrary pointer types ...
6611         (ExplicitConversionStandard): .. here.
6612         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
6613         error to always print typenames.
6614
6615 2005-10-07  Raja R Harinath  <rharinath@novell.com>
6616
6617         * convert.cs (GetConversionOperator): Rename from
6618         GetConversionOperators.  Move operator selection code from ...
6619         (UserDefinedConversion): ... here.
6620
6621 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
6622
6623         * convert.cs (ExplicitConversionCore): Removed duplicate enum
6624         conversion.
6625
6626 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
6627
6628         * assign.cs (Assign.DoResolve): Error method changed.
6629
6630         * cfold.cs (DoConstantNumericPromotions): Error method changed.
6631         
6632         * const.cs (ResolveValue): Reset in_transit immediately.
6633         
6634         * constant.cs: Error method changed.
6635         
6636         * convert.cs: Removed useless location parameter.
6637         (ExplicitNumericConversion): Don't do double enum check.
6638         (ExplicitConversionCore): Renamed from ExplicitConversion.
6639         (ExplicitUnsafe): Extracted from ExplicitConversion.
6640         (ExplicitConversion): Uses for error reporting.
6641         
6642         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
6643         error messages.
6644         (ResolveBoolean): Uses common error method.
6645         (CastToDecimal): Get rid of ec.
6646         (CastFromDecimal): Optimized.
6647         (ConvCast): Get rid of ec.
6648         
6649         * enum.cs (ResolveValue): Reset in_transit immediately.
6650         (Emit): Return after first error.
6651         
6652         * expression.cs: Convert changes.
6653         
6654         * literal.cs: Error method changed.
6655         
6656         * statement.cs: Error method changed.
6657
6658 2005-10-03  Raja R Harinath  <rharinath@novell.com>
6659
6660         * support.cs (SeekableStreamReader.Position): Don't error out when
6661         the requested position is just beyond the end of the current
6662         buffered data.
6663
6664 2005-09-28  Raja R Harinath  <rharinath@novell.com>
6665
6666         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
6667         try to keep in sync with the byte count of the underlying Stream.
6668         However, this limits us to a window size of 2048 characters: i.e.,
6669         the maximum lookahead of our lexer/parser can be 2048 characters.
6670
6671 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
6672
6673         Fix #76255.
6674         * driver.cs: Fix compilation files with full root path.
6675
6676 2005-09-25  Miguel de Icaza  <miguel@novell.com>
6677
6678         * report.cs (SymbolRelatedToPreviousError): Format the output so
6679         it does not use an open parenthesis that is never closed. 
6680
6681         * driver.cs: Follow coding guidelines
6682
6683 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
6684
6685         Fix #72930.
6686         * const.cs (Const.ResolveValue): Check for assigning non-null
6687         value to reference type.
6688
6689 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
6690
6691         * anonymous.cs: Implemented ExprClassName.
6692         
6693         * assign.cs (Assign.DoResolve): Don't chrash when type is not
6694         delegate.
6695         
6696         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
6697         check.
6698         
6699         * class.cs (StaticClass.DefineContainerMembers): Report protected
6700         members as error.
6701         
6702         * codegen.cs: if(ed) PRODUCTION.
6703         
6704         * convert.cs (Error_CannotImplicitConversion): Better error
6705         distinction.
6706         
6707         * cs-parser.jay: More error checks.
6708         
6709         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
6710         
6711         * driver.cs (CSCParseOption): Enabled wrong option check.
6712         
6713         * ecore.cs (Expression.ExprClassName): Turned to property.
6714         (MemberExpr.CheckIntermediateModification): For checking boxed
6715         value types     modification.
6716         
6717         * statement.cs (Fixed.Resolve): Expression type must be
6718         convertible to fixed type.
6719         (CollectionForeach.GetEnumeratorFilter,TryType):
6720         Small refactoring for easier error checking.
6721
6722 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
6723
6724         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
6725         attributes.
6726         
6727         * class.cs (GeneratedBaseInitializer): New class for customization
6728         compiler generated initializers.
6729         (MemberBase.DoDefine): Check Obsolete attribute here.
6730         (FieldMember.DoDefine): Ditto.
6731         
6732         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
6733         constants.
6734         
6735         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
6736         (MemberCore.GetObsoleteAttribute): Removed argument.
6737         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
6738         (MemberCore.CheckObsoleteType): New helper.
6739         
6740         * delegate.cs,
6741         * enum.cs,
6742         * statement.cs: Updates after MemberCore changes.
6743         
6744         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
6745         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
6746         
6747         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
6748         obsolete attribute for compiler construct.
6749         (As.DoResolve): Cache result.
6750         
6751         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
6752
6753 2005-09-26  Raja R Harinath  <rharinath@novell.com>
6754
6755         Fix #76133.
6756         * expression.cs (This.VerifyFixed): In a value type T, the type of
6757         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
6758         value type R, 'this' is treated as a value parameter.
6759
6760 2005-09-22  Miguel de Icaza  <miguel@novell.com>
6761
6762         * statement.cs (Lock): Use the TemporaryVariable class instead of
6763         manually using local variables as those do not work when variables
6764         are captured.
6765
6766         * ecore.cs: Moved the TemporaryVariable class from being a nested
6767         class inside Foreach to be a public class that can be employed in
6768         other places. 
6769
6770 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
6771
6772         * cs-parser.jay: interface_accessors replaced by
6773         accessor_declarations.
6774
6775         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
6776         location.
6777         
6778         * statement.cs (GotoCase.Resolve): Convert null constant to
6779         null case.
6780         (SwitchLabel.ResolveAndReduce): Ditto.
6781         (SwitchLabel.NullStringCase): Custom null stamp.
6782         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
6783         
6784         typemanager.cs (CSharpSignature): Don't skip first argument
6785         for full names.
6786
6787 2005-09-18  Miguel de Icaza  <miguel@novell.com>
6788
6789         * driver.cs: Set InEmacs based on the environment variable EMACS. 
6790
6791         * location.cs (InEmacs): in this mode, do not report column
6792         location as it confuses Emacs.
6793
6794 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
6795
6796         * cfold.cs, constant.cs, convert.cs, ecore.cs,
6797         expression.cs, iterators.cs, literal.cs: Store constants and
6798         literals location.
6799         
6800         * class.cs (MemberBase.ShortName): Pass location.
6801         
6802         * cs-parser.jay: Some location fixes.
6803         
6804         * ecore.cs (Expression.Location): Made virtual.
6805
6806 2005-09-05  Miguel de Icaza  <miguel@novell.com>
6807
6808         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
6809         if the underlying types are the same, otherwise we need to produce
6810         code that will do the proper cast.
6811
6812         This was exposed by Marek's constant rewrite which produced
6813         invalid code for the call site:
6814
6815         enum X : long { a }
6816         void Method (X v) {}
6817
6818         Method ((X) 5)
6819
6820         This fixes test-49.cs
6821
6822 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
6823
6824         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
6825           Type/Object should be allowed as well. Fixed bug #75968.
6826
6827 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
6828
6829         * expression.cs : (Binary.DoResolve): when one is enum constant and
6830           another is constant 0, then return enum one *as enum type*.
6831           Fixed bug 74846.
6832
6833 2005-09-02  Raja R Harinath  <rharinath@novell.com>
6834
6835         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
6836         internal.
6837
6838         Fix #75941.
6839         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
6840         flow-branching for LocalVariableReferences in case we were invoked
6841         from a MemberAccess.
6842         * expression.cs (LocalVariableReference.VerifyAssigned): New.
6843         Carved out of ...
6844         (LocalVariableReference.DoResolveBase): ... this.
6845         (MemberAccess.Resolve): Do the check that was disabled during
6846         SimpleNameResolve.
6847
6848 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
6849
6850         * class.cs :
6851           (PartialContainer.Create): check abstract/sealed/static strictly
6852           but abstract/sealed can exist only at one side. Fixed bug #75883.
6853
6854 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
6855
6856         Fix #75945.
6857         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
6858         specified, don't default to UnmanagedType.I4.
6859
6860 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
6861
6862         * expression.cs : conditional operator should check possibly
6863           incorrect assign expression. Fixed bug #75946.
6864
6865 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
6866
6867         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
6868           Reverting the change. gmcs is much complex than mcs on this matter.
6869
6870 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
6871
6872         * cs-tokenizer.cs : To read another token ahead of the actual 
6873           consumption, use new SavedToken and cache token instead of moving
6874           back the stream with SeekableStreamReader (it seemed problematic).
6875         * cs-parser.jay,
6876           driver.cs : Thus use StreamReader directly.
6877         * support.cs : Thus removed SeekableStreamReader.
6878
6879 2005-08-30  Raja R Harinath  <rharinath@novell.com>
6880
6881         Fix #75934.
6882         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
6883         (ScopeInfo.EmitScopeType): Use it to construct field names from
6884         names of captured locals.
6885
6886         Fix #75929.
6887         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
6888         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
6889         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
6890         (ExplicitConversion): Remove enum cases already handled by
6891         implicit conversion.  Move implicit conversion check to the beginning.
6892         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
6893         * expression.cs (ArrayCreation.EmitDynamicInitializers):
6894         Don't treat System.Enum as a struct.
6895
6896 2005-08-30  Jb Evain  <jbevain@gmail.com>
6897
6898         * attribute.cs: handles as expression in parameters.
6899
6900 2005-08-30  Raja R Harinath  <rharinath@novell.com>
6901
6902         Fix #75802.
6903         * class.cs (TypeContainer.VerifyClsName): Don't use a
6904         PartialContainer when verifying CLS compliance.
6905         (AbstractPropertyEventMethod): Set Parent here, ...
6906         (PropertyMethod): ... not here.
6907
6908 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
6909
6910         * attribute.cs : escaped attribute name should not be allowed to be
6911           resolved (e.g. @class as classAttribute). Fixed bug #75930.
6912
6913 2005-08-29  Raja R Harinath  <rharinath@novell.com>
6914
6915         Fix #75927.
6916         * convert.cs (ImplicitStandardConversionExists): Allow zero also
6917         when converting a long constant to unsigned long.
6918         * expression.cs (Invocation.OverloadResolve): Add sanity check to
6919         detect where IsApplicable and VerifyArgumentsCompat disagree.
6920
6921 2005-08-29  Raja R Harinath  <rharinath@novell.com>
6922         and Carlos Alberto Cortez  <carlos@unixmexico.org>
6923
6924         Fix #75848.
6925         * class.cs (TypeContainer.CanElideInitializer): New helper.
6926         (TypeContainer.EmitFieldInitializers): Use it to determine if we
6927         can safely emitting the initializer of a field.
6928
6929 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
6930
6931         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
6932           allowed inside a switch (without loop). Fixed bug #75433.
6933
6934 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
6935
6936         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
6937         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
6938
6939 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
6940
6941         * driver.cs : kinda reverting the default encoding changes (not exact 
6942           revert since I noticed that "codepage:reset" might not work fine).
6943
6944 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
6945
6946         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
6947           Location. Now getter and setter store location correctly.
6948           (errors/cs0111-12.cs now reports the expected location.)
6949
6950 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
6951
6952         * driver.cs : Use default encoding on the environment.
6953           Removed (now that) extra parameter for SeekableStreamReader.
6954         * support.cs : (SeekableStreamReader) third .ctor() argument for
6955           StreamReader is not required (always true). preamble size could
6956           be acquired in simpler and safe way.
6957
6958 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
6959
6960         * cs-parser.jay: report CS0642 at warning level 3
6961           and report CS0642 for an if else statement also
6962           fixes bug #74745. Patch by John Luke (and a bit
6963           modified by me).
6964           Removed extra CS0642 warning check for "while",
6965           "for" and "fixed".
6966         * statement.cs: In Block.Resolve(), CS0642 check
6967           is reimplemented to check a sequence of an empty
6968           statement and a block.
6969
6970           Both fix bug #66777.
6971
6972 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
6973
6974         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
6975         detection until I fix it.
6976         
6977         * cs-tokenizer.cs: Changed error message.
6978         
6979         * cs-parser.jay: Fixed 2 error locations.
6980         
6981         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
6982         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
6983         properties.
6984         
6985         * enum.cs (GetSignatureForError): Fixed.
6986         
6987         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
6988         method detection.
6989         
6990         * class.cs,
6991         * typemanager.cs (RegisterProperty): Removed.
6992         
6993         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
6994
6995 2005-08-24  Raja R Harinath  <rharinath@novell.com>
6996
6997         Fix #75874.
6998         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
6999         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
7000
7001 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7002
7003         * expression.cs : tiny fix is required for not warning positive ulong.
7004           See test-441.cs.
7005
7006 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7007
7008         * expression.cs : add CS0652 check for constant and integral
7009           expression. Fixed bug #53974.
7010
7011 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7012
7013         * expression.cs : in DoNumericPromotions(), check if there is implicit
7014           conversion overload for string (to check CS0034). Fixed bug #52492.
7015
7016 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7017
7018         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
7019
7020 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7021
7022         * ecore.cs : report location when it is *not* Null.
7023
7024 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7025
7026         * codegen.cs,
7027           ecore.cs,
7028           flowanalysis.cs,
7029           expression.cs:
7030           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
7031           correctly. Fixed bug #75721.
7032
7033 2005-08-23  Raja R Harinath  <rharinath@novell.com>
7034
7035         * support.cs (SeekableStreamReader.Position): Avoid an expensive
7036         loop that performs 'min (pos, char_count)'.
7037
7038         Fix #75862.
7039         * expression.cs (Unary.ResolveOperator): Don't discard implicit
7040         converted value in Operator.OnesComplement.
7041
7042 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
7043
7044         * anonymous.cs: If the anon method is pulled into a helper class,
7045         it needs to be `internal' not `private'. Fixes runtime behavior on
7046         msft. bug #75704
7047
7048 2005-08-20  Martin Baulig  <martin@ximian.com>
7049
7050         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7051         scope if we don't already have it.
7052
7053         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
7054         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
7055         fixes #75867.
7056
7057 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
7058
7059         Fix #75803
7060         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
7061         is a partial class.
7062
7063 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
7064
7065         The big constants rewrite
7066         Fix #75746, #75685 and more
7067         As a side effect saved 1MB for MWF ;-)
7068         
7069         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
7070         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
7071         enum based for corlib compilation.
7072         
7073         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
7074         subtractions.
7075         
7076         * class.cs (FixedField.Define): Use ResolveAsConstant.
7077         
7078         * const.cs (IConstant): Interface constants and enums.
7079         (Const.ResolveValue): New method for constant resolvning.
7080         (ExternalConstant): Constants from imported assemblies.
7081         
7082         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
7083         conversion; like enums.
7084         (Constant.ToType): Converts this constant to different type.
7085         (Constant.Increment): Adds 1.
7086         
7087         * convert.cs (ImplicitConversionRequired): Simplified.
7088         
7089         * cs-parser.jay: Create EnumMember directly.
7090         
7091         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
7092         
7093         * doc.cs (GenerateEnumDocComment): Removed.
7094         
7095         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
7096         (ConvertIntLiteral): Removed.
7097         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
7098         
7099         * enum.cs (EnumMember): Implement IConstant.
7100         (Enum.IsValidEnumConstant): Removed.
7101         (Enum.GetNextDefaultValue): Removed.
7102         (Enum.FindMembers): Updated.
7103         (Enum.GenerateDocComment): Iterate enum members.
7104         
7105         * expression.cs (Cast.TryReduce): Handle enums correctly.
7106         (New.Constantify): Made public.
7107         (MemberAccess.DoResolve): Removed contant specific if(s).
7108         
7109         * literal.cs (NullLiteral): Implement new abstract methods.
7110         
7111         * statement.cs (GotoCase.Resolve): Use new constant methods.
7112         (SwitchLabel.ResolveAndReduce): Use new constant methods.
7113         
7114         * typemanager.cs (LookupEnum): Removed.
7115         (IsEnumType): Fixed to work with corlib.
7116         (RegisterConstant): Removed.
7117         (LookupConstant): Removed.
7118         (GetConstant): Changed to work with IConstant.
7119
7120 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
7121
7122         * location.cs : Fixed overflown (>255) column number.
7123
7124 2005-08-03  Raja R Harinath  <rharinath@novell.com>
7125
7126         First cut of the qualified-alias-member feature.
7127         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
7128         token.
7129         * cs-parser.jay (DOUBLE_COLON): New token.
7130         (namespace_or_type_name): Add rule for recognizing
7131         qualified-alias-members.
7132         (primary_expression): Likewise.
7133         (element_access): Allow QualifiedAliasMember as a possible
7134         type-bearing expression.
7135         (local_variable_type, local_variable_pointer_type): Likewise.
7136         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
7137         aliases in the current and enclosing namespace declarations.
7138         (NamespaceEntry.UsingAlias): Add CS0440 warning.
7139         * decl.cs (MemberName.is_double_colon): New.
7140         (MemberName.MemberName): Add new constructor for alias-member.
7141         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
7142         * expression.cs (QualifiedAliasMember): New expression type.
7143
7144 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7145
7146         * location.cs : it borked when no argument was specified.
7147
7148 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7149
7150         * location.cs : tiny ToString() format fix.
7151
7152 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7153
7154         * statement.cs : oops, it was missing.
7155
7156 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7157
7158         A set of fixes for precise line/column location.
7159
7160         * location.cs :
7161           "token" field now holds a file/line "delta", a line number offset 
7162           from the segment, and a column number. See also:
7163           http://lists.ximian.com/pipermail/mono-devel-list/2004-
7164           December/009508.html
7165           Removed static IsNull. Use instance IsNull property instead.
7166         * cs-tokenizer.cs :
7167           For some tokens it stores Location. For Identifier it stores
7168           LocatedToken which is a pair of string name and location.
7169           Column numbers are adjusted only at getChar().
7170         * report.cs :
7171           Use Location.ToString() for reporting (it now contains column).
7172         * cs-parser.jay :
7173           Largely modified to use LocatedToken instead of
7174           string (IDENTIFIER), and to acquire Location from some tokens.
7175         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
7176           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
7177           codegen.cs :
7178           Now MemberName holds Location. DeclSpace.ctor() receives Location
7179           as a parameter. Removed extra parameters to all derived classes.
7180           Replaced Location.IsNull() with instance property.
7181         * assign.cs, expression.cs :
7182           Added .ctor() overload that omits Location.
7183         * attribute.cs :
7184           Added "nameEscaped" flag that indicates the identifier was escaped
7185           in the source file. This fixes bug #57047.
7186
7187 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
7188
7189         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
7190         New method, looking for lo-case imported cls type.
7191
7192         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
7193         here.
7194
7195         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
7196
7197         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
7198
7199         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
7200         all_imported_types.
7201         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
7202
7203         Optimized to save 3.5 MB for SWF compilation.
7204
7205 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
7206
7207         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
7208         (PartialContainer.Create): Moved logic AddToContainer.
7209         (PartialContainer.MarkForDuplicationCheck): Shares name.
7210         
7211         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
7212         place.
7213         
7214         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
7215         initialization.
7216         (Namespace.GetSignatureForError): New method.
7217         
7218         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
7219         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
7220
7221 2005-08-01  Raja R Harinath  <rharinath@novell.com>
7222
7223         Fix #75669.
7224         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
7225         member lookup rather than qualifier_type, since qualifier_type can
7226         be null.
7227
7228 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
7229
7230         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
7231         enum member.
7232
7233 2005-07-31  Miguel de Icaza  <miguel@novell.com>
7234
7235         * statement.cs: Copy the local exception into the exception
7236         captured local.  Fixes 75674
7237
7238 2005-07-31  Raja R Harinath  <harinath@gmail.com>
7239
7240         Fix #75658.
7241         * expression.cs (Invocation.OverloadResolve): Don't report error
7242         CS1501 if error CS1502 has been reported.
7243         (New.DoResolve): Delegate CS1501 reporting to
7244         Invocation.OverloadResolve.
7245
7246         Fix #75656.
7247         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
7248         invariant-meaning-in-block property in an enclosing block if
7249         necessary.
7250
7251 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
7252
7253         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
7254         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
7255         (Switch.CheckSwitch): Just save 50kb for SWF.
7256
7257 2005-07-27  Martin Baulig  <martin@ximian.com>
7258
7259         * anonymous.cs (CaptureContext.AddField): Added
7260         `AnonymousContainer am' argument; compute its toplevel scope if
7261         it's not already computed.  Fixes #75649.
7262
7263 2005-07-26  Raja R Harinath  <rharinath@novell.com>
7264
7265         Fix #75628.
7266         * class.cs (Constructor.Emit): Reset block to null if the block
7267         resolve fails.
7268
7269 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
7270
7271         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
7272
7273 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
7274
7275         * class.cs (MethodData.Define): Check whether accessor implementing
7276         interface is public.
7277
7278         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
7279
7280 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
7281
7282         Fix #57245
7283         * namespace.cs (LookupType): Moved same type check to...
7284         
7285         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
7286         with the same name.
7287
7288 2005-07-21  Raja R Harinath  <rharinath@novell.com>
7289
7290         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
7291         already found a typebuilder.
7292         * class.cs (MethodCore.IsDuplicateImplementation): Compare
7293         MemberNames, not strings.
7294
7295         * const.cs (Error_ExpressionMustBeConst): 
7296         Rename from Error_EpressionMustBeConst.
7297         * const.cs, class.cs, statement.cd: Update.
7298
7299 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
7300
7301         Fix #65573
7302
7303         * const.cs (Const.LookupConstantValue): Report missing contant expression
7304         everytime.
7305         (Error_EpressionMustBeConstant): Only one error method.
7306
7307         * class.cs, statement.c: Updated.
7308
7309 2005-07-20  Raja R Harinath  <rharinath@novell.com>
7310
7311         * statement.cs (Block.Flags): Add back HasVarargs.
7312         (Block.flags): Make protected.
7313         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
7314
7315         * typemanager.cs (types, typecontainers, user_types): Remove.
7316         (UserTypes, TypeContainers): Likewise.
7317         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
7318         (CleanUp, Reset): Update.
7319         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
7320         (GetNestedType): Use Type.GetNestedType.
7321         (CoreLookupType): Take two arguments, the namespace and the
7322         basename of the type.  Update to use the Namespace.Lookup
7323         mechanism.
7324         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
7325         (RealMemberLookup): Use IsNestedChildOf instead of playing with
7326         string concatenation and substring matches.
7327         * class.cs, enum.cs, delegate.cs: Update to changes.
7328
7329 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
7330
7331         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
7332         Expression and made virtual.
7333
7334         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
7335         (ImplicitStandardConversionExists): Fixed `byte' typo ?
7336
7337         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
7338
7339         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
7340         error message.
7341
7342         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
7343         change.
7344
7345 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
7346
7347         Fix #57707
7348         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
7349         AssemblyCultureAttribute is not used on executable.
7350
7351         * rootcontext.cs,
7352         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
7353
7354 2005-07-16  Raja R Harinath  <rharinath@novell.com>
7355
7356         Fix #60638.
7357         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
7358         New.  Reports CS0252/CS0253.
7359         Mostly taken from preliminary patch by Duncak Mak.
7360         (Binary.DoResolveOperator): Store results of operator lookup.
7361         Use them to detect if we need to warn about unintended reference
7362         comparisons.
7363
7364 2005-07-15  Raja R Harinath  <rharinath@novell.com>
7365
7366         Fix #72969.
7367         * namespace.cs (Namespace.Lookup): Add back location parameter.
7368         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
7369         * delegate.cs, ecore.cs, expression.cs: Update to changes.
7370
7371         * codegen.cs (EmitContext.DeclSpace): Make readonly.
7372         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
7373         (Namespace.LookupType): ... this.
7374         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
7375         of namespaces.
7376         * typemanager.cs (LookupTypeReflection): Remove buggy code that
7377         purported to handle pointers.
7378         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
7379         CoreLookupType.
7380
7381 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
7382
7383         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
7384         type as namespace.
7385
7386 2005-07-15  Raja R Harinath  <rharinath@novell.com>
7387
7388         * namespace.cs (Namespace.Lookup): Drop location parameter.
7389         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
7390         (NamespaceEntry.Lookup): ... this.
7391         (NamespaceEntry.Error_AmbiguousTypeReference):
7392         Move here from DeclSpace.
7393         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
7394         names ...
7395         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
7396         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
7397         Move to NamespaceEntry.
7398         * delegate.cs, expression.cs: Update to changes.
7399
7400 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
7401
7402         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
7403         CheckAttributeType and refactored.
7404         (Attribute.ResolvePossibleAttributeType): Changed to reuse
7405         ResolveAsTypeTerminal error handling.
7406         (ResolveAsTypeTerminal): Introduced because of global attributes extra
7407         handling.
7408         (GetSignatureForError): Print errors in same way.
7409
7410         * class.cs,
7411         * codegen.cs: Reflect attribute GetSignatureForError change.
7412
7413         * ecore.cs,
7414         * expression.cs: Add silent parameter to ResolveAsTypeStep.
7415
7416         * namespace.cs (UsingEntry): Refactored to make fields private.
7417
7418         * assign.cs,
7419         statement.cs: Error_UnexpectedKind has extra parameter.
7420
7421 2005-07-14  Raja R Harinath  <rharinath@novell.com>
7422
7423         * ecore.cs (IAlias): Remove.
7424         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
7425         that implement the interface.
7426         * namespace.cs (Namespace): Likewise.
7427         (Namespace.declspaces): Renamed from 'defined_names'.
7428         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
7429         DeclSpace instead of an IAlias.
7430         * tree.cs (Tree.AddDecl): Update.
7431
7432 2005-07-12  Raja R Harinath  <rharinath@novell.com>
7433
7434         * statement.cs (Block.Flags); Remove HasVarargs.
7435         (Block.HasVarargs): Move to ToplevelBlock.
7436         (Block.ThisVariable, Block.AddThisVariable): Likewise.
7437         (Block.Variables): Make protected.  Initialize variable hashtable
7438         if necessary.
7439         (Block.AddVariable): Update.
7440         (Block.Resolve): Update to changes.
7441         (ToplevelBlock.HasVarargs): New boolean.
7442         (ToplevelBlock.ThisVariable): Move here from Block.
7443         (ToplevelBlock.AddThisVariable): Likewise.
7444         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
7445         * expression.cs (This.ResolveBase): Update to changes.
7446         (ArglistAccess.DoResolve): Likewise.
7447
7448 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
7449
7450         Fix #75321
7451         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
7452
7453         * class.cs (TypeContainer.VerifyMembers): Distinguish between
7454         not used and not used & assigned.
7455         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
7456
7457 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
7458
7459         Fix #75053
7460         * expression.cs (Is.DoResolve): null is never provided type.
7461
7462 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
7463
7464         Fix #52496
7465         * cs-parser.jay: Less strict event error rule to catch more errors.
7466
7467 2005-07-08  Martin Baulig  <martin@ximian.com>
7468
7469         Fix test-iter-10.cs - distinguish whether we `yield' in a property
7470         gettter (allowed) or setter (not allowed).
7471
7472         * class.cs (Accessor): Implement IIteratorContainer.
7473         (Accessor.Yields): New public field.
7474         (PropertyBase.PropertyMethod.Define): Handle iterators on a
7475         per-accessor basis.
7476
7477         * cs-parser.jay
7478         (get_accessor_declaration, set_accessor_declaration): Set the
7479         `yields' flag on the accessor, not the property.
7480         (property_declaration): Do the iterators check on a per-accessor
7481         basis and not for the whole property.
7482
7483 2005-07-08  Martin Baulig  <martin@ximian.com>
7484
7485         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
7486         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
7487
7488 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
7489
7490         Fix #74975
7491         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
7492         (ExtractSecurityPermissionSet): Cope with self referencing security
7493         attributes properly.
7494
7495         * driver.cs (SetOutputFile): Made public property OutputFile.
7496
7497 2005-07-07  Raja R Harinath  <rharinath@novell.com>
7498
7499         Fix #75486.
7500         * class.cs (TypeContainer.first_nonstatic_field): Rename from
7501         has_nonstatic_fields.  Make into a FieldBase pointer.
7502         (TypeContainer.AddField): Add CS0282 check.
7503         (TypeContainer.EmitType): Update.
7504
7505 2005-07-06  Miguel de Icaza  <miguel@novell.com>
7506
7507         * cs-tokenizer.cs (consume_identifier): Do not create strings to
7508         compare if they start with __.
7509
7510 2005-07-06  Raja R Harinath  <rharinath@novell.com>
7511
7512         * statement.cs (Switch.SwitchGoverningType): Only look at
7513         UserCasts that don't need implicit standard conversions to one of
7514         the allowed switch types (Fixes test-322.cs).
7515         (LocalInfo.Resolve): Re-enable sanity-test.
7516
7517 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
7518
7519         * cs-tokenizer.cs (consume_identifier): Detect double undescores
7520         
7521         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
7522         
7523         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
7524
7525 2005-07-06  Raja R Harinath  <rharinath@novell.com>
7526
7527         Fix #75472.
7528         * ecore.cs (SimpleName.GetSignatureForError): Add.
7529         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
7530         (MemberAccess.GetSignatureForError): Add.
7531
7532 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
7533  
7534         The big error and warning messages review.
7535         
7536         * anonymous.cs,
7537         * assign.cs,
7538         * attribute.cs,
7539         * class.cs,
7540         * codegen.cs,
7541         * convert.cs,
7542         * cs-parser.jay,
7543         * cs-tokenizer.cs,
7544         * decl.cs,
7545         * delegate.cs,
7546         * doc.cs,
7547         * driver.cs,
7548         * ecore.cs,
7549         * enum.cs,
7550         * expression.cs,
7551         * flowanalysis.cs,
7552         * iterators.cs,
7553         * literal.cs,
7554         * location.cs,
7555         * modifiers.cs,
7556         * namespace.cs,
7557         * parameter.cs,
7558         * pending.cs,
7559         * report.cs,
7560         * rootcontext.cs,
7561         * statement.cs,
7562         * support.cs,
7563         * tree.cs,
7564         * typemanager.cs: Updated.
7565         
7566         * class.cs: (MethodCore.SetYields): Moved here to share.
7567         (PropertyMethod.Define): Moved iterator setup here.
7568         
7569         * iterators.cs: Add orig_method to have full access to parent
7570         container.
7571
7572 2005-07-05  Raja R Harinath  <rharinath@novell.com>
7573
7574         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
7575         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
7576         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
7577         variable of struct type.
7578         * expression.cs (Unary.ResolveOperator): Update to change.
7579         (Indirection.VerifyFixed): Likewise.
7580         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
7581         (ParameterReference.VerifyFixed): Value parameters are fixed.
7582         (This.VerifyFixed): Treat 'this' as a value parameter.
7583         * statement.cs (LocalInfo.IsFixed): Remove.
7584
7585 2005-07-01  Martin Baulig  <martin@ximian.com>
7586
7587         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
7588         `ec.EmitThis ()' to get the correct scope.
7589
7590 2005-07-01  Martin Baulig  <martin@ximian.com>
7591
7592         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
7593         instance is a ParameterReference; fixes #75299.
7594
7595 2005-07-01  Martin Baulig  <martin@ximian.com>
7596
7597         Reverted Marek's latest patch (r46725):
7598         - it contains structural changes which are neither mentioned in
7599           the ChangeLog nor explained anywhere; for example the additional
7600           argument of EmitContext's and Iterator's .ctor's and the
7601           TypeContainer.DefineMembers() change.
7602         - structural changes like this should go in in seperate patches
7603           and not be hidden in a huge patch which just seems to affect
7604           warnings and errors.
7605           a big and hard to understand patch.
7606         - it breaks iterators and causes regressions, for instance in
7607           test-iter-03.cs.      
7608
7609 2005-06-30  Raja R Harinath  <rharinath@novell.com>
7610
7611         Fix #75412.
7612         * expression.cs (Indexers.map): Remove.
7613         (Indexers.Append): Filter out inaccessible setters and getters.
7614         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
7615
7616         Fix #75283.
7617         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
7618         Refactored from ...
7619         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
7620         (FieldExpr.Emit, PropertyExpr.Emit): Update.
7621         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
7622         * expression.cs (Invocation.EmitCall): Add CS0120 check.
7623
7624 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
7625
7626         Fix #75322
7627         * class.cs (FieldBase.GetInitializerExpression): One more field
7628         for backup.
7629
7630 2005-06-28  Miguel de Icaza  <miguel@novell.com>
7631
7632         * pending.cs: Do not define a proxy if the base method is virtual,
7633         it will be picked up by the runtime (bug 75270).
7634
7635 2005-06-08  Martin Baulig  <martin@ximian.com>
7636
7637         The big Iterators rewrite :-)
7638
7639         * iterators.cs: Rewrite this to use the anonymous methods framework.
7640
7641         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
7642         before the TypeContainers; see 2test-21.cs.
7643
7644         * class.cs
7645         (TypeContainer.DefineType): Don't create a new EmitContext if we
7646         already have one (this only happens if we're an Iterator).
7647         (TypeContainer.Define): Also call Define() on all our iterators.
7648         (Method.CreateEmitContext): Added support for iterators.
7649
7650         * anonymous.cs
7651         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
7652         (AnonymousContainer.CreateMethodHost): Moved here from
7653         AnonymousMethod and made abstract.
7654         (AnonymousContainer.CreateScopeType): New abstract method.
7655         (AnonymousContainer.IsIterator): New public property.
7656         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
7657         get the ScopeTypeBuilder rather than manually defining it here. 
7658         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
7659         iterators here.
7660
7661         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
7662         before RootContext.DefineTypes().
7663
7664         * codegen.cs (EmitContext.RemapToProxy): Removed.
7665         (EmitContext.CurrentAnonymousMethod): Changed type from
7666         AnonymousMethod -> AnonymousContainer.
7667         (EmitContext.ResolveTopBlock): Protect from being called twice.
7668         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
7669         (EmitContext.EmitThis): Removed the iterators hacks; use the
7670         anonymous methods framework for that.
7671
7672         * statement.cs
7673         (ToplevelBlock.Container): Make this a property, not a field.
7674         (ToplevelBlock.ReParent): New public method; move the
7675         ToplevelBlock into a new container.
7676         (Foreach.TemporaryVariable): Simplify.
7677
7678 2005-06-05  Martin Baulig  <martin@ximian.com>
7679
7680         * statement.cs (LocalInfo.CompilerGenerated): New flag.
7681         (Block.AddTemporaryVariable): New public method; creates a new
7682         `LocalInfo' for a temporary variable.
7683         (Block.EmitMeta): Create the LocalBuilders for all the temporary
7684         variables here.
7685         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
7686         non-iterator variables.
7687
7688 2005-06-05  Martin Baulig  <martin@ximian.com>
7689
7690         * statement.cs (Foreach.TemporaryVariable): Create the
7691         LocalBuilder in the Emit phase and not in Resolve since in some
7692         situations, we don't have an ILGenerator during Resolve; see
7693         2test-19.cs for an example.
7694
7695 2005-06-04  Martin Baulig  <martin@ximian.com>
7696
7697         **** Merged r45395 from GCS ****
7698
7699         The big Foreach rewrite - Part II.
7700
7701         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
7702         with `PropertyInfo ienumerator_getcurrent'.
7703
7704         * codegen.cs (VariableStorage): Removed.
7705
7706         * statement.cs
7707         (Foreach): Derive from Statement, not ExceptionStatement.
7708         (Foreach.CollectionForeach): New nested class.  Moved all the code
7709         dealing with collection foreach here.
7710         (Foreach.ForeachHelperMethods): Removed.
7711         (Foreach.TemporaryVariable): Implement IMemoryLocation.
7712
7713 2005-05-23  Martin Baulig  <martin@ximian.com>
7714
7715         * statement.cs (Try.DoResolve): Don't create a `finally' if we
7716         don't need to.  Fix #75014.
7717
7718 2005-05-20  Martin Baulig  <martin@ximian.com>
7719
7720         Merged r44808 from GMCS.
7721
7722         * class.cs (TypeContainer.CircularDepException): Removed.
7723         (TypeContainer.DefineType): Removed the `InTransit' stuff.
7724         (TypeContainer.CheckRecursiveDefinition): Check for circular class
7725         (CS0146) and interface (CS0529) dependencies here.
7726
7727 2005-06-21  Raja R Harinath  <rharinath@novell.com>
7728
7729         * expression.cs (Invocation.EmitCall): Fix initialization
7730         'this_call' to reflect current behaviour.  Fix indentation.
7731
7732         * convert.cs (FindMostEncompassedType): Add two trivial special
7733         cases (number_of_types == 0 || number_of_types == 1).
7734         (FindMostEncompasingType): Likewise.
7735
7736 2005-06-17  Raja R Harinath  <rharinath@novell.com>
7737
7738         Some cleanups preparing for the fix of #75283.
7739         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
7740         error testing.
7741         (EventExpr.InstanceResolve): Likewise.
7742         (EventExpr.DoResolve): Remove redundant checks.
7743
7744 2005-06-10  Duncan Mak  <duncan@novell.com>
7745
7746         * cs-tokenizer.cs (process_directives): New flag for controlling
7747         the processing of preprocessor directives.
7748         (x_token): After seeing a '#', return Token.NONE instead of going
7749         to handle_preprocessing_directive() when not processing
7750         directives. This avoids unnecessary processing during the token peek in
7751         is_punct().
7752
7753         This fixes #74939.
7754
7755         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
7756         the existing error reporting methods instead of Report.Error.
7757
7758         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
7759         after Raja's rewrite.
7760
7761 2005-06-08  Miguel de Icaza  <miguel@novell.com>
7762
7763         * class.cs: Small fix.
7764
7765 2005-06-08  Raja R Harinath  <rharinath@novell.com>
7766
7767         Fix #75160.
7768         * class.cs (GetPartialBases): Fix return value check of
7769         part.GetClassBases.
7770
7771 2005-06-07  Raja R Harinath  <rharinath@novell.com>
7772
7773         Ensure that partial classes are registered in their enclosing
7774         namespace.  Initial part of fix of #75160.
7775         * tree.cs (Tree.RecordDecl): Add new namespace argument.
7776         Register declspace with namespace here, not in
7777         DeclSpace.RecordDecl.
7778         * cs-parser.jay: Pass namespace to RecordDecl.
7779         * class.cs (PartialContainer.Create): Likewise.
7780         (ClassPart.DefineType): New sanity-check.  Throws an exception if
7781         called.
7782         * decl.cs (Declspace.RecordDecl): Remove.
7783         * namespace.cs (NamespaceEntry.DefineName): Remove.
7784
7785 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
7786
7787         * rootcontext.cs: Reset TargetExt as well.
7788
7789 2005-06-03  Raja R Harinath  <rharinath@novell.com>
7790
7791         * ecore.cs (Expression.Resolve): Emit CS0654 error when
7792         -langversion:ISO-1.
7793
7794 2005-06-02  Raja R Harinath  <rharinath@novell.com>
7795
7796         Fix #75080, cs0119.cs.
7797         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
7798         of ...
7799         (Expression.Resolve): ... this.  Use it.  Remove bogus code
7800         allowing ExprClass.Type and ExprClass.Namespace for
7801         ResolveFlags.VariableOrValue.
7802         (Expression.Resolve) [1-argument variant]: Change default resolve
7803         flags based on language version.
7804         (Expression.Error_UnexpectedKind): Use a simple string array
7805         rather than an ArrayList.
7806         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
7807         not ExprClass.Type.
7808         (TypeOfVoid.DoResolve): Likewise.
7809         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
7810         flags argument -- it always has the same value.
7811
7812 2005-05-31  Raja R Harinath  <rharinath@novell.com>
7813
7814         Fix #75081.
7815         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
7816         Use it in the error message.
7817         * assign.cs, expression.cs, statement.cs: Update.
7818
7819 2005-05-30  Raja R Harinath  <rharinath@novell.com>
7820
7821         Fix #75088.
7822         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
7823         the "almostMatchedMember" case too.
7824         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
7825         that failed the accessibility checks to 'almost_match'.
7826
7827 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
7828
7829         * attribute.cs: Use internal MethodBuilder methods to set
7830         ExactSpelling and SetLastError on PInvoke methods, instead
7831         of passing them via charset.  Fixes #75060.
7832
7833 2005-05-27  Raja R Harinath  <rharinath@novell.com>
7834
7835         * parameter.cs (Parameter): Remove TODO comment.
7836         (Parameter.DefineParameter): Remove Location parameter.
7837         (Parameters.LabelParameters): Likewise.
7838         * class.cs (Constructor.Emit): Update to change.
7839         (MethodData.Emit): Likewise.
7840         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
7841         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
7842
7843 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
7844
7845         * parameter.cs,
7846           Removed Parameters.Location and added Parameter.Location instead.
7847           Removed Location parameter from Emit() and GetSignature().
7848         * anonymous.cs,
7849           class.cs,
7850           cs-parser.jay,
7851           delegate.cs,
7852           iterators.cs,
7853           statement.cs :
7854           Modified all related calls.
7855
7856 2005-05-26  Raja R Harinath  <rharinath@novell.com>
7857
7858         Improve user-defined conversion handling.
7859         * convert.cs (GetConversionOperators): Rewrite.  Return only the
7860         applicable operators.
7861         (AddConversionOperators): New.  Helper for GetConversionOperators.
7862         (FindMostEncompassedType, FindMostEncompassingType): Verify that
7863         there is only one most encompassed/encompassing type.
7864         (FindMostSpecificSource, FindMostSpecificTarget): Remove
7865         "applicable operator" handling.
7866         (UserConversion): Move cache here from GetConversionOperators.
7867         Directly cache the chosen operator, rather than the whole
7868         MethodGroup.
7869         (ExplicitNumericConversion): Fix buggy implementation of Decimal
7870         case.  Allow conversion of decimal to sbyte and byte too.
7871         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
7872         New static methods.  Used to avoid allocating EmptyExpressions in
7873         convert.cs.
7874
7875 2005-05-24  Duncan Mak  <duncan@novell.com>
7876
7877         * ecore.cs (CastFromDecimal): New class for casting a decimal to
7878         another class, used in Convert.ExplicitNumericConversion.
7879         (CastToDecimal): New class, similar to above, but casts to
7880         System.Decimal, used in Convert.ImplicitNumericConversion and also
7881         in explicit convesion from double/float to decimal.
7882
7883         * convert.cs (ImplicitNumericConversion): Handle implicit
7884         conversions to System.Decimal.
7885         (ExplicitNumericConversion): handle explicit conversions to
7886         System.Decimal.
7887
7888         This fixes #68711.
7889         
7890 2005-05-20  Miguel de Icaza  <miguel@novell.com>
7891
7892         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
7893         know the type at this stage, just break through.   Fixes #75008 
7894
7895 2005-05-19  Martin Baulig  <martin@ximian.com>
7896
7897         * delegate.cs
7898         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
7899         to disable error reporting.
7900
7901         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
7902         here since we don't want to report an error; see the new test-336.cs.
7903
7904 2005-05-19  Raja R Harinath  <rharinath@novell.com>
7905
7906         * statement.cs (ToplevelBlock.GetParameterReference)
7907         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
7908         Move here from class Block.
7909         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
7910         * expression.cs (ParameterReference.DoResolveBase): Likewise.
7911
7912 2005-05-18  Martin Baulig  <martin@ximian.com>
7913
7914         Fix #74978.
7915
7916         * flowanalysis.cs
7917         (FlowBranching.Reachability): Add non-static public And() and Or()
7918         methods.
7919         (FlowBranchingSwitch): New class; do the `break_origins' thing
7920         like in FlowBranchingLoop.
7921         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
7922         reachability, not just locals and parameters.
7923         (FlowBranching.MergeChild): Remove some of the hacks for loop and
7924         switch; MergeBreakOrigins() now takes care of that.
7925
7926 2005-05-18  Martin Baulig  <martin@ximian.com>
7927
7928         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7929         a loop and may leave it, reset the barrier; fixes #74974.
7930
7931 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
7932         
7933         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
7934         is back.
7935         
7936         * cs-parser.jay: Catch more lexical errors.
7937         
7938         * report.cs: Add one more Error method.
7939         
7940         * rootcontext.cs,
7941         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
7942
7943 2005-05-17  Martin Baulig  <martin@ximian.com>
7944
7945         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
7946         #70970. 
7947
7948 2005-05-16  Raja R Harinath  <rharinath@novell.com>
7949
7950         Fix test-382.cs.  Emit values of decimal constants.
7951         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
7952         Carved out of ...
7953         (TypeContainer.AddField): ... this.
7954         (TypeContainer.EmitFieldInitializers): Allow the list of fields
7955         with initializers to include 'Const's.
7956         (ClassPart.RegisterFieldForInitialization): Forward to
7957         PartialContainer.
7958         * const.cs (Const.Const): Pass initializer to base class.
7959         (Const.Define): In case of decimal constants, register them for
7960         initialization in a static constructor.
7961
7962 2005-05-14  Martin Baulig  <martin@ximian.com>
7963
7964         * statement.cs (Block.Resolve): Correctly handle unreachable code;
7965         do not call ResolveUnreachable() on unreachable statements in
7966         here, see the comment in the source code.
7967
7968 2005-05-13  Raja R Harinath  <rharinath@novell.com>
7969
7970         Fix #74934.
7971         * expression.cs (BinaryResolveOperator): If one of the operands of
7972         an equality comparison is 'null' and the other is a pointer type,
7973         convert the null to a NullPointer.
7974         * convert.cs (ImplicitReferenceConversion): If the expression is a
7975         NullLiteral and the target type is a pointer type, return a
7976         NullPointer instead.
7977         (ImplicitConversionStandard): Likewise.
7978
7979 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
7980         
7981         * cs-parser.jay: Set readonly context based on special constructs.
7982         
7983         * expression.cs (LocalVariableReference.DoResolveBase): Improved
7984         readonly variable error handling.
7985         
7986         * rootcontext.cs (EmitCode): Don't verify members when error
7987         occurred.
7988         
7989         * statement.cs (LocalInfo): Add reaodnly context information.
7990         (SetReadOnlyContext, GetReadOnlyContext): New methods.
7991
7992 2005-05-13  Raja R Harinath  <rharinath@novell.com>
7993
7994         * statement.cs (Block.Resolve): Revert change below.  Modify fix
7995         for #74041 to initialize 'resolved' to false only for explicit
7996         blocks.  Fixes #74873.
7997
7998 2005-05-12  Raja R Harinath  <harinath@gmail.com>
7999
8000         Fix #74920.
8001         * typemanager.cs (unmanaged_enclosing_types): New.
8002         (IsUnmanagedType): Avoid infloops by using
8003         'unmanaged_enclosing_types' to talk with recursive invocations.
8004
8005 2005-05-13  Martin Baulig  <martin@ximian.com>
8006
8007         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
8008         instance variable, not a local.  Fix #74873.
8009         (Block.ResolveUnreachable): Set it to true here.
8010
8011 2005-05-11  Duncan Mak  <duncan@novell.com>
8012
8013         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
8014         continuing to process for 'arg'.
8015         (handle_preprocessing_directive): Check the argument of the #endif
8016         directive and report error CS1025 if there are any trailing
8017         characters.
8018
8019         According to the C# spec, having even whitespace after the #endif
8020         directive is illegal; however, because we call arg.TrimEnd ()
8021         beforehand, we have the same behavior as csc, allowing whitespace
8022         after the directive.
8023
8024         Fixes #74892.
8025
8026 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
8027
8028         Fix #74863.
8029         
8030         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
8031         (Constructor.GetObsoleteAttribute): Implemented correctly.
8032
8033 2005-05-10  Martin Baulig  <martin@ximian.com>
8034
8035         * support.cs (ReflectionParameters.ParameterModifier): Use
8036         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
8037         and `ParameterAttributes.In'.  Fixes #74884.
8038
8039 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
8040
8041         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
8042         
8043         * expression.cs (Argument.GetParameterModifier): Turned to property.
8044         (Invocation.Error_InvalidArguments): Add more descriptive errors.
8045         
8046         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
8047         its C# equivalent.
8048         
8049 2005-05-09  Raja R Harinath  <rharinath@novell.com>
8050
8051         Fix #74852.
8052         * decl.cs (MemberCache.AddMethods): Register override methods,
8053         rather than non-override methods.
8054         * typemanager.cs (RegisterOverride): New.
8055         (IsOverride): Update.
8056
8057 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
8058
8059         Fix #73105.
8060         
8061         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
8062         recursive declaration.
8063         
8064         * statement.cs (Block.ResolveMeta): Report any error in resolving.
8065         
8066 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
8067
8068         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
8069         
8070         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
8071
8072 2005-05-05  Raja R Harinath  <rharinath@novell.com>
8073
8074         Fix #74797.
8075         * decl.cs (DeclSpace.FamilyAccessible): 
8076         Use TypeManager.IsNestedFamilyAccessible.
8077
8078         Fix reopened #64812.
8079         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
8080         internal'.
8081
8082 2005-05-04  Raja R Harinath  <rharinath@novell.com>
8083             Abin Thomas  <projectmonokochi@rediffmail.com>
8084             Anoob V E  <projectmonokochi@rediffmail.com>
8085             Harilal P R  <projectmonokochi@rediffmail.com>
8086
8087         Fix #64812.
8088         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
8089         allow access to all static members.
8090
8091 2005-05-04  Martin Baulig  <martin@ximian.com>
8092
8093         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
8094
8095 2005-05-04  Martin Baulig  <martin@ximian.com>
8096
8097         Fix #74655.
8098
8099         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
8100         section at the end; make things work if `default' is not the last
8101         section.        
8102
8103 2005-05-04  Martin Baulig  <martin@ximian.com>
8104
8105         Fix #70400.
8106
8107         * statement.cs (Switch): Replaced the `got_default' field with a
8108         `default_section' one.
8109         (Switch.CheckSwitch): Set `default_section' here.
8110         (Switch.Resolve): If we're a constant switch and the constant is
8111         not found, use the default section.
8112
8113 2005-05-03  Martin Baulig  <martin@ximian.com>
8114
8115         * expression.cs (ArrayAccess.EmitGetLength): New public method.
8116
8117         * statement.cs (Foreach.ArrayForeach): New nested class.
8118         (Foreach.TemporaryVariable): New nested class.
8119         (Foreach.EmitArrayForeach): Removed; this is now in the new
8120         ArrayForeach class.
8121
8122 2005-05-03  Raja R Harinath  <rharinath@novell.com>
8123
8124         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
8125         more conservative.
8126         (VerifyPendingMethods): Revert change below.
8127
8128         * typemanager.cs (IsOverride, RegisterNonOverride): New.
8129         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
8130         that used to trigger warning -28.  Remove warning -28.
8131         * expression.cs (Invocation.OverloadResolve): Use
8132         TypeManager.IsOverride to distinguish override methods.
8133
8134         Fix #74773.
8135         * pending.cs (VerifyPendingMethods): If a base type implements the
8136         requested interface, don't bother checking individual methods of
8137         the base type.  As a side-effect, this prevents the creation of
8138         unnecessary proxies.
8139
8140 2005-05-02  Martin Baulig  <martin@ximian.com>
8141
8142         Fix #70182.
8143
8144         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8145         Also `And' the locals if the old vector is null.
8146         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
8147         null; in this case we basically reset all the variables.        
8148
8149 2005-05-02  Martin Baulig  <martin@ximian.com>
8150
8151         Fix #74529.
8152
8153         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
8154         Added `FlowBranching branching' argument; always `and' the
8155         variables instead of `or'ing them unless we're an infinite loop.
8156
8157         * statement.cs (While.Resolve): Create a new sibling unless we're
8158         infinite.       
8159
8160 2005-05-02  Martin Baulig  <martin@ximian.com>
8161
8162         Fix #70140.
8163
8164         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
8165         arguments; use it instead of creating a new TopLevelBlock.
8166         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
8167         our ConstructorInitializer.
8168
8169         * statement.cs
8170         (TopLevelBlock.TopLevelBranching): New public property.
8171         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
8172         and create our `TopLevelBranching'.
8173
8174         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
8175         anonymous method host, use `block.TopLevelBranching' rather than
8176         creating a new branching.
8177
8178 2005-04-20  Miguel de Icaza  <miguel@novell.com>
8179
8180         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
8181         a ScopeInfo, if any of the current children is a child of the new
8182         entry, move those children there.
8183
8184 2005-04-30  Martin Baulig  <martin@ximian.com>
8185
8186         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
8187         at the beginning of a SwitchSection.  Fix #73335.
8188
8189 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
8190
8191         Fix #74378
8192         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
8193         
8194         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
8195         (FieldExpr.DoResolve): Obsolete members are ignored for field
8196         initializers.
8197         
8198 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
8199
8200         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
8201         of arrays detection.
8202
8203         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
8204         verification.
8205         (Field.VerifyClsCompliance): Volatile fields are not compliant.
8206
8207         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
8208         arrays report.
8209
8210 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
8211
8212         * cs-parser.jay: Use the prefered version of -unsafe in error
8213         message.
8214
8215 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
8216
8217         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
8218         circumstances.
8219
8220 2005-04-20  John Luke  <john.luke@gmail.com>
8221
8222         * driver.cs: fix typo in error message, --outout to --output
8223
8224 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
8225
8226         * codegen.cs (InRefOutArgumentResolving): New field.
8227         
8228         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
8229         fields outside contructor.
8230         
8231         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
8232         
8233 2005-04-19  Miguel de Icaza  <miguel@novell.com>
8234
8235         * anonymous.cs (CaptureContext.EmitParameterInstance): The
8236         parameter code was not completed ever, so it was not as up-to-date
8237         as local variables.  Must finish it.
8238
8239         The bug fix was to compare the Toplevel of the block, not the
8240         current block.  Thanks for Ben for pointing this out. 
8241
8242 2005-04-19  Raja R Harinath  <rharinath@novell.com>
8243
8244         * decl.cs (AddMethods): Use the declaring type of the problem
8245         method to determine if we want to squash a warning.
8246
8247 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
8248
8249         * attribute.cs: Removed debug output.
8250
8251         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
8252         
8253         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
8254         Report.Stderr.
8255         
8256 2005-04-18  Raja R Harinath  <rharinath@novell.com>
8257
8258         Fix #74481.
8259         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
8260         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
8261         all null comparisons against reference types.
8262
8263 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
8264
8265         Fix# 74565
8266         * class.cs (TypeContainer.CircularDepException) New nested
8267         exception class.
8268         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
8269         (TypeContainer.DefineType): Removed error, reset InTransit before
8270         exit.
8271         (Class.DefineType): Throw exception when is in Transit.
8272         Catch exception and report error.
8273         (Struct.DefineType): Throw exception when is in Transit.
8274         Catch exception and report error.
8275         (Interface.DefineType): Throw exception when is in Transit.
8276         Catch exception and report error.
8277
8278         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
8279         handle nested exception handlers.
8280
8281         * flowanalysis.cs (InTryWithCatch): New method, search for try with
8282         a catch.
8283
8284         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
8285         InFinally and InCatch storage.
8286
8287         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
8288         (Catch.Resolve): Set and Restore ec.InCatch.
8289         (Try.Resolve): Set and Restore ec.InFinally.
8290         (Try.HasCatch): True when try has catch.
8291
8292 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
8293
8294         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
8295           for the same event member, so exclude such cases from warning 419.
8296           Fixed bug #74633.
8297
8298 2005-04-16  Miguel de Icaza  <miguel@novell.com>
8299
8300         * expression.cs (Binary.ResolveOperator): Apply patch from John
8301         Luke to fix bug 59864: operators &, | and ^ on enumerations
8302         require that the same enum type on both sides.
8303
8304         * driver.cs: Add warnings to old flag usage, this is to assist
8305         people who produce Makefiles and hope that the Makefiles will be
8306         used on Windows.
8307
8308         * class.cs (TypeContainer.EmitType): Moved the definition of the
8309         special $PRIVATE$ field from the resolve phase to the Emit phase.
8310         During resolve we do not know if we are a struct with
8311         HasExplicitLayout, we know this only after the attributes for the
8312         type are emitted.
8313
8314         Set the FieldOffset to zero on the dummy field that we create for
8315         the class.   Fixes 74590.
8316
8317 2005-04-16  Raja R Harinath  <rharinath@novell.com>
8318
8319         Fix #73834.
8320         * ecore.cs (PropertyExpr.resolved): New.
8321         (DoResolve): Use it to handle a case of double resolution here.
8322         Handle a case of identical-name-and-type-name.
8323         * expression.cs (ArrayCreation.CheckIndices): Avoid double
8324         resolution by storing the results of expression resolution back
8325         into the "probes" array.
8326
8327 2005-04-15  Raja R Harinath  <rharinath@novell.com>
8328
8329         Fix cs0208-7.cs and cs0208-8.cs.
8330         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
8331         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
8332         error reporting to point out the reason a struct is not unmanaged.
8333
8334 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
8335
8336         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
8337           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
8338
8339 2005-04-13  Raja R Harinath  <rharinath@novell.com>
8340
8341         Fix #74528.
8342         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
8343         IdenticalNameAndTypeName here.
8344         (EventExpr.InstanceResolve): Likewise.
8345
8346 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
8347
8348         C# 2.0 DefaultCharSetAttribute implementation
8349         
8350         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
8351         which allows us to set GlobalNamespace for every resolve.
8352         (Attribute.ResolveArguments): Cut from Resolve.
8353         (Attribute.GetCharSetValue): Returns CharSet named argument.
8354         (Attribute.DefinePInvokeMethod): Gets default charset from
8355         module settings.
8356         (GlobalAttribute.ResolveAsTypeStep): Override.
8357         (GlobalAttribute.ResolveArguments): Override.
8358         
8359         * class.cs (TypeAttr): Is protected.
8360         
8361         * codegen.cs (ModuleClass.DefaultCharSet): New member.
8362         (ModuleClass.DefaultCharSetType): New memeber.
8363         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
8364         
8365         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
8366         charset from module.
8367         
8368         * delegate.cs (TypeAttr): Override.
8369         (Delegate.DefineType): Use this TypeAttr.
8370         
8371         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
8372         at very early stage (before types are defined) to resolve model
8373         module attributes. It will probably not work with corlib but it
8374         should be ok.
8375         
8376         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
8377         charset from module.
8378         
8379         * typemanager.cs (default_charset_type): New type.
8380
8381 2005-04-13  Raja R Harinath  <rharinath@novell.com>
8382
8383         * decl.cs (MemberCache.AddMethods): Don't warn if
8384         System.Object.Finalize has buggy MethodAttributes.
8385
8386         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
8387         removed below.
8388
8389 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
8390
8391         * doc.cs : detect ambiguous reference to overloaded members.
8392           Fixed bug #71603. MS 1.1 csc does not detect it.
8393
8394 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
8395
8396         * doc.cs : delegates must not be referenced with parameters.
8397           Fixed bug #71605.
8398
8399 2005-04-12  Miguel de Icaza  <miguel@novell.com>
8400
8401         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
8402
8403 2005-04-10  Miguel de Icaza  <miguel@novell.com>
8404
8405         * driver.cs (MainDriver): Stop processing if the CLS stage found
8406         errors. 
8407
8408         (CompilerCallableEntryPoint.InvokeCompiler): Always
8409         reset after execution;   Take a TextWriter argument for the
8410         output.
8411
8412         * report.cs: Use the error stream instead of hardcoding stderr. 
8413
8414 2005-04-09  Miguel de Icaza  <miguel@novell.com>
8415
8416         * class.cs: Reduce code paths to test, too small of an
8417         optimization to make it worth the extra testing.  Always perform
8418         it. 
8419
8420 2005-04-08  Raja R Harinath  <rharinath@novell.com>
8421
8422         Fix #74510.
8423         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
8424         operators that had errors reported on them.
8425
8426 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
8427
8428         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
8429         argument types.
8430         (Attribute.Resolve): Add named argument type checking.
8431         
8432         * class.cs (FixedField.Define): Use IsPrimitiveType
8433         
8434         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
8435         
8436         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
8437         unsafe parameter types.
8438         
8439         * statement.cs (Using.ResolveExpression): Add better error description.
8440         
8441         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
8442         
8443 2005-04-08  Raja R Harinath  <rharinath@novell.com>
8444
8445         Fix #74484.
8446         * attribute.cs (Attribute.GetAttributeUsage): Resolve
8447         AttributeUsageAttribute in the emitcontext of the attribute class,
8448         not in the emitcontext of the attributable entity it was attached to.
8449         * cs-parser.jay: Use 'current_class', not 'current_container',
8450         when creating a GlobalAttribute.
8451
8452 2005-04-08  Alp Toker  <alp@atoker.com>
8453
8454         * pending.cs: The fix to #58413 failed to compile methods implementing
8455         interfaces with/without params modifiers and vice versa, even though
8456         params modifiers aren't part of the signature. Make the modifier check
8457         less strict as in csc.
8458
8459 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
8460             Anoob V E  <projectmonokochi@rediffmail.com>
8461             Harilal P R  <projectmonokochi@rediffmail.com>
8462
8463         Fix #58413.
8464         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
8465         modifiers of pending methods.
8466         (PendingImplementation.PendingImplementation): Initialize it.
8467         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
8468         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
8469         with ParameterData.  Add check for modifiers.
8470         * class.cs (MethodData.Define): Update to changes.
8471
8472 2005-04-07  Raja R Harinath  <rharinath@novell.com>
8473
8474         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
8475
8476 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
8477
8478         * class.cs (PropertyMethod.Define): Check private accessor in abstract
8479         property.
8480         
8481         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
8482         
8483         * rootcontext.cs,
8484         * typemanager.cs: Registered RequiredAttributeAttribute.
8485         
8486 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
8487
8488         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
8489         Warning CS0169 is back at level 3.
8490         (IMethodData.SetMemberIsUsed): New method.
8491         
8492         * decl.cs (IsUsed): New value; moved from FieldBase.Status
8493         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
8494         
8495         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
8496
8497         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
8498         contants.
8499         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
8500         is used.
8501         
8502         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
8503         is used.
8504         
8505         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
8506         to avoid the problems with nested types.
8507
8508 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
8509             Anoob V.E  <projectmonokochi@rediffmail.com>
8510             Harilal P.R  <projectmonokochi@rediffmail.com>
8511             Raja R Harinath  <rharinath@novell.com>
8512
8513         Fix #73820.
8514         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
8515         attribute.
8516         * typemanager (GetConstructor): Make public.
8517
8518 2005-04-05  John Luke  <john.luke@gmail.com>
8519             Raja R Harinath  <rharinath@novell.com>
8520
8521         Fix #62232.
8522         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
8523         struct too.  Return false quicker in a few cases.
8524         (VerifyUnManaged): Use it.
8525
8526 2005-04-05  Raja R Harinath  <rharinath@novell.com>
8527
8528         Fix #74041.
8529         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
8530         not 'unreachable_seen'.
8531
8532 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
8533
8534         * attribute.cs (Attribute.GetValue): Removed unused.
8535         
8536         * codegen.cs (CodeGen.TrimExt): Removed unused.
8537         
8538         * cs-parser.jay (output): Removed unused.
8539         
8540         * cs-tokenizer.cs (hex_digits): Removed unused.
8541         
8542         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
8543         
8544         * expression.cs (Indirection.LoadExprValue): Removed unused.
8545         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
8546         
8547         * iterators.cs (Iterator.param_types): Removed unused.
8548         
8549         * statement.cs (Goto.block): Removed unused.
8550         (ToplevelBlock.did): Removed unused.
8551         (Switch.ResolveConstantSwitch): Removed unused.
8552
8553 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
8554
8555         * rootcontext.cs: Allow mcs to bootstrap with the compilation
8556         resetting thingy.
8557
8558 2005-04-01  Raja R Harinath  <rharinath@novell.com>
8559
8560         Fix #74232 and cs0208-3.cs.
8561         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
8562         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
8563         unmanaged type.  Don't use FieldBuilders when 't' is a
8564         TypeBuilder.  Use ModFlags and MemberType fields.
8565         * class.cs (MemberBase.member_type): Rename from MemberType.
8566         (MemberBase.MemberType): New property.  Determines member_type on
8567         demand.
8568         (MemberBase.DoDefine): Don't initialize MemberType here.
8569         (FieldMember.Define): Likewise.
8570
8571 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
8572
8573         Fix #74241
8574         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
8575         Attributes are emitted there.
8576         
8577 2005-04-01  Raja R Harinath  <rharinath@novell.com>
8578
8579         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
8580         keyword in 'partial enum' too.
8581         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
8582         is not allowed).
8583         Report from Kamil Skalski <nazgul@omega.pl>.
8584
8585         Fix #74309.
8586         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
8587         have partial containers too.
8588
8589         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
8590         in block' checks to Block.CheckInvariantMeaningInBlock.
8591         * statement.cs (Block.GetKnownVariableInfo): Make private.
8592         (Block.IsVariableUsedInChildBlock): Remove.
8593         (Block.IsVariableUsedInBlock): Likewise.
8594         (Block.CheckInvariantMeaningInBlock): New.  Show location of
8595         conflicting declaration.
8596         (Block.AddVariable): Make error messages less long-winded and more
8597         specific.  Show location of conflicting declaration.
8598         * parameter.cs (Parameters.Location): New readonly property.
8599
8600 2005-03-31  Raja R Harinath  <rharinath@novell.com>
8601
8602         Clean up semantics of invoking ResolveMemberAccess.
8603         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
8604         can have an instance, ensure that we pass in a non-TypeExpression
8605         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
8606         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
8607         argument.  Update to changes and simplify.
8608         (FieldExpr.Emitinstance): Remove CS0120 check.
8609         (PropertyExpr.EmitInstance): Likewise.
8610         * expression.cs (Argument.Resolve): Likewise.
8611         (Invocation.DoResolve): Update to changes in semantics of
8612         InstanceExpression.
8613
8614 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
8615
8616         Fix #74241
8617         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
8618         customization.
8619         
8620         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
8621
8622 2005-03-31  Raja R Harinath  <rharinath@novell.com>
8623
8624         Fix difference in behaviour with commandline invocation.
8625         * driver.cs (Driver.Reset): New.
8626         (CompilerCallableEntryPoint): Call it.
8627
8628         * statement.cs (If.Resolve): Avoid spurious "uninitialized
8629         variable" warnings if the boolean expression failed to resolve.
8630
8631 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
8632
8633         * attribute.cs: Fix the union of several permissions when some of them
8634         are unrestricted (so the result isn't an unrestricted permission set).
8635         Fix #74036.
8636
8637 2005-03-30  Raja R Harinath  <rharinath@novell.com>
8638
8639         * ecore.cs (MemberExpr): New class.  Convert from interface
8640         IMemberExpr.
8641         (MemberExpr.ResolveMemberAccess): Refactor and move here from
8642         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
8643         error checks.
8644         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
8645         (MethodGroupExpr.IsExplicitImpl): Remove.
8646         (Expression.GetFieldFromEvent): Remove.
8647         (SimpleName.MemberStaticCheck): Remove.
8648         (SimpleName.DoSimpleNameResolve): Update to changes.
8649         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
8650         (MemberAccess.IdenticalNameAndTypeName): Remove.
8651         (MemberAccess.error176): Move to MemberExpr.
8652         (MemberAccess.DoResolve): Update to changes.
8653         (BaseAccess.DoResolve): Likewise.
8654
8655 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
8656
8657         C# 2.0 Conditional attribute class implementation
8658         
8659         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
8660         Analyzes class whether it has attribute which has ConditionalAttribute
8661         and its condition is not defined.
8662         
8663         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
8664         (Class.IsExcluded): New method. Search for at least one defined
8665         condition in ConditionalAttribute of attribute class.
8666
8667 2005-03-30  Raja R Harinath  <rharinath@novell.com>
8668
8669         * ecore.cs (PropertyExpr): Derive from Expression, not
8670         ExpressionStatement.
8671         (PropertyExpr.EmitStatement): Remove.
8672
8673 2005-03-29  Raja R Harinath  <rharinath@novell.com>
8674
8675         Fix #74060.
8676         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
8677         internal field "value__" of an enum be private.  The examples for
8678         "value__" that I found on MSDN all used FieldAttributes.Private.
8679
8680         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
8681         Don't mention IL method attribute names.
8682
8683         Fix #47991.  Remove a TODO.
8684         * statement.cs (Block.Toplevel): Make into a field.
8685         (Block.Parameters): Move into ToplevelBlock.
8686         (Block.known_variables): Rename from child_variable_names.
8687         (Block.Block): Remove variants that take Parameters.  Initialize
8688         'Toplevel' with the immediately surrounding toplevel block.
8689         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
8690         LocalInfo parameter.
8691         (Block.GetKnownVariableInfo): New.
8692         (Block.IsVariableNameUsedInChildBlock): Update.
8693         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
8694         the block, even though it may not be in scope.
8695         (Block.AddVariable): Remove Parameters parameter.  Use
8696         Toplevel.Parameters instead.
8697         (Block.AddConstant): Remove Parameters parameter.
8698         (Block.GetParameterReference): Update to use Toplevel.Parameters.
8699         (Block.IsParamaterReference): Likewise.
8700         (Block.IsLocalParameter): Likewise.  Simplify a lot.
8701         (ToplevelBlock.Parameters): New.  Moved from Block.
8702         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
8703         initialize Parameters to a non-null value.
8704         * cs-parser.jay: Update to changes.
8705         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
8706         simple names that mean different things in the same block.  Use
8707         Block.IsVariableNameUsedInBlock.
8708
8709 2005-03-28  Raja R Harinath  <rharinath@novell.com>
8710
8711         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
8712         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
8713         GetTypeHandle.  It is possible for a reflected type to derive from
8714         a TypeBuilder (e.g., int[] derives from the TypeBuilder
8715         System.Array during mscorlib compilation).
8716         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
8717         contain a method_hash, don't create one either.  Don't create a
8718         deep copy of the base cache's method_hash.
8719         (MemberCache.SetupCache): Rename back from DeepCopy.
8720         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
8721         already initialized.  If we see an override function, add its
8722         underlying base virtual function to the member_hash too.
8723
8724         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
8725
8726 2005-03-26  Raja R Harinath  <harinath@acm.org>
8727
8728         Fix #73038.
8729         * assign.cs (Assign.DoResolve): When the RHS of an assignment
8730         fails to resolve, ensure that the LHS is still resolved as an
8731         lvalue.
8732
8733 2005-03-25  Raja R Harinath  <harinath@acm.org>
8734
8735         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
8736         ec.ContainerType.
8737         (Enum.current_ec): Remove.
8738         (Enum.LookupEnumValue): Remove EmitContext argument.
8739         Just uses the one created during DefineType.
8740         (Enum.FindMembers): Update.
8741         * expression.cs (MemberAccess.DoResolve): Update.
8742
8743 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
8744
8745         * assign.cs (Assign.DoResolve): Check for CS1717 when
8746         source and target are same (uses Equals).
8747
8748         * expression.cs (LocalVariableReference, ParameterReference,
8749         This): Implemented Equals, GetHashCode.
8750
8751         * statement.cs (Block.GetParameterReference): Removed useless
8752         local variable.
8753
8754 2005-03-22  Raja R Harinath  <rharinath@novell.com>
8755
8756         Fix cs0128.cs
8757         * statement.cs (Block.AddVariable): Ensure that we skip implicit
8758         blocks before deciding whether the error is cs0136 or cs0128.
8759
8760         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
8761         (using_alias_directive, using_namespace_directive): Pass
8762         MemberName, not an expression to Namespace.UsingAlias and
8763         Namespace.Using.
8764         (MakeName): Use the MemberName of the namespace.
8765         * namespace.cs (Namespace.MemberName): New.
8766         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
8767         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
8768         Likewise.
8769         * decl.cs (MemberName.Name): Make readonly.
8770         (MemberName.FromDotted): New "constructor".
8771         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
8772         (MemberCore.Name): Compute from MemberName on demand.
8773         (MemberCore.SetMemberName): Provide a way to change the
8774         MemberName.
8775         (MemberCore.AddToContainer): Don't take a fullname parameter.
8776         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
8777         fully qualified name of the container to the member name.
8778         (TypeContainer.AddToTypeContainer): Use a fully qualified name
8779         only if the type is a member of the root container.
8780         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
8781         MemberName.Left rather than searching for an embedded ".".
8782         (PartialContainer.CreatePart): Update to changes in RootContext.
8783         (MemberBase.ShortName): Turn into a property.  Use
8784         MemberCore.SetMemberName.
8785         (MemberBase.ExplicitInterfaceName): Remove.
8786         (MemberBase.UpdateMemberName): Remove.
8787         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
8788         (PropertyBase.SetMemberName): New override.
8789         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
8790         (Tree.GetDecl): New.
8791         (Tree.AllDecls): Rename from Decls.
8792         * attribute.cs, enum.cs, report.cs: Update to changes.
8793         * driver.cs (MainDriver): Use MemberName.FromDotted on
8794         RootContext.MainClass.
8795
8796 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
8797
8798         * class.cs (FixedField.Define): Check for CS1664 and more sanity
8799         checks.
8800
8801         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
8802
8803 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
8804
8805         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
8806         property accessor modifiers.
8807
8808         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
8809         fixed buffer attribute (CS1716).
8810         (PropertyMethod.HasCustomAccessModifier): When property accessor
8811         has custom modifier.
8812
8813         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
8814         modifiers.
8815         (PropertyExpr.DoResolveLValue): Add CS0272.
8816
8817 2005-03-17  Miguel de Icaza  <miguel@novell.com>
8818
8819         * convert.cs: When converting to a pointer, use the proper Conv.U
8820         or Conv.I depending on the source data type.
8821
8822         * cs-tokenizer.cs: Make the size for large decimal constants,
8823         fixes #72957.
8824
8825 2005-03-17  Martin Baulig  <martin@ximian.com>
8826
8827         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
8828         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
8829
8830 2005-03-17  Martin Baulig  <martin@ximian.com>
8831
8832         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
8833         to bool so we can return an error condition.
8834         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
8835         returned an error.
8836
8837 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
8838
8839         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
8840         attributes.
8841
8842 2005-03-16  Raja R Harinath  <rharinath@novell.com>
8843
8844         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
8845         Refactor to avoid traversing the list of assemblies, and to avoid
8846         string concatenation.
8847         * typemanager.cs (guid_attr_type): Remove.
8848         (negative_hits, pointers, references): Remove hashes.
8849         (type_hash): New.
8850         (GetConstructedType): New.  Uses type_hash to handle constructed
8851         types (arrays, references, pointers).
8852         (GetReferenceType, GetPointerType): Use it.
8853         (GetNestedType): New.  Uses type_hash to handle nested types of
8854         reflected types.
8855         (LookupType, LookupTypeDirect): Remove.
8856         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
8857         'types' hash and LookupTypeReflection directly.
8858         (params_string, params_object): Use GetConstructedType.
8859         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
8860         top-level types.
8861         (Namespace.Lookup): Use cached_types.
8862         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
8863         provided by old TypeManager.LookupType.
8864         * rootcontext.cs (MakeFQN): Remove.
8865         * decl.cs (DeclSpace.MakeFQN): Likewise.
8866         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
8867         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
8868         TypeManager.GetConstructedType.
8869         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
8870
8871 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
8872
8873         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
8874         indexers.
8875
8876         * cs-parser.jay: Reports CS1527 for any namespace element.
8877
8878         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
8879         Added CS0407.
8880
8881         * expression.cs (ParameterReference.IsAssigned): Changed error to
8882         CS0269.
8883         (Error_WrongNumArguments): Moved CS0245 detection here.
8884
8885         * statement.cs (Return.Resolve): Add CS1622 report.
8886
8887 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
8888
8889         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
8890
8891 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
8892
8893         * attribute.cs expression.cs: Get rid of some allocations.
8894
8895 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
8896
8897         * doc.cs : just eliminate the latest change.
8898
8899 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
8900
8901         * doc.cs : commented out the latest change. It breaks xml-030.cs
8902
8903 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
8904
8905         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
8906           fail. So invoke CreateType() in FindDocumentedType().
8907
8908 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
8909
8910         * cs-tokenizer.cs : added IsKeyword().
8911         * doc.cs : Detect keyword incorrectly used as identifier.
8912           Allow identifiers prefixed by @.
8913
8914 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
8915
8916         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
8917         It caused exception in namespace resolving (again!).
8918         
8919         * class.cs (Class.ctor): Removed exit.
8920         (PropertyMethod.ctor): ditto.
8921         
8922         * codegen.cs (Codegen.Reset): Reset static data.
8923         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
8924         
8925         * cs-tokenizer.cs (Cleanup): Removed.
8926         
8927         * driver.cs (GetSystemDir): Rewrote to one line command.
8928         It caused problem with unloaded dynamic modules.
8929         (UnixParseOption): Removed Exit.
8930         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
8931         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
8932         Now can be mcs used as library.
8933         
8934         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
8935         empty location.
8936         
8937         * location.cs (Reset): Reset static data.
8938         
8939         * namespace.cs (Reset): Reset static data.
8940         
8941         * report.cs (Report.Reset): Reset static data.
8942         
8943         * rootcontext.cs (RootContext.Reset): Reset static data.
8944         
8945         * tree.cs (RootTypes.ctor): Use Location.Null
8946         
8947         * typemanager.cs (TypeManager.Reset): Reset static data.
8948         (CoreLookupType): Removed Exit.
8949         (TypeHandle.Reset): Reset static data.
8950         
8951 2005-03-10  Raja R Harinath  <rharinath@novell.com>
8952
8953         Fix #73516.
8954         * typemanager.cs (ComputeNamespaces): Import namespaces from
8955         referenced modules too.
8956
8957 2005-03-09  Raja R Harinath  <rharinath@novell.com>
8958
8959         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
8960         than '.'.
8961
8962 2005-03-09  Raja R Harinath  <rharinath@novell.com>
8963
8964         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
8965         enclosing DeclSpace.  This ensures that a name-lookup populates
8966         more caches and there are fewer 'TypeExpression's.  Carve out
8967         nested type lookup into ...
8968         (LookupNestedTypeInHierarchy): ... this.
8969
8970 2005-03-09  Raja R Harinath  <rharinath@novell.com>
8971
8972         Clean up a few partial-class semantics.  
8973         Fixes test-357.cs and cs1618-2.cs.
8974         * cs-parser.jay (struct_declaration): Use 'current_class' as
8975         parent of newly-created struct.  Remove call to Register ().
8976         Use 'pop_current_class' to complete handing the current struct.
8977         (interface_declaration): Likewise.
8978         (class_declaration): Likewise.
8979         (enum_declaration): Use 'current_class' as parent of newly created
8980         enum.
8981         (delegate_declaration): Likewise.
8982         (pop_current_class): New function.  This is used to handle closing
8983         up the 'current_class' and 'current_container', and pointing them
8984         to the enclosing class/container.
8985         (CSharpParser): Initialize 'current_class' too.
8986         * decl.cs (MemberCore): Add check for invariant: a partial
8987         container is not a parsed entity, and thus does not enclose any
8988         parsed members.
8989         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
8990         (DeclSpace.BaseTypeExpr): Use it.
8991         (DeclSpace.LookupType): Add check for invariant.
8992         * class.cs (TypeContainer): Add check for invariant: a nested
8993         class should have the same NamespaceEntry as its enclosing class.
8994         (TypeContainer.EmitFieldInitializers): Make virtual.
8995         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
8996         MemberCore.
8997         (TypeContainer.Register): Remove.
8998         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
8999         null.  Use TypeResolveEmitContext for resolving base types and
9000         interfaces.  Move initialization of Parts.TypeBuilder here from
9001         ...
9002         (TypeContainer.DefineNestedTypes): ... here.
9003         (PartialContainer): Take a Namespace not a NamespaceEntry.
9004         (PartialContainer.Create): Don't use Register.  Call the
9005         appropriate Add... function directly.
9006         (ClassPart): Take both the PartialContainer and the enclosing
9007         class as constructor arguments.
9008         (ClassPart.EmitFieldInitializers): Override.
9009         (ClassPart.PartFindNestedTypes): Remove.
9010         (FieldBase.GetInitializerExpression): Resolve the initializer
9011         expression in the emit context of the enclosing class.
9012         * tree.cs (RootTypes): Remove Register ().
9013         
9014 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
9015
9016         * cs-parser.jay: Removed CS0134.
9017         
9018         * driver.cs: Removed CS1901.
9019         
9020         * expression.cs (SizeOf.DoResolve): Don't report CS0233
9021         for predefined types.
9022
9023 2005-03-07  Duncan Mak  <duncan@novell.com>
9024
9025         * codegen.cs (Save):  Catch UnauthorizedAccessException as
9026         well. Fixes bug #73454.
9027
9028 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
9029
9030         * cs-tokenizer.cs (xtoken): Add CS1035.
9031         
9032         * class.cs (MethodData.Define): Add CS0683.
9033         (FieldMember.ctor): Add CS0681.
9034
9035 2005-03-07  Raja R Harinath  <rharinath@novell.com>
9036
9037         * ecore.cs (SimpleName.DoResolve): Rename from
9038         SimpleName.DoResolveAllowStatic.
9039         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
9040         Pass 'intermediate' flag to MemberStaticCheck.
9041         (SimpleName.MemberStaticCheck): Skip "static check" only in case
9042         of "intermediate" lookups via MemberAccess.
9043         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
9044         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
9045
9046 2005-03-07  Raja R Harinath  <rharinath@novell.com>
9047
9048         Fix #73394.
9049         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
9050         slipped in because of variable names that are identical to a
9051         builtin type's BCL equivalent ('string String;', 'int Int32;').
9052         (PropertyExpr.EmitInstance): Likewise.
9053
9054 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
9055
9056         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
9057         
9058         * report.cs (warning_ignore_table): Made public.
9059
9060 2005-03-04  Raja R Harinath  <rharinath@novell.com>
9061
9062         Fix #73282.
9063         * class.cs (MethodData.Emit): Pass 'container' to
9064         container.GetObsoleteAttribute instead of 'container.Parent'.
9065
9066 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
9067
9068         * cs-parser.jay: Add 1534 error test.
9069
9070         * iterators.cs (Yield.CheckContext): Add error 1629.
9071         (Iterator.ctor): Save unsafe modifier.
9072         (MoveNextMethod.DoEmit): Restore unsafe context.
9073
9074         * namespace.cs (UsingAlias): Better error message.
9075
9076 2005-03-03  Dan Winship  <danw@novell.com>
9077
9078         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
9079         the warning message [#73219]
9080
9081 2005-03-03  Raja R Harinath  <rharinath@novell.com>
9082
9083         Fix compile with MCS 1.0.0.0.
9084         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
9085         w_restore to not depend on string constant folding.
9086
9087 2005-03-03  Raja R Harinath  <rharinath@novell.com>
9088
9089         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
9090         CS0246 check to users who passed 'silent = false'.
9091         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
9092         check.
9093         (SimpleName.SimpleNameResolve): Update.
9094         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
9095         (MemberAccess.IdenticalNameAndTypeName): Update.
9096         * doc.cs (FindDocumentedTypeNonArray): Update.
9097
9098 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
9099
9100         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
9101         * parameters.cs (ComputeAndDefineParameters): Remove.
9102         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
9103         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
9104         Use GetParameterInfo.
9105
9106 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
9107
9108         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
9109
9110 2005-03-02  Raja R Harinath  <rharinath@novell.com>
9111
9112         Unify DeclSpace.LookupType and DeclSpace.FindType.
9113         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
9114         is in charge of defining nested types on demand.
9115         (DeclSpace.LookupType): Use it when the current_type is a
9116         TypeBuilder.  Use LookupTypeDirect for reflected types.
9117         (DeclSpace.FindType): Remove.
9118         (DeclSpace.LookupInterfaceOrClass): Likewise.
9119         (DeclSpace.DefineTypeAndParents): Likewise.
9120         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
9121         DeclSpace.LookupType.
9122         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
9123         * typemanager.cs (LookupType): Simplify.
9124         (AddUserType): Remove type from negative_hits.
9125         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
9126         * class.cs (TypeContainer.FindMembers): Move handling of nested
9127         types ...
9128         (TypeContainer.FindMembers_NestedTypes): ... here.
9129         (TypeContainer.FindNestedType): Implement override.
9130         (ClassPart.FindNestedType): Delegate to PartialContainer.
9131         (ClassPart.PartFindNestedType): Looks up the nested types of the
9132         part alone.
9133
9134 2005-03-02  Martin Baulig  <martin@ximian.com>
9135
9136         * class.cs (TypeContainer.DoDefineMembers): We also need a default
9137         static constructor in static classes.
9138
9139 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
9140
9141         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
9142         sizeParamIndex is not specified.
9143
9144 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
9145
9146         Fix #73117
9147         * report.cs (WarningMessage.IsEnabled): Missing null check.
9148
9149 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
9150
9151         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
9152         in the fields and not in the properties.
9153
9154 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
9155
9156         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
9157         fields as well.
9158
9159 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
9160
9161         * attribute.cs: Small refactoring (improved robustness).
9162         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
9163         (ValidateGuid): Removed.
9164         (Resolve): Removed referenced to above mentioned.
9165         (GetAttributeUsage): Made private and changed to work without
9166         class assistance.
9167         (GetIndexerAttributeValue): Don't crash.
9168         (GetConditionalAttributeValue): Ditto.
9169         (GetClsCompliantAttributeValue): Ditto.
9170         (ExtractSecurityPermissionSet): All attributes exceptions are
9171         error 648.
9172         (GetPropertyValue): New helper.
9173         (GetMethodImplOptions): New method.
9174         (DefinePInvokeMethod): Reuse common code. Implemented handling of
9175         some missing properties.
9176         
9177         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
9178         (Method.ApplyAttributeBuilder): Updated.
9179         
9180         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
9181         exception.
9182
9183 2005-02-28  Raja R Harinath  <rharinath@novell.com>
9184
9185         Fix #73052.
9186         * report.cs (Report.SymbolRelatedToPreviousError): Handle
9187         non-simple types (array, pointer, reference).
9188
9189 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
9190
9191         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
9192
9193         * class.cs (MethodCore.IsDuplicateImplementation): Special error
9194         for operators.
9195         (Method.CheckBase): Catch wrong destructor here.
9196         (MethodData.Define): Add errors 550, 668.
9197
9198         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
9199
9200         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
9201
9202         * pending.cs (VerifyPendingMethods): Add error 551.
9203
9204         * typemanager.cs (CSharpName): Next error report helper.
9205
9206 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
9207
9208         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
9209         attributes. Removed useless attribute double check.
9210         It saves almost 2MBs for corlib.
9211
9212 2005-02-25  Raja R Harinath  <rharinath@novell.com>
9213
9214         Fix #72924.
9215         * statement.cs (ExpressionStatement.Resolve): Make robust to being
9216         called twice in case of error.
9217
9218 2005-02-23  Chris Toshok  <toshok@ximian.com>
9219
9220         Fix compiler portions of #72827.
9221         * statement.cs (Block.Emit): call Begin/EndScope on the
9222         EmitContext instead of the ILGenerator.
9223
9224         * codegen.cs (EmitContext.BeginScope): new method, call
9225         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
9226         we have one.)
9227         (EmitContext.BeginScope): same, but EndScope and CloseScope
9228
9229         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
9230         offset and call the superclass's OpenScope(int) with it.
9231         (SymbolWriter.CloseScope): get the current il
9232         offset and call superclass's CloseScope(int) with it.
9233
9234 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
9235
9236         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
9237         CS1677 for out and ref as well.
9238
9239         * class.cs (Method.Define): Add error CS1599 detection.
9240         
9241         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
9242         
9243         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
9244         
9245         * delegate.cs (Delegate.Define): Add error CS1599 detection.
9246         
9247         * support.cs.cs (ModifierDesc): New helper method.
9248
9249 2005-02-23  Raja R Harinath  <rharinath@novell.com>
9250             Abin Thomas  <projectmonokochi@rediffmail.com>
9251             Anoob V E  <projectmonokochi@rediffmail.com>
9252             Harilal P R  <projectmonokochi@rediffmail.com>
9253
9254         Fix #57851, #72718.
9255         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
9256         MemberLookup (used for error reporting) actually returns a result.
9257         Fix error report number (122, not 112).
9258
9259 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
9260             Anoob V E  <projectmonokochi@rediffmail.com>
9261             Harilal P R  <projectmonokochi@rediffmail.com>
9262
9263         Fix #71134.
9264         * pending.cs (PendingImplementation.GetAbstractMethods):
9265         Find NonPublic members too.
9266
9267 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
9268
9269         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
9270         Fixed error 217.
9271         
9272         * class.cs (MethodCore.CheckMethodAgainstBase):
9273         Add error 239 report.
9274
9275 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9276
9277         Fix #68955.
9278         * expression.cs (Invocation.IsApplicable): Make public.
9279         (Invocation.IsParamsMethodApplicable): Likewise.
9280         * delegate.cs (Delegate.VerifyApplicability): Don't use
9281         Invocation.VerifyArgumentCompat for parameter applicability
9282         testing.  Use Invocation.IsApplicable and
9283         Invocation.IsParamsMethodApplicable.
9284
9285 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
9286
9287         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
9288         
9289         * class.cs (Operator.Define): Add error 217 report.
9290         
9291 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9292
9293         * namespace.cs (UsingEntry.Resolve): Undo change below.
9294
9295 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9296
9297         Fix #72756.
9298         * ecore.cs (Expression.MemberLookupFailed): Add argument to
9299         disable the error message when the extended MemberLookup also
9300         fails.
9301         (Expression.MemberLookupFinal): Update.
9302         (SimpleName.DoSimpleNameResolve): Update.
9303         * expression.cs (MemberAccess.ResolveNamespaceOrType):
9304         Don't use MemberLookupFinal.
9305         (New.DoResolve): Update.
9306         (BaseAccess.CommonResolve): Update.
9307
9308 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9309
9310         Fix #72732.
9311         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
9312         occured previously, don't resolve again.
9313
9314 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
9315
9316         Fix #69949
9317         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
9318         argument. Call ResolveAttributeUsage for unresolved.
9319         when types doesn't match ctor arguments.
9320         
9321         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
9322         for nested attribute classes.
9323         (Class.attribute_usage): Removed.
9324         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
9325         for attribute class.
9326         
9327         * ecore.cs (IsAttribute): Removed.
9328         
9329         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
9330         
9331         * rootcontext.cs (RegisterAttribute): Removed, attributes are
9332         now normal types.
9333         (attribute_types): Removed.
9334         (EmitCode): Global attributes are emited as the latest.
9335
9336 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
9337
9338         * class.cs (EmitFieldInitializers): Don't emit field initializer
9339         for default values when optimilization is on.
9340         
9341         * constant.cs (Constant.IsDefaultValue): New property.
9342         
9343         * driver.cs: Add /optimize handling.
9344         
9345         * constant.cs,
9346         * ecore.cs,
9347         * literal.cs: Implement new IsDefaultValue property.
9348         
9349         * rootcontext.cs (Optimize): New field, holds /optimize option.
9350
9351 2005-02-18  Raja R Harinath  <rharinath@novell.com>
9352
9353         Fix crasher in re-opened #72347.
9354         * namespace.cs (Namespace.Lookup): Return null if
9355         DeclSpace.DefineType returns null.
9356
9357         Fix #72678.
9358         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
9359
9360 2005-02-18  Raja R Harinath  <rharinath@novell.com>
9361
9362         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
9363         now returns null if it cannot resolve to an lvalue.
9364         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
9365         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
9366         returned null.  Remove check for SimpleName.
9367         (EventExpr.DoResolveLValue): New.
9368         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
9369         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
9370         error from ...
9371         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
9372         avoid CS0131 error.
9373         (Unary.ResolveOperator): Move CS0211 check ...
9374         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
9375         CS0131 error.
9376         (Unary.DoResolveLValue): Simplify.
9377         (AddressOf.DoResolveLValue): New.
9378         (ArrayAccess.DoResolveLValue): New.
9379
9380 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
9381
9382         * attribute.cs (Attribute.Resolve): Add arguments casting for
9383         when types doesn't match ctor arguments.
9384
9385 2005-02-16  Raja R Harinath  <rharinath@novell.com>
9386
9387         Fix parts of #63202.
9388         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
9389         lookup of operator in base type.  Ensure that all checks happen
9390         when the operator resolves to an "op_..." method.
9391
9392 2005-02-15  Raja R Harinath  <rharinath@novell.com>
9393
9394         Fix #71992.
9395         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
9396         'ignore_cs0104' parameter.  Pass it to ...
9397         (NamespaceEntry.Lookup): ... this.
9398         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
9399         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
9400         (TypeLookupExpression.DoResolveAsTypeStep): Update.
9401         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
9402         Update.  Request that cs0104 errors be ignored.
9403         (ComposedCast.ResolveAsTypeStep): Update.
9404
9405 2005-02-14  Raja R Harinath  <rharinath@novell.com>
9406
9407         Fix #59209.
9408         * expression.cs (Invocation.BetterFunction): Remove support for
9409         comparing virtual functions and their overrides.
9410         (Invocation.IsOverride): New.
9411         (Invocation.OverloadResolve): Don't consider 'override' functions
9412         during candidate selection.  Store them in a lookaside list.
9413         If the selected method is a 'virtual' function, use the list to
9414         find any overrides that are closer to the LHS type.
9415
9416 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
9417
9418         * expression.cs (New.DoResolve): Add complex core type reduction.
9419         (New.Constantify): Converts complex core type syntax like 'new int ()'
9420         to simple constant.
9421         
9422 2005-02-14  Raja R Harinath  <rharinath@novell.com>
9423
9424         * decl.cs (EntryType.EntryType): New constructor to create an
9425         updated copy of a cache entry.
9426         (MemberCache.AddMethods): Use it.
9427         (MemberCache.ClearDeclaredOnly): Remove.
9428         (MemberCache.MemberCache): Update.
9429
9430 2005-02-11  Miguel de Icaza  <miguel@novell.com>
9431
9432         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
9433         variable.  This one is represents the actual low-level declaration
9434         of the method, as opposed to the semantic level `IsStatic'.   
9435
9436         An anonymous method which is hosted into a static method might be
9437         actually an instance method.  IsStatic would reflect the
9438         container, while MethodIsStatic represents the actual code
9439         generated.
9440
9441         * expression.cs (ParameterReference): Use the new MethodIsStatic
9442         instead of IsStatic.
9443
9444         * anonymous.cs (AnonymousMethod.Compatible): Pass the
9445         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
9446         set on the current EmitContext. 
9447
9448         * expression.cs (Cast): Overload DoResolveLValue so we can pass
9449         resolve our casted expression as an LValue.  This triggers the
9450         proper LValue processing that is later required by Assign.
9451
9452         This fixes 72347.
9453
9454         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
9455
9456 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
9457
9458         C# 2.0 Fixed buffer implementation
9459
9460         * anonymous.cs: Update after RegisterHelperClass renaming.
9461
9462         * attribute.cs (AttributeTester.fixed_buffer_cache):
9463         Cache of external fixed buffers.
9464         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
9465         implementation if field is fixed buffer else null.
9466
9467         * class.cs
9468         (TypeContainer.AddField): Accept FieldMember instead of Field.
9469         (FieldBase.IsFieldClsCompliant): Extracted code from
9470         VerifyClsCompliance descendant customization.
9471         (FixedField): New class handles fixed buffer fields.
9472         (FixedFieldExternal): Keeps information about imported fixed
9473         buffer.
9474         (IFixedField): Make access to internal or external fixed buffer
9475         same.
9476
9477         * cs-parser.jay: Add fixed buffer parsing.
9478
9479         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
9480         buffer.
9481
9482         * expression.cs (Indirection): Extended implementation to accept
9483         fixed buffer field.
9484         (PointerArithmetic.Emit): Get element from fixed buffer as well.
9485         (ElementAccess.MakePointerAccess): Get type as parameter.
9486         (DoResolve): Add fixed buffer field expression conversion.
9487         (DoResolveLValue): Ditto.
9488         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
9489         (ArrayPtr): Derives from FixedBufferPtr.
9490         (ArrayPtr.Emit): Add extra emit for array elements.
9491
9492         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
9493
9494         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
9495         for compiler generated types.
9496         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
9497
9498         * statement.cs (Fixed): Refactored to be easier add fixed buffer
9499         and consume less memory.
9500         (Fixed.Resolve): Add fixed buffer case.
9501
9502         * typemanager.cs (compiler_generated_attr_ctor,
9503         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
9504         (HasElementType): Add our own implementation to work on every
9505         runtime.
9506
9507 2005-02-11  Miguel de Icaza  <miguel@novell.com>
9508
9509         * anonymous.cs (CaptureContext): Track whether `this' has been
9510         referenced.   
9511
9512         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
9513         only captured `this' if it was implicitly done (instance
9514         methods/variables were used). 
9515
9516         * codegen.cs (EmitContext.CaptureThis): New method to flag that
9517         `this' must be captured.
9518
9519 2005-01-30  Miguel de Icaza  <miguel@novell.com>
9520  
9521         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
9522         is null it means that there has been no need to capture anything,
9523         so we just create a sibling.
9524
9525         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
9526
9527         Just a partial fix.  The other half is fairly elusive.
9528         
9529 2005-02-10  Raja R Harinath  <rharinath@novell.com>
9530
9531         Fix #52586, cs0121-4.cs.
9532         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
9533         and return a hashtable.
9534         (MemberCache.ClearDeclaredOnly): New.
9535         (MemberCache.MemberCache): Update to change.  Make a deep copy of
9536         the method_hash of a base type too.
9537         (MemberCache.AddMethods): Adapt to having a deep copy of the base
9538         type methods.  Overwrite entries with the same MethodHandle so
9539         that the ReflectedType is correct.  The process leaves in base
9540         virtual functions and their overrides as distinct entries.
9541         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
9542         matters since it was boxed in a ArrayList before.
9543         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
9544         modifier.
9545         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
9546         case of a virtual function and its override (choose the overload
9547         as better).
9548         (Invocation.OverloadResolve): Avoid 'override' members during
9549         'applicable_type' calculation.
9550
9551 2005-02-09  Raja R Harinath  <rharinath@novell.com>
9552
9553         Combine two near-redundant caches.
9554         * typemanager.cs (method_params): Rename from method_internal_params.
9555         (TypeManager.GetParameterData): New.  Replace
9556         Invocation.GetParameterData.
9557         (TypeManager.LookupParametersByBuilder): Remove.
9558         * expression.cs (Invocation.method_parameter_cache): Remove.
9559         (Invocation.GetParameterData): Remove.
9560         Update to changes.
9561         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
9562         Update to changes.
9563
9564 2005-02-08  Raja R Harinath  <rharinath@novell.com>
9565
9566         Fix #72015.
9567         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
9568         TypeManager.multicast_delegate_type is null, resolve it by looking
9569         up "System.MulticastDelegate".
9570         * rootcontext.cs (RootContext.ResolveCore): Simplify.
9571
9572 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
9573             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
9574             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
9575
9576         Fix cs0164.cs.
9577         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
9578         (LabeledStatement.AddReference): New.  Set 'referenced'.
9579         (Goto.Resolve): Use it.
9580
9581 2005-02-05  John Luke  <john.luke@gmail.com>
9582
9583         * driver.cs: remove duplicate -doc line in Usage ()
9584
9585 2005-02-04  Raja R Harinath  <rharinath@novell.com>
9586
9587         * location.cs (Location.AddFile): Fix CS2002 error report.
9588
9589 2005-02-02  Martin Baulig  <martin@ximian.com>
9590
9591         * delegate.cs (Delegate.DefineType): Report an internal error if
9592         TypeManager.multicast_delegate_type is null.  See bug #72015 for
9593         details.        
9594
9595 2005-02-02  Raja R Harinath  <rharinath@novell.com>
9596
9597         Fix a crasher in a variant of #31984.
9598         * const.cs (Constant.CheckBase): New override that defers the
9599         new-or-override check in case the base type hasn't been populated
9600         yet.
9601         (Constant.Define): Ensure the new-or-override check is performed.
9602
9603 2005-02-01  Duncan Mak  <duncan@ximian.com>
9604
9605         * const.cs (LookupConstantValue): Check that `ce' is not null
9606         before calling GetValue ().
9607
9608 2005-02-01  Raja R Harinath  <rharinath@novell.com>
9609
9610         Fix test-334.cs (#69519).
9611         * cs-parser.jay (using_alias_directive): Pass in an expression to
9612         NamespaceEntry.UsingAlias.
9613         (using_namespace_directive): Pass in an expression to
9614         NamespaceEntry.Using.
9615         (namespace_name): Don't flatten to a string.
9616         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
9617         (NamespaceEntry.AliasEntry.Resolve): Lookup using
9618         ResolveAsTypeStep.
9619         (NamespaceEntry.UsingEntry): Likewise.
9620         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
9621         changes.
9622         (NamespaceEntry.LookupForUsing): Remove.
9623         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
9624         names.
9625         (NamespaceEntry.Lookup): Remove support for dotted names.
9626
9627 2005-02-01  Raja R Harinath  <rharinath@novell.com>
9628
9629         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
9630         split into two.
9631         (NamespaceEntry.ImplicitParent): Compute on demand.
9632         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
9633         parallels the current.
9634         (NamespaceEntry.LookupForUsing): Use it.
9635         (NamespaceEntry.Lookup): If the current namespace-entry is
9636         implicit, don't search aliases and using tables.
9637
9638 2005-02-01  Raja R Harinath  <rharinath@novell.com>
9639
9640         Fix #31984.
9641         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
9642         BaseCache here.
9643         (TypeContainer.BaseCache): Compute on demand.
9644         (TypeContainer.FindMembers): Define constants and types if they're
9645         not already created.
9646         (FieldMember.Define): Move resetting of ec.InUnsafe before error
9647         check.
9648         * const.cs (Constant.Define): Make idempotent.
9649
9650 2005-01-29  Miguel de Icaza  <miguel@novell.com>
9651
9652         * pending.cs: Produce better code (no nops produced by using Ldarg
9653         + value).
9654         
9655         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
9656         i - 1' it should be arg + 1.
9657
9658         Fixes bug #71819.
9659
9660 2005-01-28  Raja R Harinath  <rharinath@novell.com>
9661
9662         * attribute.cs (Attribute.CheckAttributeType): Make private
9663         non-virtual.
9664         (Attribute.ResolveType): Make virtual.
9665         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
9666         handling of RootContext.Tree.Types.
9667
9668 2005-01-27  Raja R Harinath  <rharinath@novell.com>
9669
9670         Update attribute-handling to use the SimpleName/MemberAccess
9671         mechanisms.
9672         * cs-parser.jay (attribute): Pass in an expression to the
9673         constructors of Attribute and GlobalAttribute.
9674         * attribute.cs (Attribute): Take an expression for the name.
9675         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
9676         passed in attribute name expression.
9677         (Attribute.CheckAttributeType): Use it.
9678         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
9679         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
9680         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
9681         argument to prevent error messages if the lookup fails.
9682
9683 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
9684
9685         * expression.cs (Indirection): Implemented IVariable interface
9686         to support indirection in AddressOf operator.
9687         (PointerArithmetic.Emit): Add optimalization for case where
9688         result can be precomputed.
9689
9690 2005-01-26  Martin Baulig  <martin@ximian.com>
9691
9692         * class.cs (TypeContainer.AttributeTargets): Return the correct
9693         AttributeTargets depending on our `Kind' instead of throwing an
9694         exception; fixes #71632.
9695
9696 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
9697
9698         Fix #71257
9699         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
9700         constant members.
9701
9702 2005-01-25  Raja R Harinath  <rharinath@novell.com>
9703
9704         Fix #71602.
9705         * expression.cs (MemberAccess.DoResolve): Don't complain with
9706         cs0572 when the LHS of a member access has identical name and type
9707         name.
9708
9709 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
9710
9711         Fix #71651, #71675
9712         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
9713         CreatePermission.
9714         Create custom PermissionSet only for PermissionSetAttribute.
9715
9716 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
9717
9718         Fix #71649
9719         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
9720         delegates in static class.
9721
9722 2005-01-24  Martin Baulig  <martin@ximian.com>
9723
9724         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9725         merging an implicit block, just use its reachability.
9726
9727         * statement.cs (Block.Resolve): Make the unreachable code check
9728         work wrt. implicit blocks; see test-337 from #63842.
9729
9730 2005-01-21  Alp Toker  <alp@atoker.com>
9731  
9732         * cs-parser.jay: destructor_declaration's container is PartialContainer
9733         not Class when partial types are used, so use Kind prop instead of
9734         'is'.
9735         
9736 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
9737
9738         * cs-parser.jay: Improve error reporting when an interface
9739         declares new types.
9740
9741 2005-01-20  Dick Porter  <dick@ximian.com>
9742
9743         * support.cs: SeekableStreamReader fix from Sandor Dobos
9744         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
9745         chars are read.  Fixes bug 70369.
9746
9747 2005-01-20  Raja R Harinath  <rharinath@novell.com>
9748
9749         * cs-parser.jay (catch_clause): Simplify current_block handling
9750         somewhat.
9751
9752 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
9753
9754         * convert.cs (ImplicitStandardConversionExists): Synchronize the
9755         code with ImplicitStandardConversion to handle the implicit
9756         conversion of method groups into valid delegate invocations. 
9757
9758         The problem is that in parameter handling we were using this code
9759         path.  Fixes bug #64698
9760
9761 2005-01-19  Raja R Harinath  <rharinath@novell.com>
9762
9763         * cs-parser.jay: Fix several infelicities.
9764         - Avoid assigning to the parser value stack.  Code like 
9765           '$3 = null' is unclean.  Synthesize a value for the code block
9766           instead. 
9767         - Avoid using oob_stack for storing location information.  Use ...
9768         (_mark_): ... this.  New (empty) rule.  Saves the current location
9769         in $$.
9770         (foreach_statement): Avoid using oob_stack for current_block
9771         handling.  Use technique used in for_statement and
9772         using_statement.  Synthesize a value for the code block to store
9773         additional intermediate information.
9774
9775 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
9776
9777         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
9778         of a different type is only allowed to private fields of a
9779         containing type, not on fields of a base class.
9780
9781         See test-174.cs and error cs0122-9.cs
9782
9783 2005-01-13  Raja R Harinath  <rharinath@novell.com>
9784
9785         Fix test-335.cs (bug #58126).
9786         * cs-parser.jay (argument): Split out non-expression parts of the
9787         rule into 'non_simple_argument'.
9788         (invocation_expression): Support parenthesized invocations with
9789         multiple arguments, and with single non-simple arguments.
9790
9791 2005-01-13  Raja R Harinath  <rharinath@novell.com>
9792
9793         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
9794         places.
9795
9796 2005-01-12  Raja R Harinath  <rharinath@novell.com>
9797
9798         Fix cs0038-1.cs, cs1640-6.cs.
9799         * ecore.cs (Expression.Resolve): Remove special-case for
9800         SimpleName in error-handling.
9801         (Expression.almostMatchedMembers): Relax access permission to
9802         protected.
9803         (Expression.MemberLookupFailed): Handle duplicates in
9804         almostMatchedMembers list.
9805         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
9806         * expression.cs (New.DoResolve): Report CS1540 for more cases.
9807         * typemanager.cs (GetFullNameSignature): Use the MethodBase
9808         overload if the passed in MemberInfo is a MethodBase.
9809
9810 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
9811
9812         Fix #70749
9813         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
9814         for non-CAS & merge permission sets properly.
9815
9816 2005-01-11  Raja R Harinath  <rharinath@novell.com>
9817
9818         Improve standard-compliance of simple name and member access 
9819         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
9820         * ecore.cs (FullNamedExpression): New abstract base class 
9821         for Namespaces and TypeExpressions.
9822         (ResolveFlags.SimpleName): Remove.
9823         (SimpleName): Remove support for dotted names.
9824         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
9825         DeclSpace.FindType and DeclSpace.LookupType.
9826         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
9827         (Expression.ExprClassName): Make member function.
9828         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
9829         a namespace.  Remove creation of dotted "SimpleName"s.
9830         (MemberAccess.DoResolve): Likewise.
9831         * decl.cs (DeclSpace.Cache): Make private.
9832         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
9833         (DeclSpace.FindType): Update.
9834         (DeclSpace.LookupType): Move here from RootContext.  Return a 
9835         FullNamedExpression.
9836         * namespace.cs (Namespace): Derive from FullNamedExpression
9837         so that it can be part of expression resolution.
9838         (Namespace.Lookup): Return an FullNamedExpression.
9839         (NamespaceEntry.LookupAlias): Lookup aliases only in current
9840         namespace.
9841         * rootcontext.cs (NamespaceLookup): Remove.
9842         (LookupType): Move to DeclSpace.
9843         * attribute.cs (CheckAttributeType): Update.
9844         * doc.cs (FindDocumentedType): Remove allowAlias argument.
9845         (FindDocumentedTypeNonArray): Likewise.
9846
9847 2005-01-11  Raja R Harinath  <rharinath@novell.com>
9848
9849         Fix cs0509.cs, cs1632.cs.
9850         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
9851         is the same as IsInterface.
9852         (TypeContainer.GetClassBases): Likewise.
9853         * statement.cs (LabeledStatement.ig): New field.
9854         (LabeledStatement.LabelTarget): Save ILGenerator which created the
9855         label.
9856         (LabeledStatement.DoEmit): Check that the label was created with
9857         the same ILGenerator.
9858
9859 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
9860
9861         Fix #71058
9862         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
9863         accessors to its properties.
9864
9865         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
9866         from accessors to property.
9867         
9868 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
9869
9870         Fix #70722
9871         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
9872         only for overrides.
9873         
9874 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
9875
9876         * attribute.cs: Check for null and empty strings.  
9877
9878         I have lost another battle to Paolo.
9879
9880 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
9881
9882         Fix #70942
9883         * class.cs (PropertyMethod): Set Parent field in ctors.
9884         (SetMethod.InternalParameters): Add unsafe switch hack.
9885         Override MarkForDuplicationCheck where it is appropriate.
9886
9887         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
9888         It says whether container allows members with the same name.
9889         Base default is no.
9890         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
9891         Removed is_method parameter.
9892
9893 2005-01-06  Duncan Mak  <duncan@ximian.com>
9894
9895         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
9896         because the previous change led to incorrect reporting of CS1032
9897         ("Cannot define/undefine preprocessor symbols after first token in
9898         file"). Instead of using `tokens_seen' as the only flag that
9899         triggers CS1040, introduce `comments_seen'. This new flag is used
9900         to signify having seen comments on the current line, so it is
9901         unset after a newline.
9902
9903 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
9904
9905         * doc.cs : When searching for a type, find nested type too.
9906           This fixes bug #71040.
9907
9908 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
9909
9910         * doc.cs :
9911           - Warn missing member comment on those classes which also does not
9912             have doc comments. Fixed bug #71041.
9913           - Don't warn missing doc comment on default constructor.
9914             Fixed bug #71042.
9915
9916 2005-01-06  Duncan Mak  <duncan@ximian.com>
9917
9918         * cs-tokenizer.cs (xtoken): After handling traditional C-style
9919         comments, set `tokens_seen' to true. This allows us to detect
9920         misplaced preprocessor directives (i.e. not at the beginning of
9921         the a line, nor after whitespaces). In that case, report error
9922         CS1040. This fixes bug #56460.
9923
9924         * cs-parser.jay (interface_member_declaration): Add checks for
9925         IsExplicitImpl, and report CS0541 error if an interface member is
9926         defined as an explicit interface declaration.
9927
9928 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
9929
9930         Fix #70817
9931         * class.cs (PropertyMethod): Set Parent field in ctors.
9932         (SetMethod.InternalParameters): Add unsafe switch hack.
9933         
9934         * decl.cs (MemberCore.Parent): Cannot be readonly.
9935
9936 2005-01-06  Raja R Harinath  <rharinath@novell.com>
9937
9938         * decl.cs (DeclSpace.ResolveType): Remove.
9939         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
9940         Merge in code from ...
9941         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
9942         * class.cs, enum.cs: Update to changes.
9943
9944 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
9945
9946         * anonymous.cs: Ensure that we init the scope of our parent if it
9947         has not been initialized yet.
9948
9949 2004-12-30  Duncan Mak  <duncan@ximian.com>
9950
9951         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
9952         if field.FieldBuilder is null. Fixes #70758.
9953
9954         * convert.cs: Fixed some typos and updated some of the comments.
9955         (ImplicitStandardConversionExists):
9956         (TryImplicitIntConversion): If `target_type' is an interface and
9957         the type of `ic' implements this interface, return true or a new
9958         BoxedCast instead of null. This fixes #70468.
9959
9960 2004-12-29  Duncan Mak  <duncan@ximian.com>
9961
9962         * expression.cs (Argument.Emit): Check that Expr is
9963         IMemoryLocation before casting to it, and report CS1510 otherwise.
9964
9965         This fixes #70402.
9966
9967 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
9968
9969         * statement.cs (Block.ThisVariable): remove the recursion here, to
9970         make the --profile more sane.
9971
9972 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
9973
9974         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
9975         assembly, by JB Evain.
9976
9977 2004-12-17  Raja R Harinath  <rharinath@novell.com>
9978
9979         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
9980           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
9981         "parent" refers to enclosing type/class.  "base" refers to superclass.
9982
9983 2004-12-17  Raja R Harinath  <rharinath@novell.com>
9984
9985         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9986         Ensure that we only have GlobalAttributes.
9987         * attribute.cs (Attribute.Emit): Make non-virtual.
9988         (GlobalAttribute.Emit): Remove.
9989         (Attribute.Resolve): Make virtual.
9990         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
9991         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
9992         the argument. Don't create one.
9993         (Attribute.GetObsoleteAttribute): Likewise.
9994         (Attribute.GetClsCompliantAttributeValue): Likewise.
9995         * class.cs, decl.cs: Update to changes.
9996
9997 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
9998
9999         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
10000         
10001         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
10002         
10003         * statement.cs (Foreach.Resolve): Add error 186 report.
10004
10005 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
10006
10007         * expression.cs (Conditional.DoResolve): Add warning 429.
10008         
10009         * statement.cs (If.Resolve): Add warning 665.
10010
10011 2004-12-16  Raja R Harinath  <rharinath@novell.com>
10012
10013         New invariant: RootContext.Tree.Types.NamespaceEntry == null
10014         except when in the parser, and in GlobalAttribute.
10015         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
10016         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
10017         RootContext.Tree.Types.NamespaceEntry once work is done.
10018         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
10019         and resets RootContext.Tree.Types.NamespaceEntry.
10020
10021 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
10022
10023         * cs-parser.jay: Don't create a block for every variable.
10024
10025 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
10026
10027         * location.cs: Provide extra information.
10028
10029         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
10030         variables from the captured environment, it is the ldarg_0.
10031
10032 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
10033
10034         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
10035         find a conclusion.
10036         
10037         * class.cs: Changed warning level for 169 to avoid developer
10038         displeasure from warning flooding. It will be changed back when they
10039         fix most of current BCL warnings.
10040         
10041         * RootContext.cs: Pushed default WarningLevel to 3.
10042         
10043         * statement.cs: Removed unused variable.
10044
10045 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
10046
10047         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
10048         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
10049         Add error 502 report.
10050         (StaticClass.DefineType): Add error 441 report.
10051         (Class.AllowedModifiersProp): New virtual property as temporary
10052         extension to AllowedModifiers.
10053         (Class.DefineType): Add error 418 report. Moved ModFlags check here
10054         to share implementation with StaticClass and don't call virtual
10055         methods from ctor.
10056         
10057         * driver.cs (MainDriver): Add error 1558 test.
10058
10059         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
10060         report. Moved error 36 test here.
10061
10062         * statement.cs (Throw.Resolve): Add error 724 report.
10063
10064         * typemanager.cs: Add out_attribute_type core type.
10065         
10066 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
10067
10068         * class.cs (TypeContainer.VerifyClsCompliance): Add error
10069         3018 report.
10070         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
10071
10072         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
10073         3017 report.
10074         
10075         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
10076
10077         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
10078         Add error 3023 report.
10079         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
10080
10081         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
10082         implementation.
10083
10084 2004-12-12  John Luke  <john.luke@gmail.com>
10085
10086         * driver.cs (AddArgs): take -- into account when
10087         adding arguments, fixes bug 65710 
10088
10089 2004-12-12  Martin Baulig  <martin@ximian.com>
10090
10091         * expression.cs (Unary.TryReduceNegative): Added support for
10092         SByteConstant and ByteConstant.
10093         (Unary.Reduce): Check error values from TryReduceNegative().
10094
10095 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
10096
10097         * attributes.cs (Attribute.Resolve): Avoid multiple error report
10098         and report exception as error 182.
10099
10100 2004-12-10  Raja R Harinath  <rharinath@novell.com>
10101
10102         * driver.cs (Main): Fix message when there are warnings.
10103
10104 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
10105
10106         * delegate.cs: Fixed my fix from yesterday, sorry about that.
10107
10108 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
10109
10110         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
10111         Reduced number of warnings.
10112         
10113         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
10114
10115 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
10116
10117         * driver.cs: Removed message.
10118
10119         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
10120
10121 2004-12-08    <vargaz@freemail.hu>
10122
10123         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
10124
10125 2004-12-08  Martin Baulig  <martin@ximian.com>
10126
10127         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
10128         instead of a CS3002 for properties and indexer.
10129
10130 2004-12-08  Martin Baulig  <martin@ximian.com>
10131
10132         * decl.cs (MemberName.ToString): Make this work again.
10133
10134 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
10135
10136         * attribute.cs (Resolve): Add error 591 detection.
10137
10138         * class.cs (FieldMember.Define): Add error 1547 detection.
10139         (Indexer.Define): Add error 620 detection.
10140         (Operator.Define): Add error 590 detection.
10141
10142         * ecore.cs: Missing argument for error 79.
10143
10144         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
10145         detection.
10146
10147 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
10148
10149         Fix #70106
10150         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
10151         only.
10152
10153 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
10154
10155         * cs-parser.jay : handle doc comments on implicit/explicit operators.
10156           Some operator comments were suppressed.
10157         * doc.cs : Implicit/explicit operator name in doc comments are like
10158           "op_Explicit(type)~returnType", so added suffix handling.
10159
10160 2004-12-07  Martin Baulig  <martin@ximian.com>
10161
10162         * decl.cs
10163         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
10164         (MemberCore.GetClsCompliantAttributeValue): Likewise.
10165         (DeclSpace.ec): New protected field; store the EmitContext here.
10166         (DeclSpace.EmitContext): New public property; moved here from
10167         `TypeContainer'.
10168         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
10169         EmitContext.
10170
10171         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
10172         (Enum.Emit): Don't create a new EmitContext.
10173
10174         * delegate.cs (Delegate.DefineType): Always create the
10175         EmitContext.
10176
10177         * iterators.cs (Iterators.DefineIterator): Create a new
10178         EmitContext and store it in `ec'.
10179
10180 2004-08-24  Martin Baulig  <martin@ximian.com>
10181
10182         * typemanager.cs
10183         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
10184         this for accessibility checks.
10185         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
10186         IsNestedFamilyAccessible.
10187         (TypeManager.IsSubclassOf): New method, do what the name actually
10188         says.   
10189
10190 2004-12-06  Raja R Harinath  <rharinath@novell.com>
10191
10192         Fix crash on cs0657-17.cs.
10193         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10194         Use RootContext.Tree.Types, not 'new RootTypes ()'.
10195         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
10196         the case where the NamespaceEntry gets overwritten.
10197
10198 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
10199
10200         Fixed #69195, #56821
10201         * ecore.cs (ResolveBoolean): Tiny refactoring.
10202
10203         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
10204         of right expression resolving when left is false constant and
10205         operator is LogicalAnd OR true constant and operator is LogicalOr.
10206
10207         * statement.cs (ResolveUnreachable): Always reports warning.
10208
10209 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
10210
10211         * class.cs: Distinguish between 1721 and 1722 (just a little help
10212         for the programmer).
10213
10214 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
10215
10216         * delegate.cs: Only allow this on new versions of the language. 
10217
10218 2004-12-02  Duncan Mak  <duncan@ximian.com>
10219
10220         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
10221         Expression class.
10222         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
10223         here as a static method. Take an additional bool out parameter
10224         `must_do_cs1540_check' for signaling to InstanceResolve.
10225         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
10226         member field from PropertyExpr class and made it an argument of
10227         the method instead.
10228         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
10229         check for MarshalByRefObject, and report CS0122 instead of CS1540.
10230         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
10231         and `remove_accessor' as well as InstanceResolve: report CS0122
10232         where applicable.
10233
10234         Fixes #70129.
10235
10236 2004-12-03  Raja R Harinath  <rharinath@novell.com>
10237
10238         Fix test-327.cs, test-328.cs, and put in early infrastructure
10239         for eventually fixing #52697.
10240         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
10241         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
10242         from other methods.
10243         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
10244         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
10245         (VerifyUsing, error246): Update.
10246         * rootcontext.cs (RootContext.NamespaceLookup): Just use
10247         'NamespaceEntry.LookupNamespaceOrType'.
10248
10249 2004-12-03  Martin Baulig  <martin@ximian.com>
10250
10251         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10252         method as our child, call AnonymousMethod.Compatible() on it.
10253
10254 2004-12-03  Raja R Harinath  <rharinath@novell.com>
10255
10256         Disable XML documentation support in 'basic' profile.
10257         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
10258         Redirect XmlElement to System.Object.
10259         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
10260         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
10261         * mcs.exe.sources: Add doc-bootstrap.cs.
10262         * doc-bootstrap.cs: New file.  Contains empty stub implementation
10263         of doc.cs.
10264
10265 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
10266
10267         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
10268           comments are allowed.
10269
10270 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10271
10272         * delegate.cs: Add checks for subtypes in paramaters and return values
10273         in VerifyMethod () to add support for Covariance/Contravariance
10274         in delegates.
10275         
10276 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
10277
10278         * report.cs: Remove extra closing parenthesis.
10279
10280         * convert.cs (Error_CannotImplicitConversion): If the name of the
10281         types are the same, provide some extra information.
10282
10283         * class.cs (FieldBase): Use an unused bit field from the field to
10284         encode the `has_offset' property from the FieldMember.  This saves
10285         a couple of Ks on bootstrap compilation.
10286
10287         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10288         method as our child, return the AnonymousMethod resolved
10289         expression.
10290
10291         * expression.cs (New.DoResolve): Allow return values from
10292         NewDelegate to also include AnonymousMethods.
10293
10294         Fixes #70150.
10295
10296 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
10297
10298         Fix bug #70102
10299         * attribute.cs (Resolve): Improved implementation of params
10300         attribute arguments.
10301
10302         * support.cs (ParameterData): Add HasParams to be faster.
10303
10304 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
10305
10306         all things are for /doc support:
10307
10308         * doc.cs: new file that supports XML documentation generation.
10309         * mcs.exe.sources: added doc.cs.
10310         * driver.cs:
10311           Handle /doc command line option.
10312           Report error 2006 instead of 5 for missing file name for /doc.
10313           Generate XML documentation when required, after type resolution.
10314         * cs-tokenizer.cs:
10315           Added support for picking up documentation (/// and /** ... */),
10316           including a new XmlCommentState enumeration.
10317         * cs-parser.jay:
10318           Added lines to fill Documentation element for field, constant,
10319           property, indexer, method, constructor, destructor, operator, event
10320           and class, struct, interface, delegate, enum.
10321           Added lines to warn incorrect comment.
10322         * rootcontext.cs :
10323           Added Documentation field (passed only when /doc was specified).
10324         * decl.cs:
10325           Added DocComment, DocCommentHeader, GenerateDocComment() and
10326           OnGenerateDocComment() and some supporting private members for
10327           /doc feature to MemberCore.
10328         * class.cs:
10329           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
10330         * delegate.cs:
10331           Added overriden DocCommentHeader.
10332         * enum.cs:
10333           Added overriden DocCommentHeader and GenerateDocComment().
10334
10335 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
10336
10337         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
10338         unwrapping the enumeration values, chain to
10339         DoConstantNumericPromotions again, so we can promote things to the
10340         fundamental types (takes care of enums that are bytes, sbytes).
10341
10342         Fixes bug #62054.
10343
10344 2004-12-01  Raja R Harinath  <rharinath@novell.com>
10345
10346         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
10347         Fix long-standing bug in type-lookup.  Use FindType instead of
10348         LookupType when ec.ResolvingTypeTree.
10349         (Attribute.ResolveType, Attribute.Resolve)
10350         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
10351         Update to changes.
10352         (Attributes.Search): Remove internal version.  Update.
10353         (Attributes.SearchMulti): Update.
10354         (Attributes.GetClsCompliantAttribute): Remove.
10355         (Attributes.GetIndexerNameAttribute): Remove.
10356         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
10357         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
10358         * class.cs (Indexer.Define): Likewise.
10359
10360 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
10361
10362         Fix bug #68790
10363         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
10364         MarshallByReference members access.
10365
10366         * expression.cs: Use CheckMarshallByRefAccess;
10367         Better error CS0197 message.
10368
10369         * report.cs: Print whole related error message.
10370
10371 2004-11-30  Raja R Harinath  <rharinath@novell.com>
10372
10373         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
10374         the current directory to help debugging.
10375
10376 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
10377
10378         * class (GetClassBases): Better error 60 report.
10379         (EventProperty): Disabled warning 67 detection.
10380
10381 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
10382
10383         Fix bug #60324
10384         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
10385
10386         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
10387         precise values.
10388
10389 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
10390
10391         Fix bug #49488
10392         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
10393
10394         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
10395
10396 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
10397
10398         * attribute.cs (Attribute.Resolve): Refine error reporting and
10399         report a cs0117 if the identifier does not exist, to distinguish
10400         from 0617 which is a miss-use of the actual identifier.
10401
10402         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
10403         between cs0070 and cs0079.
10404
10405         * class.cs (MemberBase.DoDefine): When reporting a wrong
10406         accessibility level, we use MethodCore to compare instead of
10407         Method (this was a regression in some refactoring effort).
10408
10409         So now we correctly report cs0056 again.
10410
10411         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
10412         testing the target_type (which was known to be object_type) and
10413         not the source type (which is anonymous_method).
10414
10415         Fixed reporting of error cs1660.
10416
10417         * expression.cs (UserCast.Source): Expose the underlying cast.
10418
10419         * statement.cs (Switch.SwitchGoverningType): Sort the list of
10420         allowed types to find a match to int32 first (most common).
10421
10422         In addition, it ignores any ImplicitUserConversions that did an
10423         internal implicit conversion (as the switch statement allows only
10424         one integral conversion to exist).
10425
10426         * class.cs (PartialContainer.Create): rename `name' to
10427         `member_name' for clarity.  Then replace the string calls with a
10428         call to MemberName.GetPartialName, as now using
10429         MemberName.ToString is an error (this is due to the side effects
10430         it had, that were fixed in the past).
10431
10432         This will restore the error reporting on a number of partial class
10433         errors that were missusing this (and getting an exception as a
10434         results, which is now just a plain textual warning, because
10435         yyparse debug output would crash otherwise).
10436
10437 2004-11-26  Raja R Harinath  <rharinath@novell.com>
10438
10439         * Makefile (PROGRAM_INSTALL_DIR): Remove.
10440
10441 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
10442
10443         * rootcontext.cs (LookupType): Make sure to cache lookups that
10444         don't give us a negative result. This saves about 5% of corlib
10445         compilation time.
10446
10447 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
10448
10449         * report.cs (AbstractMessage.Print): messages are sent to stderr
10450
10451         * class.cs (TypeContainer.GetClassBases): It is an error to have a
10452         non-interface in the list of interfaces (at this point, either
10453         parent was properly set, or a base class is being listed in the
10454         interfaces section).
10455
10456         This flags error 1722, and resolves the crash from bug 69259.
10457
10458 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
10459
10460         * statement.cs (Using.EmitExpressionFinally): make this work right
10461         for valuetypes. Fixes 69926.
10462
10463 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
10464
10465         * const.cs (Const.ChangeType): Cope with the "0 literal can be
10466         converted to an enum" here, before we try to change the underlying
10467         type.  This code exists, but it is a different code path than the
10468         one used while encoding constants.
10469
10470         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
10471         old bug: when converting from the null literal to a pointer,
10472         return an EmptyCast, not the NullLiteral.
10473
10474         This fixes #69921, the recent null_type changes probably made this
10475         bug more prominent.
10476
10477         (ImplicitReferenceConversionExists): In addition, resynchronized
10478         the code here, so it matches the same code in
10479         ImplicitReferenceConversionExists for the `from any class-type S
10480         to any interface-type T'.
10481         
10482
10483 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
10484
10485         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
10486
10487 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
10488
10489         * cs-parser.jay: Use verbosity accordingly. 
10490
10491 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
10492
10493         * expression.cs (Unary.ResolveOperator): Do not report warning;
10494         AddressOf reads from variable.
10495         
10496         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
10497
10498 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
10499
10500         Fix bug #69462
10501
10502         * attribute.cs (Attributable): Removed CheckTargets.
10503         (Attributes.Emit): Explicit attribute targets are tested here.
10504
10505         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
10506         not enabled for interfaces.
10507
10508         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
10509         (GetAssemblyName): Ouch next bug there.
10510
10511 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10512
10513         * expression.cs: Error 275 added.
10514         
10515 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
10516
10517         Fix bug #69177 (Implemented decimal constant support)
10518
10519         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
10520         (BinaryFold): Add DecimalConstant.
10521
10522         * const.cs (Define): Decimal constant 
10523         (is not constant.
10524         (ChangeType): Add decimal type handling.
10525         (LookupConstantValue): Don't set value for decimal type but
10526         emit DecimalConstantAttribute. Needed for constant optimization.
10527
10528         * constant.cs (ToDecimal): New method.
10529         (ConvertToDecimal): New method.
10530         (IntConstant): Implemented ConvertToDecimal.
10531         (DecimalConstant.Emit): Emit optimized version for decimals in
10532         int range.
10533
10534         * expression.cs (ResolveOperator): Changed order of constant
10535         reduction to work correctly with native types which have
10536         overloaded operators.
10537         (ResolveMemberAccess): Extract constant value from attribute
10538         for decimal type.
10539
10540         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
10541
10542         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
10543         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
10544         (ChangeType): Decimal is special.
10545         (TypeToCoreType): Add decimal type.
10546
10547 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
10548
10549         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
10550         decimal types.
10551
10552 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
10553
10554         * class.cs (EventField.ApplyAttributeBuilder): Fix error
10555         test cs1667-5.cs.
10556
10557 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
10558
10559         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
10560
10561         * pending.cs (PendingImplementation): Grab only interfaces.
10562
10563 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
10564
10565         * statement.cs (ForeachHelperMethods): Add location member and
10566         error 202 detection.
10567
10568 2004-11-19  Raja R Harinath  <rharinath@novell.com>
10569
10570         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
10571         automatically handled by executable.make.
10572         (PROGRAM): Make profile-specific.
10573
10574 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
10575
10576         * expression.cs (DoResolveBase): Fixed wrong warning for out
10577         variables.
10578
10579 2004-11-18  Martin Baulig  <martin@ximian.com>
10580
10581         Merged latest changes into gmcs.  Please keep this comment in
10582         here, it makes it easier for me to see what changed in MCS since
10583         the last time I merged.
10584
10585 2004-11-17  Raja R Harinath  <rharinath@novell.com>
10586
10587         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
10588         (TypeHandle.GetMemberCache): New.
10589         (TypeHandle.TypeHandle): Update.
10590         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
10591         (TypeManager.LookupParentInterfacesCache):
10592         Rename from LookupInterfaceCache.  Optimize slightly.
10593         (TypeManager.MemberLookup_FindMembers): Update.
10594         * decl.cs (MemberCache.MemberCache): Set Container to null in the
10595         multi-type variant.
10596         (AddCacheContents): Rename from AddHashtable.
10597         * class.cs (TypeContainer.parent_container): Remove.
10598         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
10599         (TypeContainer.DoDefineMembers): Don't initialize it.
10600         Update to name changes.
10601         
10602 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
10603
10604         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
10605         that factors the code to check access modifiers on override.  
10606
10607         (PropertyBase): Use the code here.
10608
10609         Patch from Lluis S'anchez, fixes bug #69361.
10610
10611 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
10612
10613         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
10614         routine that is used to report the use of a captured variable
10615         whose address has been taken.
10616
10617         There are two checks: one when variables are being captured and
10618         the other check is when the address of a variable is taken. 
10619         
10620         (because an anonymous methods might be resolved before *or* after
10621         the address has been taken) and 
10622
10623         * expression.cs (Conditional.DoResolve): Remove the special
10624         casing that Martin added to trueExpr and falseExpr being both
10625         NullLiteral.  We get the right behavior now just by introducing
10626         the null_type into the compiler. 
10627
10628         * convert.cs (ExplicitConversion): Change the code to use
10629         null_type instead of testing `expr is NullLiteral'.
10630         (ImplicitConversionStandard): use null_type too.
10631         (ImplicitReferenceConversionExists): use null_type too.
10632         (ImplicitReferenceConversion): use null_type too.
10633
10634         * literal.cs: The type of `NullLiteral' is now null_type instead
10635         of object_type. 
10636         (Resolve): Set the type here.
10637
10638         * typemanager.cs: Introduce null_type.
10639
10640 2004-11-17  Martin Baulig  <martin@ximian.com>
10641
10642         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
10643         direction, like FindMembers() does.  Fixes #69546, testcase is in
10644         test-315.cs.    
10645
10646 2004-11-16  Martin Baulig  <martin@ximian.com>
10647
10648         This is based on a patch from Marek Safar, see bug #69082.
10649         Fixes bugs #63705 and #67130.
10650
10651         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
10652         method; create a MemberCache for an interface type and cache the
10653         result.
10654
10655         * decl.cs (IMemberContainer.ParentContainer): Removed.
10656         (IMemberContainer.ParentCache): New property.
10657         (MemberCache.SetupCacheForInterface): Removed.
10658         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
10659         to create a cache for an interface's "parent".
10660
10661         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
10662         interfaces too.
10663
10664 2004-11-16  Martin Baulig  <martin@ximian.com>
10665
10666         Merged back from gmcs; these changes already went into gmcs a
10667         couple of weeks ago.
10668
10669         * typemanager.cs
10670         (TypeManager.AddUserType): Removed the `ifaces' argument.
10671         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
10672         `TypeExpr []'.
10673         (TypeManager.AddUserInterface): Removed.
10674         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
10675         `TypeExpr []'.
10676         (TypeManager.GetInterfaces): Likewise.
10677         (TypeManager.GetExplicitInterfaces): Likewise.
10678
10679         * ecore.cs (TypeExpr.GetInterfaces): Removed.
10680
10681         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
10682         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
10683
10684 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
10685
10686         * statement.cs: Avoid adding bools to a hashtable.
10687
10688 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
10689
10690         * expression.cs (Invocation.OverloadResolve): Flag error if we are
10691         calling an unsafe method from a safe location.
10692
10693 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
10694
10695         Fix #69167
10696         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
10697
10698 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
10699
10700         * namespace.cs (VerifyUsing): use GetPartialName instead of
10701         ToString. 
10702
10703 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
10704
10705         * statement.cs (Return.Resolve): Fix regression in typo: if
10706         `in_exc', we have to request a NeedReturnLabel, this was a typo
10707         introduced in the anonymous method check-in.  Fixes #69131.
10708
10709         * Indexers were using the ShortName when defining themselves,
10710         causing a regression in the compiler bootstrap when applying the
10711         patch from 2004-11-02 (first part), now they use their full name
10712         and the bug is gone.
10713
10714 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
10715
10716         * driver.cs: Strip the path from the names of embedded resources. Fixes
10717         #68519.
10718
10719 2004-11-04  Raja R Harinath  <rharinath@novell.com>
10720
10721         Fix error message regression: cs0104-2.cs.
10722         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
10723         (AliasEntry.Resolve): Update.
10724         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
10725         'silent' flag.
10726         (RootContext.LookupType): Update.
10727
10728 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
10729
10730         * cs-parser.jay: Add support for handling accessor modifiers
10731         * class: Add support port accessor modifiers and error checking,
10732         define PropertyMethod.Define as virtual (not abstract anymore)
10733         * ecore.cs: Add checking for proeprties access with access modifiers
10734         * iterators.cs: Modify Accessor constructor call based in the modified
10735         constructor
10736 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
10737
10738         * expression.cs (StringConcat): Handle being called twice,
10739         as when we have a concat in a field init with more than two
10740         ctors in the class
10741
10742 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
10743
10744         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
10745         special case explicit implementations, we should always produce
10746         the .property or .event declaration.
10747         
10748         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
10749         since it will not return correct data if people use this
10750         unresolved in the presence of using statements (see test-313).
10751
10752         * class.cs (MethodData.Define): If we are an explicit interface
10753         implementation, set the method name to the full name of the
10754         interface plus the name of the method.  
10755
10756         Notice that using the method.MethodName.GetFullName() does not
10757         work, as it will only contain the name as declared on the source
10758         file (it can be a shorthand in the presence of using statements)
10759         and not the fully qualifed type name, for example:
10760
10761         using System;
10762
10763         class D : ICloneable {
10764                 object ICloneable.Clone ()  {
10765                 }
10766         }
10767
10768         Would produce a method called `ICloneable.Clone' instead of
10769         `System.ICloneable.Clone'.
10770
10771         * namespace.cs (Alias.Resolve): Use GetPartialName.
10772         
10773 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
10774
10775         * cs-parser.jay: Add error 1055 report.
10776
10777 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
10778
10779         * assign.cs (Assign.DoResolve): Only do the transform of
10780         assignment into a New if the types are compatible, if not, fall
10781         through and let the implicit code deal with the errors and with
10782         the necessary conversions. 
10783
10784 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
10785
10786         * cs-parser.jay: Add error 1031 report.
10787
10788         * cs-tokenizer.cs: Add location for error 1038.
10789
10790 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
10791
10792         * cs-parser.jay: Add error 1016 report.
10793
10794 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
10795
10796         * cs-parser.jay: Add errors 1575,1611 report.
10797
10798 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
10799
10800         * cs-parser.jay: Add error 1001 report.
10801
10802 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
10803
10804         Fix #68850
10805         * attribute.cs (GetMarshal): Add method argument for
10806         caller identification.
10807
10808         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
10809         agument for GetMarshal and RuntimeMissingSupport.
10810
10811 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
10812
10813         * attribute.cs (ExtractSecurityPermissionSet): Removed
10814         TypeManager.code_access_permission_type.
10815
10816         * typemanager.cs: Removed TypeManager.code_access_permission_type.
10817
10818 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
10819
10820         * expression.cs (LocalVariableReference.DoResolveLValue): Check
10821         for obsolete use of a variable here.   Fixes regression on errors
10822         cs0619-25 and cs0619-26.
10823
10824 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
10825
10826         Fix #62358, implemented security attribute encoding.
10827
10828         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
10829         Tests permitted SecurityAction for assembly or other types.
10830         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
10831         data from SecurityPermissionAttribute to PermisionSet class.
10832
10833         * class.cs (ApplyAttributeBuilder): Added special handling
10834         for System.Security.Permissions.SecurityAttribute based types.
10835
10836         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
10837         special handling for System.Security.Permissions.SecurityAttribute
10838         based types.
10839
10840         * enum.cs (ApplyAttributeBuilder): Added special handling
10841         for System.Security.Permissions.SecurityAttribute based types.
10842
10843         * parameter.cs (ApplyAttributeBuilder): Added special handling
10844         for System.Security.Permissions.SecurityAttribute based types.
10845
10846         * rootcontext.cs: Next 2 core types.
10847
10848         * typemanager.cs (TypeManager.security_permission_attr_type):
10849         Built in type for the SecurityPermission Attribute.
10850         (code_access_permission_type): Build in type.
10851
10852 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
10853
10854         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
10855         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
10856         all of this information into
10857         EmitContext.EmitCapturedVariableInstance.
10858         
10859         * codegen.cs (EmitCapturedVariableInstance): move here the
10860         funcionality of emitting an ldarg.0 in the presence of a
10861         remapping.   This centralizes the instance emit code.
10862
10863         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
10864         then emit a load of this: it means that we have reached the
10865         topmost ScopeInfo: the one that contains the pointer to the
10866         instance of the class hosting the anonymous method.
10867
10868         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
10869         captures to the topmost CaptureContext.
10870
10871 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
10872
10873         * expression.cs (LocalVariableReference): Move the knowledge about
10874         the iterators into codegen's EmitCapturedVariableInstance.
10875
10876 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
10877
10878         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
10879         all code paths return a value from an anonymous method (it is the
10880         same as the 161 error, but for anonymous methods).
10881
10882 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
10883
10884         The introduction of anonymous methods in the compiler changed
10885         various ways of doing things in the compiler.  The most
10886         significant one is the hard split between the resolution phase
10887         and the emission phases of the compiler.
10888
10889         For instance, routines that referenced local variables no
10890         longer can safely create temporary variables during the
10891         resolution phase: they must do so from the emission phase,
10892         since the variable might have been "captured", hence access to
10893         it can not be done with the local-variable operations from the runtime.
10894         
10895         * statement.cs 
10896
10897         (Block.Flags): New flag `IsTopLevel' to indicate that this block
10898         is a toplevel block.
10899
10900         (ToplevelBlock): A new kind of Block, these are the blocks that
10901         are created by the parser for all toplevel method bodies.  These
10902         include methods, accessors and anonymous methods.
10903
10904         These contain some extra information not found in regular blocks:
10905         A pointer to an optional CaptureContext (for tracking captured
10906         local variables and parameters).  A pointer to the parent
10907         ToplevelBlock.
10908         
10909         (Return.Resolve): Catch missmatches when returning a value from an
10910         anonymous method (error 1662).
10911         Invoke NeedReturnLabel from the Resolve phase instead of the emit
10912         phase.
10913
10914         (Break.Resolve): ditto.
10915
10916         (SwitchLabel): instead of defining the labels during the
10917         resolution phase, we now turned the public ILLabel and ILLabelCode
10918         labels into methods called GetILLabelCode() and GetILLabel() that
10919         only define the label during the Emit phase.
10920
10921         (GotoCase): Track the SwitchLabel instead of the computed label
10922         (its contained therein).  Emit the code by using
10923         SwitchLabel.GetILLabelCode ().
10924
10925         (LocalInfo.Flags.Captured): A new flag has been introduce to track
10926         whether the Local has been captured or not.
10927
10928         (LocalInfo.IsCaptured): New property, used to tell whether the
10929         local has been captured.
10930         
10931         * anonymous.cs: Vastly updated to contain the anonymous method
10932         support.
10933
10934         The main classes here are: CaptureContext which tracks any
10935         captured information for a toplevel block and ScopeInfo used to
10936         track the activation frames for various local variables.   
10937
10938         Each toplevel block has an optional capture context associated
10939         with it.  When a method contains an anonymous method both the
10940         toplevel method and the anonymous method will create a capture
10941         context.   When variables or parameters are captured, they are
10942         recorded on the CaptureContext that owns them, for example:
10943
10944         void Demo () {
10945              int a;
10946              MyDelegate d = delegate {
10947                  a = 1;
10948              }
10949         }
10950
10951         Here `a' will be recorded as captured on the toplevel
10952         CapturedContext, the inner captured context will not have anything
10953         (it will only have data if local variables or parameters from it
10954         are captured in a nested anonymous method.
10955
10956         The ScopeInfo is used to track the activation frames for local
10957         variables, for example:
10958
10959         for (int i = 0; i < 10; i++)
10960                 for (int j = 0; j < 10; j++){
10961                    MyDelegate d = delegate {
10962                         call (i, j);
10963                    }
10964                 }
10965
10966         At runtime this captures a single captured variable `i', but it
10967         captures 10 different versions of the variable `j'.  The variable
10968         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
10969         recorded on a child.  
10970
10971         The toplevel ScopeInfo will also track information like the `this'
10972         pointer if instance variables were referenced (this is necessary
10973         as the anonymous method lives inside a nested class in the host
10974         type of the method). 
10975
10976         (AnonymousMethod): Expanded to track the Toplevel, implement
10977         `AnonymousMethod.Compatible' to tell whether an anonymous method
10978         can be converted to a target delegate type. 
10979
10980         The routine now also produces the anonymous method content
10981
10982         (AnonymousDelegate): A helper class that derives from
10983         DelegateCreation, this is used to generate the code necessary to
10984         produce the delegate for the anonymous method that was created. 
10985
10986         * assign.cs: API adjustments for new changes in
10987         Convert.ImplicitStandardConversionExists.
10988
10989         * class.cs: Adjustments to cope with the fact that now toplevel
10990         blocks are of type `ToplevelBlock'. 
10991
10992         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
10993         insteda of standard blocks.
10994
10995         Flag errors if params arguments are passed to anonymous methods.
10996
10997         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
10998         `CurrentAnonymousMethod' which points to the current Anonymous
10999         Method.  The variable points to the AnonymousMethod class that
11000         holds the code being compiled.  It is set in the new EmitContext
11001         created for the anonymous method.
11002
11003         (EmitContext.Phase): Introduce a variable and an enumeration to
11004         assist in enforcing some rules about when and where we are allowed
11005         to invoke certain methods (EmitContext.NeedsReturnLabel is the
11006         only one that enfonces this right now).
11007
11008         (EmitContext.HaveCaptureInfo): new helper method that returns
11009         whether we have a CapturedContext initialized.
11010
11011         (EmitContext.CaptureVariable): New method used to register that a
11012         LocalInfo must be flagged for capturing. 
11013
11014         (EmitContext.CapturedParameter): New method used to register that a
11015         parameters must be flagged for capturing. 
11016         
11017         (EmitContext.CapturedField): New method used to register that a
11018         field must be flagged for capturing. 
11019
11020         (EmitContext.HaveCapturedVariables,
11021         EmitContext.HaveCapturedFields): Return whether there are captured
11022         variables or fields. 
11023
11024         (EmitContext.EmitMethodHostInstance): This is used to emit the
11025         instance for the anonymous method.  The instance might be null
11026         (static methods), this (for anonymous methods that capture nothing
11027         and happen to live side-by-side with the current method body) or a
11028         more complicated expression if the method has a CaptureContext.
11029
11030         (EmitContext.EmitTopBlock): Routine that drives the emission of
11031         code: it will first resolve the top block, then emit any metadata
11032         and then emit the code.  The split is done so that we can extract
11033         any anonymous methods and flag any captured variables/parameters.
11034         
11035         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
11036         during this phase, the ILGenerator should not be used as labels
11037         and local variables declared here might not be accessible to any
11038         code that is part of an anonymous method.  
11039
11040         Exceptions to this include the temporary variables that are
11041         created by some statements internally for holding temporary
11042         variables. 
11043         
11044         (EmitContext.EmitMeta): New routine, in charge of emitting all the
11045         metadata for a cb
11046
11047         (EmitContext.TemporaryReturn): This method is typically called
11048         from the Emit phase, and its the only place where we allow the
11049         ReturnLabel to be defined other than the EmitMeta.  The reason is
11050         that otherwise we would have to duplicate a lot of logic in the
11051         Resolve phases of various methods that today is on the Emit
11052         phase. 
11053
11054         (EmitContext.NeedReturnLabel): This no longer creates the label,
11055         as the ILGenerator is not valid during the resolve phase.
11056
11057         (EmitContext.EmitThis): Extended the knowledge in this class to
11058         work in anonymous methods in addition to iterators. 
11059
11060         (EmitContext.EmitCapturedVariableInstance): This emits whatever
11061         code is necessary on the stack to access the instance to a local
11062         variable (the variable will be accessed as a field).
11063
11064         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
11065         EmitContext.EmitAddressOfParameter): Routines to support
11066         parameters (not completed at this point). 
11067         
11068         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
11069         will also remove the parameters.
11070
11071         * convert.cs (Convert): Define a `ConstantEC' which points to a
11072         null.  This is just to prefity some code that uses
11073         ImplicitStandardConversion code and do not have an EmitContext
11074         handy.
11075
11076         The idea is to flag explicitly that at that point in time, it is
11077         known that the conversion will not trigger the delegate checking
11078         code in implicit conversions (which requires a valid
11079         EmitContext). 
11080
11081         Everywhere: pass new EmitContext parameter since
11082         ImplicitStandardConversionExists now requires it to check for
11083         anonymous method conversions. 
11084
11085         (Convert.ImplicitStandardConversionExists): If the type of an
11086         expression is the anonymous_method_type, and the type is a
11087         delegate, we invoke the AnonymousMethod.Compatible method to check
11088         whether an implicit conversion is possible. 
11089
11090         (Convert.ImplicitConversionStandard): Only do implicit method
11091         group conversions if the language level is not ISO_1.
11092
11093         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
11094         MethodInfo for the Invoke method.  used by Delegate and
11095         AnonymousDelegate.
11096
11097         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
11098         method conversions if the target type is a delegate.
11099
11100         Removed extra debugging nops.
11101
11102         (LocalVariableReference): Turn the `local_info' into a public
11103         field. 
11104
11105         Add `prepared' field, the same hack used for FieldExprs to cope
11106         with composed assignments, as Local variables do not necessarily
11107         operate purely on the stack as they used to: they can be captured
11108         fields. 
11109
11110         Add `temp' for a temporary result, like fields.
11111
11112         Refactor DoResolve and DoResolveLValue into DoResolveBase.
11113
11114         It now copes with Local variables that are captured and emits the
11115         proper instance variable to load it from a field in the captured
11116         case. 
11117
11118         (ParameterReference.DoResolveBase): During the resolve phase,
11119         capture parameters if we are in an anonymous method.
11120
11121         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
11122         anonymous method, use the EmitContext helper routines to emit the
11123         parameter reference.
11124
11125         * iterators.cs: Set RemapToProxy to true/false during the
11126         EmitDispose class.
11127
11128         * parameters.cs (GetParameterByName): New helper method. 
11129
11130         * typemanager.cs (anonymous_method_type) a new type that
11131         represents an anonyous method.  This is always an internal type,
11132         used as a fencepost to test against the anonymous-methodness of an
11133         expression. 
11134         
11135 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
11136
11137         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
11138         561 report.
11139         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
11140
11141 2004-10-18  Martin Baulig  <martin@ximian.com>
11142
11143         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
11144         `Type' directly, but call ResolveType() on it.
11145         (Catch.Resolve): Likewise.
11146         (Foreach.Resolve): Likewise.
11147
11148 2004-10-18  Martin Baulig  <martin@ximian.com>
11149
11150         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
11151         `Type' directly, but call ResolveType() on it.
11152         (Probe.DoResolve): Likewise.
11153         (ArrayCreation.LookupType): Likewise.
11154         (TypeOf.DoResolve): Likewise.
11155         (SizeOf.DoResolve): Likewise.
11156
11157 2004-10-18  Martin Baulig  <martin@ximian.com>
11158
11159         * expression.cs (Invocation.BetterFunction): Put back
11160         TypeManager.TypeToCoreType().
11161
11162 2004-10-18  Raja R Harinath  <rharinath@novell.com>
11163
11164         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
11165         the ResolveType.
11166
11167 2004-10-18  Martin Baulig  <martin@ximian.com>
11168
11169         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
11170         `Type' directly, but call ResolveType() on it.
11171
11172 2004-10-18  Martin Baulig  <martin@ximian.com>
11173
11174         * class.cs (FieldMember.Define): Don't access the TypeExpr's
11175         `Type' directly, but call ResolveType() on it.
11176         (MemberBase.DoDefine): Likewise.
11177
11178         * expression.cs (New.DoResolve): Don't access the TypeExpr's
11179         `Type' directly, but call ResolveType() on it.
11180         (ComposedCast.DoResolveAsTypeStep): Likewise.
11181
11182         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
11183         `Type' directly, but call ResolveType() on it.
11184
11185 2004-10-17  John Luke  <john.luke@gmail.com>
11186
11187         * class.cs (Operator.GetSignatureForError): use CSharpName
11188
11189         * parameter.cs (Parameter.GetSignatureForError): Returns
11190         correct name even if was not defined.
11191
11192 2004-10-13  Raja R Harinath  <rharinath@novell.com>
11193
11194         Fix #65816.
11195         * class.cs (TypeContainer.EmitContext): New property.
11196         (DefineNestedTypes): Create an emitcontext for each part.
11197         (MethodCore.DoDefineParameters): Use container's emitcontext.
11198         Pass type array to InternalParameters.
11199         (MemberBase.DoDefine): Use container's emitcontext.
11200         (FieldMember.Define): Likewise.
11201         (Event.Define): Likewise.
11202         (SetMethod.GetParameterInfo): Change argument to EmitContext.
11203         Pass type array to InternalParameters.
11204         (SetIndexerMethod.GetParameterInfo): Likewise.
11205         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
11206         * delegate.cs (Define): Pass emitcontext to
11207         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
11208         array to InternalParameters.
11209         * expression.cs (ParameterReference.DoResolveBase): Pass
11210         emitcontext to GetParameterInfo.
11211         (ComposedCast.DoResolveAsTypeStep): Remove check on
11212         ec.ResolvingTypeTree.
11213         * parameter.cs (Parameter.Resolve): Change argument to
11214         EmitContext.  Use ResolveAsTypeTerminal.
11215         (Parameter.GetSignature): Change argument to EmitContext.
11216         (Parameters.ComputeSignature): Likewise.
11217         (Parameters.ComputeParameterTypes): Likewise.
11218         (Parameters.GetParameterInfo): Likewise.
11219         (Parameters.ComputeAndDefineParameterTypes): Likewise.
11220         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
11221         * support.cs (InternalParameters..ctor): Remove variant that takes
11222         a DeclSpace.
11223         * typemanager.cs (system_intptr_expr): New.
11224         (InitExpressionTypes): Initialize it.
11225
11226 2004-10-12  Chris Toshok  <toshok@ximian.com>
11227
11228         * cs-parser.jay: fix location for try_statement and catch_clause.
11229
11230 2004-10-11  Martin Baulig  <martin@ximian.com>
11231
11232         * report.cs: Don't make --fatal abort on warnings, we have
11233         -warnaserror for that.
11234
11235 2004-10-07  Raja R Harinath  <rharinath@novell.com>
11236
11237         More DeclSpace.ResolveType avoidance.
11238         * decl.cs (MemberCore.InUnsafe): New property.
11239         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
11240         with newly created EmitContext.
11241         (FieldMember.Define): Likewise.
11242         * delegate.cs (Delegate.Define): Likewise.
11243         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
11244         only if normal name-lookup fails.
11245         (TypeExpr.DoResolve): Enable error-checking.
11246         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
11247         (SizeOf.DoResolve): Likewise.
11248         (ComposedCast.DoResolveAsTypeStep): Likewise.
11249         (StackAlloc.DoResolve): Likewise.
11250         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
11251         (Block.Unsafe): New property.
11252         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
11253         (Unsafe): Set 'unsafe' flag of contained block.
11254         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
11255         (Fixed.Resolve): Likewise.
11256         (Catch.Resolve): Likewise.
11257         (Using.ResolveLocalVariableDecls): Likewise.
11258         (Foreach.Resolve): Likewise.
11259
11260 2004-10-05  John Luke <john.luke@gmail.com>
11261
11262         * cs-parser.jay: add location to error CS0175
11263
11264 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
11265
11266         * ecore.cs (Expression.Constantity): Add support for turning null
11267         into a constant.
11268
11269         * const.cs (Const.Define): Allow constants to be reference types
11270         as long as the value is Null.
11271
11272 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
11273
11274         * namespace.cs (NamespaceEntry.Using): No matter which warning
11275         level is set, check if this namespace name has already been added.
11276
11277 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
11278
11279         * expression.cs: reftype [!=]= null should always use br[true,false].
11280         # 67410
11281
11282 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
11283
11284         Fix #67108
11285         * attribute.cs: Enum conversion moved to 
11286         GetAttributeArgumentExpression to be applied to the all
11287         expressions.
11288
11289 2004-10-01  Raja R Harinath  <rharinath@novell.com>
11290
11291         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
11292         * class.c (TypeContainer.DefineType): Flag error if
11293         base types aren't accessible due to access permissions.
11294         * decl.cs (DeclSpace.ResolveType): Move logic to
11295         Expression.ResolveAsTypeTerminal.
11296         (DeclSpace.ResolveTypeExpr): Thin layer over
11297         Expression.ResolveAsTypeTerminal.
11298         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
11299         Refactor code into NestedAccess.  Use it.
11300         (DeclSpace.NestedAccess): New.
11301         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
11302         argument to silence errors.  Check access permissions.
11303         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
11304         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
11305         (Cast.DoResolve): Likewise.
11306         (New.DoResolve): Likewise.
11307         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
11308         (TypeOf.DoResolve): Likewise.
11309
11310         * expression.cs (Invocation.BetterConversion): Return the Type of
11311         the better conversion.  Implement section 14.4.2.3 more faithfully.
11312         (Invocation.BetterFunction): Make boolean.  Make correspondence to
11313         section 14.4.2.2 explicit.
11314         (Invocation.OverloadResolve): Update.
11315         (Invocation): Remove is_base field.
11316         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
11317         (Invocation.Emit): Likewise.
11318
11319 2004-09-27  Raja R Harinath  <rharinath@novell.com>
11320
11321         * README: Update to changes.
11322
11323 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
11324
11325         * cs-parser.jay: Reverted 642 warning fix.
11326
11327 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11328
11329         Fix bug #66615
11330         * decl.cs (FindMemberWithSameName): Indexer can have more than
11331         1 argument.
11332
11333 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11334
11335         * expression.cs (LocalVariableReference.DoResolveLValue):
11336         Do not report warning 219 for out values.
11337         (EmptyExpression.Null): New member to avoid extra allocations.
11338
11339 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11340
11341         * cs-parser.jay: Fix wrong warning 642 report.
11342
11343         * cs-tokenizer.cs (CheckNextToken): New helper;
11344         Inspect next character if is same as expected.
11345
11346 2004-09-23  Martin Baulig  <martin@ximian.com>
11347
11348         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
11349         (Convert.ImplicitReferenceConversionExists): Likewise.
11350
11351 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11352
11353         * class.cs (Operator.Define): Add error 448 and 559 report.
11354
11355 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
11356
11357         * class.cs (MemberBase.IsTypePermitted): New protected
11358         method for checking error CS0610.
11359
11360 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
11361
11362         * class.cs (TypeContainer.HasExplicitLayout): New property
11363         Returns whether container has StructLayout attribute set Explicit.
11364         (FieldMember): New abstract class for consts and fields.
11365         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
11366         (Field): Reuse FieldMember.
11367
11368         * const.cs (Const): Reuse FieldMember.
11369
11370         * rootcontext.cs: EmitConstants call moved to class.
11371
11372 2004-09-22  Martin Baulig  <martin@ximian.com>
11373
11374         Thanks to Peter Sestoft for this bug report.
11375
11376         * expression.cs (Conditional): If both the `trueExpr' and the
11377         `falseExpr' is a NullLiteral, return a NullLiteral.
11378
11379 2004-09-22  Martin Baulig  <martin@ximian.com>
11380
11381         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
11382         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
11383         for the "get_Current" call.
11384
11385 2004-09-22  Martin Baulig  <martin@ximian.com>
11386
11387         Marek and me just fixed one of our oldest bugs: #28562 :-)
11388
11389         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
11390
11391         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
11392         we're an EnumConstant, just return that.
11393         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
11394         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
11395         to get the value which'll actually be written into the attribute.
11396         However, we have to use GetValue() to access the attribute's value
11397         in the compiler.        
11398
11399 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
11400
11401         * constant.cs (Constant.IsNegative): New abstract property
11402         IsNegative.
11403
11404         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
11405         (StackAlloc.DoResolve): Reused IsNegative.
11406
11407 2004-09-21  Martin Baulig  <martin@ximian.com>
11408
11409         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
11410         if we're used in an iterator, we may be called from different
11411         methods.
11412
11413         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
11414         we actually have an exception block.
11415
11416 2004-09-20  John Luke <jluke@cfl.rr.com>
11417
11418         * class.cs, cs-parser.jay: Improve the error report for 1520:
11419         report the actual line where the error happens, not where the
11420         class was declared.
11421
11422         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
11423         Pass location information that was available elsewhere.
11424
11425 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
11426
11427         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
11428         runtime to delay sign assemblies.
11429
11430 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
11431
11432         * cs-parser.jay: Do not report the stack trace, this is barely
11433         used nowadays.
11434
11435 2004-08-22  John Luke  <john.luke@gmail.com>
11436  
11437         * driver.cs : check that a resource id is not already used
11438         before adding it, report CS1508 if it is, bug #63637
11439
11440 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
11441
11442         * ecore.cs: Removed dead code.
11443
11444 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
11445
11446         * class.cs: Do not report warning CS0067 on the interfaces.
11447
11448 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
11449
11450         * cs-parser.jay: Add error 504 report.
11451
11452 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
11453
11454         * rootcontext.cs: WarningLevel is 4 by default now.
11455
11456         * statement.cs (Fixed.Resolve): Do not null
11457         VariableInfo.
11458
11459 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
11460
11461         Fixed bug #55780
11462         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
11463         deep search when property is not virtual.
11464         (PropertyExpr.ResolveAccessors): Make one call for both
11465         accessors.
11466
11467 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11468
11469         Fixed bug #65766
11470         * statement.cs: Error 152 report constains also location.
11471
11472 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11473
11474         Fixed bug #65766
11475         * const.cs: Explicitly set constant as static.
11476
11477 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11478
11479         Fixed bug #64226
11480         * cs-parser.jay: Add error 1017 report.
11481
11482 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11483
11484         Fixed bug #59980, #64224
11485         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
11486
11487         * typemanager.cs (IsSpecialMethod): Simplified
11488
11489 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
11490
11491         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
11492         condition with better params.
11493
11494 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
11495
11496         Fixed bug #65238
11497         * attribute.cs (Resolve): Property has to have both
11498         accessors.
11499
11500 2004-09-14  Martin Baulig  <martin@ximian.com>
11501
11502         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
11503
11504 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
11505
11506         Fixed bug #61902
11507         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
11508         called and is obsolete then this member suppress message
11509         when call is inside next [Obsolete] method or type.
11510
11511         * expression.cs: Use TestObsoleteMethodUsage member.
11512
11513 2004-09-14  Martin Baulig  <martin@ximian.com>
11514
11515         * cs-parser.jay: Sync a bit with the GMCS version.
11516
11517 2004-09-14  Martin Baulig  <martin@ximian.com>
11518
11519         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
11520         (CSharpParser.yacc_verbose_flag): New public field.
11521
11522         * genericparser.cs: Removed.
11523
11524 2004-09-14  Raja R Harinath  <rharinath@novell.com>
11525
11526         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
11527
11528 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
11529
11530         * class.cs (MethodCore.CheckBase): Fix bug #65757.
11531
11532 2004-09-10  Martin Baulig  <martin@ximian.com>
11533
11534         Backported my MemberName changes from GMCS into MCS.
11535
11536         - we are now using a special `MemberName' class instead of using
11537         strings; in GMCS, the `MemberName' also contains the type
11538         arguments.
11539
11540         - changed the grammar rules a bit:
11541           * the old `member_name' is now a `namespace_or_type_name':
11542             The rule is that we use `namespace_or_type_name' everywhere
11543             where we expect either a "member name" (GetEnumerator) or a
11544             "member name" with an explicit interface name
11545             (IEnumerable.GetEnumerator).
11546             In GMCS, the explicit interface name may include type arguments
11547             (IEnumerable<T>.GetEnumerator).
11548           * we use `member_name' instead of just `IDENTIFIER' for
11549             "member names":
11550             The rule is that we use `member_name' wherever a member may
11551             have type parameters in GMCS.       
11552
11553         * decl.cs (MemberName): New public class.
11554         (MemberCore.MemberName): New public readonly field.
11555         (MemberCore.ctor): Take a `MemberName' argument, not a string.
11556         (DeclSpace): Likewise.
11557
11558         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
11559         * enum.cs (Enum.ctor): Likewise.
11560
11561         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
11562         MemberName.     
11563         (AliasEntry.ctor): Take a MemberName, not an Expression.
11564         (AliasEntry.UsingAlias): Likewise.
11565
11566         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
11567         (IMethodData.MemberName): Changed type from string to MemberName.
11568         (MemberBase.ExplicitInterfaceName): Likewise.
11569         (AbstractPropertyEventMethod.SetupName): Make this private.
11570         (AbstractPropertyEventMethod.ctor): Added `string prefix'
11571         argument; compute the member name here.
11572         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
11573         on the `member.MemberName' and the `prefix'.
11574
11575         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
11576         not `type_name'.
11577         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
11578         thus, we get a `MemberName' instead of a `string'.  These
11579         declarations may have type parameters in GMCS.
11580         (interface_method_declaration, delegate_declaration): Likewise.
11581         (class_declaration, interface_declaration): Likewise.
11582         (method_header): Use `namespace_or_type_name' instead of
11583         `member_name'.  We may be an explicit interface implementation.
11584         (property_declaration, event_declaration): Likewise.
11585         (member_name): This is now just an `IDENTIFIER', not a
11586         `namespace_or_type_name'.
11587         (type_name, interface_type): Removed.
11588         (namespace_or_type_name): Return a MemberName, not an Expression.
11589         (primary_expression): Use `member_name' instead of `IDENTIFIER';
11590         call GetTypeExpression() on the MemberName to get an expression.
11591         (IndexerDeclaration.interface_type): Changed type from string to
11592         MemberName.
11593         (MakeName): Operate on MemberName's instead of string's.
11594
11595 2004-09-13  Raja R Harinath  <rharinath@novell.com>
11596
11597         Fix bug #55770.
11598         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
11599         (NamespaceEntry.Lookup): Add new argument to flag if we want the
11600         lookup to avoid symbols introduced by 'using'.
11601         * rootcontext.cs (NamespaceLookup): Update.
11602
11603 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
11604
11605         * class.cs (TypeContainer.DoDefineMembers): Do not call
11606         DefineDefaultConstructor for static classes.
11607
11608 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
11609
11610         * attribute.cs (Attribute.Resolve): Add error 653 report.
11611
11612         * class.cs (Class.ApplyAttributeBuilder): Add error 641
11613         report.
11614         (Method.ApplyAttributeBuilder): Add error 685 report.
11615         (Operator.Define): Add error 564 report.
11616
11617         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
11618
11619         * expression.cs (Invocation.DoResolve): Add error
11620         245 and 250 report.
11621
11622         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
11623         error 674 report.
11624
11625 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
11626
11627         * class.cs (ConstructorInitializer.Resolve):
11628         Wrong error number (515->516).
11629
11630 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
11631
11632         * class.cs (Indexer.Define): Add error 631 report.
11633
11634 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
11635
11636         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
11637
11638 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
11639
11640         * expression.cs (Probe.DoResolve): Add error CS0241 report.
11641
11642 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
11643
11644         * cs-parser.jay: Added error CS0241 report.
11645
11646 2004-09-10  Raja R Harinath  <rharinath@novell.com>
11647
11648         * cs-parser.jay (fixed_statement): Introduce a scope for the
11649         declaration in the 'fixed' statement.
11650
11651 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
11652
11653         * cs-parser.jay: Added CS0230 error report.
11654
11655 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
11656
11657         * cs-parser.jay: Added errors CS0231 and CS0257 report.
11658
11659 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
11660
11661         * expression.cs (Argument.Resolve): Added error CS0192 and
11662         CS0199 report.
11663
11664 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
11665
11666         C# 2.0 #pragma warning feature
11667
11668         * cs-tokenizer.cs (PreProcessPragma): New method; 
11669         Handles #pragma directive.
11670
11671         * report.cs (WarningRegions): New class; Support
11672         class for #pragma warning directive. It tests whether
11673         warning is enabled for a given line.
11674
11675 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
11676
11677         * const.cs: Add more descriptive error report, tahnks to
11678         Sebastien. 
11679
11680 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
11681
11682         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
11683
11684 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
11685
11686         * expression.cs: Apply patch from Ben: Remove dead code from
11687         ArrayCreation, and remove the TurnintoConstant call in const.cs,
11688         as that code just threw an exception anwyays.
11689
11690         * const.cs: Remove the call to the turnintoconstant, for details
11691         see bug: #63144
11692         
11693         * literal.cs: The type of the null-literal is the null type;  So
11694         we use a placeholder type (literal.cs:System.Null, defined here)
11695         for it.
11696
11697         * expression.cs (Conditional.DoResolve): Remove some old code that
11698         is no longer needed, conversions have been fixed.
11699
11700         (ArrayCreationExpression.DoResolve): Return false if we fail to
11701         resolve the inner expression.
11702
11703 2004-09-07  Raja R Harinath  <rharinath@novell.com>
11704
11705         Fix test-290.cs.
11706         * cs-parser.jay (delegate_declaration): Record a delegate
11707         declaration as a type declaration.
11708         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
11709
11710 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
11711
11712         * parameter.cs: Do not crash if the type can not be resolved. 
11713
11714         * expression.cs: Report errors with unsafe pointers, fixes #64896
11715
11716 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
11717
11718         * expression.cs: Pointer arith always needs to do a conv.i
11719         if the operand is a long. fix 65320
11720
11721 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
11722
11723         Fixed cs0619-37.cs, cs0619-38.cs
11724
11725         * enum.cs (GetObsoleteAttribute): Removed.
11726
11727         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
11728         on Enum member is double staged. The first is tested member
11729         and then enum.
11730
11731 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
11732
11733         Fixed #56986, #63631, #65231
11734
11735         * class.cs: (TypeContainer.AddToMemberContainer): New method,
11736         adds member to name container.
11737         (TypeContainer.AddToTypeContainer): New method, adds type to
11738         name container.
11739         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
11740         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
11741         AddOperator): Simplified by reusing AddToMemberContainer.
11742         (TypeContainer.UserDefinedStaticConstructor): Changed to property
11743         instead of field.
11744         (Method.CheckForDuplications): Fixed implementation to test all
11745         possibilities.
11746         (MemberBase): Detection whether member is explicit interface
11747         implementation is now in constructor.
11748         (MemberBase.UpdateMemberName): Handles IndexerName.
11749         (Accessor): Changed to keep also location information.
11750         (AbstractPropertyEventMethod): Is derived from MemberCore.
11751         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
11752         will be emited or not.
11753         (PropertyBase.AreAccessorsDuplicateImplementation):
11754         Tests whether accessors are not in collision with some method.
11755         (Operator): Is derived from MethodCore to simplify common
11756         operations.
11757
11758         * decl.cs (Flags.TestMethodDuplication): Test for duplication
11759         must be performed.
11760         (DeclSpace.AddToContainer): Adds the member to defined_names
11761         table. It tests for duplications and enclosing name conflicts.
11762
11763         * enum.cs (EnumMember): Clean up to reuse the base structures
11764
11765 2004-09-03  Martin Baulig  <martin@ximian.com>
11766
11767         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
11768         into TypeContainer, to make partial classes work again.
11769
11770 2004-09-03  Martin Baulig  <martin@ximian.com>
11771
11772         * rootcontext.cs (RootContext.V2): Removed.
11773
11774 2004-03-23  Martin Baulig  <martin@ximian.com>
11775
11776         * expression.cs (Invocation.OverloadResolve): Added `bool
11777         may_fail' argument and use it instead of the Location.IsNull() hack.
11778
11779 2004-09-03  Martin Baulig  <martin@ximian.com>
11780
11781         Merged latest changes into gmcs.  Please keep this comment in
11782         here, it makes it easier for me to see what changed in MCS since
11783         the last time I merged.
11784
11785 2004-09-03  Raja R Harinath  <rharinath@novell.com>
11786
11787         Fix #61128.
11788         * expression.cs (BetterConversion): Don't allow either conversion 
11789         to be null.  Remove redundant implicit conversion test when 'q ==
11790         null' -- when this function is invoked, we already know that the
11791         implicit conversion exists.
11792         (BetterFunction): Assume that 'best' is non-null.  Remove
11793         redundant reimplementation of IsApplicable when 'best' is null.
11794         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
11795         number of arguments.
11796         (IsAncestralType): Extract from OverloadResolve.
11797         (OverloadResolve): Make robust to the MethodGroupExpr being
11798         unsorted.  Implement all the logic of Section 14.5.5.1, and
11799         support overloading of methods from multiple applicable types.
11800         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
11801
11802         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
11803         (RealError, Warning): Append type of report to related symbol.
11804
11805 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
11806
11807         * enum.cs: Fixed CLS-Compliance checks for enum members.
11808         Error tests cs3008-8.cs, cs3014-8.cs
11809
11810 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
11811
11812         Fixed bug #62342, #63102
11813         * class.cs: ImplementIndexer uses member.IsExplicitImpl
11814         like ImplementMethod.
11815
11816 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
11817
11818         * attribute.cs (Attribute.GetAttributeArgumentExpression):
11819         Fixed bug #65170.
11820
11821 2004-09-02  Martin Baulig  <martin@ximian.com>
11822
11823         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
11824         TypeManager.GetArgumentTypes() rather than calling GetParameters()
11825         on the MethodBase.
11826
11827 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
11828
11829         C# 2.0 Static classes implemented
11830
11831         * class.cs (TypeContainer): instance_constructors,
11832         initialized_fields, initialized_static_fields,
11833         default_constructor, base_inteface_types are protected to be
11834         accessible from StaticClass.
11835         (TypeContainer.DefineDefaultConstructor): New virtual method
11836         for custom default constructor generating
11837         (StaticClass): New class to handle "Static classes" feature.
11838
11839         * cs-parser.jay: Handle static keyword on class like instance
11840         of StaticClass.
11841
11842         * driver.cs: Added "/langversion" command line switch with two
11843         options (iso-1, default).
11844
11845 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
11846
11847         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
11848
11849 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
11850
11851         * delegate.cs: Style.
11852
11853 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11854
11855         * delegate.cs: Add seperate instance expr field for miguel.
11856
11857 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11858
11859         * PointerArithmetic (Resolve): make sure we are not doing
11860         pointer arith on void*. Also, make sure we are resolved
11861         by not setting eclass until resolve.
11862
11863         All callers: Make sure that PointerArithmetic gets resolved.
11864
11865 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11866
11867         * ArrayCreation (LookupType): If the type does not resolve 
11868         to an array, give an error.
11869
11870 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
11871
11872         * statement.cs (Try.Resolve): Fixed bug #64222
11873
11874 2004-08-27  Martin Baulig  <martin@ximian.com>
11875
11876         * class.cs
11877         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
11878         crash here.     
11879
11880 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
11881
11882         * ecore.cs (Constantify): Get underlying type via
11883         System.Enum.GetUnderlyingType to avoid StackOverflow on the
11884         Windows in special cases.
11885
11886 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
11887
11888         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
11889         for obtaining also private methods.
11890         (GetRemoveMethod): Used GetRemoveMethod (true)
11891         for obtaining also private methods.
11892
11893 2004-08-24  Martin Baulig  <martin@ximian.com>
11894
11895         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
11896         MethodAttributes.HideBySig for operators.
11897
11898 2004-08-23  Martin Baulig  <martin@ximian.com>
11899
11900         Back to the old error reporting system :-)
11901
11902         * report.cs (Message): Removed.
11903         (Report.MessageData, ErrorData, WarningData): Removed.
11904         (Report.Error, Warning): Back to the old system.
11905
11906 2004-08-23  Martin Baulig  <martin@ximian.com>
11907
11908         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
11909
11910         * class.cs (TypeContainer.ParentContainer): New public virtual
11911         method; replaces the explicit interface implementation.
11912         (ClassPart.ParentContainer): Override.
11913
11914 2004-08-23  Martin Baulig  <martin@ximian.com>
11915
11916         * statement.cs (Switch): Added support for constant switches; see
11917         #59428 or test-285.cs.
11918
11919 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
11920
11921         Fixed bug #62740.
11922         * statement.cs (GetEnumeratorFilter): Removed useless
11923         logic because C# specs is strict. GetEnumerator must be
11924         public.
11925
11926 2004-08-22  Martin Baulig  <martin@ximian.com>
11927
11928         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11929         a switch and may break, reset the barrier.  Fixes #59867.
11930
11931 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
11932
11933         CLS-Compliance speed up (~5% for corlib)
11934
11935         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
11936         New method. Tests container for CLS-Compliant names
11937
11938         * class.cs (TypeContainer.VerifyClsName): New method.
11939         Checks whether container name is CLS Compliant.
11940         (Constructor): Implements IMethodData.
11941
11942         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
11943         low-case table for CLS Compliance test.
11944         (MemberCache.VerifyClsParameterConflict): New method.
11945         Checks method parameters for CS3006 error.
11946
11947         * enum.cs (EnumMember): Is derived from MemberCore.
11948         (Enum.VerifyClsName): Optimized for better performance.
11949
11950 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
11951
11952         * report.cs: Renamed Error_T to Error and changed all
11953         references.
11954
11955 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
11956
11957         * class.cs (TypeContainer.IndexerArrayList): New inner class
11958         container for indexers.
11959         (TypeContainer.DefaultIndexerName): New constant for default
11960         indexer name. Replaced all "Item" with this constant.
11961         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
11962
11963         * typemanager.cs (TypeManager.default_member_ctor): Cache here
11964         DefaultMemberAttribute constructor.
11965
11966 2004-08-05  Martin Baulig  <martin@ximian.com>
11967
11968         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
11969         Fix bug #59429.
11970
11971 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
11972
11973         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
11974         multi platforms problem.
11975
11976         * compiler.csproj: Included shared files.
11977
11978 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
11979
11980         Fix bug 60333, 55971 in the more general way
11981         * attribute.cs (Attribute.GetAttributeArgumentExpression):
11982         Added arg_type argument for constant conversion.
11983         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
11984
11985 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
11986
11987         Fix bug #59760
11988         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
11989         OperatorArrayList, MethodCoreArrayList for typecontainer
11990         containers. Changed class member types to these new types.
11991         (MethodArrayList.DefineMembers): Added test for CS0659.
11992
11993 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
11994
11995         * cfold.cs: Synchronize the folding with the code in expression.cs
11996         Binary.DoNumericPromotions for uint operands.
11997
11998         * attribute.cs: Revert patch from Raja, it introduced a regression
11999         while building Blam-1.2.1 (hard to isolate a test case).
12000
12001 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
12002
12003         Fix for #55382
12004         * class.cs:
12005         (TypeContainer.Define): Renamed to DefineContainerMembers because of
12006         name collision.
12007         (MethodCore.parent_method): New member. The method we're overriding
12008         if this is an override method.
12009         (MethodCore.CheckBase): Moved from Method class and made common.
12010         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
12011         private.
12012         (MethodCore.CheckForDuplications): New abstract method. For custom
12013         member duplication search in a container
12014         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
12015         method and its return type.
12016         (Event.conflict_symbol): New member. Symbol with same name in the
12017         parent class.
12018
12019         * decl.cs:
12020         (MemberCache.FindMemberWithSameName): New method. The method
12021         is looking for conflict with inherited symbols.
12022
12023 2004-08-04  Martin Baulig  <martin@ximian.com>
12024
12025         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
12026
12027         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
12028
12029 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
12030
12031         * report.cs (Message): New enum for better error, warning reference in
12032         the code.
12033         (MessageData): New inner abstract class. It generally handles printing of
12034         error and warning messages.
12035         Removed unused Error, Warning, Message methods.
12036
12037 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
12038
12039         Fix for cs0592-8.cs test
12040         * attribute.cs
12041         (Attributable.ValidAttributeTargets): Made public.
12042         (Attribute.ExplicitTarget): New member for explicit target value.
12043         (Attribute.CheckTargets): Now we translate explicit attribute
12044         target to Target here.
12045
12046 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
12047
12048         * ecore.cs (MethodGroupExpr): new IsBase property.
12049
12050         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
12051
12052         * delegate.cs (DelegateCreation): store a MethodGroupExpr
12053         rather than an instance expr.
12054
12055         (DelegateCreation.Emit): Use the method group rather than
12056         the instance expression. Also, if you have base.Foo as the
12057         method for a delegate, make sure to emit ldftn, not ldftnvirt.
12058
12059         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
12060
12061         (NewDelegate.DoResolve): Only check for the existance of Invoke
12062         if the method is going to be needed. Use MethodGroupExpr.
12063
12064         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
12065
12066         * expression.cs: For pointer arith., make sure to use
12067         the size of the type, not the size of the pointer to
12068         the type.
12069
12070 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
12071
12072         Fix for #60722
12073         * class.cs (Class): Added error CS0502 test.
12074
12075 2004-08-03  John Luke  <jluke@cfl.rr.com>
12076             Raja R Harinath  <rharinath@novell.com>
12077
12078         Fix for #60997.
12079         * attribute.cs (Attribute.complained_before): New flag.
12080         (Attribute.ResolveType, Attribute.Resolve),
12081         (Attribute.DefinePInvokeMethod): Set it.
12082         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
12083         
12084 2004-08-03  Martin Baulig  <martin@ximian.com>
12085
12086         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
12087         use a user-defined operator; we still need to do numeric
12088         promotions in case one argument is a builtin type and the other
12089         one has an implicit conversion to that type.  Fixes #62322.
12090
12091 2004-08-02  Martin Baulig  <martin@ximian.com>
12092
12093         * statement.cs (LocalInfo.Flags): Added `IsThis'.
12094         (LocalInfo.IsThis): New public property.
12095         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
12096
12097 2004-08-01  Martin Baulig  <martin@ximian.com>
12098
12099         * class.cs (TypeContainer.GetClassBases): Don't set the default
12100         here since we may get called from GetPartialBases().
12101         (TypeContainer.DefineType): If GetClassBases() didn't return a
12102         parent, use the default one.
12103
12104 2004-07-30  Duncan Mak  <duncan@ximian.com>
12105
12106         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
12107
12108 2004-07-30  Martin Baulig  <martin@ximian.com>
12109
12110         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
12111
12112         * class.cs (SourceMethod): New public class, derive from the
12113         symbol writer's ISourceMethod.
12114         (Method): Use the new symbol writer API.
12115
12116         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
12117         as argument and use the new symbol writer.
12118
12119         * location.cs
12120         (SourceFile): Implement the symbol writer's ISourceFile.
12121         (Location.SymbolDocument): Removed.
12122         (Location.SourceFile): New public property.
12123
12124         * symbolwriter.cs: Use the new symbol writer API.
12125
12126 2004-07-30  Raja R Harinath  <rharinath@novell.com>
12127
12128         * Makefile (install-local): Remove.  Functionality moved to
12129         executable.make.
12130
12131 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
12132
12133         * Makefile: Install mcs.exe.config file together with mcs.exe.
12134         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
12135         correct runtime version.
12136         
12137 2004-07-25  Martin Baulig  <martin@ximian.com>
12138
12139         * class.cs
12140         (TypeContainer.RegisterOrder): Removed, this was unused.
12141         (TypeContainer, interface_order): Removed.
12142         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
12143         TypeContainer as argument since we can also be called with a
12144         `PartialContainer' for a partial class/struct/interface.
12145         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
12146         of checking whether we're an `Interface' - we could be a
12147         `PartialContainer'.
12148         (PartialContainer.Register): Override; call
12149         AddClass()/AddStruct()/AddInterface() on our parent.
12150
12151         * cs-parser.jay (interface_member_declaration): Add things to the
12152         `current_container', not the `current_class'.
12153
12154         * rootcontext.cs (RegisterOrder): The overloaded version which
12155         takes an `Interface' was unused, removed.
12156
12157         * typemanager.cs (TypeManager.LookupInterface): Return a
12158         `TypeContainer', not an `Interface'.
12159         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
12160         contain a `PartialContainer' for an interface, so check it's
12161         `Kind' to figure out what it is.
12162
12163 2004-07-25  Martin Baulig  <martin@ximian.com>
12164
12165         * class.cs (Class.DefaultTypeAttributes): New public constant.
12166         (Struct.DefaultTypeAttributes): Likewise.
12167         (Interface.DefaultTypeAttributes): Likewise.
12168         (PartialContainer.TypeAttr): Override this and add the
12169         DefaultTypeAttributes.
12170
12171 2004-07-25  Martin Baulig  <martin@ximian.com>
12172
12173         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
12174         we can just use the `Parent' field instead.
12175
12176 2004-07-25  Martin Baulig  <martin@ximian.com>
12177
12178         * class.cs (TypeContainer.Emit): Renamed to EmitType().
12179
12180 2004-07-25  Martin Baulig  <martin@ximian.com>
12181
12182         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
12183         our parts before defining any methods.
12184         (TypeContainer.VerifyImplements): Make this virtual.
12185         (ClassPart.VerifyImplements): Override and call VerifyImplements()
12186         on our PartialContainer.
12187
12188 2004-07-25  Martin Baulig  <martin@ximian.com>
12189
12190         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
12191
12192         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
12193         argument, we can just use the `Parent' field instead.
12194
12195         * class.cs
12196         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
12197         (MemberBase.DoDefine): Likewise.
12198
12199 2004-07-24  Martin Baulig  <martin@ximian.com>
12200
12201         * decl.cs (MemberCore.Parent): New public field.
12202         (DeclSpace.Parent): Moved to MemberCore.
12203
12204         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
12205         (MemberBase.ctor): Added TypeContainer argument, pass it to our
12206         parent's .ctor.
12207         (FieldBase, Field, Operator): Likewise.
12208         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
12209         (EventField, Event): Likewise.
12210
12211 2004-07-23  Martin Baulig  <martin@ximian.com>
12212
12213         * class.cs (PartialContainer): New public class.
12214         (ClassPart): New public class.
12215         (TypeContainer): Added support for partial classes.
12216         (TypeContainer.GetClassBases): Splitted some of the functionality
12217         out into GetNormalBases() and GetPartialBases().
12218
12219         * cs-tokenizer.cs (Token.PARTIAL): New token.
12220         (Tokenizer.consume_identifier): Added some hacks to recognize
12221         `partial', but only if it's immediately followed by `class',
12222         `struct' or `interface'.
12223
12224         * cs-parser.jay: Added support for partial clases.
12225
12226 2004-07-23  Martin Baulig  <martin@ximian.com>
12227
12228         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
12229         a `DeclSpace' and also made it readonly.
12230         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
12231         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
12232         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
12233
12234         * cs-parser.jay: Pass the `current_class', not the
12235         `current_container' (at the moment, this is still the same thing)
12236         to a new Method, Property, Event, Indexer or Constructor.
12237
12238 2004-07-23  Martin Baulig  <martin@ximian.com>
12239
12240         * cs-parser.jay (CSharpParser): Added a new `current_class' field
12241         and removed the `current_interface' one.
12242         (struct_declaration, class_declaration, interface_declaration):
12243         Set `current_class' to the newly created class/struct/interface;
12244         set their `Bases' and call Register() before parsing their body.
12245
12246 2004-07-23  Martin Baulig  <martin@ximian.com>
12247
12248         * class.cs (Kind): New public enum.
12249         (TypeContainer): Made this class abstract.
12250         (TypeContainer.Kind): New public readonly field.
12251         (TypeContainer.CheckDef): New public method; moved here from
12252         cs-parser.jay.
12253         (TypeContainer.Register): New public abstract method.
12254         (TypeContainer.GetPendingImplementations): New public abstract
12255         method.
12256         (TypeContainer.GetClassBases): Removed the `is_class' and
12257         `is_iface' parameters.
12258         (TypeContainer.DefineNestedTypes): Formerly known as
12259         DoDefineType().
12260         (ClassOrStruct): Made this class abstract.
12261
12262         * tree.cs (RootTypes): New public type. 
12263
12264 2004-07-20  Martin Baulig  <martin@ximian.com>
12265
12266         * tree.cs (Tree.RecordNamespace): Removed.
12267         (Tree.Namespaces): Removed.
12268
12269         * rootcontext.cs (RootContext.IsNamespace): Removed.
12270
12271         * cs-parser.jay (namespace_declaration): Just create a new
12272         NamespaceEntry here.
12273
12274 2004-07-20  Martin Baulig  <martin@ximian.com>
12275
12276         * statement.cs (ExceptionStatement): New abstract class.  This is
12277         now used as a base class for everyone who's using `finally'.
12278         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
12279         our local variables before using them.
12280
12281         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
12282         virtual method.  This is used by Yield.Resolve() to "steal" an
12283         outer block's `finally' clauses.
12284         (FlowBranchingException): The .ctor now takes an ExceptionStatement
12285         argument.
12286
12287         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
12288         version which takes an ExceptionStatement.  This version must be
12289         used to create exception branchings.
12290
12291         * iterator.cs
12292         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
12293         (Iterator.EmitMoveNext): Added exception support; protect the
12294         block with a `fault' clause, properly handle 'finally' clauses.
12295         (Iterator.EmitDispose): Run all the `finally' clauses here.
12296
12297 2004-07-20  Martin Baulig  <martin@ximian.com>
12298
12299         * iterator.cs: This is the first of a set of changes in the
12300         iterator code.  Match the spec more closely: if we're an
12301         IEnumerable, then GetEnumerator() must be called.  The first time
12302         GetEnumerator() is called, it returns the current instance; all
12303         subsequent invocations (if any) must create a copy.
12304
12305 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
12306
12307         * expression.cs: Resolve the constant expression before returning
12308         it. 
12309
12310 2004-07-19  Martin Baulig  <martin@ximian.com>
12311
12312         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
12313         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
12314         the return type of the new EmitContext.
12315
12316 2004-07-18  Martin Baulig  <martin@ximian.com>
12317
12318         * class.cs (Property.Define): Fix iterators.
12319
12320         * iterators.cs (Iterator.Define): Moved the
12321         `container.AddInterator (this)' call here from the .ctor; only do
12322         it if we resolved successfully.
12323
12324 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
12325
12326         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
12327         `true' for preprocessing directives that we parse.  The return
12328         value indicates whether we should return to regular tokenizing or
12329         not, not whether it was parsed successfully.
12330
12331         In the past if we were in: #if false ... #line #endif, we would
12332         resume parsing after `#line'.  See bug 61604.
12333
12334         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
12335         building: IsEnumType should return true only for enums, not for
12336         enums or System.Enum itself.  This fixes #61593.
12337
12338         Likely what happened is that corlib was wrong: mcs depended on
12339         this bug in some places.  The bug got fixed, we had to add the
12340         hack, which caused bug 61593.
12341
12342         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
12343         that was a workaround for the older conditions.
12344
12345 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
12346
12347         * assign.cs: IAssignMethod has a new interface, as documented
12348         inline. All assignment code now uses this new api.
12349
12350         * ecore.cs, expression.cs: All classes which implement
12351         IAssignMethod now use the new interface.
12352
12353         * expression.cs (Invocation): add a hack to EmitCall so that
12354         IndexerAccess can be the target of a compound assignment without
12355         evaluating its arguments twice.
12356
12357         * statement.cs: Handle changes in Invocation api.
12358
12359 2004-07-16  Martin Baulig  <martin@ximian.com>
12360
12361         * iterators.cs: Rewrote this.  We're now using one single Proxy
12362         class for both the IEnumerable and the IEnumerator interface and
12363         `Iterator' derives from Class so we can use the high-level API.
12364
12365         * class.cs (TypeContainer.AddIterator): New method.
12366         (TypeContainer.DoDefineType): New protected virtual method, which
12367         is called from DefineType().
12368         (TypeContainer.DoDefineMembers): Call DefineType() and
12369         DefineMembers() on all our iterators.
12370         (TypeContainer.Emit): Call Emit() on all our iterators.
12371         (TypeContainer.CloseType): Call CloseType() on all our iterators.
12372
12373         * codegen.cs (EmitContext.CurrentIterator): New public field.
12374
12375 2004-07-15  Martin Baulig  <martin@ximian.com>
12376
12377         * typemanager.cs
12378         (TypeManager.not_supported_exception_type): New type.   
12379
12380 2004-07-14  Martin Baulig  <martin@ximian.com>
12381
12382         * iterators.cs: Use real error numbers.
12383
12384 2004-07-14  Martin Baulig  <martin@ximian.com>
12385
12386         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
12387         requires this to be a System.Collection.IEnumerable and not a
12388         class implementing that interface.
12389         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
12390
12391 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
12392
12393         * class.cs: Fixed previous fix, it broke some error tests.
12394
12395 2004-07-12  Martin Baulig  <martin@ximian.com>
12396
12397         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
12398         Fixes #61293.
12399
12400 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
12401
12402         * assign.cs (LocalTemporary): Add new argument: is_address,If
12403         `is_address' is true, then the value that we store is the address
12404         to the real value, and not the value itself.
12405         
12406         * ecore.cs (PropertyExpr): use the new local temporary
12407         stuff to allow us to handle X.Y += z (where X is a struct)
12408
12409 2004-07-08  Martin Baulig  <martin@ximian.com>
12410
12411         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
12412         not always return, just like we're doing in Using.Resolve().
12413
12414 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
12415
12416         * cs-parser.jay (fixed_statement): flag this as Pinned.
12417
12418 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
12419
12420         * typemanager.cs (TypeManager): Removed MakePinned method, this
12421         mechanism is replaced with the .NET 2.x compatible mechanism of
12422         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
12423
12424         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
12425         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
12426         `IsFixed' property which has a different meaning.
12427
12428 2004-07-02  Raja R Harinath  <rharinath@novell.com>
12429
12430         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
12431         visible from inside a nested class, not just the names of the
12432         immediately enclosing class.
12433         Fix for bug #60730.
12434
12435 2004-06-24  Raja R Harinath  <rharinath@novell.com>
12436
12437         * expression.cs (BetterConversion): Remove buggy special-case
12438         handling of "implicit constant expression conversions".  At this
12439         point, we already know that the conversion is possible -- we're
12440         only checking to see which is better.
12441
12442 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12443
12444         * cs-parser.jay: Added error CS0210 test.
12445
12446 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12447
12448         * cs-parser.jay: Added error CS0134 test.
12449
12450 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12451
12452         Fix bug #52507
12453         * cs-parser.jay: Added error CS0145 test.
12454
12455 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12456
12457         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
12458
12459 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
12460         
12461         * expression.cs (StackAlloc.Resolve): The argument may not
12462         be a constant; deal with this case.
12463         
12464 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
12465
12466         * attribute.cs (IndexerName_GetIndexerName): Renamed to
12467         GetIndexerAttributeValue.
12468         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
12469
12470         * class.cs (Indexer.Define): Added error tests for CS0415,
12471         CS0609.
12472
12473 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
12474
12475         * attribute.cs (Attribute.Resolve): Keep field code in sync with
12476         property code.
12477
12478 2004-06-23  Martin Baulig  <martin@ximian.com>
12479
12480         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
12481         neither return nor throw, reset the barrier as well.  Fixes #60457.
12482
12483 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
12484
12485         * class.cs : EventAttributes is now set to None by default.
12486           This fixes bug #60459.
12487
12488 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
12489
12490         Fix bug #60219
12491         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
12492         Don't throw exception but return null (it's sufficient now).
12493
12494 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
12495
12496         * typemanager.cs (GetArgumentTypes): Faster implementation.
12497
12498 2004-06-18  Martin Baulig  <martin@ximian.com>
12499
12500         * attribute.cs (Attribute.Resolve): Check whether we're an
12501         EmptyCast which a Constant child.  Fixes #60333.
12502
12503 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
12504
12505         * statement.cs (EmitCollectionForeach): Account for the fact that
12506         not all valuetypes are in areas which we can take the address of.
12507         For these variables, we store to a temporary variable. Also, make
12508         sure that we dont emit a `callvirt' on a valuetype method.
12509
12510 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
12511
12512         * expression.cs (StackAlloc.DoReSolve): Added test for
12513         negative parameter (CS0247).
12514
12515 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
12516
12517         Fix bug #59792
12518         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
12519
12520 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
12521
12522         Fix bug #59781
12523         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
12524         ulong.
12525
12526 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
12527
12528         Fix bug #58254 & cs1555.cs, cs1556.cs
12529         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
12530
12531 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
12532
12533         * cs-parser.jay: Added error CS1669 test for indexers.
12534
12535 2004-06-11  Martin Baulig  <martin@ximian.com>
12536
12537         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
12538         call this twice: for params and varargs methods.
12539
12540 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12541
12542         * class.cs:
12543         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
12544
12545 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12546
12547         * attribute.cs (Attribute.GetValidTargets): Made public.
12548
12549         * class.cs: 
12550         (AbstractPropertyEventMethod): New class for better code sharing.
12551         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
12552         CS1667 report.
12553         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
12554
12555 2004-06-11  Raja R Harinath  <rharinath@novell.com>
12556
12557         Fix bug #59477.
12558         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
12559         that the call to Resolve is part of a MemberAccess.
12560         (Expression.Resolve): Use it for SimpleName resolution.
12561         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
12562         Add 'intermediate' boolean argument.
12563         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
12564         error message when the SimpleName can be resolved ambiguously
12565         between an expression and a type.
12566         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
12567         public.
12568         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
12569         call on the left-side.
12570
12571 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12572
12573         * class.cs:
12574         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
12575
12576 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12577
12578         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
12579
12580 2004-06-11  Martin Baulig  <martin@ximian.com>
12581
12582         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
12583         varargs methods if applicable.
12584
12585 2004-06-11  Martin Baulig  <martin@ximian.com>
12586
12587         * expression.cs (Invocation.EmitCall): Don't use
12588         `method.CallingConvention == CallingConventions.VarArgs' since the
12589         method could also have `CallingConventions.HasThis'.
12590
12591 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12592
12593         * class.cs (Event.GetSignatureForError): Implemented.
12594         Fixed crash in error test cs3010.cs
12595
12596 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
12597
12598         * cs-tokenizer.cs: Change the way we track __arglist to be
12599         consistent with the other keywords.
12600
12601 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
12602
12603         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
12604         tomorrow.
12605
12606 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
12607
12608         * codegen.cs: Check that all referenced assemblies have a strongname
12609         before strongnaming the compiled assembly. If not report error CS1577.
12610         Fix bug #56563. Patch by Jackson Harper.
12611         * typemanager.cs: Added a method to return all referenced assemblies.
12612         Fix bug #56563. Patch by Jackson Harper.
12613
12614 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
12615
12616         * class.cs:
12617         (Method.ApplyAttributeBuilder): Moved and added conditional
12618         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
12619
12620         * delegate.cs:
12621         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
12622
12623 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
12624
12625         Fixed #59640
12626         * class.cs: (EventField.attribute_targets): Changed default target.
12627
12628 2004-06-08  Martin Baulig  <martin@ximian.com>
12629
12630         * expression.cs (Invocation.EmitCall): Enable varargs methods.
12631
12632 2004-06-08  Martin Baulig  <martin@ximian.com>
12633
12634         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
12635
12636 2004-06-07  Martin Baulig  <martin@ximian.com>
12637
12638         Added support for varargs methods.
12639
12640         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
12641         keyword.
12642
12643         * cs-parser.jay: Added support for `__arglist'.
12644
12645         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
12646
12647         * expression.cs (Argument.AType): Added `ArgList'.
12648         (Invocation): Added support for varargs methods.
12649         (ArglistAccess): New public class.
12650         (Arglist): New public class.
12651
12652         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
12653
12654         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
12655         a method's top-level block if the method has varargs.
12656
12657         * support.cs (ReflectionParameters, InternalParameters): Added
12658         support for varargs methods.    
12659
12660 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
12661
12662         * class.cs: Provide location in indexer error report.
12663
12664         * driver.cs: Use standard names.
12665
12666         * namespace.cs: Catch the use of using after a namespace has been
12667         declared also on using aliases.
12668
12669 2004-06-03  Raja R Harinath  <rharinath@novell.com>
12670
12671         Bug #50820.
12672         * typemanager.cs (closure_private_ok, closure_invocation_type)
12673         (closure_qualifier_type, closure_invocation_assembly)
12674         (FilterWithClosure): Move to ...
12675         (Closure): New internal nested class.
12676         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
12677         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
12678         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
12679         (MemberLookup, MemberLookupFailed): Use it.
12680         * expression.cs (New.DoResolve): Treat the lookup for the
12681         constructor as being qualified by the 'new'ed type.
12682         (Indexers.GetIndexersForTypeOrInterface): Update.
12683
12684 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
12685
12686         * attribute.cs
12687         (GetConditionalAttributeValue): New method. Returns
12688         condition of ConditionalAttribute.
12689         (SearchMulti): New method.  Returns all attributes of type 't'.
12690         Use it when attribute is AllowMultiple = true.
12691         (IsConditionalMethodExcluded): New method.
12692
12693         * class.cs
12694         (Method.IsExcluded): Implemented. Returns true if method has conditional
12695         attribute and the conditions is not defined (method is excluded).
12696         (IMethodData): Extended interface for ConditionalAttribute support.
12697         (PropertyMethod.IsExcluded): Implemented.
12698
12699         * decl.cs
12700         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
12701
12702         * expression.cs
12703         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
12704         on the method.
12705
12706 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12707
12708         * expression.cs (ArrayCreationExpression): Make this just an
12709         `expression'. It can't be a statement, so the code here was
12710         dead.
12711
12712 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
12713
12714         Fixed #59072
12715         * typemanager.cs (GetFullNameSignature): New method for
12716         MethodBase types.
12717
12718 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
12719
12720         Fixed #56452
12721         * class.cs (MemberBase.GetSignatureForError): New virtual method.
12722         Use this method when MethodBuilder is null.
12723         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
12724         Added test for error CS0626 (MONO reports error for this situation).
12725         (IMethodData.GetSignatureForError): Extended interface.
12726
12727 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
12728
12729         * attribute.cs
12730         (AttributeTester.GetObsoleteAttribute): Returns instance of
12731         ObsoleteAttribute when type is obsolete.
12732
12733         * class.cs
12734         (TypeContainer.VerifyObsoleteAttribute): Override.
12735         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
12736         (MethodCode.VerifyObsoleteAttribute): Override.
12737         (MemberBase.VerifyObsoleteAttribute): Override.
12738
12739         * decl.cs
12740         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
12741         and report proper error.
12742
12743         *delegate.cs
12744         Delegate.VerifyObsoleteAttribute): Override.
12745
12746         * ecore.cs
12747         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
12748         and report proper error.
12749         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
12750
12751         * enum.cs
12752         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
12753         and enum member.
12754
12755         * expression.cs
12756         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
12757         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
12758         Added test for ObsoleteAttribute.
12759
12760         * statement.cs
12761         (Catch): Derived from Statement.
12762
12763 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
12764  
12765         Fixed bug #59071 & cs0160.cs
12766  
12767         * statement.cs (Try.Resolve): Check here whether order of catch
12768         clauses matches their dependencies.
12769
12770 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
12771
12772         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
12773         caused a regression: #59343.  Referencing nested classes from an
12774         assembly stopped working.
12775
12776 2004-05-31  Martin Baulig  <martin@ximian.com>
12777
12778         MCS is now frozen for beta 2.
12779
12780 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12781
12782         * convert.cs: add a trivial cache for overload operator resolution.
12783
12784 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12785
12786         * decl.cs: If possible, use lookuptypedirect here. We can only do
12787         this if there is no `.' after the namespace. Avoids using
12788         LookupType, which does lots of slow processing.
12789         (FindNestedType) New method, does what it says :-).
12790         * namespace.cs: use LookupTypeDirect.
12791         * rootcontext.cs: use membercache, if possible.
12792         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
12793
12794 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12795
12796         * expression.cs:
12797         According to the spec, 
12798
12799         In a member access of the form E.I, if E is a single identifier,
12800         and if the meaning of E as a simple-name (§7.5.2) is a constant,
12801         field, property, localvariable, or parameter with the same type as
12802         the meaning of E as a type-name (§3.8), then both possible
12803         meanings of E are permitted.
12804
12805         We did not check that E as a simple-name had the same type as E as
12806         a type name.
12807
12808         This trivial check gives us 5-7% on bootstrap time.
12809
12810 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12811
12812         * expression.cs (Invocation.OverloadResolve): Avoid the
12813         use of hashtables and boxing here by allocating on demand.
12814
12815 2004-05-30  Martin Baulig  <martin@ximian.com>
12816
12817         * rootcontext.cs (RootContext.LookupType): Don't cache things if
12818         we're doing a silent lookup.  Don't try to lookup nested types in
12819         TypeManager.object_type (thanks to Ben Maurer).
12820
12821 2004-05-30  Martin Baulig  <martin@ximian.com>
12822
12823         Committing a patch from Ben Maurer.
12824
12825         * rootcontext.cs (RootContext.LookupType): Cache negative results.
12826
12827 2004-05-29  Martin Baulig  <martin@ximian.com>
12828
12829         * class.cs (IMethodData.ShouldIgnore): New method.
12830
12831         * typemanager.cs (TypeManager.MethodFlags): Don't take a
12832         `Location' argument, we don't need it anywhere.  Use
12833         `IMethodData.ShouldIgnore ()' instead of
12834         `MethodData.GetMethodFlags ()'.
12835         (TypeManager.AddMethod): Removed.
12836         (TypeManager.AddMethod2): Renamed to AddMethod.
12837
12838 2004-05-29  Martin Baulig  <martin@ximian.com>
12839
12840         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
12841
12842         * convert.cs (Convert.ImplicitReferenceConversion): If we're
12843         converting from a class type S to an interface type and we already
12844         have an object on the stack, don't box it again.  Fixes #52578.
12845
12846 2004-05-29  Martin Baulig  <martin@ximian.com>
12847
12848         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
12849         Added support for `params' parameters.  Fixes #59267.
12850
12851 2004-05-29  Martin Baulig  <martin@ximian.com>
12852
12853         * literal.cs (NullPointer): Provide a private .ctor which sets
12854         `type' to TypeManager.object_type.  Fixes #59048.
12855
12856 2004-05-29  Martin Baulig  <martin@ximian.com>
12857
12858         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
12859         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
12860
12861         * ecore.cs (EventExpr.instance_expr): Make the field private.
12862
12863 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
12864
12865         Fixed bug #50080 & cs0214-2.cs
12866         * expression.cs (Cast.DoResolve): Check unsafe context here.
12867         
12868         * statement.cs (Resolve.DoResolve): Likewise.
12869
12870 2004-05-26  Martin Baulig  <martin@ximian.com>
12871
12872         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
12873
12874         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
12875         (RootContext.LookupType): Pass down the `silent' flag.
12876
12877 2004-05-25  Martin Baulig  <martin@ximian.com>
12878
12879         * expression.cs
12880         (MethodGroupExpr.IdenticalTypeName): New public property.
12881         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
12882         expression actually refers to a type.
12883
12884 2004-05-25  Martin Baulig  <martin@ximian.com>
12885
12886         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
12887         for #56176 and made it actually work.
12888
12889 2004-05-25  Martin Baulig  <martin@ximian.com>
12890
12891         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
12892         (FieldExpr, PropertyExpr): Override and implement
12893         CacheTemporaries.  Fixes #52279.
12894
12895 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
12896
12897         * location.cs: In the new compiler listing a file twice is a
12898         warning, not an error.
12899
12900 2004-05-24  Martin Baulig  <martin@ximian.com>
12901
12902         * enum.cs (Enum.DefineType): For the `BaseType' to be a
12903         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
12904
12905 2004-05-24  Martin Baulig  <martin@ximian.com>
12906
12907         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
12908         walking the `using' list.  Fixes #53921.
12909
12910 2004-05-24  Martin Baulig  <martin@ximian.com>
12911
12912         * const.cs (Const.LookupConstantValue): Added support for
12913         EmptyCast's; fixes #55251.
12914
12915 2004-05-24  Martin Baulig  <martin@ximian.com>
12916
12917         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
12918         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
12919         which does the CS0135 check.  The reason is that we first need to
12920         check whether the variable actually exists.
12921
12922 2004-05-24  Martin Baulig  <martin@ximian.com>
12923
12924         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
12925         than RootContext.LookupType() to find the explicit interface
12926         type.  Fixes #58584.
12927
12928 2004-05-24  Raja R Harinath  <rharinath@novell.com>
12929
12930         * Makefile: Simplify.  Use executable.make.
12931         * mcs.exe.sources: New file.  List of sources of mcs.exe.
12932
12933 2004-05-24  Anders Carlsson  <andersca@gnome.org>
12934
12935         * decl.cs:
12936         * enum.cs:
12937         Use the invariant culture when doing String.Compare for CLS case
12938         sensitivity.
12939         
12940 2004-05-23  Martin Baulig  <martin@ximian.com>
12941
12942         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
12943         don't have any dots.  Fixes #52622, added cs0246-8.cs.
12944
12945         * namespace.cs (NamespaceEntry.Lookup): Likewise.
12946         
12947 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
12948
12949         * class.cs (MemberBase.Define): Reuse MemberType member for 
12950         resolved type. Other methods can use it too.
12951
12952 2004-05-23  Martin Baulig  <martin@ximian.com>
12953
12954         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
12955         the variable also exists in the current block (otherwise, we need
12956         to report a CS0103).  Fixes #58670.
12957
12958 2004-05-23  Martin Baulig  <martin@ximian.com>
12959
12960         * flowanalysis.cs (Reachability.Reachable): Compute this
12961         on-the-fly rather than storing it as a field.
12962
12963 2004-05-23  Martin Baulig  <martin@ximian.com>
12964
12965         * flowanalysis.cs (Reachability.And): Manually compute the
12966         resulting `barrier' from the reachability.      
12967        
12968 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
12969
12970         Fix bug #57835
12971         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
12972         instance of ObsoleteAttribute when symbol is obsolete.
12973
12974         * class.cs
12975         (IMethodData): Extended interface for ObsoleteAttribute support.
12976
12977 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
12978
12979         * attribute.cs: Fix bug #55970
12980
12981 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
12982
12983         Fix bug #52705
12984         * attribute.cs
12985         (GetObsoleteAttribute): New method. Creates the instance of
12986         ObsoleteAttribute.
12987         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
12988         ObsoleteAttribute when member is obsolete.
12989         (AttributeTester.Report_ObsoleteMessage): Common method for
12990         Obsolete error/warning reporting.
12991
12992         * class.cs
12993         (TypeContainer.base_classs_type): New member for storing parent type.
12994
12995         * decl.cs
12996         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
12997         for this MemberCore.
12998
12999 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
13000
13001         * attribute.cs, const.cs: Fix bug #58590
13002
13003 2004-05-21  Martin Baulig  <martin@ximian.com>
13004
13005         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
13006         out parameters if the end of the method is unreachable.  Fixes
13007         #58098. 
13008
13009 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
13010
13011         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
13012         Hari was right, why extra method.
13013
13014 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
13015
13016         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
13017
13018 2004-05-20  Martin Baulig  <martin@ximian.com>
13019
13020         Merged this back from gmcs to keep the differences to a minumum.
13021
13022         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
13023         instead of a Declspace.
13024         (Attribute.ResolveType): Likewise.
13025         (Attributes.Search): Likewise.
13026         (Attributes.Contains): Likewise.
13027         (Attributes.GetClsCompliantAttribute): Likewise.
13028
13029         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
13030         argument.
13031         (MethodData.ApplyAttributes): Take an EmitContext instead of a
13032         DeclSpace.
13033
13034 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
13035
13036         Fix bug #58688 (MCS does not report error when the same attribute
13037         is assigned twice)
13038
13039         * attribute.cs (Attribute.Emit): Distinction between null and default.
13040
13041 2004-05-19  Raja R Harinath  <rharinath@novell.com>
13042
13043         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
13044         of a top-level attribute without an attribute target.
13045         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
13046         Make non-static.
13047         (Attribute.Conditional_GetConditionName), 
13048         (Attribute.Obsolete_GetObsoleteMessage): Update.
13049         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
13050         part of ScanForIndexerName.
13051         (Attribute.CanIgnoreInvalidAttribute): New function.
13052         (Attribute.ScanForIndexerName): Move to ...
13053         (Attributes.ScanForIndexerName): ... here.
13054         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
13055         (Attributes.Search): New internal variant that can choose not to
13056         complain if types aren't resolved.  The original signature now
13057         complains.
13058         (Attributes.GetClsCompliantAttribute): Use internal variant, with
13059         complaints suppressed.
13060         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
13061         only if it not useful.
13062         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
13063         top-level for attributes that are shared between the assembly
13064         and a top-level class.
13065         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
13066         * class.cs: Update to reflect changes.
13067         (DefineIndexers): Fuse loops.
13068         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
13069         a couple more variants of attribute names.
13070
13071 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
13072
13073         Fix bug #52585 (Implemented explicit attribute declaration)
13074
13075         * attribute.cs:
13076         (Attributable.ValidAttributeTargets): New abstract method. It gets
13077         list of valid attribute targets for explicit target declaration.
13078         (Attribute.Target): It holds target itself.
13079         (AttributeSection): Removed.
13080         (Attribute.CheckTargets): New method. It checks whether attribute
13081         target is valid for the current element.
13082
13083         * class.cs:
13084         (EventProperty): New class. For events that are declared like
13085         property (with add and remove accessors).
13086         (EventField): New class. For events that are declared like field.
13087         class.cs
13088
13089         * cs-parser.jay: Implemented explicit attribute target declaration.
13090
13091         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
13092         Override ValidAttributeTargets.
13093
13094         * parameter.cs:
13095         (ReturnParameter): Class for applying custom attributes on 
13096         the return type.
13097         (ParameterAtribute): New class. Class for applying custom
13098         attributes on the parameter type.
13099
13100 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
13101
13102         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
13103         definitions. 
13104
13105         (Method): Allow UNSAFE here.
13106
13107         * modifiers.cs: Support unsafe reporting.
13108
13109 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
13110
13111         * decl.cs: Fix bug #58478.
13112
13113 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13114
13115         * statement.cs: When checking for unreachable code on an EmptyStatement,
13116         set the location. Fixes bug #58488.
13117
13118 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
13119
13120         * driver.cs: Add -pkg handling.
13121
13122         From Gonzalo: UseShelLExecute=false
13123
13124 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
13125
13126         * attribute.cs:
13127         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
13128         for attribute.
13129         (Attribute.IsClsCompliaceRequired): Moved to base for better
13130         accesibility.
13131         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
13132         when attribute is AttributeUsageAttribute.
13133         (Attribute.GetValidTargets): Simplified.
13134         (Attribute.GetAttributeUsage): New method returns AttributeUsage
13135         attribute for this type.
13136         (Attribute.ApplyAttributes): Method renamed to Emit and make
13137         non-static.
13138         (GlobalAttributeSection): New class for special handling of global
13139         attributes (assembly, module).
13140         (AttributeSection.Emit): New method.
13141
13142         * class.cs: Implemented Attributable abstract methods.
13143         (MethodCore.LabelParameters): Moved to Parameter class.
13144         (Accessor): Is back simple class.
13145         (PropertyMethod): Implemented Attributable abstract class.
13146         (DelegateMethod): Implemented Attributable abstract class.
13147         (Event): New constructor for disctintion between normal Event
13148         and Event with accessors.
13149
13150         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
13151
13152         * codegen.cs, const.cs, decl.cs, delegate.cs:
13153         (CommonAssemblyModulClass): Implemented Attributable abstract class
13154         and simplified.
13155
13156         * enum.cs: Implement IAttributeSupport interface.
13157         (EnumMember): New class for emum members. Implemented Attributable
13158         abstract class
13159
13160         * parameter.cs:
13161         (ParameterBase): Is abstract.
13162         (ReturnParameter): New class for easier [return:] attribute handling.
13163
13164         * typemanager.cs: Removed builder_to_attr.
13165
13166 2004-05-11  Raja R Harinath  <rharinath@novell.com>
13167
13168         Fix bug #57151.
13169         * attribute.cs (Attribute.GetPositionalValue): New function.
13170         * class.cs (TypeContainer.VerifyMembers): New function.
13171         (TypeContainer.Emit): Use it.
13172         (ClassOrStruct): New base class for Class and Struct.
13173         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
13174         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
13175         class.
13176         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
13177         then each non-static field should have a FieldOffset attribute.
13178         Otherwise, none of the fields should have a FieldOffset attribute.
13179         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
13180         and FieldOffset attributes.
13181         * typemanager.cs (TypeManager.struct_layout_attribute_type)
13182         (TypeManager.field_offset_attribute_type): New core types.
13183         (TypeManager.InitCoreTypes): Initialize them.
13184
13185 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
13186
13187         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
13188         Return correct type.
13189         From bug #58270.
13190
13191 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
13192
13193         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
13194         be implicitly converted to ulong.
13195         
13196         * expression.cs: The logic for allowing operator &, | and ^ worked
13197         was wrong, it worked before because we did not report an error in
13198         an else branch.  Fixes 57895.
13199
13200         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
13201         allow volatile fields to be reference types.
13202
13203 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
13204
13205         * driver.cs: Add support for /debug-
13206
13207 2004-05-07  Raja R Harinath  <rharinath@novell.com>
13208
13209         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
13210         Add a 'complain' parameter to silence errors.
13211         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
13212         silently overlooked type-resolutions.
13213         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
13214         to reflect changes.
13215         (Attributes.Search): New function.
13216         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
13217         (Attributes.GetAttributeFullName): Remove hack.
13218         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
13219         Update to reflect changes.
13220         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13221         Use Attributes.Search instead of nested loops.
13222
13223 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
13224
13225         * decl.cs:
13226         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
13227         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
13228         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
13229
13230         * report.cs: (Report.Warning): Renamed to Warning_T because of
13231         parameter collision.
13232
13233 2004-05-05  Raja R Harinath  <rharinath@novell.com>
13234
13235         * expression.cs (MemberAccess.ResolveMemberAccess):
13236         Exit with non-zero status after Report.Error.
13237         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
13238         Likewise.
13239         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
13240
13241 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
13242
13243         * support.cs: Don't hang when the file is empty.
13244
13245 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
13246
13247         * support.cs: In SeekableStreamReader, compute the preamble size of the
13248           underlying stream. Position changes should take into account that initial
13249           count of bytes.
13250
13251 2004-05-03  Todd Berman  <tberman@sevenl.net>
13252
13253         * driver.cs: remove unused GetSysVersion function.
13254
13255 2004-05-03  Todd Berman  <tberman@sevenl.net>
13256
13257         * driver.cs: Remove the hack from saturday, as well as the hack
13258         from jackson (LoadAssemblyFromGac), also adds the CWD to the
13259         link_paths to get that bit proper.
13260
13261 2004-05-01  Todd Berman  <tberman@sevenl.net>
13262
13263         * driver.cs: Try a LoadFrom before a Load, this checks the current
13264         path. This is currently a bug in mono that is be fixed, however, this
13265         provides a workaround for now. This will be removed when the bug
13266         is fixed.
13267
13268 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
13269
13270         * CryptoConvert.cs: Updated to latest version. Fix issue with 
13271         incomplete key pairs (#57941).
13272
13273 2004-05-01  Todd Berman  <tberman@sevenl.net>
13274
13275         * driver.cs: Remove '.' from path_chars, now System.* loads properly
13276         from the GAC
13277
13278 2004-04-30  Jackson Harper  <jackson@ximian.com>
13279
13280         * codegen.cs: Open keys readonly.
13281         
13282 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13283
13284         * typemanager.cs: don't report cyclic struct layout when a struct
13285         contains 2 or more fields of the same type. Failed for Pango.AttrShape
13286         which has 2 Pango.Rectangle fields.
13287
13288 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13289
13290         * expression.cs: Handle IntPtr comparisons with IL code
13291         rather than a method call.
13292
13293 2004-04-29  Martin Baulig  <martin@ximian.com>
13294
13295         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
13296         the list of PropertyInfo's in class hierarchy and find the
13297         accessor.  Fixes #56013.
13298
13299 2004-04-29  Martin Baulig  <martin@ximian.com>
13300
13301         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
13302
13303 2004-04-29  Martin Baulig  <martin@ximian.com>
13304
13305         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13306
13307         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
13308
13309 2004-04-29  Martin Baulig  <martin@ximian.com>
13310
13311         * class.cs (ConstructorInitializer.Resolve): Check whether the
13312         parent .ctor is accessible.  Fixes #52146.
13313
13314 2004-04-29  Martin Baulig  <martin@ximian.com>
13315
13316         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13317
13318         * statement.cs (Using.EmitLocalVariableDecls): Use
13319         TypeManager.idisposable_type, not typeof (IDisposable).
13320         (Foreach.EmitCollectionForeach): Added support for valuetypes.
13321
13322 2004-04-29  Martin Baulig  <martin@ximian.com>
13323
13324         * class.cs (Event.Define): Don't emit the field and don't set
13325         RTSpecialName and SpecialName for events on interfaces.  Fixes
13326         #57703. 
13327
13328 2004-04-29  Raja R Harinath  <rharinath@novell.com>
13329
13330         Refactor Attribute.ApplyAttributes.
13331         * attribute.cs (Attributable): New base class for objects that can
13332         have Attributes applied on them.
13333         (Attribute): Make AttributeUsage fields public.
13334         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
13335         (Attribute.IsInternalCall): New property.
13336         (Attribute.UsageAttr): Convert to a public read-only property.
13337         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
13338         (Attribute.ResolveType, Attribute.Resolve)
13339         (Attribute.ScanForIndexerName): Update to reflect changes.
13340         (Attribute.CheckAttributeTarget): Re-format.
13341         (Attribute.ApplyAttributes): Refactor, to various
13342         Attributable.ApplyAttributeBuilder methods.
13343         * decl.cs (MemberCore): Make Attributable.
13344         * class.cs (Accessor): Make Attributable.
13345         (MethodData.ApplyAttributes): Use proper attribute types, not
13346         attribute names.
13347         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
13348         (TypeContainer.ApplyAttributeBuilder)
13349         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
13350         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
13351         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
13352         (Operator.ApplyAttributeBuilder): New factored-out methods.
13353         * const.cs (Const.ApplyAttributeBuilder): Likewise.
13354         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
13355         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
13356         * parameter.cs (ParameterBase): New Attributable base class
13357         that can also represent Return types.
13358         (Parameter): Update to the changes.
13359
13360 2004-04-29  Jackson Harper  <jackson@ximian.com>
13361
13362         * driver.cs: Prefer the corlib system version when looking for
13363         assemblies in the GAC. This is still a hack, but its a better hack
13364         now.
13365         
13366 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
13367
13368         * decl.cs, enum.cs: Improved error 3005 reporting.
13369   
13370         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
13371         (related_symbols): New private member for list of symbols
13372         related to reported error/warning.
13373         
13374         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
13375
13376 2004-04-29  Martin Baulig  <martin@ximian.com>
13377
13378         * ecore.cs (Expression.Constantify): If we're an enum and
13379         TypeManager.TypeToCoreType() doesn't give us another type, use
13380         t.UnderlyingSystemType.  Fixes #56178.  
13381
13382 2004-04-29  Martin Baulig  <martin@ximian.com>
13383
13384         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
13385         interfaces and for each interface, only add members directly
13386         declared in that interface.  Fixes #53255.
13387
13388 2004-04-28  Martin Baulig  <martin@ximian.com>
13389
13390         * expression.cs (ConditionalLogicalOperator): Use a temporary
13391         variable for `left' to avoid that we evaluate it more than once;
13392         bug #52588.
13393
13394 2004-04-28  Martin Baulig  <martin@ximian.com>
13395
13396         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
13397         `void[]' (CS1547).
13398
13399 2004-04-28  Martin Baulig  <martin@ximian.com>
13400
13401         * statement.cs (LocalInfo.Resolve): Check whether the type is not
13402         void (CS1547).
13403
13404         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
13405         whether the type is not void (CS1547).
13406
13407 2004-04-28  Martin Baulig  <martin@ximian.com>
13408
13409         * expression.cs (Unary.DoResolveLValue): Override this and report
13410         CS0131 for anything but Operator.Indirection.
13411
13412 2004-04-28  Martin Baulig  <martin@ximian.com>
13413
13414         Committing a patch from Ben Maurer; see bug #50820.
13415
13416         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13417         check for classes.
13418
13419         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13420         classes.        
13421
13422 2004-04-28  Martin Baulig  <martin@ximian.com>
13423
13424         Committing a patch from Ben Maurer; see bug #50820.
13425
13426         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13427         check for classes.
13428
13429         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13430         classes.        
13431
13432 2004-04-28  Martin Baulig  <martin@ximian.com>
13433
13434         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
13435         (Block.AddLabel): Call DoLookupLabel() to only search in the
13436         current block.
13437
13438 2004-04-28  Martin Baulig  <martin@ximian.com>
13439
13440         * cfold.cs (ConstantFold.BinaryFold): Added special support for
13441         comparing StringConstants and NullLiterals in Equality and Inequality.
13442
13443 2004-04-28  Jackson Harper  <jackson@ximian.com>
13444
13445         * driver.cs: Attempt to load referenced assemblies from the
13446         GAC. This is the quick and dirty version of this method that
13447         doesnt take into account versions and just takes the first
13448         canidate found. Will be good enough for now as we will not have more
13449         then one version installed into the GAC until I update this method.
13450
13451 2004-04-28  Martin Baulig  <martin@ximian.com>
13452
13453         * typemanager.cs (TypeManager.CheckStructCycles): New public
13454         static method to check for cycles in the struct layout.
13455
13456         * rootcontext.cs (RootContext.PopulateTypes): Call
13457         TypeManager.CheckStructCycles() for each TypeContainer.
13458         [Note: We only need to visit each type once.]
13459
13460 2004-04-28  Martin Baulig  <martin@ximian.com>
13461
13462         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
13463
13464         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
13465         success and added `out object value'.  Use a `bool resolved' field
13466         to check whether we've already been called rather than
13467         `ConstantValue != null' since this breaks for NullLiterals.
13468
13469 2004-04-28  Raja R Harinath  <rharinath@novell.com>
13470
13471         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
13472         setting of this flag, since the 'set' method may be non-public.
13473
13474 2004-04-28  Raja R Harinath  <rharinath@novell.com>
13475
13476         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
13477         check on current_vector.Block.
13478
13479 2004-04-27  Martin Baulig  <martin@ximian.com>
13480
13481         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
13482         a field initializer.  Fixes #56459.
13483
13484 2004-04-27  Martin Baulig  <martin@ximian.com>
13485
13486         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
13487         we're not attempting to use an indexer.  Fixes #52154.
13488
13489 2004-04-27  Martin Baulig  <martin@ximian.com>
13490
13491         * statement.cs (Return): Don't create a return label if we don't
13492         need it; reverts my change from January 20th.  Thanks to Ben
13493         Maurer for this.
13494
13495 2004-04-27  Martin Baulig  <martin@ximian.com>
13496
13497         According to the spec, `goto' can only leave a nested scope, but
13498         never enter it.
13499
13500         * statement.cs (Block.LookupLabel): Only lookup in the current
13501         block, don't recurse into parent or child blocks.
13502         (Block.AddLabel): Check in parent and child blocks, report
13503         CS0140/CS0158 if we find a duplicate.
13504         (Block): Removed this indexer for label lookups.
13505         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
13506         this already does the error reporting for us.
13507
13508         * flowanalysis.cs
13509         (FlowBranching.UsageVector.Block): New public variable; may be null.
13510         (FlowBranching.CreateSibling): Added `Block' argument.
13511         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
13512         label for the target of a `goto' and check whether we're not
13513         leaving a `finally'.
13514
13515 2004-04-27  Martin Baulig  <martin@ximian.com>
13516
13517         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13518         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
13519         just for returns).
13520
13521 2004-04-27  Martin Baulig  <martin@ximian.com>
13522
13523         * statement.cs (Block.AddLabel): Also check for implicit blocks
13524         and added a CS0158 check.
13525
13526 2004-04-27  Martin Baulig  <martin@ximian.com>
13527
13528         * flowanalysis.cs (FlowBranchingLoop): New class.
13529         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
13530         UsageVector's instead of an ArrayList.
13531         (FlowBranching.Label): Likewise.
13532         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
13533         (FlowBranching.AddBreakVector): New method.
13534
13535 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
13536
13537         * attribute.cs: Small regression fix: only convert the type if we
13538         the type is different, fixes System.Drawing build.
13539
13540 2004-04-27  Martin Baulig  <martin@ximian.com>
13541
13542         * attribute.cs (Attribute.Resolve): If we have a constant value
13543         for a named field or property, implicity convert it to the correct
13544         type.
13545
13546 2004-04-27  Raja R Harinath  <rharinath@novell.com>
13547
13548         * statement.cs (Block.Block): Implicit blocks share
13549         'child_variable_names' fields with parent blocks.
13550         (Block.AddChildVariableNames): Remove.
13551         (Block.AddVariable): Mark variable as "used by a child block" in
13552         every surrounding block.
13553         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
13554         been used in a child block, complain about violation of "Invariant
13555         meaning in blocks" rule.
13556         * cs-parser.jay (declare_local_variables): Don't use
13557         AddChildVariableNames.
13558         (foreach_statement): Don't create an implicit block: 'foreach'
13559         introduces a scope.
13560
13561 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
13562
13563         * convert.cs (ImplicitNumericConversion): 0 is also positive when
13564         converting from 0L to ulong.  Fixes 57522.
13565
13566 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
13567
13568         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
13569         derived class hides via 'new' keyword field from base class (test-242.cs).
13570         TODO: Handle this in the more general way.
13571         
13572         * class.cs (CheckBase): Ditto.
13573
13574 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
13575
13576         * decl.cs (caching_flags): New member for storing cached values
13577         as bit flags.
13578         (MemberCore.Flags): New enum where bit flags for caching_flags
13579         are defined.
13580         (MemberCore.cls_compliance): Moved to caching_flags.
13581         (DeclSpace.Created): Moved to caching_flags.
13582
13583         * class.cs: Use caching_flags instead of DeclSpace.Created
13584         
13585 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
13586
13587         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
13588         if we are only a derived class, not a nested class.
13589
13590         * typemanager.cs: Same as above, but do this at the MemberLookup
13591         level (used by field and methods, properties are handled in
13592         PropertyExpr).   Allow for the qualified access if we are a nested
13593         method. 
13594
13595 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
13596
13597         * class.cs: Refactoring.
13598         (IMethodData): New inteface; Holds links to parent members
13599         to avoid member duplication (reduced memory allocation).
13600         (Method): Implemented IMethodData interface.
13601         (PropertyBase): New inner classes for get/set methods.
13602         (PropertyBase.PropertyMethod): Implemented IMethodData interface
13603         (Event): New inner classes for add/remove methods.
13604         (Event.DelegateMethod): Implemented IMethodData interface.
13605
13606         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
13607         EmitContext (related to class.cs refactoring).
13608
13609 2004-04-21  Raja R Harinath  <rharinath@novell.com>
13610
13611         * delegate.cs (Delegate.VerifyApplicability): If the number of
13612         arguments are the same as the number of parameters, first try to
13613         verify applicability ignoring  any 'params' modifier on the last
13614         parameter.
13615         Fixes #56442.
13616
13617 2004-04-16  Raja R Harinath  <rharinath@novell.com>
13618
13619         * class.cs (TypeContainer.AddIndexer): Use
13620         'ExplicitInterfaceName' to determine if interface name was
13621         explicitly specified.  'InterfaceType' is not initialized at this time.
13622         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
13623         Indexers array is already in the required order.  Initialize
13624         'IndexerName' only if there are normal indexers.
13625         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
13626         (TypeContainer.Emit): Emit DefaultMember attribute only if
13627         IndexerName is initialized.
13628         Fixes #56300.
13629
13630 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
13631
13632         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
13633         Fixes #57007
13634
13635 2004-04-15  Raja R Harinath  <rharinath@novell.com>
13636
13637         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
13638         attributes.
13639         Fix for #56456.
13640
13641         * attribute.cs (Attribute.Resolve): Check for duplicate named
13642         attributes.
13643         Fix for #56463.
13644
13645 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
13646
13647         * iterators.cs (MarkYield): track whether we are in an exception,
13648         and generate code accordingly.  Use a temporary value to store the
13649         result for our state.
13650
13651         I had ignored a bit the interaction of try/catch with iterators
13652         since their behavior was not entirely obvious, but now it is
13653         possible to verify that our behavior is the same as MS .NET 2.0
13654
13655         Fixes 54814
13656
13657 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
13658
13659         * iterators.cs: Avoid creating temporaries if there is no work to
13660         do. 
13661
13662         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
13663         Enumerations, use TypeManager.EnumToUnderlying and call
13664         recursively. 
13665
13666         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
13667         bug #57013
13668
13669         (This.Emit): Use EmitContext.EmitThis to emit our
13670         instance variable.
13671
13672         (This.EmitAssign): Ditto.
13673
13674         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
13675         codepaths, we will move all the functionality into
13676         Mono.CSharp.This 
13677
13678         (FieldExpr.EmitAssign): Ditto.
13679
13680         This fixes several hidden bugs that I uncovered while doing a code
13681         review of this today.
13682
13683         * codegen.cs (EmitThis): reworked so the semantics are more clear
13684         and also support value types "this" instances.
13685
13686         * iterators.cs: Changed so that for iterators in value types, we
13687         do not pass the value type as a parameter.  
13688
13689         Initialization of the enumerator helpers is now done in the caller
13690         instead of passing the parameters to the constructors and having
13691         the constructor set the fields.
13692
13693         The fields have now `assembly' visibility instead of private.
13694
13695 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
13696
13697         * expression.cs (Argument.Resolve): Check if fields passed as ref
13698         or out are contained in a MarshalByRefObject.
13699
13700         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
13701         another compiler type.
13702
13703 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
13704
13705         * class.cs (Indexer.Define): use the new name checking method.
13706         Also, return false on an error.
13707         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
13708         (is_identifier_[start/part]_character): make static.
13709
13710 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
13711
13712         * expression.cs (Binary.ResolveOperator): Do no append strings
13713         twice: since we can be invoked more than once (array evaluation)
13714         on the same concatenation, take care of this here.  Based on a fix
13715         from Ben (bug #56454)
13716
13717 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
13718
13719         * codegen.cs: Fix another case where CS1548 must be reported (when 
13720         delay-sign isn't specified and no private is available #56564). Fix
13721         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
13722         error when MCS is used on the MS runtime and we need to delay-sign 
13723         (which seems unsupported by AssemblyBuilder - see #56621).
13724
13725 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
13726
13727         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
13728         (TypeManager.ComputeNamespaces): Faster implementation for
13729         Microsoft runtime.
13730
13731         * compiler.csproj: Updated AssemblyName to mcs.
13732
13733 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
13734
13735         * rootcontext.cs: Add new types to the boot resolution.
13736
13737         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
13738         MulticastDelegate is not allowed.
13739
13740         * typemanager.cs: Add new types to lookup: System.TypedReference
13741         and ArgIterator.
13742
13743         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
13744         check for TypedReference or ArgIterator, they are not allowed. 
13745
13746         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
13747         makes us properly catch 1510 in some conditions (see bug 56016 for
13748         details). 
13749
13750 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
13751
13752         * CryptoConvert.cs: update from corlib version
13753         with endian fixes.
13754
13755 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
13756
13757         * class.cs (Indexer.Define): Check indexername declaration
13758
13759 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
13760
13761         * attribute.cs (IsClsCompliant): Fixed problem with handling
13762         all three states (compliant, not-compliant, undetected).
13763
13764 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
13765
13766         * attribute.cs (Attribute): Location is now public.
13767         (Resolve): Store resolved arguments (pos_values) in attribute class.
13768         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
13769         (GetClsCompliantAttributeValue): New method that gets
13770         CLSCompliantAttribute value.
13771         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
13772         if exists else null.
13773         (AttributeTester): New class for CLS-Compliant verification routines.
13774
13775         * class.cs (Emit): Add CLS-Compliant verification.
13776         (Method.GetSignatureForError): Implemented.
13777         (Constructor.GetSignatureForError): Implemented
13778         (Constructor.HasCompliantArgs): Returns if constructor has
13779         CLS-Compliant arguments.
13780         (Constructor.Emit): Override.
13781         (Construcor.IsIdentifierClsCompliant): New method; For constructors
13782         is needed to test only parameters.
13783         (FieldBase.GetSignatureForError): Implemented.
13784         (TypeContainer): New member for storing base interfaces.
13785         (TypeContainer.FindMembers): Search in base interfaces too.
13786
13787         * codegen.cs (GetClsComplianceAttribute): New method that gets
13788         assembly or module CLSCompliantAttribute value.
13789         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
13790         for assembly.
13791         (ModuleClass.Emit): Add error 3012 test.
13792
13793         * const.cs (Emit): Override and call base for CLS-Compliant tests.
13794
13795         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
13796         state for all decl types.
13797         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
13798         if CLS-Compliant tests are required.
13799         (IsClsCompliaceRequired): New method. Analyze whether code
13800         must be CLS-Compliant.
13801         (IsExposedFromAssembly): New method. Returns true when MemberCore
13802         is exposed from assembly.
13803         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
13804         value or gets cached value.
13805         (HasClsCompliantAttribute): New method. Returns true if MemberCore
13806         is explicitly marked with CLSCompliantAttribute.
13807         (IsIdentifierClsCompliant): New abstract method. This method is
13808         used to testing error 3005.
13809         (IsIdentifierAndParamClsCompliant): New method. Common helper method
13810         for identifier and parameters CLS-Compliant testing.
13811         (VerifyClsCompliance): New method. The main virtual method for
13812         CLS-Compliant verifications.
13813         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
13814         null. I don't know why is null (too many public members !).
13815         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
13816         and get value of first CLSCompliantAttribute that found.
13817
13818         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
13819         (VerifyClsCompliance): Override and add extra tests.
13820
13821         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
13822         clscheck- disable CLS-Compliant verification event if assembly is has
13823         CLSCompliantAttribute(true).
13824
13825         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
13826         ApllyAttribute is now called in emit section as in the other cases.
13827         Possible future Emit integration.
13828         (IsIdentifierClsCompliant): New override.
13829         (VerifyClsCompliance): New override.
13830         (GetEnumeratorName): Returns full enum name.
13831
13832         * parameter.cs (GetSignatureForError): Implemented.
13833
13834         * report.cs (WarningData): New struct for Warning message information.
13835         (LocationOfPreviousError): New method.
13836         (Warning): New method. Reports warning based on the warning table.
13837         (Error_T): New method. Reports error based on the error table.
13838
13839         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
13840         verifications are done here.
13841
13842         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
13843
13844         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
13845         CLSCompliantAttribute.
13846         (all_imported_types): New member holds all imported types from other
13847         assemblies.
13848         (LoadAllImportedTypes): New method fills static table with exported types
13849         from all referenced assemblies.
13850         (Modules): New property returns all assembly modules.
13851
13852 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
13853
13854         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
13855         throwing a parser error.
13856
13857         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
13858         which removes the hardcoded get_/set_ prefixes for properties, as
13859         IL allows for the properties to be named something else.  
13860
13861         Bug #56013
13862
13863         * expression.cs: Do not override operand before we know if it is
13864         non-null.  Fix 56207
13865
13866 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13867
13868         * typemanager.cs: support for pinned variables.
13869
13870 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13871
13872         * decl.cs, typemanager.cs: Avoid using an arraylist
13873         as a buffer if there is only one result set.
13874
13875 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13876
13877         * expression.cs: Make sure you cant call a static method
13878         with an instance expression, bug #56174.
13879
13880 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
13881
13882         * class.cs (IsDuplicateImplementation): Improve error reporting to
13883         flag 663 (method only differs in parameter modifier).
13884
13885         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
13886         in preprocessor directives.
13887
13888         * location.cs (LookupFile): Allow for the empty path.
13889
13890         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
13891         better approach for some of that patch, but its failing with the
13892         CharSet enumeration.  For now try/catch will do.
13893
13894         * typemanager.cs: Do not crash if a struct does not have fields.
13895         Fixes 56150.
13896
13897 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
13898
13899         * expression.cs: cs0213, cant fix a fixed expression.
13900         fixes 50231.
13901
13902 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
13903
13904         * cs-parser.jay: detect invalid embeded statements gracefully.
13905         bug #51113.
13906
13907 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
13908
13909         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
13910         As a regex:
13911         s/
13912         the invocation type may not be a subclass of the tye of the item/
13913         The type of the item must be a subclass of the invocation item.
13914         /g
13915
13916         Fixes bug #50820.
13917
13918 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
13919
13920         * attribute.cs: Added methods to get a string and a bool from an
13921         attribute. Required to information from AssemblyKeyFileAttribute,
13922         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
13923         * codegen.cs: Modified AssemblyName creation to include support for
13924         strongnames. Catch additional exceptions to report them as CS1548.
13925         * compiler.csproj: Updated include CryptoConvert.cs.
13926         * compiler.csproj.user: Removed file - user specific configuration.
13927         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
13928         Mono.Security assembly. The original class is maintained and tested in
13929         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
13930         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
13931         like CSC 8.0 (C# v2) supports.
13932         * Makefile: Added CryptoConvert.cs to mcs sources.
13933         * rootcontext.cs: Added new options for strongnames.
13934
13935 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
13936
13937         * driver.cs: For --expect-error, report error code `2'
13938         if the program compiled with no errors, error code `1' if
13939         it compiled with an error other than the one expected.
13940
13941 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
13942
13943         * compiler.csproj: Updated for Visual Studio .NET 2003.
13944         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
13945         * compiler.sln: Updated for Visual Studio .NET 2003.
13946
13947 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
13948
13949         * expression.cs: Fix bug #47234. We basically need to apply the
13950         rule that we prefer the conversion of null to a reference type
13951         when faced with a conversion to 'object' (csc behaviour).
13952
13953 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13954
13955         * statement.cs: Shorter form for foreach, eliminates
13956         a local variable. r=Martin.
13957
13958 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13959
13960         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
13961         checks if we can use brtrue/brfalse to test for 0.
13962         * expression.cs: use the above in the test for using brtrue/brfalse.
13963         cleanup code a bit.
13964
13965 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13966
13967         * expression.cs: Rewrite string concat stuff. Benefits:
13968
13969         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
13970         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
13971         rather than a concat chain.
13972
13973         * typemanager.cs: Add lookups for more concat overloads.
13974
13975 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13976
13977         * expression.cs: Emit shorter il code for array init.
13978
13979         newarr
13980         dup
13981         // set 1
13982
13983         // set 2
13984
13985         newarr
13986         stloc.x
13987
13988         ldloc.x
13989         // set 1
13990
13991         ldloc.x
13992         // set 2
13993
13994 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
13995
13996         * statement.cs: Before, two switch blocks would be merged if the
13997         total size of the blocks (end_item - begin_item + 1) was less than
13998         two times the combined sizes of the blocks.
13999
14000         Now, it will only merge if after the merge at least half of the
14001         slots are filled.
14002
14003         fixes 55885.
14004
14005 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
14006
14007         * class.cs : csc build fix for GetMethods(). See bug #52503.
14008
14009 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
14010
14011         * expression.cs: Make sure fp comparisons work with NaN.
14012         This fixes bug #54303. Mig approved this patch a long
14013         time ago, but we were not able to test b/c the runtime
14014         had a related bug.
14015
14016 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
14017
14018         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
14019
14020 2004-03-19  Martin Baulig  <martin@ximian.com>
14021
14022         * class.cs (MemberCore.IsDuplicateImplementation): Report the
14023         error here and not in our caller.
14024
14025 2004-03-19  Martin Baulig  <martin@ximian.com>
14026
14027         * interface.cs: Completely killed this file.
14028         (Interface): We're now a TypeContainer and live in class.cs.
14029
14030         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
14031         argument; we're now also called for interfaces.
14032         (TypeContainer.DefineMembers): Allow this method being called
14033         multiple times.
14034         (TypeContainer.GetMethods): New public method; formerly known as
14035         Interface.GetMethod().  This is used by PendingImplementation.
14036         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
14037         it's now private and non-static.
14038         (Interface): Moved this here; it's now implemented similar to
14039         Class and Struct.
14040         (Method, Property, Event, Indexer): Added `bool is_interface'
14041         argument to their .ctor's.
14042         (MemberBase.IsInterface): New public field.
14043
14044         * cs-parser.jay: Create normal Method, Property, Event, Indexer
14045         instances instead of InterfaceMethod, InterfaceProperty, etc.
14046         (opt_interface_base): Removed; we now use `opt_class_base' instead.
14047         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
14048
14049 2004-03-19  Martin Baulig  <martin@ximian.com>
14050
14051         * class.cs (MethodCore.IsDuplicateImplementation): New private
14052         method which does the CS0111 checking.
14053         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
14054         Use IsDuplicateImplementation().
14055
14056 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
14057
14058         * decl.cs (FindMemberToOverride): New method to find the correct
14059         method or property to override in the base class.
14060         * class.cs
14061             - Make Method/Property use the above method to find the
14062               version in the base class.
14063             - Remove the InheritableMemberSignatureCompare as it is now
14064               dead code.
14065
14066         This patch makes large code bases much faster to compile, as it is
14067         O(n) rather than O(n^2) to do this validation.
14068
14069         Also, it fixes bug 52458 which is that nested classes are not
14070         taken into account when finding the base class member.
14071
14072         Reviewed/Approved by Martin.
14073
14074 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
14075
14076         * interface.cs: In all interface classes removed redundant
14077         member initialization.
14078
14079 2004-03-16  Martin Baulig  <martin@ximian.com>
14080
14081         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
14082
14083 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
14084
14085         * decl.cs (DefineTypeAndParents): New helper method to define a
14086         type's containers before the type itself is defined;  This is a
14087         bug exposed by the recent changes to Windows.Forms when an
14088         implemented interface was defined inside a class that had not been
14089         built yet.   
14090
14091         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
14092
14093         (Check): Loop correctly to report errors modifiers
14094         (UNSAFE was not in the loop, since it was the same as TOP).
14095
14096         * interface.cs: Every interface member now takes a ModFlags,
14097         instead of a "is_new" bool, which we set on the base MemberCore. 
14098
14099         Every place where we called "UnsafeOk" in the interface, now we
14100         call the proper member (InterfaceMethod.UnsafeOK) instead to get
14101         the unsafe settings from the member declaration instead of the
14102         container interface. 
14103
14104         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
14105
14106         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
14107         `set_indexer_name' to the pending bits (one per type).
14108
14109         We fixed a bug today that was picking the wrong method to
14110         override, since for properties the existing InterfaceMethod code
14111         basically ignored the method name.  Now we make sure that the
14112         method name is one of the valid indexer names.
14113
14114 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
14115  
14116         * support.cs (SeekableStreamReader): Keep track of stream byte
14117         positions and don't mix them with character offsets to the buffer.
14118
14119         Patch from Gustavo Giráldez
14120
14121 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
14122
14123         * interface.cs (InterfaceSetGetBase): Removed double member
14124         initialization, base class does it as well.
14125
14126 2004-03-13  Martin Baulig  <martin@ximian.com>
14127
14128         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
14129         when compiling corlib.
14130
14131 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
14132
14133         * convert.cs (ExplicitConversion): We were reporting an error on
14134         certain conversions (object_type source to a value type, when the
14135         expression was `null') before we had a chance to pass it through
14136         the user defined conversions.
14137
14138         * driver.cs: Replace / and \ in resource specifications to dots.
14139         Fixes 50752
14140
14141         * class.cs: Add check for duplicate operators.  Fixes 52477
14142
14143 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
14144
14145         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
14146         that are in the middle of the statements, not only at the end.
14147         Fixes #54987
14148
14149         * class.cs (TypeContainer.AddField): No longer set the
14150         `HaveStaticConstructor' flag, now we call it
14151         `UserDefineStaticConstructor' to diferentiate the slightly
14152         semantic difference.
14153
14154         The situation is that we were not adding BeforeFieldInit (from
14155         Modifiers.TypeAttr) to classes that could have it.
14156         BeforeFieldInit should be set to classes that have no static
14157         constructor. 
14158
14159         See:
14160
14161         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
14162
14163         And most importantly Zoltan's comment:
14164
14165         http://bugzilla.ximian.com/show_bug.cgi?id=44229
14166
14167         "I think beforefieldinit means 'it's ok to initialize the type sometime 
14168          before its static fields are used', i.e. initialization does not need
14169          to be triggered by the first access to the type. Setting this flag
14170          helps the JIT to compile better code, since it can run the static
14171          constructor at JIT time, and does not need to generate code to call it
14172          (possibly lots of times) at runtime. Unfortunately, mcs does not set
14173          this flag for lots of classes like String. 
14174          
14175          csc sets this flag if the type does not have an explicit static 
14176          constructor. The reasoning seems to be that if there are only static
14177          initalizers for a type, and no static constructor, then the programmer
14178          does not care when this initialization happens, so beforefieldinit
14179          can be used.
14180          
14181          This bug prevents the AOT compiler from being usable, since it 
14182          generates so many calls to mono_runtime_class_init that the AOT code
14183          is much slower than the JITted code. The JITted code is faster, 
14184          because it does not generate these calls if the vtable is type is
14185          already initialized, which is true in the majority of cases. But the
14186          AOT compiler can't do this."
14187
14188 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
14189
14190         * class.cs (MethodData.Emit): Refactor the code so symbolic
14191         information is generated for destructors;  For some reasons we
14192         were taking a code path that did not generate symbolic information
14193         before. 
14194
14195 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
14196
14197         * class.cs: Create a Constructor.CheckBase method that
14198         takes care of all validation type code. The method
14199         contains some code that was moved from Define.
14200
14201         It also includes new code that checks for duplicate ctors.
14202         This fixes bug #55148.
14203
14204 2004-03-09  Joshua Tauberer <tauberer@for.net>
14205
14206         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
14207         a { ... }-style array creation invokes EmitStaticInitializers
14208         which is not good for reference-type arrays.  String, decimal
14209         and now null constants (NullCast) are not counted toward
14210         static initializers.
14211
14212 2004-03-05  Martin Baulig  <martin@ximian.com>
14213
14214         * location.cs (SourceFile.HasLineDirective): New public field;
14215         specifies whether the file contains or is referenced by a "#line"
14216         directive.
14217         (Location.DefineSymbolDocuments): Ignore source files which
14218         either contain or are referenced by a "#line" directive.        
14219
14220 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
14221
14222         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
14223         direct access to our parent, so check the method inline there.
14224
14225 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
14226
14227         * expression.cs (Invocation.EmitCall): Miguel's last commit
14228         caused a regression. If you had:
14229
14230             T t = null;
14231             t.Foo ();
14232
14233         In Foo the implict this would be null.
14234
14235 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
14236
14237         * expression.cs (Invocation.EmitCall): If the method is not
14238         virtual, do not emit a CallVirt to it, use Call.
14239
14240         * typemanager.cs (GetFullNameSignature): Improve the method to
14241         cope with ".ctor" and replace it with the type name.
14242
14243         * class.cs (ConstructorInitializer.Resolve): Now the method takes
14244         as an argument the ConstructorBuilder where it is being defined,
14245         to catch the recursive constructor invocations.
14246
14247 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
14248
14249         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
14250         routines to check if a type is an enumerable/enumerator allow
14251         classes that implement the IEnumerable or IEnumerator interfaces.
14252
14253         * class.cs (Property, Operator): Implement IIteratorContainer, and
14254         implement SetYields.
14255
14256         (Property.Define): Do the block swapping for get_methods in the
14257         context of iterators.   We need to check if Properties also
14258         include indexers or not.
14259
14260         (Operator): Assign the Block before invoking the
14261         OperatorMethod.Define, so we can trigger the Iterator code
14262         replacement. 
14263
14264         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
14265         Property and Operator classes are not created when we parse the
14266         declarator but until we have the block completed, so we use a
14267         singleton SimpleIteratorContainer.Simple to flag whether the
14268         SetYields has been invoked.
14269
14270         We propagate this setting then to the Property or the Operator to
14271         allow the `yield' to function.
14272
14273 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
14274
14275         * codegen.cs: Implemented attribute support for modules.
14276         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
14277         Assembly/Module functionality.
14278
14279         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
14280         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
14281         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
14282
14283 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
14284
14285         * interface.cs (FindMembers): The operation is performed on all base
14286         interfaces and not only on the first. It is required for future CLS Compliance patch.
14287
14288 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
14289
14290         * statement.cs, codegen.cs:
14291         This patch deals with patterns such as:
14292
14293         public class List : IEnumerable {
14294
14295                 public MyEnumerator GetEnumerator () {
14296                         return new MyEnumerator(this);
14297                 }
14298
14299                 IEnumerator IEnumerable.GetEnumerator () {
14300                         ...
14301                 }
14302                 
14303                 public struct MyEnumerator : IEnumerator {
14304                         ...
14305                 }
14306         }
14307
14308         Before, there were a few things we did wrong:
14309         1) we would emit callvirt on a struct, which is illegal
14310         2) we emited ldarg when we needed to emit ldarga
14311         3) we would mistakenly call the interface methods on an enumerator
14312         type that derived from IEnumerator and was in another assembly. For example:
14313
14314         public class MyEnumerator : IEnumerator
14315
14316         Would have the interface methods called, even if there were public impls of the
14317         method. In a struct, this lead to invalid IL code.
14318
14319 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
14320
14321         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
14322           renamed to Emit.
14323
14324         * delegate.cs (Define): Fixed crash when delegate type is undefined.
14325
14326 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
14327
14328         * cs-parser.jay: Fix small regression: we were not testing V2
14329         compiler features correctly.
14330
14331         * interface.cs: If the emit context is null, then create one
14332
14333 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
14334
14335         * decl.cs (GetSignatureForError): New virtual method to get full name
14336           for error messages.
14337
14338         * attribute.cs (IAttributeSupport): New interface for attribute setting.
14339           Now it is possible to rewrite ApplyAttributes method to be less if/else.
14340
14341         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
14342           Duplicated members and code in these classes has been removed.
14343           Better encapsulation in these classes.
14344
14345 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
14346
14347         * assign.cs (Assign.DoResolve): When dealing with compound
14348         assignments, there is a new rule in ECMA C# 2.4 (might have been
14349         there before, but it is documented here) that states that in:
14350
14351         a op= b;
14352
14353         If b is of type int, and the `op' is a shift-operator, then the
14354         above is evaluated as:
14355
14356         a = (int) a op b 
14357
14358         * expression.cs (Binary.ResolveOperator): Instead of testing for
14359         int/uint/long/ulong, try to implicitly convert to any of those
14360         types and use that in pointer arithmetic.
14361
14362         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
14363         method to print information for from the type, not from the
14364         null-method we were given.
14365
14366 2004-02-01  Duncan Mak  <duncan@ximian.com>
14367
14368         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
14369         parsing for cmd, fixes bug #53694.
14370
14371 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
14372
14373         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
14374         in the member name duplication tests. Property and operator name duplication
14375         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
14376
14377 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
14378
14379         * interface.cs (PopulateMethod): Fixed crash when interface method
14380         returns not existing type (error test cs0246-3.cs).
14381
14382 2004-02-02  Ravi Pratap M <ravi@ximian.com>
14383
14384         * cs-parser.jay (interface_accessors): Re-write actions to also
14385         store attributes attached to get and set methods. Fix spelling
14386         while at it.
14387
14388         (inteface_property_declaration): Modify accordingly.
14389
14390         (InterfaceAccessorInfo): New helper class to store information to pass
14391         around between rules that use interface_accessors.
14392
14393         * interface.cs (Emit): Apply attributes on the get and set
14394         accessors of properties and indexers too.
14395
14396         * attribute.cs (ApplyAttributes): Modify accordingly to use the
14397         right MethodBuilder when applying attributes to the get and set accessors.
14398
14399 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
14400
14401         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
14402
14403 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
14404
14405         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
14406
14407 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
14408
14409         * cs-parser.jay: Remove YIELD token, instead use the new grammar
14410         changes that treat `yield' specially when present before `break'
14411         or `return' tokens.
14412
14413         * cs-tokenizer.cs: yield is no longer a keyword.
14414
14415 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
14416
14417         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
14418         setting for default constructors.
14419         For default constructors are almost every time set wrong Modifier. The
14420         generated IL code has been alright. But inside mcs this values was
14421         wrong and this was reason why several of my CLS Compliance tests
14422         failed.
14423
14424 2004-01-22  Martin Baulig  <martin@ximian.com>
14425
14426         * cs-parser.jay (namespace_or_type_name): Return an Expression,
14427         not a QualifiedIdentifier.  This is what `type_name_expression'
14428         was previously doing.
14429         (type_name_expression): Removed; the code is now in
14430         `namespace_or_type_name'.
14431         (qualified_identifier): Removed, use `namespace_or_type_name'
14432         instead.
14433         (QualifiedIdentifier): Removed this class.      
14434
14435 2004-01-22  Martin Baulig  <martin@ximian.com>
14436
14437         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
14438         not a string as alias name.
14439
14440 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
14441
14442         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
14443         #52730 bug, and instead compute correctly the need to use a
14444         temporary variable when requesting an address based on the
14445         static/instace modified of the field and the constructor.
14446  
14447 2004-01-21  Martin Baulig  <martin@ximian.com>
14448
14449         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
14450         class and namespace before looking up aliases.  Fixes #52517.
14451
14452 2004-01-21  Martin Baulig  <martin@ximian.com>
14453
14454         * flowanalysis.cs (UsageVector.Merge): Allow variables being
14455         assinged in a 'try'; fixes exception4.cs.
14456
14457 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14458         * class.cs : Implemented parameter-less constructor for TypeContainer
14459
14460         * decl.cs: Attributes are now stored here. New property OptAttributes
14461
14462         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
14463
14464         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
14465
14466 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14467
14468         * typemanager.cs (CSharpSignature): Now reports also inner class name.
14469           (CSharpSignature): New method for indexer and property signature.
14470
14471 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14472
14473         * pending.cs (IsVirtualFilter): Faster implementation.
14474
14475 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14476
14477         * typemanager.cs: Avoid inclusion of same assembly more than once.
14478
14479 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14480
14481         * cs-parser.jay: Fixed problem where the last assembly attribute
14482           has been applied also to following declaration (class, struct, etc.)
14483           
14484 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14485
14486         * class.cs: Added error CS0538, CS0539 reporting.
14487         Fixed crash on Microsoft runtime when field type is void.
14488
14489         * cs-parser.jay: Added error CS0537 reporting.
14490
14491         * pending.cs: Added error CS0535 reporting.
14492         Improved error report for errors CS0536, CS0534.
14493
14494 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
14495
14496         Merge a few bits from the Anonymous Method MCS tree.
14497
14498         * statement.cs (ToplevelBlock): New class for toplevel methods,
14499         will hold anonymous methods, lifted variables.
14500
14501         * cs-parser.jay: Create toplevel blocks for delegates and for
14502         regular blocks of code. 
14503
14504 2004-01-20  Martin Baulig  <martin@ximian.com>
14505
14506         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
14507         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
14508         and `NeedExplicitReturn'; added `IsLastStatement'.
14509         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
14510         have a `ReturnLabel' or we're not unreachable.
14511
14512         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
14513         child's reachability; don't just override ours with it.  Fixes
14514         #58058 (lluis's example).
14515         (FlowBranching): Added public InTryOrCatch(), InCatch(),
14516         InFinally(), InLoop(), InSwitch() and
14517         BreakCrossesTryCatchBoundary() methods.
14518
14519         * statement.cs (Return): Do all error checking in Resolve().
14520         Unless we are the last statement in a top-level block, always
14521         create a return label and jump to it.
14522         (Break, Continue): Do all error checking in Resolve(); also make
14523         sure we aren't leaving a `finally'.
14524         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
14525         statement in a top-level block.
14526         (Block.Flags): Added `IsDestructor'.
14527         (Block.IsDestructor): New public property.
14528
14529 2004-01-20  Martin Baulig  <martin@ximian.com>
14530
14531         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
14532
14533 2004-01-20  Martin Baulig  <martin@ximian.com>
14534
14535         * statement.cs (Statement.ResolveUnreachable): New public method.
14536         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
14537         (Block.Resolve): Resolve unreachable statements.
14538
14539 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
14540
14541         * expression.cs: We need to fix the case where we do
14542         not have a temp variable here.
14543
14544         * assign.cs: Only expression compound assignments need
14545         temporary variables.
14546
14547 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
14548
14549         * flowanalysis.cs: Reduce memory allocation in a few ways:
14550           - A block with no variables should not allocate a bit
14551             vector for itself.
14552           - A method with no out parameters does not need any tracking
14553             for assignment of the parameters, so we need not allocate
14554             any data for it.
14555           - The arrays:
14556                 public readonly Type[] VariableTypes;
14557                 public readonly string[] VariableNames;
14558             Are redundant. The data is already stored in the variable
14559             map, so we need not allocate another array for it.
14560           - We need to add alot of checks for if (params | locals) == null
14561             due to the first two changes.
14562
14563 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
14564
14565         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
14566         implement IMemoryLocation, we store a copy on a local variable and
14567         take the address of it.  Patch from Benjamin Jemlich
14568
14569         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
14570         to use a special "type_name_expression" rule which reduces the
14571         number of "QualifiedIdentifier" classes created, and instead
14572         directly creates MemberAccess expressions.
14573
14574 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
14575
14576         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
14577         that fixes #52853.  Null literal assignment to ValueType
14578
14579         * class.cs (MethodData.Emit): Instead of checking the name of the
14580         method to determine if its a destructor, create a new derived
14581         class from Method called Destructor, and test for that.  
14582
14583         * cs-parser.jay: Create a Destructor object instead of a Method.  
14584
14585         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
14586
14587         Fixes: 52933
14588
14589 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
14590
14591         * expression.cs (Binary.ResolveOperator): Perform an implicit
14592         conversion from MethodGroups to their delegate types on the
14593         Addition operation.
14594
14595         * delegate.cs: Introduce a new class DelegateCreation that is the
14596         base class for `NewDelegate' and `ImplicitDelegateCreation',
14597         factor some code in here.
14598
14599         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
14600         conversion from MethodGroups to compatible delegate types. 
14601
14602         * ecore.cs (Expression.Resolve): Do not flag error 654
14603         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
14604         we allow conversions from MethodGroups to delegate types now.
14605
14606         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
14607         assignments in v2 either.
14608
14609 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
14610
14611         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
14612         static read-only fields in ctors.
14613
14614         Applied patch from Benjamin Jemlich 
14615
14616         * expression.cs (UnaryMutator): Avoid leaking local variables. 
14617
14618 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
14619
14620         * cs-tokenizer.cs (IsCastToken): Allow the various native types
14621         here to return true, as they can be used like this:
14622
14623                 (XXX) int.MEMBER ()
14624
14625         Fixed 49836 and all the other dups
14626
14627 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
14628
14629         * driver.cs: Implement /win32res and /win32icon.
14630
14631 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
14632
14633         * cs-parser.jay: Add a rule to improve error handling for the
14634         common mistake of placing modifiers after the type.
14635
14636 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
14637
14638         * cs-parser.jay (interface_event_declaration): Catch
14639         initialization of events on interfaces, and report cs0068
14640
14641         * cs-parser.jay (interface_event_declaration): Catch
14642         initialization of events. 
14643
14644         * ecore.cs: Better report missing constructors.
14645
14646         * expression.cs (Binary.ResolveOperator): My previous bug fix had
14647         the error reporting done in the wrong place.  Fix.
14648
14649         * expression.cs (Binary.ResolveOperator): Catch the 
14650         operator + (E x, E y) error earlier, and later allow for implicit
14651         conversions in operator +/- (E e, U x) from U to the underlying
14652         type of E.
14653
14654         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
14655         52596, if the container class is abstract, the default constructor
14656         is protected otherwise its public (before, we were always public).
14657
14658         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
14659         fixed statement.
14660
14661         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
14662         Jemlich that fixes bug #52597, MCS was generating invalid code for
14663         idisposable structs.   Thanks to Ben for following up with this
14664         bug as well.
14665
14666 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
14667
14668         * driver.cs: Allow assemblies without code to be generated, fixes
14669         52230.
14670
14671 2004-01-07  Nick Drochak <ndrochak@gol.com>
14672
14673         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
14674
14675 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
14676
14677         * cs-parser.jay: Add rules to improve error reporting if fields or
14678         methods are declared at the namespace level (error 116)
14679
14680         * Add rules to catch event add/remove
14681
14682 2004-01-04  David Sheldon <dave-mono@earth.li>
14683
14684   * expression.cs: Added matching ")" to error message for 
14685   CS0077
14686
14687 2004-01-03 Todd Berman <tberman@gentoo.org>
14688
14689         * ecore.cs, attribute.cs:
14690         Applying fix from #52429.
14691
14692 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
14693
14694         * ecore.cs, expression.cs, statement.cs:
14695         Total rewrite of how we handle branching. We
14696         now handle complex boolean expressions with fewer
14697         jumps. As well if (x == 0) no longer emits a ceq.
14698
14699         if (x is Foo) is much faster now, because we generate
14700         better code.
14701
14702         Overall, we get a pretty big improvement on our benchmark
14703         tests. The code we generate is smaller and more readable.
14704
14705         I did a full two-stage bootstrap. The patch was reviewed
14706         by Martin and Miguel.
14707
14708 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
14709
14710         * cs-parser.jay: Make primary_expression not take a QI.
14711         we dont need this because the member_access rule covers
14712         us here. So we replace the rule with just IDENTIFIER.
14713
14714         This has two good effects. First, we remove a s/r conflict.
14715         Second, we allocate many fewer QualifiedIdentifier objects.
14716
14717 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
14718
14719         * attribute.cs: Handle MarshalAs attributes as pseudo, and
14720         set the correct information via SRE. This prevents
14721         hanging on the MS runtime. Fixes #29374.
14722
14723 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
14724
14725         * convert.cs: correctly handle conversions to value types
14726         from Enum and ValueType as unboxing conversions.
14727
14728         Fixes bug #52569. Patch by Benjamin Jemlich.
14729
14730 2004-01-02  Ravi Pratap  <ravi@ximian.com>
14731
14732         * expression.cs (BetterConversion): Prefer int -> uint
14733         over int -> ulong (csc's behaviour). This fixed bug #52046.
14734
14735 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
14736
14737         * decl.cs (MemberCache.FindMembers): now returns a
14738         MemberInfo [].
14739
14740         * typemanager.cs: In general, go with with ^^.
14741         (CopyNewMethods): take an IList.
14742         (RealMemberLookup): Only allocate an arraylist
14743         if we copy from two sets of methods.
14744
14745         This change basically does two things:
14746         1) Fewer array lists allocated due to CopyNewMethods.
14747         2) the explicit cast in MemberList costed ALOT.
14748
14749 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
14750
14751         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
14752         a hashtable to avoid needless string allocations when an identifier is
14753         used more than once (the common case).
14754
14755 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
14756
14757         * pending.cs: MS's TypeBuilder.GetInterfaces ()
14758         is broken, it will not return anything. So, we
14759         have to use the information we have in mcs to
14760         do the task.
14761
14762         * typemanager.cs: Add a cache for GetInterfaces,
14763         since this will now be used more often (due to ^^)
14764
14765         (GetExplicitInterfaces) New method that gets the
14766         declared, not effective, interfaces on a type
14767         builder (eg, if you have interface IFoo, interface
14768         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
14769         { IBar }.
14770
14771         This patch makes MCS able to bootstrap itself on
14772         Windows again.
14773
14774 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
14775
14776         * expression.cs: Remove the Nop's that Miguel put
14777         in by mistake.
14778
14779 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
14780
14781         * report.cs, codegen.cs: Give the real stack trace to
14782         the error when an exception is thrown.
14783
14784 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
14785
14786         * decl.cs: only allocate hashtables for ifaces if 
14787         it is an iface!
14788
14789 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
14790
14791         * expression.cs: fix the error from cs0121-2.cs
14792         (a parent interface has two child interfaces that
14793         have a function with the same name and 0 params
14794         and the function is called through the parent).
14795
14796 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
14797
14798         * class.cs, rootcontext.cs, typmanager.cs: do not
14799         leak pointers.
14800
14801 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
14802
14803         * codegen.cs: remove stack for the ec flow branching.
14804         It is already a linked list, so no need.
14805
14806 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
14807
14808         * Makefile: Allow custom profiler here.
14809
14810 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
14811
14812         * typemanager.cs (LookupType):
14813           - Use a static char [], because split takes
14814             a param array for args, so it was allocating
14815             every time.
14816           - Do not store true in a hashtable, it boxes.
14817
14818 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
14819
14820         * flowanalysis.cs: bytify common enums.
14821
14822 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
14823
14824         * modifiers.cs: Add a new set of flags for the
14825         flags allowed on explicit interface impls.
14826         * cs-parser.jay: catch the use of modifiers in
14827         interfaces correctly.
14828         * class.cs: catch private void IFoo.Blah ().
14829
14830         All related to bug #50572.
14831
14832 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
14833
14834         * decl.cs: Rewrite the consistant accessability checking.
14835         Accessability is not linear, it must be implemented in
14836         a tableish way. Fixes #49704.
14837
14838 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
14839
14840         * expression.cs: Handle negation in a checked context.
14841         We must use subtraction from zero. Fixes #38674.
14842
14843 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14844
14845         * class.cs: Ignore static void main in DLLs.
14846         * rootcontext.cs: Handle the target type here,
14847         since we are have to access it from class.cs
14848         * driver.cs: account for the above.
14849
14850 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14851
14852         * report.cs: Give line numbers and files if available.
14853
14854 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
14855
14856         * driver.cs: Implement /addmodule.
14857
14858         * typemanager.cs:  Change 'modules' field so it now contains Modules not
14859         ModuleBuilders.
14860
14861 2003-12-20  Martin Baulig  <martin@ximian.com>
14862
14863         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
14864         (FieldBase.IsAssigned): Removed this field.
14865         (FieldBase.SetAssigned): New public method.
14866         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
14867
14868 2003-12-20  Martin Baulig  <martin@ximian.com>
14869
14870         * expression.cs (LocalVariableReference.DoResolve): Don't set
14871         `vi.Used' if we're called from DoResolveLValue().
14872
14873         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
14874         returns the usage vector it just merged into the current one -
14875         pass this one to UsageWarning().
14876         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
14877         of the `EmitContext', don't call this recursively on our children.
14878
14879 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
14880
14881         * driver.cs: Implement /target:module.
14882
14883 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
14884
14885         * support.cs (CharArrayHashtable): New helper class.
14886
14887         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
14888         char arrays, not strings, so we can avoid creating a string in
14889         consume_identifier if the identifier is a keyword.
14890
14891 2003-12-16  Martin Baulig  <martin@ximian.com>
14892
14893         * statement.cs (LocalInfo.Assigned): Removed this property.
14894         (LocalInfo.Flags): Removed `Assigned'.
14895         (LocalInfo.IsAssigned): New public method; takes the EmitContext
14896         and uses flow analysis.
14897         (Block.UsageWarning): Made this method private.
14898         (Block.Resolve): Call UsageWarning() if appropriate.
14899
14900         * expression.cs (LocalVariableReference.DoResolve): Always set
14901         LocalInfo.Used here.
14902
14903 2003-12-13  Martin Baulig  <martin@ximian.com>
14904
14905         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
14906         any value here; we're now using flow analysis to figure out
14907         whether a statement/block returns a value.
14908
14909 2003-12-13  Martin Baulig  <martin@ximian.com>
14910
14911         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
14912         working again.
14913         (FlowBranching.MergeFinally): Don't call
14914         `branching.CheckOutParameters()' here, this is called in
14915         MergeTopBlock().
14916         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
14917         when adding the `finally' vector.       
14918
14919 2003-12-13  Martin Baulig  <martin@ximian.com>
14920
14921         * flowanalysis.cs
14922         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
14923         actually work and also fix #48962.
14924
14925 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
14926
14927         * decl.cs: Do not check System.Object for nested types,
14928         since we know it does not have any. Big bang for buck:
14929
14930         BEFORE:
14931            Run 1:   8.35 seconds
14932            Run 2:   8.32 seconds
14933            corlib:  17.99 seconds
14934         AFTER:
14935            Run 1:   8.17 seconds
14936            Run 2:   8.17 seconds
14937            corlib:  17.39 seconds
14938
14939 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
14940
14941         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
14942         time we are returning 0 members, so we save alot here.
14943
14944 2003-12-11  Martin Baulig  <martin@ximian.com>
14945
14946         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
14947         `MergeChild()', also just take the `FlowBranching' as argument;
14948         call Merge() on it and return the result.
14949         (FlowBranching.Merge): We don't need to do anything if we just
14950         have one sibling.
14951
14952 2003-12-11  Martin Baulig  <martin@ximian.com>
14953
14954         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
14955         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
14956         Maurer for this idea.
14957
14958 2003-12-11  Martin Baulig  <martin@ximian.com>
14959
14960         * flowanalysis.cs (MergeResult): This class is now gone; we now
14961         use the `UsageVector' for this.  The reason for this is that if a
14962         branching just has one sibling, we don't need to "merge" them at
14963         all - that's the next step to do.
14964         (FlowBranching.Merge): We now return a `UsageVector' instead of a
14965         `MergeResult'.
14966
14967 2003-12-11  Martin Baulig  <martin@ximian.com>
14968
14969         Reworked flow analyis and made it more precise and bug-free.  The
14970         most important change is that we're now using a special `Reachability'
14971         class instead of having "magic" meanings of `FlowReturns'.  I'll
14972         do some more cleanups and optimizations and also add some more
14973         documentation this week.
14974
14975         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
14976         largely reworked this class.
14977         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
14978         the new `Reachability' class instead of having "magic" values here.
14979         (FlowBranching): We're now using an instance of `Reachability'
14980         instead of having separate `Returns', `Breaks' etc. fields.
14981
14982         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
14983         based on flow analysis; ignore the return value of block.Emit ().
14984
14985 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
14986
14987         * driver.cs typemanager.cs: Find the mono extensions to corlib even
14988         if they are private.
14989
14990 2003-12-09  Martin Baulig  <martin@ximian.com>
14991
14992         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
14993         call them directly on the UsageVector.
14994
14995 2003-12-09  Martin Baulig  <martin@ximian.com>
14996
14997         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
14998         Changed return type from `FlowReturns' to `Reachability'.
14999
15000 2003-12-09  Martin Baulig  <martin@ximian.com>
15001
15002         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
15003         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
15004         `Reachable' fields with a single `Reachability' one.
15005
15006 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15007
15008         * class.cs (FindMembers): Remove foreach's.
15009
15010         Bootstrap times:
15011
15012         BEFORE
15013                 Run 1:   8.74 seconds
15014                 Run 2:   8.71 seconds
15015
15016         AFTER
15017                 Run 1:   8.64 seconds
15018                 Run 2:   8.58 seconds
15019
15020
15021 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15022
15023         * cs-parser.jay:
15024         * gen-treedump.cs:
15025         * statement.cs:
15026         This patch does a few things:
15027                 1. EmptyStatement is now a singleton, so it is never reallocated.
15028                 2. All blah is EmptyStatement constructs have been changed to
15029                    blah == EmptyStatement.Value, which is much faster and valid
15030                    now that EmptyStatement is a singleton.
15031                 3. When resolving a block, rather than allocating a new array for
15032                    the non-empty statements, empty statements are replaced with
15033                    EmptyStatement.Value
15034                 4. Some recursive functions have been made non-recursive.
15035         Mainly the performance impact is from (3), however (1) and (2) are needed for
15036         this to work. (4) does not make a big difference in normal situations, however
15037         it makes the profile look saner.
15038
15039         Bootstrap times:
15040
15041         BEFORE
15042         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15043         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15044         Total memory allocated: 56397 KB
15045
15046         AFTER
15047         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
15048         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
15049         Total memory allocated: 55666 KB
15050
15051 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15052
15053         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
15054         than the hashtable in a hashtable version
15055
15056         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
15057         we always end up concating a string. This results in a huge perf
15058         loss, because many strings have to be tracked by the GC. In this
15059         patch, we first use a hashtable that works with two keys, so that
15060         the strings do not need to be concat'ed.
15061
15062         Bootstrap times:
15063         BEFORE
15064                 Run 1:   8.74 seconds
15065                 Run 2:   8.71 seconds
15066
15067         AFTER
15068                 Run 1:   8.65 seconds
15069                 Run 2:   8.56 seconds
15070
15071 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15072
15073         * Makefile: Add a new target `do-time' that does a quick and simple
15074         profile, leaving easy to parse output.
15075
15076 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
15077
15078         * codegen.cs (Init): Create the dynamic assembly with 
15079         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
15080
15081 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
15082
15083         * support.cs: Make the PtrHashtable use only one
15084         instance of its comparer.
15085
15086 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
15087
15088         * typemanager.cs: Fix lookup of GetNamespaces.
15089
15090 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
15091
15092         * expression.cs: Removed redundant line.
15093
15094         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
15095         ArrayLists, use for loops with bounds.  
15096
15097         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
15098         arraylist.
15099
15100         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
15101         arraylists, use for loop with bounds.
15102
15103         The above three changes give us a 0.071 second performance
15104         improvement out of 3.294 seconds down to 3.223.  On my machine
15105         the above changes reduced the memory usage by 1,387 KB during
15106         compiler bootstrap.
15107
15108         * cs-parser.jay (QualifiedIdentifier): New class used to represent
15109         QualifiedIdentifiers.  Before we created a new string through
15110         concatenation, and mostly later on, the result would be
15111         manipulated by DecomposeQI through string manipulation.
15112
15113         This reduced the compiler memory usage for bootstrapping from
15114         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
15115         compile times in 0.05 seconds.
15116
15117 2003-11-28  Dick Porter  <dick@ximian.com>
15118
15119         * support.cs: Do string compares with the Invariant culture.
15120
15121         * rootcontext.cs: 
15122         * gen-treedump.cs: 
15123         * expression.cs: 
15124         * driver.cs: 
15125         * decl.cs: 
15126         * codegen.cs: 
15127         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
15128         the comparison is done with the Invariant culture.
15129
15130 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
15131
15132         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
15133         GetEnumerator method.
15134
15135         (ProbeCollectionType): Iterate starting at the most specific type
15136         upwards looking for a GetEnumerator
15137
15138         * expression.cs: Shift count can be up to 31 for int/uint and 63
15139         for long/ulong.
15140
15141 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
15142
15143         * statement.cs (Block.LookupLabel): Also look for the label on the
15144         children blocks.  Use a hash table to keep track of visited
15145         nodes. 
15146
15147         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
15148         we actually did transform the other operand, otherwise fall back
15149         to the common codepath that casts to long.
15150
15151         * cs-tokenizer.cs: Use the same code pattern as the int case.
15152         Maybe I should do the parsing myself, and avoid depending on the
15153         Parse routines to get this done.
15154
15155 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
15156
15157         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
15158         which fixes bug 51347.  This time test it.
15159
15160         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
15161         attributes for example can not tell the difference between these.
15162         The difference was only a syntax feature of the language. 
15163
15164         * attribute.cs: Apply attributes to delegates.
15165
15166         * delegate.cs: Call the apply attributes method.
15167
15168 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
15169
15170         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
15171         comparing 0 vs Byte.MinValue, not the value
15172
15173         (ImplicitConversionRequired): When reporting a conversion error,
15174         use error 31 to print out the constant error instead of the
15175         simpler 29.
15176
15177         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
15178         which fixes bug 51347.
15179
15180 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
15181
15182         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
15183         which fixes the -warnaserror command line option.
15184
15185 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
15186
15187         * cfold.cs (DoNumericPromotions): During constant folding of
15188         additions on UIntConstant, special case intconstants with
15189         IntConstants like we do on the expression binary operator. 
15190
15191 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
15192
15193         * convert.cs (ImplicitReferenceConversion): We were missing a case
15194         (System.Enum are not value types or class types, so we need to
15195         classify them separatedly).
15196
15197         * driver.cs: We do not support error 2007.
15198
15199 2003-11-12 Jackson Harper <jackson@ximian.com>
15200
15201         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
15202         system directory. Also use the full file name so users can
15203         libraries names mscorlib-o-tron.dll in a non system dir.
15204
15205 2003-11-10  Martin Baulig  <martin@ximian.com>
15206
15207         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
15208         (TypeManager.InitCoreTypes): Initialize them here, but instead of
15209         calling `ResolveType()' on them, directly assign their `Type'.
15210
15211 2003-11-08  Martin Baulig  <martin@ximian.com>
15212
15213         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
15214         return value and the `out parent' parameter.
15215         (TypeContainer.DefineType): Moved the CS0644 check into
15216         GetClassBases().  Don't pass the interface types to the
15217         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
15218         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
15219
15220         * ecore.cs (TypeExpr.IsAttribute): New property.
15221         (TypeExpr.GetInterfaces): New method.
15222
15223         * interface.cs (Interface.GetInterfaceTypeByName): Return a
15224         TypeExpr instead of a Type.
15225         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
15226         (Interface.DefineType): Don't pass the interface types to the
15227         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
15228         them later and then call `TypeBulider.AddInterfaceImplementation()'.
15229
15230         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
15231         instead of a `Type[]'.
15232         (TypeManager.RegisterBuilder): Likewise.
15233         (TypeManager.AddUserInterface): Likewise.
15234         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
15235         `Type[]' and also return a `TypeExpr[]'.
15236         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
15237
15238 2003-11-08  Martin Baulig  <martin@ximian.com>
15239
15240         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
15241         Expression.     
15242
15243 2003-11-08  Martin Baulig  <martin@ximian.com>
15244
15245         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
15246         TypeManager.ResolveExpressionTypes().
15247
15248         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
15249         instead of an Expression.
15250         (TypeExpr): This is now an abstract base class for `TypeExpression'.
15251         (TypeExpression): New public class; formerly known as `TypeExpr'.
15252
15253         * expression.cs (ComposedCast): Derive from TypeExpr.
15254
15255         * typemanager.cs (TypeManager.system_*_expr): These are now
15256         TypExpr's instead of Expression's.
15257         (TypeManager.ResolveExpressionTypes): New public static function;
15258         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
15259         of them.        
15260
15261 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
15262
15263         * expression.cs (New.DoResolve): Do not dereference value that
15264         might be a null return.
15265
15266         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
15267         sure that the constant value has the right type.  Fixes an
15268         unreported bug, similar to 50425.
15269
15270         * const.cs (Const.LookupConstantValue): Call
15271         ImplicitStandardConversionExists before doing a conversion to
15272         avoid havng the TypeManager.ChangeType do conversions.
15273
15274         Reduced the number of casts used
15275
15276         (Const.ChangeType): New routine to enable reuse of the constant
15277         type changing code from statement.
15278
15279         * typemanager.cs (ChangeType): Move common initialization to
15280         static global variables.
15281
15282         Fixes #50425.
15283
15284         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
15285         every value type to go through, even if it was void.  Fix that. 
15286
15287         * cs-tokenizer.cs: Use is_identifier_start_character on the start
15288         character of the define, and the is_identifier_part_character for
15289         the rest of the string.
15290
15291 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
15292
15293         * expression.cs (UnaryMutator.EmitCode): When I updated
15294         LocalVariableReference.DoResolve, I overdid it, and dropped an
15295         optimization done on local variable references.
15296
15297 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
15298
15299         * ecore.cs: Convert the return from Ldlen into an int.
15300
15301 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
15302
15303         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
15304         the accessibility, this is a special case for toplevel non-public
15305         classes (internal for instance).
15306
15307 2003-10-20  Nick Drochak <ndrochak@gol.com>
15308
15309         * ecore.cs: Fix typo and build.  Needed another right paren.
15310
15311 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
15312
15313         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
15314         `internal' case regular and protected, but not allowing protected
15315         to be evaluated later.  Bug 49840
15316
15317 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
15318
15319         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
15320         to kb.Nlast, and not the kb.nFirst to isolate the switch
15321         statement.
15322
15323         Extract the underlying type, so enumerations of long/ulong are
15324         treated like long/ulong.
15325
15326 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
15327
15328         * expression.cs (New): Overload the meaning of RequestedType to
15329         track the possible creation of the NewDelegate type, since
15330         DoResolve is invoked more than once for new constructors on field
15331         initialization.
15332
15333         See bugs: #48800 and #37014
15334
15335         * cs-parser.jay (declare_local_constants): Take an arraylist
15336         instead of a single constant.
15337
15338         (local_constant_declaration): It should take a
15339         constant_declarators, not a constant_declarator.  Fixes 49487
15340
15341         * convert.cs: Fix error report.
15342
15343 2003-10-13 Jackson Harper <jackson@ximian.com>
15344
15345         * typemanager.cs (TypeToCoreType): Add float and double this fixes
15346         bug #49611
15347
15348 2003-10-09  Martin Baulig  <martin@ximian.com>
15349
15350         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
15351         to the .ctor.
15352         (MethodCore.DoDefineParameters): Removed the TypeContainer
15353         argument; use the DeclSpace which was passed to the .ctor instead.
15354         (MethodCore.CheckParameter): Take a DeclSpace instead of a
15355         TypeContainer; we only need a DeclSpace here.
15356
15357 2003-10-09  Martin Baulig  <martin@ximian.com>
15358
15359         * class.cs (MethodData): Added additional `DeclSpace ds' argument
15360         to the .ctor.
15361         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
15362         EmitContext's .ctor.    
15363
15364 2003-10-09  Martin Baulig  <martin@ximian.com>
15365
15366         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
15367         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
15368         AsAccessible(), moved them as well.
15369
15370         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
15371
15372 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
15373
15374         * cs-parser.jay : Renamed yyName to yyNames related to jay.
15375
15376 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
15377
15378         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
15379         generation for >=, as spotted by Paolo, bug 48679.  
15380         Patch from David Waite.
15381
15382         * cs-tokenizer.cs: Add handling for #pragma.
15383
15384         * cs-parser.jay: Allow for both yield and yield return in the
15385         syntax.  The anti-cobolization of C# fight will go on!
15386
15387         * class.cs (TypeBuilder.DefineType): Catch error condition here
15388         (Parent.DefineType erroring out and returning null).
15389
15390         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15391         coping with enumerations variables, we were mistakenly processing
15392         them as a regular value type instead of built-in types.  Fixes the
15393         bug #48063
15394
15395         * typemanager.cs (IsBuiltinOrEnum): New method.
15396
15397 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
15398
15399         * cs-parser.jay: Upgrade: yield now needs the return clause.
15400
15401 2003-09-19  Martin Baulig  <martin@ximian.com>
15402
15403         * decl.cs (MemberCache.SetupCacheForInterface): Take a
15404         `MemberCache parent' argument.  Normally, an interface doesn't
15405         have a parent type except System.Object, but we use this in gmcs
15406         for generic type parameters.
15407
15408 2003-09-18  Martin Baulig  <martin@ximian.com>
15409
15410         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
15411         on `type.IsInterface'; don't check whether the type has a parent
15412         to determine whether it's an interface.
15413
15414 2003-09-15  Martin Baulig  <martin@ximian.com>
15415
15416         * class.cs (TypeContainer.DefineType): Added an error flag to
15417         avoid reporting duplicate CS0146's ("class definition is
15418         circular.").
15419
15420         * driver.cs (Driver.MainDriver): Abort if
15421         RootContext.ResolveTree() reported any errors.
15422
15423 2003-09-07  Martin Baulig  <martin@ximian.com>
15424
15425         * report.cs (Error, Warning): Added overloaded versions which take
15426         a `params object[] args' and call String.Format().
15427
15428 2003-09-07  Martin Baulig  <martin@ximian.com>
15429
15430         * decl.cs (DeclSpace..ctor): Don't call
15431         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
15432         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
15433         (DeclSpace.RecordDecl): New method.
15434
15435         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
15436
15437 2003-09-02  Ravi Pratap  <ravi@ximian.com>
15438
15439         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
15440         value attributes to be applied to ParameterBuilders.
15441
15442         * class.cs (MethodCore.LabelParameters): Make static and more
15443         generic so that it can be used from other places - like interface
15444         methods, for instance.
15445
15446         * interface.cs (Interface.Emit): Call LabelParameters before
15447         emitting attributes on the InterfaceMethod.
15448
15449 2003-08-26  Martin Baulig  <martin@ximian.com>
15450
15451         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
15452         resolving aliases; fixes #47927.
15453
15454 2003-08-26  Martin Baulig  <martin@ximian.com>
15455
15456         * statement.cs (Using.DoResolve): This is internally emitting a
15457         try/finally clause, so we need to set ec.NeedExplicitReturn if we
15458         do not always return.  Fixes #47681.
15459
15460 2003-08-26  Martin Baulig  <martin@ximian.com>
15461
15462         * decl.cs (MemberCore): Moved WarningNotHiding(),
15463         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
15464         into MemberBase.
15465         (AdditionResult): Make this nested in DeclSpace.
15466         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
15467         argument; call NamespaceEntry.Define() unless we're nested in a
15468         class or struct.
15469
15470         * namespace.cs (Namespace.DefineName): New public function.  This
15471         is called from DeclSpace's .ctor to add 
15472         (Namespace.Lookup): Include DeclSpaces in the lookup.
15473
15474         * class.cs (Operator): Derive from MemberBase, not MemberCore.
15475
15476         * const.cs (Const): Derive from MemberBase, not MemberCore.     
15477
15478 2003-08-25  Martin Baulig  <martin@ximian.com>
15479
15480         * convert.cs (Convert.ExplicitReferenceConversion): When
15481         converting from an interface type to a class, unbox if the target
15482         type is a struct type.  Fixes #47822.
15483
15484 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15485
15486         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
15487         #47854.
15488
15489 2003-08-22  Martin Baulig  <martin@ximian.com>
15490
15491         * class.cs (TypeManager.DefineType): When defining a nested type,
15492         call DefineType() on our parent; fixes #47801.
15493
15494 2003-08-22  Martin Baulig  <martin@ximian.com>
15495
15496         * class.cs (MethodData.Define): While checking if a method is an
15497         interface implementation, improve the test a bit more to fix #47654.
15498
15499 2003-08-22  Martin Baulig  <martin@ximian.com>
15500
15501         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
15502         correctly; fixes #47722.
15503
15504 2003-08-22  Martin Baulig  <martin@ximian.com>
15505
15506         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
15507         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
15508
15509         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
15510
15511 2003-08-22  Martin Baulig  <martin@ximian.com>
15512
15513         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
15514         can only be assigned in static constructors.  Fixes #47161.
15515
15516 2003-08-22  Martin Baulig  <martin@ximian.com>
15517
15518         Rewrote and improved the flow analysis code.
15519
15520         * flowbranching.cs (FlowBranching): Make this class abstract.
15521         (FlowBranching.CreateBranching): New static function to create a
15522         new flow branching.
15523         (FlowBranchingBlock, FlowBranchingException): New classes.
15524         (FlowBranching.UsageVector.Type): New public readonly field.
15525         (FlowBranching.UsageVector.Breaks): Removed the setter.
15526         (FlowBranching.UsageVector.Returns): Removed the setter.
15527         (FlowBranching.UsageVector): Added Break(), Return(),
15528         NeverReachable() and Throw() methods to modify the reachability.
15529         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
15530         done by FlowBranching.Merge().
15531         (FlowBranching.UsageVector.MergeChild): New method; merges the
15532         merge result into the current vector.
15533         (FlowBranching.Merge): New abstract method to merge a branching.
15534
15535 2003-08-12  Martin Baulig  <martin@ximian.com>
15536
15537         * expression.cs (Indirection.CacheTemporaries): Create the
15538         LocalTemporary with the pointer type, not its element type.
15539
15540 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
15541
15542         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
15543         token was a keyword or not.
15544
15545         Add `error' options where an IDENTIFIER was expected;  Provide
15546         CheckToken and CheckIdentifierToken convenience error reporting
15547         functions. 
15548
15549         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
15550
15551         * decl.cs: Rename `NamespaceEntry Namespace' public field into
15552         NameSpaceEntry NameSpaceEntry.
15553
15554         (LookupInterfaceOrClass): Avoid creating a full qualified name
15555         from namespace and name: avoid doing lookups when we know the
15556         namespace is non-existant.   Use new Tree.LookupByNamespace which
15557         looks up DeclSpaces based on their namespace, name pair.
15558
15559         * driver.cs: Provide a new `parser verbose' to display the
15560         exception thrown during parsing.  This is turned off by default
15561         now, so the output of a failure from mcs is more graceful.
15562
15563         * namespace.cs: Track all the namespaces defined in a hashtable
15564         for quick lookup.
15565
15566         (IsNamespace): New method
15567
15568 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
15569
15570         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
15571         we know that we need to concatenate (full typename can never be
15572         null). 
15573
15574         * class.cs: ditto.
15575
15576         * statement.cs: Use a bitfield;  Do not initialize to null things
15577         which are done by the constructor by default.
15578
15579         * cs-parser.jay: bug fix, parameter was 4, not 3.
15580
15581         * expression.cs: Just use the property;
15582
15583         * statement.cs: No need for GetVariableInfo method.
15584
15585 2003-08-08  Martin Baulig  <martin@ximian.com>
15586
15587         * flowanalysis.cs (FlowReturns): This is now nested in the
15588         `FlowBranching' class.
15589         (MyBitVector): Moved this here from statement.cs.
15590         (FlowBranching.SiblingType): New enum type.
15591         (FlowBranching.CreateSibling): Added `SiblingType' argument.
15592
15593 2003-08-07  Martin Baulig  <martin@ximian.com>
15594
15595         * flowanalysis.cs (FlowBranchingType): This is now nested in the
15596         `FlowBranching' class and called `BranchingType'.
15597
15598 2003-08-07  Martin Baulig  <martin@ximian.com>
15599
15600         * flowanalysis.cs: Moved all the control flow analysis code into
15601         its own file.
15602
15603 2003-08-07  Martin Baulig  <martin@ximian.com>
15604
15605         * assign.cs (Assign.DoResolve): `target' must either be an
15606         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
15607         #37319.
15608
15609 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
15610
15611         * expression.cs (BinaryMethod): This kind of expression is created by the
15612         Binary class if it determines that the operator has to be handled
15613         by a method.
15614
15615         (BinaryDelegate): This kind of expression is created if we are
15616         dealing with a + or - operator on delegates.
15617
15618         (Binary): remove method, argumetns, and DelegateOperator: when
15619         dealing with methods, 
15620
15621         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
15622
15623         * statement.cs (Block): use bitfields for the three extra booleans
15624         we had in use.   Remove unused topblock parameter.
15625
15626         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
15627
15628         * assign.cs: Drop extra unneeded tests.
15629
15630 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
15631
15632         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
15633
15634         * statement.cs (Foreach): Use VariableStorage instead of
15635         LocalBuilders.   
15636
15637         * codegen.cs (VariableStorage): New class used by clients that
15638         require a variable stored: locals or fields for variables that
15639         need to live across yield.
15640
15641         Maybe provide a convenience api for EmitThis+EmitLoad?
15642
15643         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
15644         these bad boys.
15645
15646 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
15647
15648         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
15649         RemapParameterLValue): New methods that are used to turn a
15650         precomputed FieldInfo into an expression like this:
15651
15652                 instance.FieldInfo
15653
15654         The idea is to use this instead of making LocalVariableReference
15655         have more than one meaning.
15656
15657         * cs-parser.jay: Add error production to BASE.
15658
15659         * ecore.cs: Deal with TypeManager.GetField returning null, which
15660         is now a valid return value.
15661
15662         (FieldExprNoAddress): New expression for Fields whose address can
15663         not be taken.
15664
15665         * expression.cs (LocalVariableReference): During the resolve
15666         phases, create new expressions if we are in a remapping context.
15667         Remove code that dealt with remapping here.
15668
15669         (ParameterReference): same.
15670
15671         (ProxyInstance): New expression, like the `This' expression, but
15672         it is born fully resolved.  We know what we are doing, so remove
15673         the errors that are targeted to user-provided uses of `this'.
15674
15675         * statement.cs (Foreach): our variable is now stored as an
15676         Expression;  During resolution, follow the protocol, dont just
15677         assume it will return this.
15678
15679 2003-08-06  Martin Baulig  <martin@ximian.com>
15680
15681         * support.cs (SeekableStreamReader.cs): New public class.
15682
15683         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
15684         SeekableStreamReader instead of the normal StreamReader.
15685
15686 2003-08-04  Martin Baulig  <martin@ximian.com>
15687
15688         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
15689         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
15690         deambiguate casts and delegate invocations.
15691         (parenthesized_expression): Use the new tokens to ensure this is
15692         not a cast of method invocation.
15693
15694         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
15695         when reading a `)' and Deambiguate_CloseParens () was previously
15696         called.
15697
15698         * expression.cs (ParenthesizedExpression): New class.  This is
15699         just used for the CS0075 test.
15700         (Binary.DoResolve): Check for CS0075.   
15701
15702 2003-07-29  Ravi Pratap  <ravi@ximian.com>
15703
15704         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
15705         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
15706         reference comparison.
15707
15708         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
15709         examine the ReturnType for equality - this is necessary in the
15710         cases of implicit and explicit operators whose signature also
15711         includes the return type.
15712
15713 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
15714
15715         * namespace.cs: Cache the result of the namespace computation,
15716         instead of computing it every time.
15717
15718 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
15719
15720         * decl.cs: Use a global arraylist that we reuse over invocations
15721         to avoid excesive memory consumption.  Reduces memory usage on an
15722         mcs compile by one meg (45 average).
15723
15724         * typemanager.cs (LookupTypeReflection): In .NET pointers are
15725         private, work around that.
15726
15727 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
15728
15729         * literal.cs (IntLiteral): Define Zero and One static literals. 
15730
15731         * cs-parser.jay (integer_literal): use static literals to reduce
15732         memory usage for the most used literals (0, 1 and -1).  211kb
15733         reduced in memory usage.
15734
15735         Replace all calls to `new ArrayList' with `new
15736         ArrayList(4)' which is a good average number for most allocations,
15737         and also requires only 16 bytes of memory for its buffer by
15738         default. 
15739
15740         This reduced MCS memory usage in seven megabytes for the RSS after
15741         bootstrapping.
15742
15743 2003-07-28  Ravi Pratap  <ravi@ximian.com>
15744
15745         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
15746         handle params methods the correct way by forming only one
15747         applicable set with params and normal methods in them. Earlier we
15748         were looking at params methods only if we found no normal methods
15749         which was not the correct thing to do.
15750
15751         (Invocation.BetterFunction): Take separate arguments indicating
15752         when candidate and the best method are params methods in their
15753         expanded form.
15754
15755         This fixes bugs #43367 and #46199.
15756
15757         * attribute.cs: Documentation updates.
15758
15759         (CheckAttribute): Rename to CheckAttributeTarget.
15760         (GetValidPlaces): Rename to GetValidTargets.
15761
15762         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
15763         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
15764
15765         Fixes bug #44468.
15766
15767 2003-07-28  Martin Baulig  <martin@ximian.com>
15768
15769         * class.cs (TypeContainer.DefineMembers): Use the base type's full
15770         name when looking up the base class of a nested class.  Fixes #46977.
15771
15772 2003-07-26  Martin Baulig  <martin@ximian.com>
15773
15774         * expression.cs (Indexers.Indexer): New nested struct; contains
15775         getter, setter and the indexer's type.
15776         (Indexers.Properties): This is now an ArrayList of
15777         Indexers.Indexer's.
15778         (IndexerAccess.DoResolveLValue): Correctly set the type if the
15779         indexer doesn't have any getters.
15780
15781         * assign.cs (Assign.DoResolve): Also do the implicit conversions
15782         for embedded property and indexer assignments.
15783
15784 2003-07-26  Martin Baulig  <martin@ximian.com>
15785
15786         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
15787         preprocessor directive is not the first non-whitespace character
15788         on a line.
15789
15790 2003-07-26  Martin Baulig  <martin@ximian.com>
15791
15792         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
15793         namespace parsing, follow the spec more closely.
15794
15795         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
15796         NamespaceEntry.Lookup().
15797
15798 2003-07-25  Martin Baulig  <martin@ximian.com>
15799
15800         * MethodCore.cs (OverridesSomething): New public field; it's set
15801         from TypeContainer.DefineMembers if this method overrides
15802         something (which doesn't need to be a method).  Fix #39462.
15803
15804 2003-07-25  Ravi Pratap  <ravi@ximian.com>
15805
15806         * typemanager.cs (GetMembers): Ensure that the list of members is
15807         reversed. This keeps things in sync.
15808
15809         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
15810         find an AttributeUsage attribute.
15811
15812         * expression.cs (Invocation.OverloadResolve): Perform the check
15813         which disallows Invoke to be directly called on a Delegate.
15814
15815         (Error_InvokeOnDelegate): Report error cs1533.
15816
15817 2003-07-25  Martin Baulig  <martin@ximian.com>
15818
15819         * expression.cs (Indexers.GetIndexersForType): Only look in the
15820         interface hierarchy if the requested type is already an
15821         interface.  Fixes #46788 while keeping #46502 fixed.
15822
15823 2003-07-25  Martin Baulig  <martin@ximian.com>
15824
15825         * class.cs (TypeContainer.DefineMembers): Check whether all
15826         readonly fields have been assigned and report warning CS0649 if
15827         not.
15828
15829         * statement.cs (LocalInfo.IsFixed): Always return true if this is
15830         a valuetype.
15831
15832 2003-07-24  Ravi Pratap  <ravi@ximian.com>
15833
15834         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
15835         returned from GetMethods to make things consistent with the
15836         assumptions MCS makes about ordering of methods.
15837
15838         This should comprehensively fix bug #45127 and it does :-)
15839
15840         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
15841         ordering is actually reverse.
15842
15843         * Clean up some debug messages I left lying around.
15844
15845         * interface.cs (Populate*): Get rid of code which emits attributes
15846         since the stage in which we emit attributes is the 'Emit' stage,
15847         not the define stage.
15848
15849         (Emit): Move attribute emission for interface members here.
15850
15851 2003-07-22  Ravi Pratap  <ravi@ximian.com>
15852
15853         * expression.cs (Invocation.OverloadResolve): Follow the spec more
15854         closely: we eliminate methods in base types when we have an
15855         applicable method in a top-level type.
15856
15857         Please see section 14.5.5.1 for an exact description of what goes
15858         on. 
15859
15860         This fixes bug #45127 and a host of other related to corlib compilation.
15861
15862         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
15863         array is the method corresponding to the top-level type (this is
15864         because of the changes made to icall.c) so we change this
15865         accordingly.
15866
15867         (MethodGroupExpr.Name): This too.
15868
15869         * typemanager.cs (GetElementType): New method which does the right
15870         thing when compiling corlib. 
15871
15872         * everywhere: Make use of the above in the relevant places.
15873
15874 2003-07-22  Martin Baulig  <martin@ximian.com>
15875
15876         * cs-parser.jay (invocation_expression): Moved
15877         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
15878         `cast_expression', but create a InvocationOrCast which later
15879         resolves to either an Invocation or a Cast.
15880
15881         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
15882         method; call this before EmitStatement() to make sure that this
15883         expression can be used as a statement.
15884
15885         * expression.cs (InvocationOrCast): New class; resolves to either
15886         an Invocation or a Cast.
15887
15888         * statement.cs (StatementExpression): Call ResolveStatement() on
15889         the ExpressionStatement before emitting it.
15890
15891 2003-07-21  Martin Baulig  <martin@ximian.com>
15892
15893         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
15894         `ref' and `out' attributes match; fixes #46220.
15895         (MemberAccess.ResolveMemberAccess): You can't reference a type
15896         through an expression; fixes #33180.
15897         (Indexers.GetIndexersForType): Don't return the indexers from
15898         interfaces the class implements; fixes #46502.
15899
15900 2003-07-21  Martin Baulig  <martin@ximian.com>
15901
15902         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
15903         CS0661 checks; fixes bug #30442.
15904
15905 2003-07-21  Martin Baulig  <martin@ximian.com>
15906
15907         * decl.cs (AdditionResult): Added `Error'.
15908
15909         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
15910
15911         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
15912         makes cs0031.cs actually work.
15913
15914 2003-07-20  Martin Baulig  <martin@ximian.com>
15915
15916         * namespace.cs: Fixed that bug which caused a crash when compiling
15917         the debugger's GUI.
15918
15919 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
15920
15921         * typemanager.cs (LookupTypeReflection): Never expose types which
15922         are NotPublic, NestedPrivate, NestedAssembly, or
15923         NestedFamANDAssem.  We used to return these, and later do a check
15924         that would report a meaningful error, but the problem is that we
15925         would not get the real match, if there was a name override.
15926
15927 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
15928
15929         * namespace.cs (Namespace, Name): Do not compute the namespace
15930         name dynamically, compute it in the constructor.  This reduced
15931         memory usage by 1697 KB.
15932
15933         * driver.cs: Use --pause to pause at the end.
15934
15935 2003-07-17  Peter Williams  <peter@newton.cx>
15936
15937         * Makefile: Change the name of the test target so that it doesn't
15938         conflict with the recursive test target.
15939
15940 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
15941
15942         * expression.cs (LocalVariableReference.Emit, EmitAssign,
15943         AddressOf): Do not use EmitThis, that was wrong, use the actual
15944         this pointer.
15945
15946 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
15947
15948         * class.cs (MethodData.Define): While checking if a method is an
15949         interface implementation, improve the test: If we are not public
15950         (use new test here: use the computed MethodAttributes directly,
15951         instead of the parsed modifier flags) check if the `implementing'
15952         method comes from an interface or not.
15953
15954         * pending.cs (VerifyPendingMethods): Slightly better error
15955         message.
15956
15957         * makefile: add test target that does the mcs bootstrap.
15958
15959 2003-07-16  Ravi Pratap  <ravi@ximian.com>
15960
15961         * interface.cs (Define): Do nothing here since there are no
15962         members to populate etc. Move the attribute emission out of here
15963         since this was just totally the wrong place to put it. Attribute
15964         application happens during the 'Emit' phase, not in the 'Define'
15965         phase.
15966
15967         (Emit): Add this method and move the attribute emission here
15968
15969         * rootcontext.cs (EmitCode): Call the Emit method on interface
15970         types too.
15971
15972 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
15973
15974         * expression.cs (OverloadResolve): Report error only if Location
15975         is not 'Null' which means that there was a probe going on.
15976
15977 2003-07-14  Martin Baulig  <martin@ximian.com>
15978
15979         * expression.cs (ConditionalLogicalOperator): New public class to
15980         implement user defined conditional logical operators.
15981         This is section 14.11.2 in the spec and bug #40505.
15982
15983 2003-07-14  Martin Baulig  <martin@ximian.com>
15984
15985         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
15986
15987 2003-07-14  Martin Baulig  <martin@ximian.com>
15988
15989         * codegen.cs (EmitContext.InFixedInitializer): New public field.
15990
15991         * ecore.cs (IVariable.VerifyFixed): New interface method.
15992
15993         * expression.cs (Unary.ResolveOperator): When resolving the `&'
15994         operator, check whether the variable is actually fixed.  Fixes bug
15995         #36055.  Set a variable definitely assigned when taking its
15996         address as required by the spec.
15997
15998         * statement.cs (LocalInfo.IsFixed): New field.
15999         (LocalInfo.MakePinned): Set `IsFixed' to true.
16000
16001 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
16002
16003         * attribute.cs (Attribute.Resolve): While doing a Member lookup
16004         for .ctors, ensure that we only ask for members declared in the
16005         attribute type (BindingFlags.DeclaredOnly).
16006
16007         Fixes bug #43632.
16008
16009         * expression.cs (Error_WrongNumArguments): Report error 1501
16010         correctly the way CSC does.
16011
16012 2003-07-13  Martin Baulig  <martin@ximian.com>
16013
16014         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
16015         lookup on the fully qualified name, to make things like "X.X" work
16016         where "X.X" is a fully qualified type name, but we also have a
16017         namespace "X" in the using list.  Fixes #41975.
16018
16019 2003-07-13  Martin Baulig  <martin@ximian.com>
16020
16021         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
16022         function. If we're a CompoundAssign, we need to create an embedded
16023         CompoundAssign, not an embedded Assign.
16024         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
16025         Fixes #45854.
16026
16027 2003-07-13  Martin Baulig  <martin@ximian.com>
16028
16029         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
16030         work to fix bug #46088.
16031
16032 2003-07-13  Ravi Pratap <ravi@ximian.com>
16033
16034         * class.cs (Operator.Emit): Do not emit attributes here - it is
16035         taken care of by the Method class that we delegate too. This takes
16036         care of bug #45876.
16037
16038 2003-07-10  Martin Baulig  <martin@ximian.com>
16039
16040         * expression.cs (TypeOfVoid): New class.
16041         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
16042
16043 2003-07-10  Martin Baulig  <martin@ximian.com>
16044
16045         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
16046         bug #35957.
16047
16048 2003-07-10  Martin Baulig  <martin@ximian.com>
16049
16050         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
16051         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
16052
16053         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
16054
16055         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
16056
16057 2003-07-10  Martin Baulig  <martin@ximian.com>
16058
16059         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
16060         of decimal.  Fixes #42850.
16061
16062         NOTE: I also fixed the created byte blob, but this doesn't work on
16063         the MS runtime and csc never produces any byte blobs for decimal
16064         arrays.
16065
16066 2003-07-10  Martin Baulig  <martin@ximian.com>
16067
16068         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
16069         structs; fixes #32068.
16070         (Block.AddChildVariableNames): Fixed #44302.
16071
16072 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16073
16074         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
16075
16076 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
16077
16078         * attribute.cs: And this test is onger needed.
16079
16080 2003-07-08  Martin Baulig  <martin@ximian.com>
16081
16082         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
16083         inaccessible types.  Fixes #36313.
16084
16085         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
16086
16087         * namespace.cs (NamespaceEntry): Create implicit entries for all
16088         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
16089         implicit entries for N1.N2 and N1.
16090
16091 2003-07-08  Martin Baulig  <martin@ximian.com>
16092
16093         Rewrote the handling of namespaces to fix a lot of the issues
16094         wrt. `using' aliases etc.
16095
16096         * namespace.cs (Namespace): Splitted this class into a
16097         per-assembly `Namespace' and a per-file `NamespaceEntry'.
16098
16099         * typemanager.cs (TypeManager.IsNamespace): Removed.
16100         (TypeManager.ComputeNamespaces): Only compute namespaces from
16101         loaded assemblies here, not the namespaces from the assembly we're
16102         currently compiling.
16103
16104 2003-07-08  Martin Baulig  <martin@ximian.com>
16105
16106         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
16107
16108 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
16109
16110         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
16111         already fixed it.  
16112
16113         I thought about the memory savings here, but LookupTypeReflection
16114         is used under already very constrained scenarios.  Compiling
16115         corlib or mcs only exposes one hit, so it would not really reduce
16116         any memory consumption.
16117
16118 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16119
16120         * typemanager.cs: fixes bug #45889 by only adding public types from
16121         other assemblies to the list of known types.
16122
16123 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
16124
16125         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
16126         on the type we resolved.
16127
16128 2003-07-05  Martin Baulig  <martin@ximian.com>
16129
16130         * pending.cs (PendingImplementation.ParentImplements): Don't
16131         create the proxy if the parent is abstract.
16132
16133         * class.cs (TypeContainer.DefineIndexers): Process explicit
16134         interface implementations first.  Fixes #37714.
16135
16136 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
16137
16138         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
16139         defined recursively;  but since we modify the input parameters
16140         (left is set to `this' temporarily), we reset this value if the
16141         left_is_explicit is false, which gives the original semantics to
16142         the code.  
16143
16144         * literal.cs (NullPointer): new class used to represent a null
16145         literal in a pointer context.
16146
16147         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
16148         type is a pointer, use a NullPointer object instead of a
16149         NullLiteral.   Closes 43687
16150
16151         (ExplicitConversion): Convert pointer values using
16152         the conv opcode to the proper type.
16153
16154         * ecore.cs (New): change ValueTypeVariable property into a method,
16155         that returns whether the valuetype is suitable for being used.
16156
16157         * expression.cs (Binary.DoNumericPromotions): Only return if we
16158         the int constant was a valid uint, and we can return both left and
16159         right as uints.  If not, we continue processing, to trigger the
16160         type conversion.  This fixes 39018.
16161
16162         * statement.cs (Block.EmitMeta): During constant resolution, set
16163         the CurrentBlock property on the emitcontext, so that we resolve
16164         constants propertly.
16165
16166 2003-07-02  Martin Baulig  <martin@ximian.com>
16167
16168         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
16169         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
16170
16171         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
16172         than emitting it here.
16173
16174         * statement.cs: Fixed some more flow analysis bugs.
16175
16176 2003-07-02  Martin Baulig  <martin@ximian.com>
16177
16178         * class.cs (MethodData.Define): When implementing interface
16179         methods, set Final unless we're Virtual.
16180
16181         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
16182         check work for interface methods.
16183
16184 2003-07-01  Martin Baulig  <martin@ximian.com>
16185
16186         * ecore.cs (EmitContext.This): Replaced this property with a
16187         GetThis() method which takes a Location argument.  This ensures
16188         that we get the correct error location for a CS0188.
16189
16190 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
16191
16192         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
16193         ImplicitStandardConversion.
16194
16195         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
16196
16197 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
16198
16199         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
16200         optimization.
16201
16202 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
16203
16204         * class.cs (Constructor.Define): Turn off initlocals for unsafe
16205         constructors.
16206
16207         (MethodData.Define): Turn off initlocals for unsafe methods.
16208
16209 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
16210
16211         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
16212         complete;  Fixes #37521.
16213
16214         * delegate.cs: Use Modifiers.TypeAttr to compute the
16215         TypeAttributes, instead of rolling our own.  This makes the flags
16216         correct for the delegates.
16217
16218 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
16219
16220         * class.cs (Constructor.Define): Set the private flag for static
16221         constructors as well.
16222
16223         * cs-parser.jay (statement_expression): Set the return value to
16224         null, to avoid a crash when we catch an error.
16225
16226 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
16227
16228         * cs-parser.jay: Applied patch from Jackson that adds support for
16229         extern and unsafe modifiers to destructor declarations.
16230
16231         * expression.cs: Report error 21 if the user is trying to index a
16232         System.Array.
16233
16234         * driver.cs: Add an error message, suggested by the bug report.
16235
16236         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
16237         if we do not have a ": this ()" constructor initializer.  Fixes 45149
16238
16239 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
16240
16241         * namespace.cs: Add some information to reduce FAQs.
16242
16243 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
16244
16245         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
16246         underlying enumeration types.  Fixes #43915.
16247
16248         * expression.cs: Treat ushort/short as legal values to be used in
16249         bitwise operations.
16250
16251 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
16252
16253         * delegate.cs: transfer custom attributes for paramenters from
16254         the delegate declaration to Invoke and BeginInvoke.
16255
16256 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
16257
16258         * attribute.cs: handle custom marshalers and emit marshal info
16259         for fields, too.
16260
16261 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
16262
16263         * makefile.gnu: Added anonymous.cs to the compiler sources.
16264
16265 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
16266
16267         * iterators.cs: Change the name of the proxy class to include two
16268         underscores.
16269
16270         * cs-parser.jay: Update grammar to include anonymous methods.
16271
16272         * anonymous.cs: new file.
16273
16274 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
16275
16276         * class.cs (Field.Define): Add missing test for pointers and
16277         safety. 
16278
16279 2003-05-27  Ravi Pratap  <ravi@ximian.com>
16280
16281         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
16282         we use the stobj opcode.
16283
16284         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
16285         since it wasn't the correct fix. 
16286
16287         It still is puzzling that we are required to use stobj for IntPtr
16288         which seems to be a ValueType.
16289
16290 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
16291
16292         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
16293         during regular simple name resolution.   Now, the trick is that
16294         instead of returning for processing the simplename, we do a
16295         TypeManager.LookupType (ie, a rooted lookup as opposed to a
16296         contextual lookup type).   If a match is found, return that, if
16297         not, return for further composition.
16298
16299         This fixes long-standing 30485.
16300
16301         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
16302         using the address to initialize an object, do an Stobj instead of
16303         using the regular Stelem.
16304
16305         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
16306         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
16307         Because if we are a BaseIndexerAccess that value will be true.
16308         Fixes 43643.
16309
16310         * statement.cs (GotoCase.Resolve): Return after reporting an
16311         error, do not attempt to continue. 
16312
16313         * expression.cs (PointerArithmetic.Emit): If our operand is a
16314         long, convert our constants to match the operand before
16315         multiplying.  Convert to I type before adding.   Fixes 43670.
16316
16317 2003-05-14  Ravi Pratap  <ravi@ximian.com>
16318
16319         * enum.cs (ImplicitConversionExists) : Rename to
16320         ImplicitEnumConversionExists to remove ambiguity. 
16321
16322         * ecore.cs (NullCast): New type of cast expression class which
16323         basically is very similar to EmptyCast with the difference being
16324         it still is a constant since it is used only to cast a null to
16325         something else
16326         (eg. (string) null)
16327
16328         * convert.cs (ImplicitReferenceConversion): When casting a null
16329         literal, we return a NullCast.
16330
16331         * literal.cs (NullLiteralTyped): Remove - I don't see why this
16332         should be around anymore.
16333
16334         The renaming (reported was slightly wrong). Corrections:
16335
16336         ConvertImplicitStandard -> ImplicitConversionStandard
16337         ConvertExplicitStandard -> ExplicitConversionStandard
16338
16339         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
16340         before passing them in !
16341
16342         * convert.cs (ImplicitConversionStandard): When comparing for
16343         equal expr and target types, ensure that expr is not a
16344         NullLiteral.
16345
16346         In general, we must not be checking (expr_type ==
16347         target_type) in the top level conversion methods
16348         (ImplicitConversion, ExplicitConversion etc). This checking is
16349         done in the methods that they delegate to.
16350
16351 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
16352
16353         * convert.cs: Move Error_CannotConvertType,
16354         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
16355         ImplicitNumericConversion, ImplicitConversionExists,
16356         ImplicitUserConversionExists, StandardConversionExists,
16357         FindMostEncompassedType, FindMostSpecificSource,
16358         FindMostSpecificTarget, ImplicitUserConversion,
16359         ExplicitUserConversion, GetConversionOperators,
16360         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
16361         TryImplicitIntConversion, Error_CannotConvertImplicit,
16362         ConvertImplicitRequired, ConvertNumericExplicit,
16363         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
16364         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
16365         its own file.
16366
16367         Perform the following renames:
16368
16369         StandardConversionExists -> ImplicitStandardConversionExists
16370         ConvertImplicit -> ImplicitConversion
16371         ConvertImplicitStandard -> ImplicitStandardConversion
16372         TryImplicitIntConversion -> ImplicitIntConversion
16373         ConvertImplicitRequired -> ImplicitConversionRequired
16374         ConvertNumericExplicit -> ExplicitNumericConversion
16375         ConvertReferenceExplicit -> ExplicitReferenceConversion
16376         ConvertExplicit -> ExplicitConversion
16377         ConvertExplicitStandard -> ExplicitStandardConversion
16378
16379 2003-05-19  Martin Baulig  <martin@ximian.com>
16380
16381         * statement.cs (TypeInfo.StructInfo): Made this type protected.
16382         (TypeInfo): Added support for structs having structs as fields.
16383
16384         * ecore.cs (FieldExpr): Implement IVariable.
16385         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
16386         VariableInfo for the field.
16387
16388 2003-05-18  Martin Baulig  <martin@ximian.com>
16389
16390         * expression.cs (This.DoResolve): Report a CS0027 if we're
16391         emitting a field initializer.
16392
16393 2003-05-18  Martin Baulig  <martin@ximian.com>
16394
16395         * expression.cs (This.ResolveBase): New public function.
16396         (This.DoResolve): Check for CS0188.
16397
16398         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
16399         This.Resolve().
16400
16401         * ecore.cs (MethodGroupExpr.DoResolve): Set the
16402         `instance_expression' to null if we don't have any non-static
16403         methods.
16404
16405 2003-05-18  Martin Baulig  <martin@ximian.com>
16406
16407         Reworked the way how local variables and parameters are handled by
16408         the flow analysis code.
16409
16410         * statement.cs (TypeInfo, VariableMap): New public classes.
16411         (VariableInfo): New public class.  This is now responsible for
16412         checking whether a variable has been assigned.  It is used for
16413         parameters and local variables.
16414         (Block.EmitMeta): Take the InternalParameters as argument; compute
16415         the layout of the flow vectors here.
16416         (Block.LocalMap, Block.ParameterMap): New public properties.
16417         (FlowBranching): The .ctor doesn't get the InternalParameters
16418         anymore since Block.EmitMeta() now computes the layout of the flow
16419         vector.
16420         (MyStructInfo): This class is now known as `StructInfo' and nested
16421         in `TypeInfo'; we don't access this directly anymore.
16422
16423         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
16424         property and removed IsAssigned(), IsFieldAssigned(),
16425         SetAssigned() and SetFieldAssigned(); we now call them on the
16426         VariableInfo so we don't need to duplicate this code everywhere.
16427
16428         * expression.cs (ParameterReference): Added `Block block' argument
16429         to the .ctor.
16430         (LocalVariableReference, ParameterReference, This): The new
16431         VariableInfo class is now responsible for all the definite
16432         assignment stuff.
16433
16434         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
16435         IsParameterAssigned, SetParameterAssigned): Removed.
16436
16437 2003-05-18  Martin Baulig  <martin@ximian.com>
16438
16439         * typemanager.cs (InitCoreTypes): Try calling
16440         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
16441         the 3-args-version.  Corlib now also needs our `void_type'.
16442         (GetMethod): Added overloaded version which takes an optional
16443         `bool report_errors' to allow lookups of optional methods.
16444
16445 2003-05-12  Martin Baulig  <martin@ximian.com>
16446
16447         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
16448         only used for locals and not for parameters.
16449
16450 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
16451
16452         * support.cs (InternalParameters.ParameterType): Return the
16453         ExternalType of the parameter.
16454
16455         * parameter.cs (Parameter.ExternalType): drop the two arguments,
16456         they were unused.
16457
16458 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
16459
16460         * class.cs (MethodData.Define): Do not set the `newslot' on
16461         interface members, if they are also flagged as "override".
16462
16463         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
16464         better code for ++i and i++.  This only works for static fields
16465         and local variables.
16466
16467         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
16468         want to pull the DeclSpace out of the builder_to_declspace instead
16469         of the TypeBuilder (like in TypeContainer.FindMembers).
16470
16471         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
16472         instead of LookupTypeContainer.  Fixes the crash on .NET for
16473         looking up interface members.
16474
16475         * const.cs: Create our own emit context during the Definition
16476         stage, so that constants are evaluated in the proper context, when
16477         a recursive definition happens.
16478
16479 2003-05-11  Martin Baulig  <martin@ximian.com>
16480
16481         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
16482         new block for a switch section.
16483         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
16484         the adding/lookup in the switch block.  Fixes #39828.
16485
16486 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
16487
16488         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
16489         functionality: I needed to convert the data after I had performed
16490         the add/sub operation into the operands type size.
16491
16492         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
16493         pass the type for the box operation, otherwise the resulting
16494         object would have been of type object.
16495
16496         (BoxedCast): Add constructor to specify the type to box as.
16497
16498 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
16499
16500         * iterators.cs: I was reusing the `count' variable inadvertently,
16501         take steps to not allow this to happen.
16502
16503 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
16504
16505         * attribute.cs (Attribute.Resolve): Params attributes are encoded
16506         by creating an array at the point where the params starts and
16507         putting all those arguments there, then adjusting the size of the
16508         array.
16509
16510 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
16511
16512         * expression.cs (New.AddressOf): Implement interface
16513         IMemoryLocation.  This is used when the `new' operator is used in
16514         the context of an invocation to a method on a value type.
16515
16516         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
16517         example. 
16518
16519         * namespace.cs: Also check the using aliases here.
16520
16521         * driver.cs: Move the test for using validity after the types have
16522         been entered, so we do a single pass that also includes the using
16523         aliases. 
16524
16525         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
16526         in the regular case.   CreateSiblingForFinally is doing extra
16527         error checking.
16528
16529         * attribute.cs (GetAttributeArgumentExpression): Store the result
16530         on an out value, and use the return value to indicate failure
16531         instead of using null (which is a valid return for Constant.GetValue).
16532
16533         * statement.cs: Perform the analysis flow for the increment
16534         portion after the statement, because this will be the real flow of
16535         execution.  Fixes #42385
16536
16537         * codegen.cs (EmitContext.EmitArgument,
16538         EmitContext.EmitStoreArgument): New helper functions when the
16539         RemapToProxy flag is set.
16540
16541         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
16542         function.
16543
16544         Add support for remapping parameters. 
16545
16546         * iterators.cs: Propagate parameter values;  Store parameter
16547         values in the proxy classes.
16548
16549 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
16550
16551         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
16552         need a proxy reference;  I do not know what I was thinking
16553
16554         * cs-parser.jay (constructor_initializer): catch another error,
16555         and display nice message.
16556
16557         (field_declaration): catch void field declaration
16558         to flag a better error. 
16559
16560         * class.cs (MemberBase.CheckBase): Report an error instead of a
16561         warning if a new protected member is declared in a struct. 
16562         (Field.Define): catch the error of readonly/volatile.
16563
16564         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
16565
16566         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
16567         volatile variable is taken
16568
16569 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
16570
16571         * statement.cs (Fixed.Resolve): Report an error if we are not in
16572         an unsafe context.
16573
16574 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
16575
16576         * typemanager.cs: reuse the code that handles type clashes for
16577         delegates and enumerations.
16578
16579         * class.cs (Report28): Always report.
16580
16581         * expression.cs (EncodeAsAttribute): Allow nulls here.
16582
16583 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
16584
16585         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
16586         the functionality for testing whether an expression is valid for
16587         an attribute here.  Also handle the case of arrays of elements
16588         being stored. 
16589
16590         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
16591         encoding a linear array into an array of objects that are suitable
16592         to be passed to an CustomAttributeBuilder.
16593
16594         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
16595
16596         * ecore.cs: (FieldExpr): Handle field remapping here.
16597
16598         * iteratators.cs: Pass the instance variable (if the method is an
16599         instance method) to the constructors, so we can access the field
16600         variables on the class.
16601
16602         TODO: Test this with structs.  I think the THIS variable on
16603         structs might have to be a pointer, and not a refenrece
16604
16605 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
16606
16607         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
16608         local variables to fields in a proxy class.
16609
16610         * iterators.cs (PopulateProxy): Rename our internal fields to
16611         <XXX>.  
16612         Create a <THIS> field if we are an instance method, so we can
16613         reference our parent container variables.
16614         (MapVariable): Called back from the EmitContext code to enter a
16615         new variable to field mapping into the proxy class (we just create
16616         a FieldBuilder).
16617
16618         * expression.cs
16619         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
16620         for using the remapped locals to fields.
16621
16622         I placed the code here, because that gives the same semantics to
16623         local variables, and only changes the Emit code.
16624
16625         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
16626         statements inside iterators.
16627         (VariableInfo): Add a FieldBuilder for the cases when we are
16628         remapping local variables to fields in a proxy class
16629
16630         * ecore.cs (SimpleNameResolve): Avoid testing two times for
16631         current_block != null.
16632
16633         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
16634         not cope with strings, as it has been moved to the
16635         TableSwitchEmit.  Fixed bug in switch generation.
16636
16637         * expression.cs (New.DoResolve): Provide more context for the user
16638         when reporting an error.
16639
16640         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
16641         pointers. 
16642
16643         * expression.cs (MemberAccess.DoResolve): When we get a type back,
16644         check the permissions for it.  Note than in a type-resolution
16645         context the check was already present in DeclSpace.ResolveType,
16646         but was missing from the MemberAccess.
16647
16648         (ArrayCreation.CheckIndices): warn if the user has
16649         more nested levels of expressions, but there are no more
16650         dimensions specified.  Avoids crash on bug 41906.
16651
16652 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
16653
16654         * statement.cs (Block): replace Implicit bool, for a generic
16655         flags.   
16656         New flag: `Unchecked'.  This is used during the EmitMeta phase
16657         (which is out-of-line with the regular Resolve/Emit process for a
16658         statement, as this is done ahead of time, but still gets a chance
16659         to call constant resolve).
16660
16661         (Block.Flags): new enum for adding a new flag.
16662
16663         (Block.EmitMeta): track the state of unchecked.
16664
16665         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
16666         to enable constant resolution to work there as well.
16667
16668 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
16669
16670         * typemanager.cs (ienumerable_type): Also look up
16671         System.Collections.IEnumerable. 
16672
16673 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
16674
16675         TODO: Test more than one conditional per method.
16676
16677         * class.cs (Indexer.Define): Report the location where the user is
16678         referencing the unsupported feature.
16679
16680         (MethodData): Overload the use of `conditionals' to
16681         minimize the creation of needless ArrayLists.   This saves roughly
16682         212kb on my machine.
16683
16684         (Method): Implement the new IIteratorContainer interface.
16685         (Method.SetYields): Implement the method by setting the ModFlags
16686         to contain METHOD_YIELDS.
16687
16688         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
16689         which just got set to null.
16690
16691         * iterators.cs: New file.
16692
16693         (Yield, YieldBreak): New statements.
16694
16695         * statement.cs (Return.Resolve): Flag an error if we are used in
16696         an iterator method.
16697
16698         * codegen.cs (InIterator): New flag set if the code is being
16699         compiled in an iterator method.
16700
16701         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
16702         internal modifier, and we just use it to avoid adding extra
16703         fields, as this is seldom used.  
16704
16705         * cs-parser.jay: Add yield_statement (yield and yield break).
16706
16707         * driver.cs: New flag -v2 to turn on version 2 features. 
16708
16709         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
16710         hashtable when v2 is enabled.
16711
16712 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
16713
16714         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
16715         there is already a namespace defined with this name.
16716
16717         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
16718         people upgraded their corlibs.
16719
16720         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
16721         always use fully qualified types, no need to use the compiler
16722         front end.
16723
16724         (TypeManager.IsNamespace): Use binarysearch.
16725
16726         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
16727         AddDelegate): I did not quite use the new IsValid API properly: I
16728         have to pass the short-name and the fullname.  I was passing only
16729         the basename instead of the fullname sometimes. 
16730
16731         (TypeContainer.DefineType): call NamespaceClash.
16732
16733         * interface.cs (Interface.DefineType): use NamespaceClash before
16734         defining the type.
16735
16736         * delegate.cs (Delegate.DefineType): use NamespaceClash before
16737         defining the type.
16738
16739         * enum.cs: (Enum.DefineType): use NamespaceClash before
16740         defining the type.
16741
16742         * typemanager.cs (: 3-line patch that gives us some tasty 11%
16743         speed increase.  First, use the negative_hits cache when we get a
16744         negative.  Second, add the type with its full original name
16745         instead of the new . and + encoded name (reflection uses + to
16746         separate type from a nested type).  Use LookupTypeReflection
16747         directly which bypasses the type->name hashtable (that we already
16748         know does not contain the type.
16749
16750         * decl.cs (DeclSpace.ResolveTypeExpr): track the
16751         location/container type. 
16752
16753         * driver.cs: When passing utf8, use directly the UTF8Encoding.
16754
16755 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
16756
16757         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
16758
16759         * delegate.cs (NewDelegate.Resolve): Test whether an instance
16760         method is being referenced in the method group from a static
16761         context, and report error 120 if so.
16762
16763         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
16764         Error118. 
16765
16766         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
16767         is created, we create the A namespace).
16768
16769         * cs-parser.jay: A namespace also introduces a DeclarationFound.
16770         Fixes #41591
16771
16772 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
16773
16774         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
16775         invocation to ModuleBuilder.GetType with the same values will
16776         return a new type instance, so we need to cache its return
16777         values. 
16778
16779         * expression.cs (Binary.ResolveOperator): Only allow the compare
16780         operators on enums if they are of the same type.
16781
16782         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
16783         types of ValueType on their own case.  Before we were giving them
16784         the same treatment as objects.
16785
16786         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
16787         fullname.  Short name is used to compare against container name.
16788         Fullname is used to check against defined namespace names.
16789
16790         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
16791         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
16792
16793         (Method.CheckBase): Call parent.
16794         (MemberBase.CheckBase): Check for protected members on sealed
16795         classes.
16796         (PropertyBase.CheckBase): Call parent.
16797         (Field.Define): Call parent.
16798
16799         * report.cs: Negative error codes are now mapped to 8000 - code,
16800         so that the display is render more nicely.
16801
16802         * typemanager.cs: Do not use try/catch, instead report a regular
16803         error. 
16804
16805         (GetPointerType, GetReferenceType): These methods provide
16806         mechanisms to obtain the T* and T& from a T.  We had the code
16807         previously scattered around the code base, and it also used
16808         TypeManager.LookupType that would go through plenty of caches.
16809         This one goes directly to the type source.
16810
16811         In some places we did the Type.GetType followed by
16812         ModuleBuilder.GetType, but not in others, so this unifies the
16813         processing as well.
16814
16815         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
16816         statements now that we have namespace information.
16817
16818         * typemanager.cs (IsNamespace): New method, returns whether the
16819         string presented is a namespace or not.
16820
16821         (ComputeNamespaces): New public entry point, computes the list of
16822         available namespaces, using the GetNamespaces API call in Mono, or
16823         the slower version in MS.NET.   
16824
16825         Now before we start the semantic analysis phase, we have a
16826         complete list of namespaces including everything that the user has
16827         provided.
16828
16829         Deleted old code to cache namespaces in .nsc files.
16830
16831 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
16832
16833         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
16834         class/struct location definition Location for the implicit
16835         constructor location.
16836
16837         (Operator.Define): Use the location of the operator for the
16838         implicit Method definition.
16839
16840         (Constructor.Emit): use the constructor location for the implicit
16841         base initializer constructor.
16842
16843         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
16844         and the Expression class now contains two new methods:
16845
16846         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
16847         isolate type lookup from the rest of the resolution process.
16848
16849         Since we use Expressions to hold type definitions due to the way
16850         we parse the input we have historically overloaded Resolve to
16851         perform the Type lookups if a special flag is passed.  Now this is
16852         eliminated and two methods take their place. 
16853
16854         The differences in the two methods between xStep and xTerminal is
16855         that xStep is involved in our current lookup system that uses
16856         SimpleNames to compose a name, while xTerminal is used just to
16857         catch the case where the simplename lookup failed.
16858
16859 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
16860
16861         * expression.cs (ResolveMemberAccess): Remove redundant code.
16862         TypeExpr expressions are always born fully resolved.
16863
16864         * interface.cs (PopulateMethod): Do not lookup the types twice.
16865         We were doing it once during SemanticAnalysis and once during
16866         PopulateMethod.
16867
16868         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
16869         in local variable type definitions, were being returned as a
16870         SimpleName (we decomposed everything into a string), that is
16871         because primary_expression was being used instead of a type in the
16872         grammar (reduce/reduce conflicts).
16873
16874         The part that was wrong is that we converted the expression into a
16875         string (an oversimplification in one hand, compounded with primary
16876         expressions doing string concatenation).
16877
16878         So things like:
16879
16880         A.B.C [] x;
16881
16882         Would return "A.B.C[]" as a SimpleName.  This stopped things like
16883         using clauses from working on this particular context.  And a type
16884         was being matched directly against "A.B.C[]".
16885
16886         We now use the correct approach, and allow for ComposedCast to be
16887         part of the unary expression.  So the "A.B.C []" become a composed
16888         cast of "A.B.C" (as a nested group of MemberAccess with a
16889         SimpleName at the end) plus the rank composition "[]". 
16890
16891         Also fixes 35567
16892
16893 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
16894
16895         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
16896         for the access level checking.
16897
16898         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
16899         `TypeContainer container', because I kept getting confused when I
16900         was debugging this code.
16901
16902         * expression.cs (Indexers): Instead of tracking getters/setters,
16903         we now track them in parallel.  We create one arraylist less, but
16904         most importantly it is possible now for the LValue code to find a
16905         matching get for a set.
16906
16907         (IndexerAccess.DoResolveLValue): Update the code.
16908         GetIndexersForType has been modified already to extract all the
16909         indexers from a type.  The code assumed it did not.
16910
16911         Also make the code set the correct return type for the indexer.
16912         This was fixed a long time ago for properties, but was missing for
16913         indexers.  It used to be void_type.
16914
16915         (Binary.Emit): Test first for doubles instead of
16916         floats, as they are more common.
16917
16918         (Binary.EmitBranchable): Use the .un version of the branch opcodes
16919         when dealing with floats and the <=, >= operators.  This fixes bug
16920         #39314 
16921
16922         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
16923         to load the array value by emitting a load on the foreach variable
16924         type.  This was incorrect.  
16925
16926         We now emit the code to load an element using the the array
16927         variable type, and then we emit the conversion operator.
16928
16929         Fixed #40176
16930
16931 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
16932
16933         * attribute.cs: Avoid allocation of ArrayLists in the common case.
16934
16935 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
16936
16937         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
16938         test for protection before we test for signatures. 
16939
16940         (MethodSignature.ToString): implement.
16941
16942         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
16943         to the case where we reduced into a LongConstant.
16944
16945         * decl.cs (CheckAccessLevel): If the type is an array, we can not
16946         depend on whether the information is acurrate, because the
16947         Microsoft runtime will always claim that the array type is public,
16948         regardless of the real state.
16949
16950         If the type is a pointer, another problem happens: the type is
16951         reported as non-public in Microsoft.  
16952
16953         In both cases we have to call CheckAccessLevel recursively with
16954         the underlying type as the argument to be tested.
16955
16956 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
16957
16958         * assign.cs (Assign.Emit): If we are dealing with a compound
16959         assignment expression, we should use the code path that stores the
16960         intermediate result in a temporary value.  This fixes #40903.
16961
16962         *expression.cs (Indirection.ToString): Provide ToString method for
16963         debugging. 
16964
16965 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
16966
16967         * class.cs: Null out fields holding references to Block objects so
16968         they can be garbage collected.
16969
16970         * expression.cs (OverloadResolve): Remove unused local.
16971
16972 2003-04-07  Martin Baulig  <martin@ximian.com>
16973
16974         * codegen.cs (EmitContext.CurrentFile): New public field.
16975         (EmitContext.Mark): Use the CurrentFile to check whether the
16976         location is in the correct file.
16977         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
16978
16979 2003-04-07  Martin Baulig  <martin@ximian.com>
16980
16981         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
16982
16983         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
16984         location.  [FIXME: The location argument which gets passed to this
16985         method is sometimes wrong!]
16986
16987 2003-04-07  Nick Drochak <ndrochak@gol.com>
16988
16989         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
16990
16991 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
16992
16993         * expression.cs (Indirection.EmitAssign): We were using the
16994         temporary, but returning immediately instead of continuing the
16995         EmitAssing flow.
16996
16997 2003-04-06  Martin Baulig  <martin@ximian.com>
16998
16999         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
17000         if it's a nested child, but also deriving from the outer class.
17001         See test 190.cs.
17002
17003         * typemanager.cs (IsNestedChildOf): Make this work if it's a
17004         nested child, but also deriving from the outer class.  See
17005         test-190.cs.
17006         (FilterWithClosure): We may access private members of the outer
17007         class if we're a nested child and deriving from the outer class.
17008         (RealMemberLookup): Only set `closure_private_ok' if the
17009         `original_bf' contained BindingFlags.NonPublic.
17010
17011 2003-04-05  Martin Baulig  <martin@ximian.com>
17012
17013         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
17014
17015 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
17016
17017         * class.cs (Event.Define): Do not allow abstract events to have
17018         initializers. 
17019
17020 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
17021
17022         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
17023         block in event declarations.
17024
17025         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
17026         value type, get its address.
17027
17028         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
17029         leaving a class on the stack instead of a boolean value (int
17030         0/1).  Change the code so we compare against null, and then the
17031         result against zero.
17032
17033         * class.cs (TypeContainer.GetClassBases): We were checking for the
17034         parent class being sealed too late.
17035
17036         * expression.cs (Binary.Emit): For <= and >= when dealing with
17037         floating point values, use cgt.un and clt.un instead of cgt and
17038         clt alone.
17039
17040 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
17041
17042         * statement.cs: Apply the same optimization as MS: skip the 
17043         GetEnumerator returning an IEnumerator, and use the one returning a 
17044         CharEnumerator instead. This allows us to avoid the try-finally block 
17045         and the boxing.
17046
17047 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
17048
17049         * cs-parser.jay: Attributes cannot be applied to
17050                          namespaces. Fixes #40473
17051
17052 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17053
17054         * class.cs:
17055         (Add*): check if the name is valid using the full name for constants,
17056         fields, properties and events.
17057
17058 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
17059
17060         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
17061         char constants to be part of the enumeration.
17062
17063         * expression.cs (Conditional.DoResolve): Add support for operator
17064         true. Implements the missing functionality from 14.12
17065
17066         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
17067         operator true/false as required by the spec.
17068
17069         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
17070         implicit conversion to boolean.
17071
17072         * statement.cs (Statement.ResolveBoolean): A boolean expression is
17073         also one where the type implements `operator true'. 
17074
17075         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
17076         get an expression that will invoke operator true based on an
17077         expression.  
17078
17079         (GetConversionOperators): Removed the hack that called op_True
17080         here.  
17081
17082         (Expression.ResolveBoolean): Move this from Statement.
17083
17084 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
17085
17086         * ecore.cs (FieldExpr): do not allow initialization of initonly
17087         fields on derived classes
17088
17089 2003-03-13  Martin Baulig  <martin@ximian.com>
17090
17091         * statement.cs (Block.Emit): Call ig.BeginScope() and
17092         ig.EndScope() when compiling with debugging info; call
17093         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
17094
17095 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
17096
17097         * expression.cs (Indexers): Do not construct immediately, allow
17098         for new members to be appended as we go.  Fixes 38143
17099
17100 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17101
17102         * expression.cs: save/restore context when resolving an unchecked
17103         expression.
17104
17105 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
17106
17107         * cfold.cs: Catch division by zero in modulus operator during
17108         constant folding.
17109
17110 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
17111
17112         * interface.cs (Interface.DefineMembers): Avoid defining members
17113         twice. 
17114
17115 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
17116
17117         * driver.cs: handle the +/- options for -noconfig
17118
17119         * statement.cs (Unckeched.Resolve): Also track the state of
17120         unchecked in the Resolve phase.
17121
17122 2003-02-27  Martin Baulig  <martin@ximian.com>
17123
17124         * ecore.cs (Expression.MemberLookup): Don't create a
17125         MethodGroupExpr for something which is not a method.  Fixes #38291.
17126
17127 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
17128
17129         * class.cs (MemberBase.CheckParameters): Also check that the type
17130         is unmanaged if it is a pointer.
17131
17132         * expression.cs (SizeOf.Resolve): Add location information.
17133
17134         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
17135         a managed type is declared.
17136
17137         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
17138         parameter modifiers as well.  Fixes bug 38606
17139
17140         * class.cs: Very sad.  Am backing out the speed up changes
17141         introduced by the ArrayList -> Array in the TypeContainer, as they
17142         were not actually that much faster, and introduced a bug (no error
17143         reports on duplicated methods).
17144
17145         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
17146         source first, this will guarantee that we have a valid expression
17147         before calling in lower levels functions that will require a
17148         resolved object.  Then use this original_source in the
17149         target.ResolveLValue instead of the original source that was
17150         passed to us.
17151
17152         Another change.  Use target.Resolve instead of LValueResolve.
17153         Although we are resolving for LValues, we will let the Assign code
17154         take care of that (it will be called again from Resolve).  This
17155         basically allows code like this:
17156
17157         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
17158         class Y { void A (X x) { x [0] += o; }
17159
17160         The problem was that the indexer was trying to resolve for
17161         set_Item (idx, object o) and never finding one.  The real set_Item
17162         was set_Item (idx, X).  By delaying the process we get the right
17163         semantics. 
17164
17165         Fixes bug 36505
17166
17167 2003-02-23  Martin Baulig  <martin@ximian.com>
17168
17169         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
17170         while calling DoEmit ().
17171
17172         * codegen.cs (EmitContext.Mark): Don't mark locations in other
17173         source files; if you use the #line directive inside a method, the
17174         compiler stops emitting line numbers for the debugger until it
17175         reaches the end of the method or another #line directive which
17176         restores the original file.
17177
17178 2003-02-23  Martin Baulig  <martin@ximian.com>
17179
17180         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
17181
17182 2003-02-23  Martin Baulig  <martin@ximian.com>
17183
17184         * statement.cs (Block.AddChildVariableNames): We need to call this
17185         recursively, not just for our immediate children.
17186
17187 2003-02-23  Martin Baulig  <martin@ximian.com>
17188
17189         * class.cs (Event.Define): Always make the field private, like csc does.
17190
17191         * typemanager.cs (TypeManager.RealMemberLookup): Make events
17192         actually work, fixes bug #37521.
17193
17194 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
17195
17196         * delegate.cs: When creating the various temporary "Parameters"
17197         classes, make sure that we call the ComputeAndDefineParameterTypes
17198         on those new parameters (just like we do with the formal ones), to
17199         allow them to be resolved in the context of the DeclSpace.
17200
17201         This fixes the bug that Dick observed in Bugzilla #38530.
17202
17203 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
17204
17205         * expression.cs (ResolveMemberAccess): When resolving a constant,
17206         do not attempt to pull a constant if the value was not able to
17207         generate a valid constant.
17208
17209         * const.cs (LookupConstantValue): Do not report more errors than required.
17210
17211 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17212
17213         * expression.cs: fixes bug #38328.
17214
17215 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
17216
17217         * class.cs: Changed all the various members that can be part of a
17218         class from being an ArrayList to be an Array of the right type.
17219         During the DefineType type_list, interface_list, delegate_list and
17220         enum_list are turned into types, interfaces, delegates and enums
17221         arrays.  
17222
17223         And during the member population, indexer_list, event_list,
17224         constant_list, field_list, instance_constructor_list, method_list,
17225         operator_list and property_list are turned into their real arrays.
17226
17227         Although we could probably perform this operation earlier, for
17228         good error reporting we need to keep the lists and remove the
17229         lists for longer than required.
17230
17231         This optimization was triggered by Paolo profiling the compiler
17232         speed on the output of `gen-sample-program.pl' perl script. 
17233
17234         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
17235         not crash in methods like MemberLookupFailed that use this field.  
17236
17237         This problem arises when the compiler fails to resolve a type
17238         during interface type definition for example.
17239
17240 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
17241
17242         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
17243         inherit from System.Object, so we have to stop at null, not only
17244         when reaching System.Object.
17245
17246 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
17247
17248         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
17249         DeclaredOnly because the parent indexer might have had a different
17250         name, but did not loop until the top of the hierarchy was reached.
17251
17252         The problem this one fixes is 35492: when a class implemented an
17253         indexer from an interface, we were getting the interface method
17254         (which was abstract) and we were flagging an error (can not invoke
17255         abstract method).
17256
17257         This also keeps bug 33089 functioning, and test-148 functioning.
17258
17259         * typemanager.cs (IsSpecialMethod): The correct way of figuring
17260         out if a method is special is to see if it is declared in a
17261         property or event, or whether it is one of the predefined operator
17262         names.   This should fix correctly #36804.
17263
17264 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
17265
17266         The goal here is to remove the dependency on EmptyCast.Peel ().
17267         Killing it completely.
17268
17269         The problem is that currently in a number of places where
17270         constants are expected, we have to "probe" for an EmptyCast, and
17271         Peel, which is not the correct thing to do, as this will be
17272         repetitive and will likely lead to errors. 
17273
17274         The idea is to remove any EmptyCasts that are used in casts that
17275         can be reduced to constants, so we only have to cope with
17276         constants. 
17277
17278         This bug hunt was triggered by Bug 37363 and the desire to remove
17279         the duplicate pattern where we were "peeling" emptycasts to check
17280         whether they were constants.  Now constants will always be
17281         constants.
17282
17283         * ecore.cs: Use an enumconstant here instead of wrapping with
17284         EmptyCast.  
17285
17286         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
17287         throwing me off.  By handling this we can get rid of a few hacks.
17288
17289         * statement.cs (Switch): Removed Peel() code.
17290
17291 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
17292
17293         * class.cs: Location information for error 508
17294
17295         * expression.cs (New.DoResolve): Add a guard against double
17296         resolution of an expression.  
17297
17298         The New DoResolve might be called twice when initializing field
17299         expressions (see EmitFieldInitializers, the call to
17300         GetInitializerExpression will perform a resolve on the expression,
17301         and later the assign will trigger another resolution
17302
17303         This leads to bugs (#37014)
17304
17305         * delegate.cs: The signature for EndInvoke should contain any ref
17306         or out parameters as well.  We were not doing this in the past. 
17307
17308         * class.cs (Field.Define): Do not overwrite the type definition
17309         inside the `volatile' group.  Turns out that volatile enumerations
17310         were changing the type here to perform a validity test, which
17311         broke conversions. 
17312
17313 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
17314
17315         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
17316         and structs, we do not want to load the instance variable
17317
17318         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
17319         enum_type has to be handled like an object reference (implicit
17320         conversions exists from this to object), but the regular IsClass
17321         and IsValueType tests will never return true for this one.
17322
17323         Also we use TypeManager.IsValueType instead of type.IsValueType,
17324         just for consistency with the rest of the code (this is only
17325         needed if we ever use the construct exposed by test-180.cs inside
17326         corlib, which we dont today).
17327
17328 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
17329
17330         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
17331         just InternalCall.
17332
17333 2003-02-09  Martin Baulig  <martin@ximian.com>
17334
17335         * namespace.cs (Namespace..ctor): Added SourceFile argument.
17336         (Namespace.DefineNamespaces): New static public method; this is
17337         called when we're compiling with debugging to add all namespaces
17338         to the symbol file.
17339
17340         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
17341         pass it to the Namespace's .ctor.
17342
17343         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
17344         and MethodBase arguments; pass the namespace ID to the symwriter;
17345         pass the MethodBase instead of the token to the symwriter.
17346         (SymbolWriter.DefineNamespace): New method to add a namespace to
17347         the symbol file.
17348
17349 2003-02-09  Martin Baulig  <martin@ximian.com>
17350
17351         * symbolwriter.cs: New file.  This is a wrapper around
17352         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
17353         methods here in near future.
17354
17355 2003-02-09  Martin Baulig  <martin@ximian.com>
17356
17357         * codegen.cs (EmitContext.Mark): Just pass the arguments to
17358         ILGenerator.MarkSequencePoint() which are actually used by the
17359         symbol writer.
17360
17361 2003-02-09  Martin Baulig  <martin@ximian.com>
17362
17363         * location.cs (SourceFile): New public sealed class.  This
17364         contains the name and an index which is used in the location's token.
17365         (Location): Reserve an appropriate number of bits in the token for
17366         the source file instead of walking over that list, this gives us a
17367         really huge performance improvement when compiling with debugging.
17368
17369         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
17370         `SourceFile' argument instead of a string.
17371         (Driver.ProcessFile): Add all the files via Location.AddFile(),
17372         but don't parse/tokenize here, we need to generate the list of all
17373         source files before we do that.
17374         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
17375         the files.
17376
17377         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
17378         instead of a string.
17379
17380         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
17381         of a string.
17382
17383 2003-02-09  Martin Baulig  <martin@ximian.com>
17384
17385         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
17386         filename on `#line default'.
17387
17388 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
17389
17390         * statement.cs: don't clear the pinned var when the fixed statement
17391         returns from the method (fixes bug#37752).
17392
17393 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
17394
17395         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
17396         to IsValueType.
17397
17398 2003-02-07  Martin Baulig  <martin@ximian.com>
17399
17400         * driver.cs: Removed the `--debug-args' command line argument.
17401
17402         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
17403         automatically by the AsssemblyBuilder.
17404         (CodeGen.InitializeSymbolWriter): We don't need to call any
17405         initialization function on the symbol writer anymore.  This method
17406         doesn't take any arguments.
17407
17408 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
17409
17410         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
17411         from referenced assemblies as well.
17412
17413 2003-02-02  Martin Baulig  <martin@ximian.com>
17414
17415         * class.cs (MethodData.Emit): Generate debugging info for external methods.
17416
17417 2003-02-02  Martin Baulig  <martin@ximian.com>
17418
17419         * class.cs (Constructor.Emit): Open the symbol writer before
17420         emitting the constructor initializer.
17421         (ConstructorInitializer.Emit): Call ec.Mark() to allow
17422         single-stepping through constructor initializers.
17423
17424 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
17425
17426         * class.cs: Handle error 549: do not allow virtual methods in
17427         sealed classes. 
17428
17429 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
17430
17431         * decl.cs: Check access levels when resolving types
17432
17433 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
17434
17435         * statement.cs: Add parameters and locals set in catch blocks that might 
17436         return to set vector
17437
17438 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
17439
17440         * class.cs (Operator): Set the SpecialName flags for operators.
17441
17442         * expression.cs (Invocation.DoResolve): Only block calls to
17443         accessors and operators on SpecialName methods.
17444
17445         (Cast.TryReduce): Handle conversions from char constants.
17446
17447
17448 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
17449
17450         * statement.cs: small memory and time optimization in FlowBranching.
17451
17452 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
17453
17454         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
17455         problem that the last fix but in the other sid (Set).
17456
17457         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
17458         access when there is no indexer in the hierarchy.
17459
17460 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
17461
17462         * class.cs: Combine some if statements.
17463
17464 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17465
17466         * driver.cs: fixed bug #37187.
17467
17468 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
17469
17470         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
17471         any indexer, it's needed to build a list with all the indexers in the
17472         hierarchy (AllGetters), else we have problems. Fixes #35653.
17473
17474 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
17475
17476         * class.cs (MethodData.Define): It is wrong for an interface
17477         implementation to be static in both cases: explicit and implicit.
17478         We were only handling this in one case.
17479
17480         Improve the if situation there to not have negations.
17481
17482         * class.cs (Field.Define): Turns out that we do not need to check
17483         the unsafe bit on field definition, only on usage.  Remove the test.
17484
17485 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17486
17487         * driver.cs: use assembly.Location instead of Codebase (the latest
17488         patch made mcs fail when using MS assemblies).
17489
17490 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
17491
17492         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
17493         get the path to *corlib.dll.
17494
17495 2003-01-21  Nick Drochak <ndrochak@gol.com>
17496
17497         * cs-tokenizer.cs:
17498         * pending.cs:
17499         * typemanager.cs: Remove compiler warnings
17500
17501 2003-01-20  Duncan Mak  <duncan@ximian.com>
17502
17503         * AssemblyInfo.cs: Bump the version number to 0.19.
17504
17505 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17506
17507         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
17508
17509 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
17510
17511         * class.cs (Constructor::Emit): Emit debugging info for constructors.
17512
17513 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
17514
17515         * cs-parser.jay: Small fix: we were not comparing the constructor
17516         name correctly.   Thanks to Zoltan for the initial pointer.
17517
17518 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
17519
17520         * cs-tokenizer.cs: Set file name when specified with #line
17521
17522 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
17523
17524         * cs-parser.jay: Only perform the constructor checks here if we
17525         are named like the class;  This will help provider a better
17526         error.  The constructor path is taken when a type definition is
17527         not found, but most likely the user forgot to add the type, so
17528         report that rather than the constructor error.
17529
17530 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
17531
17532         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
17533         allocations.
17534
17535 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17536
17537         * cs-parser.jay: Add cleanup call.
17538
17539 2003-01-13  Duncan Mak  <duncan@ximian.com>
17540
17541         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
17542         consistent with other methods.
17543
17544 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17545
17546         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
17547
17548 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
17549
17550         * attribute.cs: only set GuidAttr to true when we have a
17551         GuidAttribute.
17552
17553 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17554
17555         * ecore.cs:
17556         * expression.cs:
17557         * typemanager.cs: fixes to allow mcs compile corlib with the new
17558         Type.IsSubclassOf fix.
17559
17560 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
17561
17562         * expression.cs (LocalVariableReference.DoResolve): Classify a
17563         constant as a value, not as a variable.   Also, set the type for
17564         the variable.
17565
17566         * cs-parser.jay (fixed_statement): take a type instead of a
17567         pointer_type, so we can produce a better error message later.
17568
17569         * statement.cs (Fixed.Resolve): Flag types that are not pointers
17570         as an error.  
17571
17572         (For.DoEmit): Make inifinite loops have a
17573         non-conditional branch back.
17574
17575         (Fixed.DoEmit): First populate the pinned variables, then emit the
17576         statement, then clear the variables.  Before I was emitting the
17577         code once for each fixed piece.
17578
17579
17580 2003-01-08  Martin Baulig  <martin@ximian.com>
17581
17582         * statement.cs (FlowBranching.MergeChild): A break in a
17583         SWITCH_SECTION does not leave a loop.  Fixes #36155.
17584
17585 2003-01-08  Martin Baulig  <martin@ximian.com>
17586
17587         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
17588         lives in the same number space than `param_map'.  Fixes #36154.
17589
17590 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
17591
17592         * cs-parser.jay (constructor_declaration): Set the
17593         Constructor.ModFlags before probing for it.  This makes the
17594         compiler report 514, 515 and 132 (the code was there, but got
17595         broken). 
17596
17597         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
17598         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
17599         (GotoCase.Resolve): Set `Returns' to ALWAYS.
17600
17601 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
17602
17603         * enum.cs: create the enum static fields using the enum type.
17604
17605 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
17606
17607         * class.cs: don't try to create the ParamBuilder for the return
17608         type if it's not needed (and handle it breaking for the ms runtime
17609         anyway).
17610
17611 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
17612
17613         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
17614
17615 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
17616
17617         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
17618         the command.   This showed up while compiling the JANET source
17619         code, which used \r as its only newline separator.
17620
17621 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
17622
17623         * class.cs (Method.Define): If we are an operator (because it
17624         reuses our code), then set the SpecialName and HideBySig.  #36128
17625
17626 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
17627
17628         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
17629         exception, report error 120 `object reference required'.
17630
17631         * driver.cs: Add --pause option, used during to measure the size
17632         of the process as it goes with --timestamp.
17633
17634         * expression.cs (Invocation.DoResolve): Do not allow methods with
17635         SpecialName to be invoked.
17636
17637 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
17638
17639         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
17640         number before adding it.
17641
17642 2002-12-21  Ravi Pratap  <ravi@ximian.com>
17643
17644         * ecore.cs (StandardImplicitConversion): When in an unsafe
17645         context, we allow conversion between void * to any other pointer
17646         type. This fixes bug #35973.
17647
17648 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
17649
17650         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
17651         is not thrown when extensionless outputs are used 
17652
17653 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17654
17655         * rootcontext.cs: fixed compilation of corlib.
17656
17657 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
17658
17659         * attribute.cs (Attributes.Contains): Add new method.
17660
17661         * class.cs (MethodCore.LabelParameters): if the parameter is an
17662         `out' parameter, check that no attribute `[In]' has been passed.
17663
17664         * enum.cs: Handle the `value__' name in an enumeration.
17665
17666 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
17667
17668         * decl.cs: Added special case to allow overrides on "protected
17669         internal" methods
17670
17671 2002-12-18  Ravi Pratap  <ravi@ximian.com>
17672
17673         * attribute.cs (Attributes.AddAttributeSection): Rename to this
17674         since it makes much more sense.
17675
17676         (Attributes.ctor): Don't require a Location parameter.
17677
17678         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
17679
17680         * attribute.cs (ApplyAttributes): Remove extra Location parameters
17681         since we already have that information per attribute.
17682
17683         * everywhere : make appropriate changes.
17684
17685         * class.cs (LabelParameters): Write the code which actually
17686         applies attributes to the return type. We can't do this on the MS
17687         .NET runtime so we flag a warning in the case an exception is
17688         thrown.
17689
17690 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
17691
17692         * const.cs: Handle implicit null conversions here too.
17693
17694 2002-12-17  Ravi Pratap  <ravi@ximian.com>
17695
17696         * class.cs (MethodCore.LabelParameters): Remove the extra
17697         Type [] parameter since it is completely unnecessary. Instead
17698         pass in the method's attributes so that we can extract
17699         the "return" attribute.
17700
17701 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
17702
17703         * cs-parser.jay (parse): Use Report.Error to flag errors instead
17704         of ignoring it and letting the compile continue.
17705
17706         * typemanager.cs (ChangeType): use an extra argument to return an
17707         error condition instead of throwing an exception.
17708
17709 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
17710
17711         * expression.cs (Unary.TryReduce): mimic the code for the regular
17712         code path.  Perform an implicit cast in the cases where we can
17713         implicitly convert to one of the integral types, and then reduce
17714         based on that constant.   This fixes bug #35483.
17715
17716 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17717
17718         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
17719
17720 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17721
17722         * namespace.cs: fixed bug #35489.
17723
17724 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
17725
17726         * class.cs: Remove some dead code.
17727
17728         * cs-parser.jay: Estimate the number of methods needed
17729         (RootContext.MethodCount);
17730
17731         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
17732         numbers instead of StringBuilders.
17733
17734         * support.cs (PtrHashtable): Add constructor with initial size;
17735         We can now reduce reallocations of the method table.
17736
17737 2002-12-10  Ravi Pratap  <ravi@ximian.com>
17738
17739         * attribute.cs (ApplyAttributes): Keep track of the emitted
17740         attributes on a per-target basis. This fixes bug #35413.
17741
17742 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
17743
17744         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
17745         default to the Windows 1252 encoding.
17746
17747         (UnixParseOption): Support version, thanks to Alp for the missing
17748         pointer. 
17749
17750         * AssemblyInfo.cs: Add nice assembly information.
17751
17752         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
17753         (bug 35169).
17754
17755         * cs-parser.jay: Allow a trailing comma before the close bracked
17756         in the attribute_section production.
17757
17758         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
17759         address of the instance was being taken, I will take this out,
17760         because we take the address of the object immediately here.
17761
17762 2002-12-09  Ravi Pratap  <ravi@ximian.com>
17763
17764         * typemanager.cs (AreMultipleAllowed): Take care of the most
17765         obvious case where attribute type is not in the current assembly -
17766         stupid me ;-)
17767
17768 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
17769
17770         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
17771         definitions, instead of doing that afterwards.  
17772
17773         Also we use a nice little hack, depending on the constructor, we
17774         know if we are a "composed" name or a simple name.  Hence, we
17775         avoid the IndexOf test, and we avoid 
17776
17777         * codegen.cs: Add code to assist in a bug reporter to track down
17778         the source of a compiler crash. 
17779
17780 2002-12-07  Ravi Pratap  <ravi@ximian.com>
17781
17782         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
17783         types have been emitted for a given element and flag an error
17784         if something which does not have AllowMultiple set is used more
17785         than once.
17786
17787         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
17788         attribute types and their corresponding AllowMultiple properties
17789
17790         (AreMultipleAllowed): Check the property for a given type.
17791
17792         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
17793         property in the case we have a TypeContainer.
17794
17795         (Attributes.AddAttribute): Detect duplicates and just skip on
17796         adding them. This trivial fix catches a pretty gross error in our
17797         attribute emission - global attributes were being emitted twice!
17798
17799         Bugzilla bug #33187 is now fixed.
17800
17801 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
17802
17803         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
17804         instead of pp_and).
17805
17806         * expression.cs (Binary.ResolveOperator): I can only use the
17807         Concat (string, string, string) and Concat (string, string,
17808         string, string) if the child is actually a concatenation of
17809         strings. 
17810
17811 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
17812
17813         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
17814         context where we need a 2-character lookahead.
17815
17816         * pending.cs (PendingImplementation): Rework so we can keep track
17817         of interface types all the time, and flag those which were
17818         implemented by parents as optional.
17819
17820 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
17821
17822         * expression.cs (Binary.ResolveOperator): Use
17823         String.Concat(string,string,string) or
17824         String.Concat(string,string,string,string) when possible. 
17825
17826         * typemanager: More helper methods.
17827
17828
17829 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
17830
17831         * pending.cs: remove the bogus return from GetMissingInterfaces()
17832         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
17833
17834 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17835
17836         * namespace.cs: avoid duplicated 'using xxx' being added to
17837         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
17838         when we get more than one 'using' statement for the same namespace.
17839         Report a CS0105 warning for it.
17840
17841 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
17842
17843         * cs-tokenizer.cs (consume_identifier): use read directly, instead
17844         of calling getChar/putback, uses internal knowledge of it.    
17845
17846         (xtoken): Reorder tokenizer so most common patterns are checked
17847         first.  This reduces the compilation time in another 5% (from 8.11s
17848         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
17849
17850         The parsing time is 22% of the compilation in mcs, and from that
17851         64% is spent on the tokenization process.  
17852
17853         I tried using a binary search for keywords, but this is slower
17854         than the hashtable.  Another option would be to do a couple of
17855         things:
17856
17857                 * Not use a StringBuilder, instead use an array of chars,
17858                   with a set value.  Notice that this way we could catch
17859                   the 645 error without having to do it *afterwards*.
17860
17861                 * We could write a hand-parser to avoid the hashtable
17862                   compares altogether.
17863
17864         The identifier consumption process takes 37% of the tokenization
17865         time.  Another 15% is spent on is_number.  56% of the time spent
17866         on is_number is spent on Int64.Parse:
17867
17868                 * We could probably choose based on the string length to
17869                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
17870                   computations. 
17871
17872         Another 3% is spend on wrapping `xtoken' in the `token' function.
17873
17874         Handle 0xa0 as whitespace (#34752)
17875
17876 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
17877
17878         * typemanager.cs (IsCLRType): New routine to tell whether a type
17879         is one of the builtin types.  
17880
17881         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
17882         typecode in more places instead of doing pointer comparissions.
17883         We could leverage some knowledge about the way the typecodes are
17884         laid out.
17885
17886         New code to cache namespaces in assemblies, it is currently not
17887         invoked, to be used soon.
17888
17889         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
17890
17891         * expression.cs (Binary.ResolveOperator): specially handle
17892         strings, and do not perform user-defined operator overloading for
17893         built-in types.
17894
17895 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
17896
17897         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
17898         internalcall as it is a pretty simple operation;  Avoid whenever
17899         possible to call Char.IsLetter.
17900
17901         (consume_identifier): Cut by half the number of
17902         hashtable calls by merging the is_keyword and GetKeyword behavior.
17903
17904         Do not short-circuit, because if we do, we
17905         report errors (ie, #if false && true would produce an invalid
17906         directive error);
17907
17908
17909 2002-11-24  Martin Baulig  <martin@ximian.com>
17910
17911         * expression.cs (Cast.TryReduce): If we're in checked syntax,
17912         check constant ranges and report a CS0221.  Fixes #33186.
17913
17914 2002-11-24  Martin Baulig  <martin@ximian.com>
17915
17916         * cs-parser.jay: Make this work for uninitialized variable
17917         declarations in the `for' initializer.  Fixes #32416.
17918
17919 2002-11-24  Martin Baulig  <martin@ximian.com>
17920
17921         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
17922         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
17923
17924 2002-11-24  Martin Baulig  <martin@ximian.com>
17925
17926         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
17927         argument; if true, we also check for user-defined conversions.
17928         This is only needed if both arguments are of a user-defined type.
17929         Fixes #30443, added test-175.cs.
17930         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
17931
17932         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
17933
17934 2002-11-24  Martin Baulig  <martin@ximian.com>
17935
17936         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
17937         function to get the store opcode.
17938         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
17939         only emit the Ldelema if the store opcode is Stobj.  You must run
17940         both test-34 and test-167 to test this.  Fixes #34529.
17941
17942 2002-11-23  Martin Baulig  <martin@ximian.com>
17943
17944         * ecore.cs (Expression.MemberLookup): Added additional
17945         `qualifier_type' argument which is used when we're being called
17946         from MemberAccess.DoResolve() and null if we're called from a
17947         SimpleName lookup.
17948         (Expression.MemberLookupFailed): New method to report errors; this
17949         does the CS1540 check and reports the correct error message.
17950
17951         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
17952         argument for the CS1540 check and redone the way how we're dealing
17953         with private members.  See the comment in the source code for details.
17954         (FilterWithClosure): Reverted this back to revision 1.197; renamed
17955         `closure_start_type' to `closure_qualifier_type' and check whether
17956         it's not null.  It was not this filter being broken, it was just
17957         being called with the wrong arguments.
17958
17959         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
17960         and pass it the correct `qualifier_type'; this also does the error
17961         handling for us.
17962
17963 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
17964
17965         * expression.cs (Invocation.EmitParams): If the we are dealing
17966         with a non-built-in value type, load its address as well.
17967
17968         (ArrayCreation): Use a a pretty constant instead
17969         of the hardcoded value 2.   Use 6 instead of 2 for the number of
17970         static initializers.  
17971
17972         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
17973         because they are not really value types, just glorified integers. 
17974
17975         * driver.cs: Do not append .exe, the CSC compiler does not do it.
17976
17977         * ecore.cs: Remove redundant code for enumerations, make them use
17978         the same code path as everything else, fixes the casting issue
17979         with enumerations in Windows.Forms.
17980
17981         * attribute.cs: Do only cast to string if it is a string, the
17982         validation happens later.
17983
17984         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
17985         people upgrade their corlibs.
17986
17987         * ecore.cs: Oops, enumerations were not following the entire code path
17988
17989 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
17990
17991         * typemanager.cs (FilterWithClosure): Commented out the test for
17992         1540 in typemanager.cs, as it has problems when accessing
17993         protected methods from a parent class (see test-174.cs). 
17994
17995         * attribute.cs (Attribute.ValidateGuid): new method.
17996         (Attribute.Resolve): Use above.
17997
17998 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
17999
18000         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
18001
18002         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
18003         handling for enumerations, as we only needed the TypeContainer
18004         functionality to begin with (this is required for the fix below to
18005         work for enums that reference constants in a container class for
18006         example). 
18007
18008         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
18009
18010         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
18011         a valid TypeBuilder to perform lookups on.o
18012
18013         * class.cs (InheritableMemberSignatureCompare): Use true in the
18014         call to GetGetMethod and GetSetMethod, because we are comparing
18015         the signature, and we need to get the methods *even* if they are
18016         private. 
18017
18018         (PropertyBase.CheckBase): ditto.
18019
18020         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
18021         GotoCase.Resolve): Use Peel on EmpytCasts.
18022
18023         * ecore.cs (EmptyCast): drop child, add Peel method.
18024
18025 2002-11-17  Martin Baulig  <martin@ximian.com>
18026
18027         * ecore.cs (EmptyCast.Child): New public property.
18028
18029         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
18030         label resolved to an EmptyCast.  Fixes #34162.
18031         (GotoCase.Resolve): Likewise.
18032         (Block.EmitMeta): Likewise.
18033
18034 2002-11-17  Martin Baulig  <martin@ximian.com>
18035
18036         * expression.cs (Invocation.BetterConversion): Prefer int over
18037         uint; short over ushort; long over ulong for integer literals.
18038         Use ImplicitConversionExists instead of StandardConversionExists
18039         since we also need to check for user-defined implicit conversions.
18040         Fixes #34165.  Added test-173.cs.
18041
18042 2002-11-16  Martin Baulig  <martin@ximian.com>
18043
18044         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
18045         with the `true' and `false' literals.  Fixes #33151.
18046
18047 2002-11-16  Martin Baulig  <martin@ximian.com>
18048
18049         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
18050         October 22nd; don't do the cs1540 check for static members.
18051
18052         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
18053         now using our own filter here and doing the cs1540 check again.
18054
18055 2002-11-16  Martin Baulig  <martin@ximian.com>
18056
18057         * support.cs (InternalParameters): Don't crash if we don't have
18058         any fixed parameters.  Fixes #33532.
18059
18060 2002-11-16  Martin Baulig  <martin@ximian.com>
18061
18062         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
18063         when looking up static methods to make this work on Windows.
18064         Fixes #33773.
18065
18066 2002-11-16  Martin Baulig  <martin@ximian.com>
18067
18068         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
18069         a setter rather than using PropertyInfo.CanWrite.
18070
18071 2002-11-15  Nick Drochak  <ndrochak@gol.com>
18072
18073         * class.cs: Allow acces to block member by subclasses. Fixes build
18074         breaker.
18075
18076 2002-11-14  Martin Baulig  <martin@ximian.com>
18077
18078         * class.cs (Constructor.Emit): Added the extern/block check.
18079         Fixes bug #33678.
18080
18081 2002-11-14  Martin Baulig  <martin@ximian.com>
18082
18083         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
18084         iteration while looking for indexers, this is needed because the
18085         indexer may have a different name in our base classes.  Fixed the
18086         error reporting (no indexers at all, not get accessor, no
18087         overloaded match).  Fixes bug #33089.
18088         (IndexerAccess.DoResolveLValue): Likewise.
18089
18090 2002-11-14  Martin Baulig  <martin@ximian.com>
18091
18092         * class.cs (PropertyBase.CheckBase): Make this work for multiple
18093         indexers.  Fixes the first part of bug #33089.
18094         (MethodSignature.InheritableMemberSignatureCompare): Added support
18095         for properties.
18096
18097 2002-11-13  Ravi Pratap  <ravi@ximian.com>
18098
18099         * attribute.cs (Attribute.Resolve): Catch the
18100         NullReferenceException and report it since it isn't supposed to
18101         happen. 
18102
18103 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
18104
18105         * expression.cs (Binary.EmitBranchable): Also handle the cases for
18106         LogicalOr and LogicalAnd that can benefit from recursively
18107         handling EmitBranchable.  The code now should be nice for Paolo.
18108
18109 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
18110
18111         * typemanager.cs (LookupType): Added a negative-hit hashtable for
18112         the Type lookups, as we perform quite a number of lookups on
18113         non-Types.  This can be removed once we can deterministically tell
18114         whether we have a type or a namespace in advance.
18115
18116         But this might require special hacks from our corlib.
18117
18118         * TODO: updated.
18119
18120         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
18121         and double which avoids a conversion from an integer to a double.
18122
18123         * expression.cs: tiny optimization, avoid calling IsConstant,
18124         because it effectively performs the lookup twice.
18125
18126 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
18127
18128         But a bogus return here to keep the semantics of the old code
18129         until the Mono runtime is fixed.
18130
18131         * pending.cs (GetMissingInterfaces): New method used to remove all
18132         the interfaces that are already implemented by our parent
18133         classes from the list of pending methods. 
18134
18135         * interface.cs: Add checks for calls after ResolveTypeExpr.
18136
18137 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
18138
18139         * class.cs (Class.Emit): Report warning 67: event not used if the
18140         warning level is beyond 3.
18141
18142         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
18143         being a NullLiteral.
18144
18145         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
18146         specifiers. 
18147
18148         * class.cs (TypeContainer.GetClassBases): Cover a missing code
18149         path that might fail if a type can not be resolved.
18150
18151         * expression.cs (Binary.Emit): Emit unsigned versions of the
18152         operators. 
18153
18154         * driver.cs: use error 5.
18155
18156 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
18157
18158         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
18159
18160 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
18161
18162         * cs-parser.jay (switch_section): A beautiful patch from Martin
18163         Baulig that fixed 33094.
18164
18165 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
18166
18167         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
18168         Check whether the base is abstract and report an error if so.
18169
18170         * expression.cs (IndexerAccess.DoResolveLValue,
18171         IndexerAccess.DoResolve): ditto. 
18172
18173         (Invocation.DoResolve): ditto.
18174
18175         (Invocation.FullMethodDesc): Improve the report string.
18176
18177         * statement.cs (Block): Eliminate IsVariableDefined as it is
18178         basically just a wrapper for GetVariableInfo.
18179
18180         * ecore.cs (SimpleName): Use new 
18181
18182         * support.cs (ReflectionParamter.ParameterType): We unwrap the
18183         type, as we return the actual parameter ref/unref state on a
18184         different call.
18185
18186 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
18187
18188         * support.cs: Return proper flags REF/OUT fixing the previous
18189         commit.  
18190
18191         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
18192         not used to mean `ref' but `ref or out' in ParameterReference
18193
18194         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
18195         full type signature instead of calling TypeManger.CSharpName
18196         ourselves. 
18197
18198         * support.cs (InternalParameters.ParameterDesc): Do not compare
18199         directly to the modflags, because REF/OUT will actually be bitsets
18200         if set. 
18201
18202         * delegate.cs (VerifyMethod): Check also the modifiers.
18203
18204         * cs-tokenizer.cs: Fix bug where floating point values with an
18205         exponent where a sign was missing was ignored.
18206
18207         * driver.cs: Allow multiple assemblies to be specified in a single
18208         /r: argument
18209
18210 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
18211
18212         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
18213         because identifiers after a parenthesis would end up in this kind
18214         of production, and we needed to desamiguate it for having casts
18215         like:
18216
18217                 (UserDefinedType *) xxx
18218
18219 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
18220
18221         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
18222         we should set on the Bindingflags.NonPublic, but not turn on
18223         private_ok.  private_ok controls whether a Private member is
18224         returned (this is chekced on the filter routine), while the
18225         BindingFlags.NonPublic just controls whether private/protected
18226         will be allowed.   This fixes the problem part of the problem of
18227         private properties being allowed to be used in derived classes.
18228
18229         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
18230         so we can call the children DoResolveLValue method (this will
18231         properly signal errors on lvalue assignments to base properties)
18232
18233         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
18234         getter are null, and we have a property info, we know that this
18235         happened because the lookup failed, so we report an error 122 for
18236         protection level violation.
18237
18238         We also silently return if setter and getter are null in the
18239         resolve functions, this condition only happens if we have flagged
18240         the error before.  This is the other half of the problem. 
18241
18242         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
18243         not have accessibility information, that is why we were returning
18244         true in the filter function in typemanager.cs.
18245
18246         To properly report 122 (property is inaccessible because of its
18247         protection level) correctly, we report this error in ResolveAccess
18248         by failing if both the setter and the getter are lacking (ie, the
18249         lookup failed). 
18250
18251         DoResolve and DoLResolve have been modified to check for both
18252         setter/getter being null and returning silently, the reason being
18253         that I did not want to put the knowledge about this error in upper
18254         layers, like:
18255
18256         int old = Report.Errors;
18257         x = new PropertyExpr (...);
18258         if (old != Report.Errors)
18259                 return null;
18260         else
18261                 return x;
18262
18263         So the property expr is returned, but it is invalid, so the error
18264         will be flagged during the resolve process. 
18265
18266         * class.cs: Remove InheritablePropertySignatureCompare from the
18267         class, as we no longer depend on the property signature to compute
18268         whether it is possible to implement a method or not.
18269
18270         The reason is that calling PropertyInfo.GetGetMethod will return
18271         null (in .NET, in Mono it works, and we should change this), in
18272         cases where the Get Method does not exist in that particular
18273         class.
18274
18275         So this code:
18276
18277         class X { public virtual int A { get { return 1; } } }
18278         class Y : X { }
18279         class Z : Y { public override int A { get { return 2; } } }
18280
18281         Would fail in Z because the parent (Y) would not have the property
18282         defined.  So we avoid this completely now (because the alternative
18283         fix was ugly and slow), and we now depend exclusively on the
18284         method names.
18285
18286         (PropertyBase.CheckBase): Use a method-base mechanism to find our
18287         reference method, instead of using the property.
18288
18289         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
18290         routines are gone now.
18291
18292         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
18293         names, they were incorrectly named.
18294
18295         * cs-tokenizer.cs: Return are more gentle token on failure. 
18296
18297         * pending.cs (PendingImplementation.InterfaceMethod): This routine
18298         had an out-of-sync index variable, which caused it to remove from
18299         the list of pending methods the wrong method sometimes.
18300
18301 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
18302
18303         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
18304         CanWrite, because those refer to this particular instance of the
18305         property, and do not take into account the fact that we can
18306         override single members of a property.
18307
18308         Constructor requires an EmitContext.  The resolution process does
18309         not happen here, but we need to compute the accessors before,
18310         because the resolution does not always happen for properties.
18311
18312         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
18313         subclass, before we did not update this flag, but we did update
18314         bindingflags. 
18315
18316         (GetAccessors): Drop this routine, as it did not work in the
18317         presence of partially overwritten set/get methods. 
18318
18319         Notice that this broke the cs1540 detection, but that will require
18320         more thinking. 
18321
18322 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18323
18324         * class.cs:
18325         * codegen.cs:
18326         * driver.cs: issue a warning instead of an error if we don't support
18327         debugging for the platform. Also ignore a couple of errors that may
18328         arise when trying to write the symbols. Undo my previous patch.
18329
18330 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18331
18332         * driver.cs: ignore /debug switch except for Unix platforms.
18333
18334 2002-10-23  Nick Drochak  <ndrochak@gol.com>
18335
18336         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
18337
18338 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
18339
18340         * driver.cs: Do not make mcs-debug conditional, so we do not break
18341         builds that use it.
18342
18343         * statement.cs (UsageVector.MergeChildren): I would like Martin to
18344         review this patch.  But basically after all the children variables
18345         have been merged, the value of "Breaks" was not being set to
18346         new_breaks for Switch blocks.  I think that it should be set after
18347         it has executed.  Currently I set this to the value of new_breaks,
18348         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
18349         conservative, but I do not understand this code very well.
18350
18351         I did not break anything in the build, so that is good ;-)
18352
18353         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
18354
18355 2002-10-20  Mark Crichton  <crichton@gimp.org>
18356
18357         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
18358
18359 2002-10-20  Nick Drochak  <ndrochak@gol.com>
18360
18361         * cfold.cs: Fixed compile blocker.
18362
18363 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
18364
18365         * driver.cs: I was chekcing the key, not the file.
18366
18367 2002-10-19  Ravi Pratap  <ravi@ximian.com>
18368
18369         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
18370         message that we were generating - we just need to silently return
18371         a null.
18372
18373 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
18374
18375         * class.cs (Event.Define): Change my previous commit, as this
18376         breaks the debugger.  This is a temporary hack, as it seems like
18377         the compiler is generating events incorrectly to begin with.
18378
18379         * expression.cs (Binary.ResolveOperator): Added support for 
18380         "U operator - (E x, E y)"
18381
18382         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
18383         y)".
18384
18385         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
18386         init-only variables, but this path did not take into account that
18387         there might be also instance readonly variables.  Correct this
18388         problem. 
18389
18390         This fixes bug 32253
18391
18392         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
18393         delegates as well.
18394
18395         * driver.cs: Change the extension for modules to `netmodule'
18396
18397         * cs-parser.jay: Improved slightly the location tracking for
18398         the debugger symbols.
18399
18400         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
18401         modifiers that were specified instead of the hardcoded value
18402         (FamAndAssem).  This was basically ignoring the static modifier,
18403         and others.  Fixes 32429.
18404
18405         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
18406         fixed a bug in the process (32476)
18407
18408         * expression.cs (ArrayAccess.EmitAssign): Patch from
18409         hwang_rob@yahoo.ca that fixes bug 31834.3
18410
18411 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
18412
18413         * driver.cs: Make the module extension .netmodule.
18414
18415 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
18416
18417         * driver.cs: Report an error if the resource file is not found
18418         instead of crashing.
18419
18420         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
18421         false, like Emit does.
18422
18423 2002-10-16  Nick Drochak  <ndrochak@gol.com>
18424
18425         * typemanager.cs: Remove unused private member.  Also reported mcs
18426         bug to report this as a warning like csc.
18427
18428 2002-10-15  Martin Baulig  <martin@gnome.org>
18429
18430         * statement.cs (Statement.Emit): Made this a virtual method; emits
18431         the line number info and calls DoEmit().
18432         (Statement.DoEmit): New protected abstract method, formerly knows
18433         as Statement.Emit().
18434
18435         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
18436
18437 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
18438
18439         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
18440         have fixed a remaining problem: not every AddXXXX was adding a
18441         fully qualified name.  
18442
18443         Now everyone registers a fully qualified name in the DeclSpace as
18444         being defined instead of the partial name.  
18445
18446         Downsides: we are slower than we need to be due to the excess
18447         copies and the names being registered this way.  
18448
18449         The reason for this is that we currently depend (on the corlib
18450         bootstrap for instance) that types are fully qualified, because
18451         we dump all the types in the namespace, and we should really have
18452         types inserted into the proper namespace, so we can only store the
18453         basenames in the defined_names array.
18454
18455 2002-10-10  Martin Baulig  <martin@gnome.org>
18456
18457         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
18458         from bug #31834, see the bug report for a testcase which is
18459         miscompiled.
18460
18461 2002-10-10  Martin Baulig  <martin@gnome.org>
18462
18463         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
18464         flow analysis code for this.
18465
18466         * statement.cs (Do, While, For): Tell the flow analysis code about
18467         infinite loops.
18468         (FlowBranching.UsageVector): Added support for infinite loops.
18469         (Block.Resolve): Moved the dead code elimination here and use flow
18470         analysis to do it.
18471
18472 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
18473
18474         * class.cs (Field.Define): Catch cycles on struct type
18475         definitions. 
18476
18477         * typemanager.cs (IsUnmanagedtype): Do not recursively check
18478         fields if the fields are static.  We only need to check instance
18479         fields. 
18480
18481         * expression.cs (As.DoResolve): Test for reference type.
18482
18483         * statement.cs (Using.ResolveExpression): Use
18484         ConvertImplicitRequired, not ConvertImplicit which reports an
18485         error on failture
18486         (Using.ResolveLocalVariableDecls): ditto.
18487
18488         * expression.cs (Binary.ResolveOperator): Report errors in a few
18489         places where we had to.
18490
18491         * typemanager.cs (IsUnmanagedtype): Finish implementation.
18492
18493 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
18494
18495         * expression.cs: Use StoreFromPtr instead of extracting the type
18496         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
18497
18498         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
18499         an enumeration value to a System.Enum, but System.Enum is not a
18500         value type, but an class type, so we need to box.
18501
18502         (Expression.ConvertExplicit): One codepath could return
18503         errors but not flag them.  Fix this.  Fixes #31853
18504
18505         * parameter.cs (Resolve): Do not allow void as a parameter type.
18506
18507 2002-10-06  Martin Baulig  <martin@gnome.org>
18508
18509         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
18510         if it's a class type and not a struct.  Fixes #31815.
18511
18512 2002-10-06  Martin Baulig  <martin@gnome.org>
18513
18514         * statement.cs: Reworked the flow analysis code a bit to make it
18515         usable for dead code elimination.
18516
18517 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18518
18519         * cs-parser.jay: allow empty source files. Fixes bug #31781.
18520
18521 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
18522
18523         * expression.cs (ComposedCast.DoResolveType): A quick workaround
18524         to fix the test 165, will investigate deeper.
18525
18526 2002-10-04  Martin Baulig  <martin@gnome.org>
18527
18528         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
18529         finally blocks actually work.
18530         (Try.Resolve): We don't need to create a sibling for `finally' if
18531         there is no finally block.
18532
18533 2002-10-04  Martin Baulig  <martin@gnome.org>
18534
18535         * class.cs (Constructor.Define): The default accessibility for a
18536         non-default constructor is private, not public.
18537
18538 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
18539
18540         * class.cs (Constructor): Make AllowedModifiers public, add
18541         EXTERN.
18542
18543         * cs-parser.jay: Perform the modifiers test here, as the
18544         constructor for the Constructor class usually receives a zero
18545         because of the way we create it (first we create, later we
18546         customize, and we were never checking the modifiers).
18547
18548         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
18549         is a version of LookupTypeReflection that includes the type-name
18550         cache.  This can be used as a fast path for functions that know
18551         the fully qualified name and are only calling into *.GetType() to
18552         obtain a composed type.
18553
18554         This is also used by TypeManager.LookupType during its type
18555         composition.
18556
18557         (LookupType): We now also track the real type name, as sometimes
18558         we can get a quey for the real type name from things like
18559         ComposedCast.  This fixes bug 31422.
18560
18561         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
18562         complete type fullname, it does not have to go through the type
18563         resolution system to obtain the composed version of the type (for
18564         obtaining arrays or pointers).
18565
18566         (Conditional.Emit): Use the EmitBoolExpression to
18567         generate nicer code, as requested by Paolo.
18568
18569         (ArrayCreation.CheckIndices): Use the patch from
18570         hwang_rob@yahoo.ca to validate the array initializers. 
18571
18572 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
18573
18574         * class.cs (ConstructorInitializer.Emit): simplify code by using
18575         Invocation.EmitCall, and at the same time, fix the bugs in calling
18576         parent constructors that took variable arguments. 
18577
18578         * ecore.cs (Expression.ConvertNumericExplicit,
18579         Expression.ImplicitNumericConversion): Remove the code that
18580         manually wrapped decimal (InternalTypeConstructor call is now gone
18581         as well).
18582
18583         * expression.cs (Cast.TryReduce): Also handle decimal types when
18584         trying to perform a constant fold on the type.
18585
18586         * typemanager.cs (IsUnmanagedtype): Partially implemented.
18587
18588         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
18589         that only turned off an error report, and did nothing else. 
18590
18591 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
18592
18593         * driver.cs: Handle and ignore /fullpaths
18594
18595 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
18596
18597         * expression.cs (Binary.ResolveOperator): Catch the case where
18598         DoNumericPromotions returns true, 
18599
18600         (Binary.DoNumericPromotions): Simplify the code, and the tests.
18601
18602 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
18603
18604         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
18605         report error 70.
18606
18607 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
18608
18609         * ecore.cs (ConvertNumericExplicit): It is not enough that the
18610         conversion exists, but it is also required that the conversion be
18611         performed.  This manifested in "(Type64Enum) 2".  
18612
18613         * class.cs (TypeManager.AddMethod): The fix is not to change
18614         AddEnum, because that one was using a fully qualified name (every
18615         DeclSpace derivative does), but to change the AddMethod routine
18616         that was using an un-namespaced name.  This now correctly reports
18617         the duplicated name.
18618
18619         Revert patch until I can properly fix it.  The issue
18620         is that we have a shared Type space across all namespaces
18621         currently, which is wrong.
18622
18623         Options include making the Namespace a DeclSpace, and merge
18624         current_namespace/current_container in the parser.
18625
18626 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
18627
18628         * cs-parser.jay: Improve error reporting when we get a different
18629         kind of expression in local_variable_type and
18630         local_variable_pointer_type. 
18631
18632         Propagate this to avoid missleading errors being reported.
18633
18634         * ecore.cs (ImplicitReferenceConversion): treat
18635         TypeManager.value_type as a target just like object_type.   As
18636         code like this:
18637
18638         ValueType v = 1;
18639
18640         Is valid, and needs to result in the int 1 being boxed before it
18641         is assigned to the value type v.
18642
18643         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
18644         to validate the enumeration name.
18645
18646         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
18647         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
18648         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
18649
18650         * ecore.cs (TryImplicitIntConversion): When doing an
18651         implicit-enumeration-conversion, check if the type is 64-bits and
18652         perform a conversion before passing to EnumConstant.
18653
18654 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
18655
18656         * decl.cs (Error_AmbiguousTypeReference); New routine used to
18657         report ambiguous type references.  Unlike the MS version, we
18658         report what the ambiguity is.   Innovation at work ;-)
18659
18660         (DeclSpace.FindType): Require a location argument to
18661         display when we display an ambiguous error.
18662
18663         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
18664
18665         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
18666
18667         * expression.cs (EmitDynamicInitializers): Apply patch from
18668         hwang_rob@yahoo.ca that fixes the order in which we emit our
18669         initializers. 
18670
18671 2002-09-21  Martin Baulig  <martin@gnome.org>
18672
18673         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
18674         delegate takes no arguments.
18675
18676 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
18677
18678         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
18679         from integers.
18680
18681         * expression.cs: Extract the underlying type.
18682
18683         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
18684
18685         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
18686
18687 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
18688
18689         * class.cs (TypeContainer.DefineType): We can not use the nice
18690         PackingSize with the size set to 1 DefineType method, because it
18691         will not allow us to define the interfaces that the struct
18692         implements.
18693
18694         This completes the fixing of bug 27287
18695
18696         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
18697         means also structs.  This fixes part of the problem. 
18698         (Expresion.ImplicitReferenceConversionExists): ditto.
18699
18700         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
18701         error if there were no errors reported during the type lookup
18702         process, to avoid duplicates or redundant errors.  Without this
18703         you would get an ambiguous errors plus a type not found.  We have
18704         beaten the user enough with the first error.  
18705
18706         (DeclSparce.FindType): Emit a warning if we have an ambiguous
18707         reference. 
18708
18709         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
18710         during the resolution process, stop the lookup, this avoids
18711         repeated error reports (same error twice).
18712
18713         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
18714
18715         * typemanager.cs (LookupType): Redo the type lookup code to match
18716         the needs of System.Reflection.  
18717
18718         The issue is that System.Reflection requires references to nested
18719         types to begin with a "+" sign instead of a dot.  So toplevel
18720         types look like: "NameSpace.TopLevelClass", and nested ones look
18721         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
18722         levels. 
18723
18724 2002-09-19  Martin Baulig  <martin@gnome.org>
18725
18726         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
18727         says that a method always returns or always throws an exception,
18728         don't report the CS0161.
18729
18730         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
18731         set `Returns = new_returns'.
18732
18733 2002-09-19  Martin Baulig  <martin@gnome.org>
18734
18735         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
18736         to an enum constant, check for a CS0176.
18737
18738 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
18739
18740         * class.cs (TypeContainer.CheckPairedOperators): Now we check
18741         for operators that must be in pairs and report errors.
18742
18743         * ecore.cs (SimpleName.DoResolveType): During the initial type
18744         resolution process, when we define types recursively, we must
18745         check first for types in our current scope before we perform
18746         lookups in the enclosing scopes.
18747
18748         * expression.cs (MakeByteBlob): Handle Decimal blobs.
18749
18750         (Invocation.VerifyArgumentsCompat): Call
18751         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
18752         I thought we were supposed to always call this, but there are a
18753         few places in the code where we dont do it.
18754
18755 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
18756
18757         * driver.cs: Add support in -linkres and -resource to specify the
18758         name of the identifier.
18759
18760 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
18761
18762         * ecore.cs (StandardConversionExists): Sync with the conversion
18763         code: allow anything-* to void* conversions.
18764
18765         (FindMostSpecificSource): Use an Expression argument
18766         instead of a Type, because we might be handed over a Literal which
18767         gets a few more implicit conversions that plain types do not.  So
18768         this information was being lost.
18769
18770         Also, we drop the temporary type-holder expression when not
18771         required.
18772
18773 2002-09-17  Martin Baulig  <martin@gnome.org>
18774
18775         * class.cs (PropertyBase.CheckBase): Don't check the base class if
18776         this is an explicit interface implementation.
18777
18778 2002-09-17  Martin Baulig  <martin@gnome.org>
18779
18780         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
18781         different `IndexerName' attributes.
18782
18783         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
18784         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
18785         virtual CommonResolve().
18786
18787 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
18788
18789         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
18790         and convert that to the UnderlyingType.
18791
18792         * statement.cs (Foreach.Resolve): Indexers are just like variables
18793         or PropertyAccesses.
18794
18795         * cs-tokenizer.cs (consume_string): Track line numbers and columns
18796         inside quoted strings, we were not doing this before.
18797
18798 2002-09-16  Martin Baulig  <martin@gnome.org>
18799
18800         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
18801         resolve it.  This is needed for the definite assignment check of the
18802         instance expression, fixes bug #29846.
18803         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
18804
18805 2002-09-16  Nick Drochak  <ndrochak@gol.com>
18806
18807         * parameter.cs: Fix compile error.  Cannot reference static member
18808         from an instance object.  Is this an mcs bug?
18809
18810 2002-09-14  Martin Baulig  <martin@gnome.org>
18811
18812         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
18813         multiple times.  Fixes bug #30295, added test-166.cs.
18814
18815 2002-09-14  Martin Baulig  <martin@gnome.org>
18816
18817         * statement.cs (Block.Emit): Don't emit unreachable code.
18818         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
18819         `break' statements.
18820         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
18821
18822 2002-09-14  Martin Baulig  <martin@gnome.org>
18823
18824         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
18825         is set.
18826
18827 2002-09-14  Martin Baulig  <martin@gnome.org>
18828
18829         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
18830         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
18831         be false on the ms runtime.
18832
18833 2002-09-13  Martin Baulig  <martin@gnome.org>
18834
18835         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
18836         the CS0038 error message.
18837
18838 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
18839
18840         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
18841         constant inside, return it.
18842
18843 2002-09-12  Martin Baulig  <martin@gnome.org>
18844
18845         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
18846         implicit conversion can be done between enum types.
18847
18848         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
18849         check whether an implicit conversion to the current enum's UnderlyingType
18850         exists and report an error if not.
18851
18852         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
18853         without debugging support.
18854
18855         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
18856         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
18857
18858 2002-09-12  Martin Baulig  <martin@gnome.org>
18859
18860         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
18861
18862         * ecore.cs (IMemberExpr.DeclaringType): New property.
18863         (SimpleName.SimpleNameResolve): Check whether we're accessing a
18864         nonstatic member of an outer type (CS0038).
18865
18866 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
18867
18868         * driver.cs: Activate the using-error detector at warning level
18869         4 (at least for MS-compatible APIs).
18870
18871         * namespace.cs (VerifyUsing): Small buglett fix.
18872
18873         * pending.cs (PendingImplementation): pass the container pointer. 
18874
18875         * interface.cs (GetMethods): Allow for recursive definition.  Long
18876         term, I would like to move every type to support recursive
18877         definitions, not the current ordering mechanism that we have right
18878         now.
18879
18880         The situation is this: Attributes are handled before interfaces,
18881         so we can apply attributes to interfaces.  But some attributes
18882         implement interfaces, we will now handle the simple cases
18883         (recursive definitions will just get an error).  
18884
18885         * parameter.cs: Only invalidate types at the end if we fail to
18886         lookup all types.  
18887
18888 2002-09-09  Martin Baulig  <martin@gnome.org>
18889
18890         * ecore.cs (PropertyExpr.Emit): Also check for
18891         TypeManager.system_int_array_get_length so this'll also work when
18892         compiling corlib.  Fixes #30003.
18893
18894 2002-09-09  Martin Baulig  <martin@gnome.org>
18895
18896         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
18897         and throw an exception if we can't get the type's size.  Fixed #30040,
18898         added test-165.cs.
18899
18900 2002-09-09  Martin Baulig  <martin@gnome.org>
18901
18902         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
18903
18904         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
18905         context.  Fixes bug #30027.
18906
18907         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
18908         virtual functions.  Fixes bug #30043, added test-164.cs.
18909
18910 2002-09-08  Ravi Pratap  <ravi@ximian.com>
18911
18912         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
18913
18914 2002-09-08  Nick Drochak  <ndrochak@gol.com>
18915
18916         * driver.cs: Use an object to get the windows codepage since it's not a
18917         static property.
18918
18919 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
18920
18921         * statement.cs (For.Emit): for infinite loops (test == null)
18922         return whether there is a break inside, not always "true".
18923
18924         * namespace.cs (UsingEntry): New struct to hold the name of the
18925         using definition, the location where it is defined, and whether it
18926         has been used in a successful type lookup.
18927
18928         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
18929         strings.
18930
18931         * decl.cs: ditto.
18932
18933 2002-09-06  Ravi Pratap  <ravi@ximian.com>
18934
18935         * attribute.cs : Fix incorrect code which relied on catching
18936         a NullReferenceException to detect a null being passed in
18937         where an object was expected.
18938
18939 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
18940
18941         * statement.cs (Try): flag the catch variable as assigned
18942
18943         * expression.cs (Cast): Simplified by using ResolveType instead of
18944         manually resolving.
18945
18946         * statement.cs (Catch): Fix bug by using ResolveType.
18947
18948 2002-09-06  Ravi Pratap  <ravi@ximian.com>
18949
18950         * expression.cs (BetterConversion): Special case for when we have
18951         a NullLiteral as the argument and we have to choose between string
18952         and object types - we choose string the way csc does.
18953
18954         * attribute.cs (Attribute.Resolve): Catch the
18955         NullReferenceException and report error #182 since the Mono
18956         runtime no more has the bug and having this exception raised means
18957         we tried to select a constructor which takes an object and is
18958         passed a null.
18959
18960 2002-09-05  Ravi Pratap  <ravi@ximian.com>
18961
18962         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
18963         message (1502, 1503) when we can't locate a method after overload
18964         resolution. This is much more informative and closes the bug
18965         Miguel reported.
18966
18967         * interface.cs (PopulateMethod): Return if there are no argument
18968         types. Fixes a NullReferenceException bug.
18969
18970         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
18971         expressions too. Previously we were checking only in one place for
18972         positional arguments leaving out named arguments.
18973
18974         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
18975         type to the enum type is not allowed. Remove code corresponding to
18976         that.
18977
18978         (ConvertNumericExplicit): Allow explicit conversions from
18979         the underlying type to enum type. This precisely follows the spec
18980         and closes a bug filed by Gonzalo.
18981
18982 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18983
18984         * compiler.csproj:
18985         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
18986
18987 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
18988
18989         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
18990         it was important that we stored the right value after the
18991         reduction in `converted'.
18992
18993 2002-09-04  Martin Baulig  <martin@gnome.org>
18994
18995         * location.cs (Location.SymbolDocument): Use full pathnames for the
18996         source files.
18997
18998 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
18999
19000         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
19001         of the expression resolve mechanism, because that will catch the
19002         SimpleName error failures.
19003
19004         (Conditional): If we can not resolve the
19005         expression, return, do not crash.
19006
19007 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19008
19009         * cs-tokenizer.cs:
19010         (location): display token name instead of its number.
19011
19012 2002-08-28  Martin Baulig  <martin@gnome.org>
19013
19014         * expression.cs (Binary.ResolveOperator): Don't silently return
19015         but return an error if an operator cannot be applied between two
19016         enum types.
19017
19018 2002-08-28  Martin Baulig  <martin@gnome.org>
19019
19020         * class.cs (Constructor.Define): Set the permission attributes
19021         correctly instead of making all constructors public.
19022
19023 2002-08-28  Martin Baulig  <martin@gnome.org>
19024
19025         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
19026         for private members before reporting a CS0103; if we find anything,
19027         it's a CS0122.
19028
19029 2002-08-28  Martin Baulig  <martin@gnome.org>
19030
19031         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
19032         to check whether `closure_start_type == closure_invocation_type',
19033         we also need to check whether `m.DeclaringType == closure_invocation_type'
19034         before bypassing the permission checks.  We might be accessing
19035         protected/private members from the base class.
19036         (TypeManager.RealMemberLookup): Only set private_ok if private
19037         members were requested via BindingFlags.NonPublic.
19038
19039         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
19040
19041         * expression.cs (MemberAccess.ResolveMemberAccess): Set
19042         MethodGroupExpr.IsExplicitImpl if appropriate.
19043         (Invocation.DoResolve): Don't report the CS0120 for explicit
19044         interface implementations.
19045
19046 2002-08-27  Martin Baulig  <martin@gnome.org>
19047
19048         * expression.cs (Invocation.DoResolve): If this is a static
19049         method and we don't have an InstanceExpression, we must report
19050         a CS0120.
19051
19052 2002-08-25  Martin Baulig  <martin@gnome.org>
19053
19054         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
19055         `==' between a valuetype and an object.
19056
19057 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
19058
19059         * ecore.cs (TypeExpr): Provide a ToString method.
19060
19061 2002-08-24  Martin Baulig  <martin@gnome.org>
19062
19063         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
19064         now called proggie.dbg and it's a binary file.
19065
19066 2002-08-23  Martin Baulig  <martin@gnome.org>
19067
19068         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
19069
19070 2002-08-23  Martin Baulig  <martin@gnome.org>
19071
19072         * struct.cs (MyStructInfo.ctor): Make this work with empty
19073         structs; it's not allowed to use foreach() on null.
19074
19075 2002-08-23  Martin Baulig  <martin@gnome.org>
19076
19077         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
19078         writer the full pathname of the generated assembly.
19079
19080 2002-08-23  Martin Baulig  <martin@gnome.org>
19081
19082         * statements.cs (FlowBranching.UsageVector.MergeChildren):
19083         A `finally' block never returns or breaks; improved handling of
19084         unreachable code.
19085
19086 2002-08-23  Martin Baulig  <martin@gnome.org>
19087
19088         * statement.cs (Throw.Resolve): Allow `throw null'.
19089
19090 2002-08-23  Martin Baulig  <martin@gnome.org>
19091
19092         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
19093         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
19094         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
19095         MemberLookup would return a wrong event if this is an explicit
19096         interface implementation and the class has an event with the same
19097         name.
19098
19099 2002-08-23  Martin Baulig  <martin@gnome.org>
19100
19101         * statement.cs (Block.AddChildVariableNames): New public method.
19102         (Block.AddChildVariableName): Likewise.
19103         (Block.IsVariableNameUsedInChildBlock): Likewise.
19104         (Block.AddVariable): Check whether a variable name has already
19105         been used in a child block.
19106
19107         * cs-parser.jay (declare_local_variables): Mark all variable names
19108         from the current block as being used in a child block in the
19109         implicit block.
19110
19111 2002-08-23  Martin Baulig  <martin@gnome.org>
19112
19113         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
19114         find the symbol writer.
19115
19116         * driver.cs: csc also allows the arguments to /define being
19117         separated by commas, not only by semicolons.
19118
19119 2002-08-23  Martin Baulig  <martin@gnome.org>
19120
19121         * interface.cs (Interface.GetMembers): Added static check for events.
19122
19123 2002-08-15  Martin Baulig  <martin@gnome.org>
19124
19125         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
19126         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
19127
19128         * ecore.cs (Expression.MemberLookup): Added documentation and explained
19129         why the MethodData.EmitDestructor() change was necessary.
19130
19131 2002-08-20  Martin Baulig  <martin@gnome.org>
19132
19133         * class.cs (TypeContainer.FindMembers): Added static check for events.
19134
19135         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
19136
19137         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
19138         use Type.GetEvents(), not Type.FindMembers().
19139
19140 2002-08-20  Martin Baulig  <martin@gnome.org>
19141
19142         * decl.cs (MemberCache): Added a special method cache which will
19143         be used for method-only searched.  This ensures that a method
19144         search will return a MethodInfo with the correct ReflectedType for
19145         inherited methods.      
19146
19147 2002-08-20  Martin Baulig  <martin@gnome.org>
19148
19149         * decl.cs (DeclSpace.FindMembers): Made this public.
19150
19151 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19152
19153         * delegate.cs: fixed build on windows.
19154         [FIXME:  Filed as bug #29150: MCS must report these errors.]
19155
19156 2002-08-19  Ravi Pratap  <ravi@ximian.com>
19157
19158         * ecore.cs (StandardConversionExists): Return a false
19159         if we are trying to convert the void type to anything else
19160         since that is not allowed.
19161
19162         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
19163         we flag error 70 in the event an event is trying to be accessed
19164         directly from outside the declaring type.
19165
19166 2002-08-20  Martin Baulig  <martin@gnome.org>
19167
19168         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
19169         MemberCache from typemanager.cs to decl.cs.
19170
19171 2002-08-19  Martin Baulig  <martin@gnome.org>
19172
19173         * class.cs (TypeContainer): Implement IMemberContainer.
19174         (TypeContainer.DefineMembers): Create the MemberCache.
19175         (TypeContainer.FindMembers): Do better BindingFlags checking; only
19176         return public members if BindingFlags.Public was given, check
19177         whether members are static.
19178
19179 2002-08-16  Martin Baulig  <martin@gnome.org>
19180
19181         * decl.cs (DeclSpace.Define): Splitted this in Define and
19182         DefineMembers.  DefineMembers is called first and initializes the
19183         MemberCache.
19184
19185         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
19186         DefineMembers() on all our DeclSpaces.
19187
19188         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
19189         but call DefineMembers() on all nested interfaces.  We call their
19190         Define() in our new Define() function.
19191
19192         * interface.cs (Interface): Implement IMemberContainer.
19193         (Interface.Define): Moved all code except the attribute stuf to
19194         DefineMembers().
19195         (Interface.DefineMembers): Initialize the member cache.
19196
19197         * typemanager.cs (IMemberFinder): Removed this interface, we don't
19198         need this anymore since we can use MemberCache.FindMembers directly.
19199
19200 2002-08-19  Martin Baulig  <martin@gnome.org>
19201
19202         * typemanager.cs (MemberCache): When creating the cache for an
19203         interface type, add all inherited members.
19204         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
19205         to `out bool used_cache' and documented it.
19206         (TypeManager.MemberLookup): If we already used the cache in the first
19207         iteration, we don't need to do the interfaces check.
19208
19209 2002-08-19  Martin Baulig  <martin@gnome.org>
19210
19211         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
19212         here from IMemberFinder and don't implement this interface anymore.
19213         (DeclSpace.MemberCache): Moved here from IMemberFinder.
19214
19215         * typemanager.cs (IMemberFinder): This interface is now only used by
19216         classes which actually support the member cache.
19217         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
19218         since we only put DeclSpaces into this Hashtable.
19219         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
19220         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
19221
19222 2002-08-16  Martin Baulig  <martin@gnome.org>
19223
19224         * typemanager.cs (ICachingMemberFinder): Removed.
19225         (IMemberFinder.MemberCache): New property.
19226         (TypeManager.FindMembers): Merged this with RealFindMembers().
19227         This function will never be called from TypeManager.MemberLookup()
19228         so we can't use the cache here, just the IMemberFinder.
19229         (TypeManager.MemberLookup_FindMembers): Check whether the
19230         IMemberFinder has a MemberCache and call the cache's FindMembers
19231         function.
19232         (MemberCache): Rewrote larger parts of this yet another time and
19233         cleaned it up a bit.
19234
19235 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
19236
19237         * driver.cs (LoadArgs): Support quoting.
19238
19239         (Usage): Show the CSC-like command line arguments.
19240
19241         Improved a few error messages.
19242
19243 2002-08-15  Martin Baulig  <martin@gnome.org>
19244
19245         * typemanager.cs (IMemberContainer.Type): New property.
19246         (IMemberContainer.IsInterface): New property.
19247
19248         The following changes are conditional to BROKEN_RUNTIME, which is
19249         defined at the top of the file.
19250
19251         * typemanager.cs (MemberCache.MemberCache): Don't add the base
19252         class'es members, but add all members from TypeHandle.ObjectType
19253         if we're an interface.
19254         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
19255         is the current type.
19256         (MemberCache.CacheEntry.Container): Removed this field.
19257         (TypeHandle.GetMembers): Include inherited members.
19258
19259 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19260
19261         * typemanager.cs: fixed compilation and added a comment on a field that
19262         is never used.
19263
19264 2002-08-15  Martin Baulig  <martin@gnome.org>
19265
19266         * class.cs (ConstructorInitializer.Resolve): In the
19267         Expression.MemberLookup call, use the queried_type as
19268         invocation_type.
19269
19270         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
19271         declared' attribute, it's always true.
19272         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
19273         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
19274         temporary wrapper for FindMembers which tells MemberLookup whether
19275         members from the base classes are included in the return value.
19276         This will go away soon.
19277         (TypeManager.MemberLookup): Use this temporary hack here; once the
19278         new MemberCache is completed, we don't need to do the DeclaredOnly
19279         looping here anymore since the MemberCache will take care of this.
19280         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
19281         (MemberCache): When creating the MemberCache for a class, get
19282         members from the current class and all its base classes.
19283         (MemberCache.CacheEntry.Container): New field.  This is a
19284         temporary hack until the Mono runtime is fixed to distinguish
19285         between ReflectedType and DeclaringType.  It allows us to use MCS
19286         with both the MS runtime and the unfixed Mono runtime without
19287         problems and without accecting performance.
19288         (MemberCache.SearchMembers): The DeclaredOnly looping from
19289         TypeManager.MemberLookup is now done here.      
19290
19291 2002-08-14  Martin Baulig  <martin@gnome.org>
19292
19293         * statement.cs (MyStructInfo.MyStructInfo): Don't call
19294         Type.GetFields on dynamic types but get the fields from the
19295         corresponding TypeContainer.
19296         (MyStructInfo.GetStructInfo): Added check for enum types.
19297
19298         * typemanager.cs (MemberList.IsSynchronized): Implemented.
19299         (MemberList.SyncRoot): Implemented.
19300         (TypeManager.FilterWithClosure): No need to check permissions if
19301         closure_start_type == closure_invocation_type, don't crash if
19302         closure_invocation_type is null.
19303
19304 2002-08-13  Martin Baulig  <martin@gnome.org>
19305
19306         Rewrote TypeContainer.FindMembers to use a member cache.  This
19307         gives us a speed increase of about 35% for the self-hosting MCS
19308         build and of about 15-20% for the class libs (both on GNU/Linux).
19309
19310         * report.cs (Timer): New class to get enhanced profiling.  This
19311         whole class is "TIMER" conditional since it remarkably slows down
19312         compilation speed.
19313
19314         * class.cs (MemberList): New class.  This is an IList wrapper
19315         which we're now using instead of passing MemberInfo[]'s around to
19316         avoid copying this array unnecessarily.
19317         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
19318         (ICachingMemberFinder, IMemberContainer): New interface.
19319         (TypeManager.FilterWithClosure): If `criteria' is null, the name
19320         has already been checked, otherwise use it for the name comparision.
19321         (TypeManager.FindMembers): Renamed to RealMemberFinder and
19322         provided wrapper which tries to use ICachingMemberFinder.FindMembers
19323         if possible.  Returns a MemberList, not a MemberInfo [].
19324         (TypeHandle): New class, implements IMemberContainer.  We create
19325         one instance of this class per type, it contains a MemberCache
19326         which is used to do the member lookups.
19327         (MemberCache): New class.  Each instance of this class contains
19328         all members of a type and a name-based hash table.
19329         (MemberCache.FindMembers): This is our new member lookup
19330         function.  First, it looks up all members of the requested name in
19331         the hash table.  Then, it walks this list and sorts out all
19332         applicable members and returns them.
19333
19334 2002-08-13  Martin Baulig  <martin@gnome.org>
19335
19336         In addition to a nice code cleanup, this gives us a performance
19337         increase of about 1.4% on GNU/Linux - not much, but it's already
19338         half a second for the self-hosting MCS compilation.
19339
19340         * typemanager.cs (IMemberFinder): New interface.  It is used by
19341         TypeManager.FindMembers to call FindMembers on a TypeContainer,
19342         Enum, Delegate or Interface.
19343         (TypeManager.finder_to_member_finder): New PtrHashtable.
19344         (TypeManager.finder_to_container): Removed.
19345         (TypeManager.finder_to_delegate): Removed.
19346         (TypeManager.finder_to_interface): Removed.
19347         (TypeManager.finder_to_enum): Removed.
19348
19349         * interface.cs (Interface): Implement IMemberFinder.
19350
19351         * delegate.cs (Delegate): Implement IMemberFinder.
19352
19353         * enum.cs (Enum): Implement IMemberFinder.
19354
19355         * class.cs (TypeContainer): Implement IMemberFinder.
19356
19357 2002-08-12  Martin Baulig  <martin@gnome.org>
19358
19359         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
19360
19361 2002-08-12  Martin Baulig  <martin@gnome.org>
19362
19363         * ecore.cs (ITypeExpression): New interface for expressions which
19364         resolve to a type.
19365         (TypeExpression): Renamed to TypeLookupExpression.
19366         (Expression.DoResolve): If we're doing a types-only lookup, the
19367         expression must implement the ITypeExpression interface and we
19368         call DoResolveType() on it.
19369         (SimpleName): Implement the new ITypeExpression interface.
19370         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
19371         hack, the situation that we're only looking up types can't happen
19372         anymore when this method is called.  Moved the type lookup code to
19373         DoResolveType() and call it.
19374         (SimpleName.DoResolveType): This ITypeExpression interface method
19375         is now doing the types-only lookup.
19376         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
19377         (ResolveFlags): Added MaskExprClass.
19378
19379         * expression.cs (MemberAccess): Implement the ITypeExpression
19380         interface.
19381         (MemberAccess.DoResolve): Added support for a types-only lookup
19382         when we're called via ITypeExpression.DoResolveType().
19383         (ComposedCast): Implement the ITypeExpression interface.
19384
19385         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
19386         Expression.Resolve() with ResolveFlags.Type instead.
19387
19388 2002-08-12  Martin Baulig  <martin@gnome.org>
19389
19390         * interface.cs (Interface.Define): Apply attributes.
19391
19392         * attribute.cs (Attribute.ApplyAttributes): Added support for
19393         interface attributes.
19394
19395 2002-08-11  Martin Baulig  <martin@gnome.org>
19396
19397         * statement.cs (Block.Emit): Only check the "this" variable if we
19398         do not always throw an exception.
19399
19400         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
19401         whether the property has a set accessor.
19402
19403 2002-08-11  Martin Baulig  <martin@gnome.org>
19404
19405         Added control flow analysis support for structs.
19406
19407         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
19408         with control flow analysis turned off.
19409         (IVariable): New interface.
19410         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
19411         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
19412         (FieldExpr.DoResolve): Resolve the instance expression with flow
19413         analysis turned off and do the definite assignment check after the
19414         resolving when we know what the expression will resolve to.
19415
19416         * expression.cs (LocalVariableReference, ParameterReference):
19417         Implement the new IVariable interface, only call the flow analysis
19418         code if ec.DoFlowAnalysis is true.
19419         (This): Added constructor which takes a Block argument.  Implement
19420         the new IVariable interface.
19421         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
19422         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
19423         This does the definite assignment checks for struct members.
19424
19425         * class.cs (Constructor.Emit): If this is a non-static `struct'
19426         constructor which doesn't have any initializer, call
19427         Block.AddThisVariable() to tell the flow analysis code that all
19428         struct elements must be initialized before control returns from
19429         the constructor.
19430
19431         * statement.cs (MyStructInfo): New public class.
19432         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
19433         argument to this indexer.  If non-zero, check an individual struct
19434         member, not the whole struct.
19435         (FlowBranching.CheckOutParameters): Check struct members.
19436         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
19437         overloaded versions of these methods which take an additional
19438         `int field_idx' argument to check struct members.
19439         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
19440         overloaded versions of these methods which take an additional
19441         `string field_name' argument to check struct member.s
19442         (VariableInfo): Implement the IVariable interface.
19443         (VariableInfo.StructInfo): New public property.  Returns the
19444         MyStructInfo instance of the variable if it's a struct or null.
19445         (Block.AddThisVariable): New public method.  This is called from
19446         Constructor.Emit() for non-static `struct' constructor which do
19447         not have any initializer.  It creates a special variable for the
19448         "this" instance variable which will be checked by the flow
19449         analysis code to ensure that all of the struct's fields are
19450         initialized before control returns from the constructor.
19451         (UsageVector): Added support for struct members.  If a
19452         variable/parameter is a struct with N members, we reserve a slot
19453         in the usage vector for each member.  A struct is considered fully
19454         initialized if either the struct itself (slot 0) or all its
19455         members are initialized.
19456
19457 2002-08-08  Martin Baulig  <martin@gnome.org>
19458
19459         * driver.cs (Driver.MainDriver): Only report an error CS5001
19460         if there were no compilation errors.
19461
19462         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
19463         `UnsafeContext' property to determine whether the parent is in
19464         unsafe context rather than checking the parent's ModFlags:
19465         classes nested in an unsafe class are unsafe as well.
19466
19467 2002-08-08  Martin Baulig  <martin@gnome.org>
19468
19469         * statement.cs (UsageVector.MergeChildren): Distinguish between
19470         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
19471         we return.  Added test17() and test18() to test-154.cs.
19472
19473 2002-08-08  Martin Baulig  <martin@gnome.org>
19474
19475         * typemanager.cs (TypeManager.FilterWithClosure): If we have
19476         Family access, make sure the invoking type isn't a subclass of the
19477         queried type (that'd be a CS1540).
19478
19479         * ecore.cs (Expression.MemberLookup): Added overloaded version of
19480         this method which takes an additional `Type invocation_type'.
19481
19482         * expression.cs (BaseAccess.DoResolve): Use the base type as
19483         invocation and query type.
19484         (MemberAccess.DoResolve): If the lookup failed and we're about to
19485         report a CS0122, try a lookup with the ec.ContainerType - if this
19486         succeeds, we must report a CS1540.
19487
19488 2002-08-08  Martin Baulig  <martin@gnome.org>
19489
19490         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
19491         (MethodGroupExpr): Implement the IMemberExpr interface.
19492
19493         * expression (MemberAccess.ResolveMemberAccess): No need to have
19494         any special code for MethodGroupExprs anymore, they're now
19495         IMemberExprs.   
19496
19497 2002-08-08  Martin Baulig  <martin@gnome.org>
19498
19499         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
19500         Family, FamANDAssem and FamORAssem permissions.
19501         (TypeManager.IsSubclassOrNestedChildOf): New public method.
19502
19503 2002-08-08  Martin Baulig  <martin@gnome.org>
19504
19505         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
19506         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
19507         or loop block.
19508
19509 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
19510
19511         * driver.cs: implemented /resource option to embed managed resources.
19512
19513 2002-08-07  Martin Baulig  <martin@gnome.org>
19514
19515         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
19516         (FieldBase.HasFieldInitializer): New public property.
19517         (FieldBase.GetInitializerExpression): New public method.  Resolves and
19518         returns the field initializer and makes sure it is only resolved once.
19519         (TypeContainer.EmitFieldInitializers): Call
19520         FieldBase.GetInitializerExpression to get the initializer, this ensures
19521         that it isn't resolved multiple times.
19522
19523         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
19524         the resolving process (SimpleName/MemberLookup) that we're currently
19525         emitting a field initializer (which must not access any instance members,
19526         this is an error CS0236).
19527
19528         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
19529         argument, if the `IsFieldInitializer' flag is set, we must report and
19530         error CS0236 and not an error CS0120.   
19531
19532 2002-08-07  Martin Baulig  <martin@gnome.org>
19533
19534         * ecore.cs (IMemberExpr): New public interface.
19535         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
19536         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
19537         if the expression is an IMemberExpr.
19538
19539         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
19540         to be null, implicitly default to `this' if we're non-static in
19541         this case.  Simplified the code a lot by using the new IMemberExpr
19542         interface.  Also fixed bug #28176 here.
19543
19544 2002-08-06  Martin Baulig  <martin@gnome.org>
19545
19546         * cs-parser.jay (SimpleLookup): Removed.  We need to create
19547         ParameterReferences during semantic analysis so that we can do a
19548         type-only search when resolving Cast, TypeOf and SizeOf.
19549         (block): Pass the `current_local_parameters' to the Block's
19550         constructor.
19551
19552         * class.cs (ConstructorInitializer): Added `Parameters parameters'
19553         argument to the constructor.
19554         (ConstructorInitializer.Resolve): Create a temporary implicit
19555         block with the parameters.
19556
19557         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
19558         references here if we aren't doing a type-only search.
19559
19560         * statement.cs (Block): Added constructor which takes a
19561         `Parameters parameters' argument.
19562         (Block.Parameters): New public property.
19563
19564         * support.cs (InternalParameters.Parameters): Renamed `parameters'
19565         to `Parameters' and made it public readonly.
19566
19567 2002-08-06  Martin Baulig  <martin@gnome.org>
19568
19569         * ecore.cs (Expression.Warning): Made this public as well.
19570
19571         * report.cs (Report.Debug): Print the contents of collections.
19572
19573 2002-08-06  Martin Baulig  <martin@gnome.org>
19574
19575         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
19576         used to tell Resolve() which kinds of expressions it may return.
19577         (Expression.Resolve): Added overloaded version of this method which
19578         takes a `ResolveFlags flags' argument.  This can be used to tell
19579         Resolve() which kinds of expressions it may return.  Reports a
19580         CS0118 on error.
19581         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
19582         ResolveFlags.SimpleName.
19583         (Expression.Error118): Added overloaded version of this method which
19584         takes a `ResolveFlags flags' argument.  It uses the flags to determine
19585         which kinds of expressions are allowed.
19586
19587         * expression.cs (Argument.ResolveMethodGroup): New public method.
19588         Resolves an argument, but allows a MethodGroup to be returned.
19589         This is used when invoking a delegate.
19590
19591         * TODO: Updated a bit.
19592
19593 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19594
19595         Fixed compilation with csc.
19596
19597         * ecore.cs: Expression.Error made public. Is this correct? Should
19598         Warning be made public too?
19599
19600         * expression.cs: use ea.Location instead of ea.loc.
19601         [FIXME:  Filed as bug #28607: MCS must report these errors.]
19602
19603 2002-08-06  Martin Baulig  <martin@gnome.org>
19604
19605         * ecore.cs (Expression.loc): Moved the location here instead of
19606         duplicating it in all derived classes.
19607         (Expression.Location): New public property.
19608         (Expression.Error, Expression.Warning): Made them non-static and
19609         removed the location argument.
19610         (Expression.Warning): Added overloaded version which takes an
19611         `int level' argument.
19612         (Expression.Error118): Make this non-static and removed the
19613         expression and location arguments.
19614         (TypeExpr): Added location argument to the constructor.
19615
19616         * expression.cs (StaticCallExpr): Added location argument to
19617         the constructor.
19618         (Indirection, PointerArithmetic): Likewise.
19619         (CheckedExpr, UnCheckedExpr): Likewise.
19620         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
19621         (StringPtr): Likewise.
19622
19623
19624 2002-08-05  Martin Baulig  <martin@gnome.org>
19625
19626         * expression.cs (BaseAccess.DoResolve): Actually report errors.
19627
19628         * assign.cs (Assign.DoResolve): Check whether the source
19629         expression is a value or variable.
19630
19631         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
19632         while resolving the corresponding blocks.
19633
19634         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
19635         an error, don't silently return null.
19636
19637         * statement.cs (Block.AddVariable): Do the error reporting here
19638         and distinguish between CS0128 and CS0136.
19639         (Block.DoResolve): Report all unused labels (warning CS0164).
19640         (LabeledStatement): Pass the location to the constructor.
19641         (LabeledStatement.HasBeenReferenced): New property.
19642         (LabeledStatement.Resolve): Set it to true here.
19643
19644         * statement.cs (Return.Emit): Return success even after reporting
19645         a type mismatch error (CS0126 or CS0127), this is what csc does and
19646         it avoids confusing the users with any consecutive errors.
19647
19648 2002-08-05  Martin Baulig  <martin@gnome.org>
19649
19650         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
19651
19652         * const.cs (Const.LookupConstantValue): Catch circular definitions.
19653
19654         * expression.cs (MemberAccess.DoResolve): Silently return if an
19655         error has already been reported.
19656
19657         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
19658         error has already been reported.
19659
19660 2002-08-05  Martin Baulig  <martin@gnome.org>
19661
19662         * statement.cs (UsageVector): Only initialize the `parameters'
19663         vector if we actually have any "out" parameters.
19664
19665 2002-08-05  Martin Baulig  <martin@gnome.org>
19666
19667         * expression.cs (Binary.ResolveOperator): When combining delegates,
19668         they must have the same type.
19669
19670 2002-08-05  Martin Baulig  <martin@gnome.org>
19671
19672         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
19673         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
19674         work with the ms runtime and we also don't need it: if we're a
19675         PropertyBuilder and not in the `indexer_arguments' hash, then we
19676         are a property and not an indexer.
19677
19678         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
19679         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
19680         since the latter one doesn't work with the ms runtime.
19681
19682 2002-08-03  Martin Baulig  <martin@gnome.org>
19683
19684         Fixed bugs #27998 and #22735.
19685
19686         * class.cs (Method.IsOperator): New public field.
19687         (Method.CheckBase): Report CS0111 if there's already a method
19688         with the same parameters in the current class.  Report CS0508 when
19689         attempting to change the return type of an inherited method.
19690         (MethodData.Emit): Report CS0179 if a method doesn't have a body
19691         and it's not marked abstract or extern.
19692         (PropertyBase): New abstract base class for Property and Indexer.
19693         (PropertyBase.CheckBase): Moved here from Property and made it work
19694         for indexers.
19695         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
19696         the same so we can reuse it there.
19697         (Property, Indexer): Derive from PropertyBase.
19698         (MethodSignature.inheritable_property_signature_filter): New delegate
19699         to find properties and indexers.
19700
19701         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
19702         argument and improved error reporting.
19703
19704         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
19705         EmptyReadOnlyParameters and made it a property.
19706
19707         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
19708         version of this method which takes a `PropertyInfo indexer'.
19709         (TypeManager.RegisterIndexer): New method.
19710
19711         * class.cs: Added myself as author of this file :-)
19712
19713 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19714
19715         * class.cs: fixed compilation on windoze.
19716
19717 2002-08-03  Martin Baulig  <martin@gnome.org>
19718
19719         * interface.cs (Interface.GetInterfaceBases): Check whether all
19720         base interfaces are at least as accessible than the current one.
19721
19722         * class.cs (TypeContainer.GetClassBases): Check whether base types
19723         are at least as accessible than the current type.
19724         (TypeContainer.AsAccessible): Implemented and made non-static.
19725         (MemberBase.CheckParameters): Report errors if the accessibility
19726         checks fail.
19727
19728         * delegate.cs (Delegate.Delegate): The default visibility is
19729         internal for top-level types and private for nested types.
19730         (Delegate.Define): Report errors if the accessibility checks fail.
19731
19732         * enum.cs (Enum.Enum): The default visibility is internal for
19733         top-level types and private for nested types.
19734         (Enum.DefineType): Compute the correct visibility.
19735
19736         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
19737         function which takes a `bool is_toplevel' instead of a TypeContainer.
19738
19739         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
19740         builtin type.
19741
19742 2002-08-02  Martin Baulig  <martin@gnome.org>
19743
19744         * expression.cs (LocalVariableReferenc): Added constructor which
19745         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
19746         (LocalVariableReference.IsReadOnly): New property.
19747         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
19748         variable is readonly, use our own readonly flag to do this; you can
19749         use the new constructor to get a writable reference to a read-only
19750         variable.
19751
19752         * cs-parser.jay (foreach_statement, using_statement): Get a writable
19753         reference to the local variable.
19754
19755 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
19756
19757         * rootcontext.cs (ResolveCore): Also include System.Exception
19758
19759         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
19760         we reach an EmptyStatement.
19761
19762         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
19763         is also fine.
19764
19765         * expression.cs (Binary.ResolveOperator): Check error result in
19766         two places.
19767
19768         use brtrue/brfalse directly and avoid compares to null.
19769
19770 2002-08-02  Martin Baulig  <martin@gnome.org>
19771
19772         * class.cs (TypeContainer.Define): Define all nested interfaces here.
19773         Fixes bug #28407, added test-155.cs.
19774
19775 2002-08-01  Martin Baulig  <martin@gnome.org>
19776
19777         * class.cs (Event.EmitDefaultMethod): Make this work with static
19778         events.  Fixes #28311, added verify-3.cs.
19779
19780 2002-08-01  Martin Baulig  <martin@gnome.org>
19781
19782         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
19783         `is_disposable' fields.
19784         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
19785         `hm.is_disposable' if we're using the collection pattern.
19786         (Foreach.EmitCollectionForeach): Use the correct type for the
19787         enumerator's local variable, only emit the try/finally block if
19788         necessary (fixes #27713).
19789
19790 2002-08-01  Martin Baulig  <martin@gnome.org>
19791
19792         * ecore.cs (Expression.report118): Renamed to Error118 and made
19793         it public static.
19794
19795         * statement.cs (Throw.Resolve): Check whether the expression is of
19796         the correct type (CS0118) and whether the type derives from
19797         System.Exception (CS0155).
19798         (Catch.Resolve): New method.  Do the type lookup here and check
19799         whether it derives from System.Exception (CS0155).
19800         (Catch.CatchType, Catch.IsGeneral): New public properties.
19801
19802         * typemanager.cs (TypeManager.exception_type): Added.
19803
19804 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
19805
19806         * driver.cs: Updated About function.
19807
19808 2002-07-31  Martin Baulig  <martin@gnome.org>
19809
19810         Implemented Control Flow Analysis.
19811
19812         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
19813         (EmitContext.CurrentBranching): Added.
19814         (EmitContext.StartFlowBranching): Added.
19815         (EmitContext.EndFlowBranching): Added.
19816         (EmitContext.KillFlowBranching): Added.
19817         (EmitContext.IsVariableAssigned): Added.
19818         (EmitContext.SetVariableAssigned): Added.
19819         (EmitContext.IsParameterAssigned): Added.
19820         (EmitContext.SetParameterAssigned): Added.
19821         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
19822         Added control flow analysis stuff here.
19823
19824         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
19825         resolve the expression as lvalue.
19826         (LocalVariableReference.DoResolve): Check whether the variable has
19827         already been assigned.
19828         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
19829         the parameter as assigned here.
19830         (ParameterReference.DoResolve): Check whether the parameter has already
19831         been assigned.
19832         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
19833         expression as lvalue.
19834
19835         * statement.cs (FlowBranching): New class for the flow analysis code.
19836         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
19837         (LabeledStatement.IsDefined): New public property.
19838         (LabeledStatement.AddUsageVector): New public method to tell flow
19839         analyis that the label may be reached via a forward jump.
19840         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
19841         flow analysis.
19842         (VariableInfo.Number): New public field.  This is used by flow analysis
19843         to number all locals of a block.
19844         (Block.CountVariables): New public property.  This is the number of
19845         local variables in this block (including the locals from all parent
19846         blocks).
19847         (Block.EmitMeta): Number all the variables.
19848
19849         * statement.cs: Added flow analysis support to all classes.
19850
19851 2002-07-31  Martin Baulig  <martin@gnome.org>
19852
19853         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
19854         To get debugging messages, compile mcs with /define:MCS_DEBUG and
19855         then use this argument.
19856
19857         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
19858
19859         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
19860         use this to specify /define options.
19861
19862 2002-07-29  Martin Baulig  <martin@gnome.org>
19863
19864         * statement.cs (Fixed): Moved all code that does variable lookups
19865         and resolvings from Emit to Resolve.
19866
19867         * statement.cs (For): Moved all code that does variable lookups
19868         and resolvings from Emit to Resolve.
19869
19870         * statement.cs (Using): Moved all code that does variable lookups
19871         and resolvings from Emit to Resolve.
19872
19873 2002-07-29  Martin Baulig  <martin@gnome.org>
19874
19875         * attribute.cs (Attribute.Resolve): Explicitly catch a
19876         System.NullReferenceException when creating the
19877         CustromAttributeBuilder and report a different warning message.
19878
19879 2002-07-29  Martin Baulig  <martin@gnome.org>
19880
19881         * support.cs (ParameterData.ParameterName): Added method to
19882         get the name of a parameter.
19883
19884         * typemanager.cs (TypeManager.IsValueType): New public method.
19885
19886 2002-07-29  Martin Baulig  <martin@gnome.org>
19887
19888         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
19889         is a flag which specifies that it's either ref or out.
19890         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
19891         the out parameter to `out Parameter.Modifier mod', also set the
19892         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
19893
19894         * support.cs (InternalParameters.ParameterModifier): Distinguish
19895         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
19896         Parameter.Modifier.ISBYREF flag if it's either ref or out.
19897
19898         * expression.cs (Argument.GetParameterModifier): Distinguish
19899         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
19900         Parameter.Modifier.ISBYREF flag if it's either ref or out.
19901
19902 2002-07-29  Martin Baulig  <martin@gnome.org>
19903
19904         * expression.cs (ParameterReference.ParameterReference): Added
19905         `Location loc' argument to the constructor.
19906
19907         * cs-parser.jay: Pass location to ParameterReference.
19908
19909 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
19910
19911         * statement.cs (Try): Initialize the location.
19912
19913         * cs-parser.jay: pass location to Try.
19914
19915         * expression.cs (Unary.Reduce): Change the prototype to return
19916         whether a constant fold could be performed or not.  The result is
19917         returned in an out parameters.  In the case of Indirection and
19918         AddressOf, we want to perform the full tests.
19919
19920 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
19921
19922         * statement.cs (Statement.Emit): Flag dead code.
19923
19924 2002-07-27  Andrew Birkett  <andy@nobugs.org>
19925
19926         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
19927
19928 2002-07-27  Martin Baulig  <martin@gnome.org>
19929
19930         * class.cs (MethodData.Define): Put back call to
19931         TypeManager.AddMethod(), accidentally commented this out.
19932
19933         * report.cs (Debug): New public method to print debugging information,
19934         this is `[Conditional ("DEBUG")]'.
19935
19936 2002-07-26  Martin Baulig  <martin@gnome.org>
19937
19938         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
19939         (switch_statement): Push the current_block to the switch_stack and
19940         pop it again when we're done with the switch.
19941         (switch_section): The new block is a child of the current_block.
19942         Fixes bug #24007, added test-152.cs.
19943
19944 2002-07-27  Martin Baulig  <martin@gnome.org>
19945
19946         * expression.cs (Invocation.EmitArguments): When calling a varargs
19947         function with only its fixed arguments, we need to pass an empty
19948         array.
19949
19950 2002-07-27  Martin Baulig  <martin@gnome.org>
19951
19952         Mono 0.13 has been released.
19953
19954 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
19955
19956         * driver.cs: Rename --resource to --linkres, because that is what
19957         we do currently, we dont support --resource yet.
19958
19959         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
19960
19961 2002-07-25  Martin Baulig  <martin@gnome.org>
19962
19963         * class.cs (MethodData): New public class.  This is a `method builder'
19964         class for a method or one accessor of a Property/Indexer/Event.
19965         (MethodData.GetMethodFlags): Moved here from MemberBase.
19966         (MethodData.ApplyAttributes): Likewise.
19967         (MethodData.ApplyObsoleteAttribute): Likewise.
19968         (MethodData.ApplyConditionalAttribute): Likewise.
19969         (MethodData.ApplyDllImportAttribute): Likewise.
19970         (MethodData.CheckAbstractAndExternal): Likewise.
19971         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
19972         (MethodData.Emit): Formerly known as Method.Emit().
19973         (MemberBase): Moved everything which was specific to a single
19974         accessor/method to MethodData.
19975         (Method): Create a new MethodData and call Define() and Emit() on it.
19976         (Property, Indexer, Event): Create a new MethodData objects for each
19977         accessor and call Define() and Emit() on them.
19978
19979 2002-07-25  Martin Baulig  <martin@gnome.org>
19980
19981         Made MethodCore derive from MemberBase to reuse the code from there.
19982         MemberBase now also checks for attributes.
19983
19984         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
19985         (MemberBase.GetMethodFlags): Moved here from class Method and marked
19986         as virtual.
19987         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
19988         `CallingConventions cc' and `Attributes opt_attrs' arguments.
19989         (MemberBase.ApplyAttributes): New virtual method; applies the
19990         attributes to a method or accessor.
19991         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
19992         (MemberBase.ApplyConditionalAttribute): Likewise.
19993         (MemberBase.ApplyDllImportAttribute): Likewise.
19994         (MemberBase.CheckAbstractAndExternal): Likewise.
19995         (MethodCore.ParameterTypes): This is now a property instead of a
19996         method, it's initialized from DoDefineParameters().
19997         (MethodCore.ParameterInfo): Removed the set accessor.
19998         (MethodCore.DoDefineParameters): New protected virtual method to
19999         initialize ParameterTypes and ParameterInfo.
20000         (Method.GetReturnType): We can now simply return the MemberType.
20001         (Method.GetMethodFlags): Override the MemberBase version and add
20002         the conditional flags.
20003         (Method.CheckBase): Moved some code from Define() here, call
20004         DoDefineParameters() here.
20005         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
20006         here to avoid some larger code duplication.
20007         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
20008         ensure that abstract and external accessors don't declare a body.
20009
20010         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
20011         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
20012         lookup in the attribute's parent classes, so we need to abort as soon
20013         as we found the first match.
20014         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
20015         the attribute has no arguments.
20016
20017         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
20018         of a Method.
20019
20020 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20021
20022         * cs-parser.jay: reverted previous patch.
20023
20024 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20025
20026         * cs-parser.jay: fixed bug #22119.
20027
20028 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20029
20030         * attribute.cs: fixed compilation. The error was:
20031         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
20032         be assigned to before control leaves the current method."
20033         [FIXME:  Filed as bug #28186: MCS must report this error.]
20034
20035 2002-07-25  Martin Baulig  <martin@gnome.org>
20036
20037         * attribute.cs (Attribute.Conditional_GetConditionName): New static
20038         method to pull the condition name ouf of a Conditional attribute.
20039         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
20040         the obsolete message and error flag out of an Obsolete attribute.
20041
20042         * class.cs (Method.GetMethodFlags): New public method to get the
20043         TypeManager.MethodFlags for this method.
20044         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
20045         private methods.
20046         (Method.Define): Get and apply the Obsolete and Conditional attributes;
20047         if we're overriding a virtual function, set the new private variable
20048         `parent_method'; call the new TypeManager.AddMethod().
20049
20050         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
20051         the MethodBuilder and the Method in a PtrHashtable.
20052         (TypeManager.builder_to_method): Added for this purpose.
20053         (TypeManager.MethodFlags): Added IsObsoleteError.
20054         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
20055         Obsolete and Conditional arguments in MethodBuilders.  If we discover
20056         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
20057         the message from the attribute.
20058
20059 2002-07-24  Martin Baulig  <martin@gnome.org>
20060
20061         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
20062         preprocessor directives, ensure that the argument to #define/#undef is
20063         exactly one identifier and that it's actually an identifier.
20064
20065         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
20066         did not work ....
20067
20068 2002-07-24  Martin Baulig  <martin@gnome.org>
20069
20070         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
20071         initialize it to TypeManager.object_type in the constructor.
20072         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
20073         of the `hm.get_current' method if we're using the collection pattern.
20074         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
20075         for the explicit conversion to make it work when we're using the collection
20076         pattern and the `Current' property has a different return type than `object'.
20077         Fixes #27713.
20078
20079 2002-07-24  Martin Baulig  <martin@gnome.org>
20080
20081         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
20082         does not match, but don't report any errors.  This method is called in
20083         order for all methods in a MethodGroupExpr until a matching method is
20084         found, so we don't want to bail out if the first method doesn't match.
20085         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
20086         matches, report the 123.  Fixes #28070.
20087
20088 2002-07-24  Martin Baulig  <martin@gnome.org>
20089
20090         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
20091         TypeManager.TypeToCoreType() to the top of the method so the
20092         following equality checks will work.  Fixes #28107.
20093
20094 2002-07-24  Martin Baulig  <martin@gnome.org>
20095
20096         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
20097         operand is of type uint, and the other operand is of type sbyte,
20098         short or int, the operands are converted to type long." -
20099         Actually do what this comment already told us.  Fixes bug #28106,
20100         added test-150.cs.
20101
20102 2002-07-24  Martin Baulig  <martin@gnome.org>
20103
20104         * class.cs (MethodBase): New abstract class.  This is now a base
20105         class for Property, Indexer and Event to avoid some code duplication
20106         in their Define() and DefineMethods() methods.
20107         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
20108         generic methods for Define() and DefineMethods().
20109         (FieldBase): Derive from MemberBase, not MemberCore.
20110         (Property): Derive from MemberBase, not MemberCore.
20111         (Property.DefineMethod): Moved all the code from this method to the
20112         new MethodBase.DefineAccessor(), just call it with appropriate
20113         argumetnts.
20114         (Property.Define): Call the new Property.DoDefine(), this does some
20115         sanity checks and we don't need to duplicate the code everywhere.
20116         (Event): Derive from MemberBase, not MemberCore.
20117         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
20118         accessors, this will also make them work with interface events.
20119         (Indexer): Derive from MemberBase, not MemberCore.
20120         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
20121         (Indexer.Define): Use the new MethodBase functions.
20122
20123         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
20124         argument to the constructor.
20125         (Interface.FindMembers): Added support for interface events.
20126         (Interface.PopluateEvent): Implemented.
20127
20128         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
20129
20130 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
20131
20132         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
20133         but this is required to check for a method name being the same as
20134         the containing class.  
20135
20136         Handle this now.
20137
20138 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20139
20140         * interface.cs: initialize variable.
20141
20142 2002-07-23  Martin Baulig  <martin@gnome.org>
20143
20144         Implemented the IndexerName attribute in interfaces.
20145
20146         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
20147         name if this is an explicit interface implementation.
20148         (Indexer.InterfaceIndexerName): New public variable.  If we're
20149         implementing an interface indexer, this is the IndexerName in that
20150         interface.  Otherwise, it's the IndexerName.
20151         (Indexer.DefineMethod): If we're implementing interface indexer,
20152         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
20153         and Pending.ImplementIndexer methods.
20154         (Indexer.Define): Also define the PropertyBuilder if we're
20155         implementing an interface indexer and this is neither an explicit
20156         interface implementation nor do the IndexerName match the one in
20157         the interface.
20158
20159         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
20160         If a method is defined here, then we always need to create a proxy
20161         for it.  This is used when implementing interface indexers.
20162         (Pending.IsInterfaceIndexer): New public method.
20163         (Pending.ImplementIndexer): New public method.
20164         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
20165         This is used when implementing interface indexers to define a proxy
20166         if necessary.
20167         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
20168         define a proxy if necessary.
20169
20170         * interface.cs (Interface.IndexerName): New public variable.
20171         (Interface.PopulateIndexer): Set the IndexerName.
20172         (Interface.DefineIndexers): New private method.  Populate all the
20173         indexers and make sure their IndexerNames match.
20174
20175         * typemanager.cs (IndexerPropertyName): Added support for interface
20176         indexers.
20177
20178 2002-07-22  Martin Baulig  <martin@gnome.org>
20179
20180         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
20181         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
20182         ret if HasReturnLabel.
20183         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
20184         variables.
20185
20186         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
20187         and set the ec.LoopBeginTryCatchLevel.
20188         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
20189         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
20190         the current ec.TryCatchLevel, the branch goes out of an exception
20191         block.  In this case, we need to use Leave and not Br.
20192
20193 2002-07-22  Martin Baulig  <martin@gnome.org>
20194
20195         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
20196         block unless the block does not always return or it is contained in
20197         another try { ... } catch { ... } block.  Fixes bug #26506.
20198         Added verify-1.cs to the test suite.
20199
20200 2002-07-22  Martin Baulig  <martin@gnome.org>
20201
20202         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
20203         then we do not always return.  Fixes bug #24985.
20204
20205 2002-07-22  Martin Baulig  <martin@gnome.org>
20206
20207         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
20208         lookup on a per-class level; ie. walk up the class hierarchy until we
20209         found at least one applicable method, then choose the best among them.
20210         Fixes bug #24463 and test-29.cs.
20211
20212 2002-07-22  Martin Baulig  <martin@gnome.org>
20213
20214         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
20215         return types of the methods.  The return type is not part of the
20216         signature and we must not check it to make the `new' modifier work.
20217         Fixes bug #27999, also added test-147.cs.
20218         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
20219
20220         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
20221         on the method's return type.
20222
20223 2002-07-21  Martin Baulig  <martin@gnome.org>
20224
20225         * assign.cs: Make this work if the rightmost source is a constant and
20226         we need to do an implicit type conversion.  Also adding a few more tests
20227         to test-38.cs which should have caught this.
20228
20229         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
20230         target in the makefile for this.  The makefile.gnu is primarily intended
20231         for end-users who don't want to debug the compiler.
20232
20233 2002-07-21  Martin Baulig  <martin@gnome.org>
20234
20235         * assign.cs: Improved the Assign class so it can now handle embedded
20236         assignments (X = Y = Z = something).  As a side-effect this'll now also
20237         consume less local variables.  test-38.cs now passes with MCS, added
20238         a few new test cases to that test.
20239
20240 2002-07-20  Martin Baulig  <martin@gnome.org>
20241
20242         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
20243         instructions.  Fixes bug #27977, also added test-146.cs.
20244
20245 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20246
20247         * cs-tokenizer.cs: fixed getHex ().
20248
20249 2002-07-19  Martin Baulig  <martin@gnome.org>
20250
20251         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
20252         not Type.GetType() to lookup the array type.  This is needed when
20253         we're constructing an array of a user-defined type.
20254         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
20255         single-dimensional arrays, but also for single-dimensial arrays of
20256         type decimal.
20257
20258 2002-07-19  Martin Baulig  <martin@gnome.org>
20259
20260         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
20261         this function is called, it's not allowed to share LocalBuilders
20262         among ILGenerators.
20263
20264 2002-07-19  Martin Baulig  <martin@gnome.org>
20265
20266         * expression.cs (Argument.Resolve): Report an error 118 when trying
20267         to pass a type as argument.
20268
20269 2002-07-18  Martin Baulig  <martin@gnome.org>
20270
20271         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
20272         Conv_R_Un for the signed `long' type.
20273
20274 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
20275
20276         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
20277         `expr' for the temporary result, as that will fail if we do
20278         multiple resolves on the same expression.
20279
20280 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
20281
20282         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
20283         ec.TypeContainer for looking up aliases. 
20284
20285         * class.cs (TypeContainer): Remove LookupAlias from here.
20286
20287         * decl.cs (DeclSpace); Move here.
20288
20289 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
20290
20291         * class.cs (FindMembers): Only call filter if the constructor
20292         bulider is not null.
20293
20294         Also handle delegates in `NestedTypes' now.  Now we will perform
20295         type lookups using the standard resolution process.  This also
20296         fixes a bug.
20297
20298         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
20299         This uses Expressions (the limited kind that can be parsed by the
20300         tree) instead of strings.
20301
20302         * expression.cs (ComposedCast.ToString): Implement, used to flag
20303         errors since now we have to render expressions.
20304
20305         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
20306         FormArrayType. 
20307
20308         * ecore.cs (SimpleName.ToString): ditto.
20309
20310         * cs-parser.jay: Instead of using strings to assemble types, use
20311         Expressions to assemble the type (using SimpleName, ComposedCast,
20312         MemberAccess).  This should fix the type lookups in declarations,
20313         because we were using a different code path for this.
20314
20315         * statement.cs (Block.Resolve): Continue processing statements
20316         even when there is an error.
20317
20318 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
20319
20320         * class.cs (Event.Define): Also remove the `remove' method from
20321         the list of pending items.
20322
20323         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
20324         generate more compact code. 
20325
20326 2002-07-17  Martin Baulig  <martin@gnome.org>
20327
20328         * const.cs (Const.LookupConstantValue): Add support for constant
20329         `unchecked' and `checked' expressions.
20330         Also adding test case test-140.cs for this.
20331
20332 2002-07-17  Martin Baulig  <martin@gnome.org>
20333
20334         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
20335         check whether mi.ReturnType implements the IEnumerator interface; the
20336         `==' and the IsAssignableFrom() will fail in this situation.
20337
20338 2002-07-16  Ravi Pratap  <ravi@ximian.com>
20339
20340         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
20341         here too.
20342
20343 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20344
20345         * expression.cs: fixed bug #27811.
20346
20347 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
20348
20349         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
20350         Molaro: when we are a ref, the value already contains a pointer
20351         value, do not take the address of it.
20352
20353 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
20354         * removed mb-parser.jay and mb-tokenizer.cs
20355
20356 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20357
20358         * expression.cs: check against the building corlib void type.
20359
20360 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
20361
20362         * ecore.cs: fix for valuetype static readonly fields: when 
20363         initializing them, we need their address, not the address of a copy.
20364
20365 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
20366
20367         * typemanager.cs: register also enum_type in corlib.
20368
20369 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20370
20371         * class.cs: allow calling this (but not base) initializers in structs.
20372
20373 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
20374
20375         * ecore.cs: make sure we compare against the building base types
20376         in GetTypeSize ().
20377
20378 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
20379
20380         * typemanager.cs: fix TypeToCoreType() to handle void and object
20381         (corlib gets no more typerefs after this change).
20382
20383 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
20384
20385         * expression.cs (ArrayCreation.EmitArrayArguments): use
20386         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
20387
20388         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
20389         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
20390         array indexes, the runtime actually forbids them.
20391
20392         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
20393         for array arguments here.
20394
20395         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
20396         instead of the default for ValueTypes.
20397
20398         (New.DoEmit): Use IsValueType instead of
20399         IsSubclassOf (value_type)
20400         (New.DoResolve): ditto.
20401         (Invocation.EmitCall): ditto.
20402
20403         * assign.cs (Assign): ditto.
20404
20405         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
20406         Statements *are* currently doing part of their resolution during
20407         Emit.  
20408
20409         Expressions do always resolve during resolve, but statements are
20410         only required to propagate resolution to their children.
20411
20412 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
20413
20414         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
20415
20416         (LoadAssembly): Do not add the dll if it is already specified
20417
20418         (MainDriver): Add the System directory to the link path at the end,
20419         after all the other -L arguments. 
20420
20421         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
20422         wrong opcode for loading bytes and bools (ldelem.i1 instead of
20423         ldelem.u1) and using the opposite for sbytes.
20424
20425         This fixes Digger, and we can finally run it.
20426
20427         * driver.cs (UnixParseOption): Move the option parsing here.  
20428         (CSCParseOption): Implement CSC-like parsing of options.
20429
20430         We now support both modes of operation, the old Unix way, and the
20431         new CSC-like way.  This should help those who wanted to make cross
20432         platform makefiles.
20433
20434         The only thing broken is that /r:, /reference: and /lib: are not
20435         implemented, because I want to make those have the same semantics
20436         as the CSC compiler has, and kill once and for all the confussion
20437         around this.   Will be doing this tomorrow.
20438
20439         * statement.cs (Unsafe.Resolve): The state is checked during
20440         resolve, not emit, so we have to set the flags for IsUnsfe here.
20441
20442 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
20443
20444         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
20445         not catch the Error_ObjectRefRequired in SimpleName (as it is
20446         possible to have a class/instance variable name that later gets
20447         deambiguated), we have to check this here.      
20448
20449 2002-07-10  Ravi Pratap  <ravi@ximian.com>
20450
20451         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
20452         make static and put into Expression.
20453
20454         (Event.Define): Register the private field of the event with the 
20455         TypeManager so that GetFieldFromEvent can get at it.
20456
20457         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
20458         keep track of the private field associated with an event which
20459         has no accessors.
20460
20461         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
20462         private field.
20463
20464         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
20465
20466 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
20467
20468         * expression.cs (Binary.EmitBranchable): this routine emits the
20469         Binary expression in a branchable context.  This basically means:
20470         we need to branch somewhere, not just get the value on the stack.
20471
20472         This works together with Statement.EmitBoolExpression.
20473
20474         * statement.cs (Statement.EmitBoolExpression): Use
20475         EmitBranchable. 
20476
20477 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
20478
20479         * statement.cs (For): Reduce the number of jumps in loops.
20480
20481         (For): Implement loop inversion for the For statement.
20482
20483         (Break): We can be breaking out of a Try/Catch controlled section
20484         (foreach might have an implicit try/catch clause), so we need to
20485         use Leave instead of Br.
20486
20487         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
20488         now).  If the instace expression supports IMemoryLocation, we use
20489         the AddressOf method from the IMemoryLocation to extract the
20490         address instead of emitting the instance.
20491
20492         This showed up with `This', as we were emitting the instance
20493         always (Emit) instead of the Address of This.  Particularly
20494         interesting when This is a value type, as we dont want the Emit
20495         effect (which was to load the object).
20496
20497 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
20498
20499         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
20500
20501         * statement.cs (Checked): Set the CheckedState during the resolve
20502         process too, as the ConvCast operations track the checked state on
20503         the resolve process, and not emit.
20504
20505         * cs-parser.jay (namespace_member_declaration): Flag that we have
20506         found a declaration when we do.  This is used to flag error 1529
20507
20508         * driver.cs: Report ok when we display the help only.
20509
20510 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
20511
20512         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
20513
20514 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
20515
20516         * cs-tokenizer.cs (define): We also have to track locally the
20517         defines.  AllDefines is just used for the Conditional Attribute,
20518         but we also need the local defines for the current source code. 
20519
20520 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
20521
20522         * statement.cs (While, For, Do): These loops can exit through a
20523         Break statement, use this information to tell whether the
20524         statement is the last piece of code.
20525
20526         (Break): Flag that we break.
20527
20528         * codegen.cs (EmitContexts): New `Breaks' state variable.
20529
20530 2002-07-03  Martin Baulig  <martin@gnome.org>
20531
20532         * class.cs (TypeContainer.MethodModifiersValid): Allow override
20533         modifiers in method declarations in structs.  Otherwise, you won't
20534         be able to override things like Object.Equals().
20535
20536 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
20537
20538         * class.cs (Method, Property, Indexer): Do not allow the public
20539         modifier to be used in explicit interface implementations.
20540
20541         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
20542         override modifiers in method declarations in structs
20543
20544 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
20545
20546         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
20547         integer or real overflow, report an error
20548
20549 2002-07-02  Martin Baulig  <martin@gnome.org>
20550
20551         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
20552         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
20553         to tell the runtime about our newly created System.Object and
20554         System.ValueType types.
20555
20556 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
20557
20558         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
20559         struct instead of Ldarg/Starg.
20560
20561 2002-07-02  Martin Baulig  <martin@gnome.org>
20562
20563         * expression.cs (Indirection.Indirection): Call
20564         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
20565
20566 2002-07-02  Martin Baulig  <martin@gnome.org>
20567
20568         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
20569         ValueType, call TypeManager.TypeToCoreType() on it.
20570         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
20571         the OpCodes.Newarr argument.
20572
20573 2002-07-02  Martin Baulig  <martin@gnome.org>
20574
20575         * expression.cs (Invocation.EmitCall): When compiling corlib,
20576         replace all calls to the system's System.Array type to calls to
20577         the newly created one.
20578
20579         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
20580         System.Array methods.
20581         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
20582         from the system's System.Array type which must be replaced.
20583
20584 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
20585
20586         * typemanager.cs: load unverifiable_code_ctor so we can build
20587         corlib using the correct type. Avoid using GetTypeCode() with
20588         TypeBuilders.
20589         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
20590         TypeManager.object_type to allow building corlib.
20591
20592 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
20593
20594         * ecore.cs: handle System.Enum separately in LoadFromPtr().
20595
20596 2002-07-01  Martin Baulig  <martin@gnome.org>
20597
20598         * class.cs: Make the last change actually work, we need to check
20599         whether `ifaces != null' to avoid a crash.
20600
20601 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20602
20603         * class.cs: when we build structs without fields that implement
20604         interfaces, we need to add the interfaces separately, since there is
20605         no API to both set the size and add the interfaces at type creation
20606         time.
20607
20608 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20609
20610         * expression.cs: the dimension arguments to the array constructors
20611         need to be converted if they are a long.
20612
20613 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
20614
20615         * class.cs: don't emit ldarg.0 if there is no parent constructor
20616         (fixes showstopper for corlib).
20617
20618 2002-06-29  Martin Baulig  <martin@gnome.org>
20619
20620         MCS now compiles corlib on GNU/Linux :-)
20621
20622         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
20623         ie. check for MethodImplOptions.InternalCall.
20624
20625         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
20626         and TypeManager.attribute_type are null, so we must explicitly check
20627         whether parent is not null to find out whether it's an attribute type.
20628         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
20629         and SetBuilder, not only if the property is neither abstract nor external.
20630         This is necessary to set the MethodImplOptions on the accessor methods.
20631         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
20632         SetBuilder, see Property.Emit().
20633
20634         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
20635         populate "System.Object", "System.ValueType" and "System.Attribute" since
20636         they've already been populated from BootCorlib_PopulateCoreTypes().
20637
20638 2002-06-29  Martin Baulig  <martin@gnome.org>
20639
20640         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
20641         is the NullLiteral, we also need to make sure that target_type is not
20642         an enum type.   
20643
20644 2002-06-29  Martin Baulig  <martin@gnome.org>
20645
20646         * rootcontext.cs (RootContext.ResolveCore): We must initialize
20647         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
20648         before calling BootstrapCorlib_ResolveDelegate ().
20649
20650 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20651
20652         * statement.cs: fixed build-breaker. All tests passed ok.
20653
20654 2002-06-27  Martin Baulig  <martin@gnome.org>
20655
20656         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
20657         for System.Decimal when compiling corlib.
20658
20659 2002-06-27  Martin Baulig  <martin@gnome.org>
20660
20661         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
20662         switch blocks which contain nothing but a default clause.
20663
20664 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
20665
20666        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
20667
20668 2002-06-27  Martin Baulig  <martin@gnome.org>
20669
20670         * ecore.cs (PropertyExpr.PropertyExpr): Call
20671         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
20672
20673         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
20674         is already a TypeBuilder.
20675
20676 2002-06-27  Martin Baulig  <martin@gnome.org>
20677
20678         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
20679         `target_type == TypeManager.array_type', not IsAssignableFrom() in
20680         the "from an array-type to System.Array" case.  This makes it work
20681         when compiling corlib.
20682
20683 2002-06-27  Martin Baulig  <martin@gnome.org>
20684
20685         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
20686         non-static PropertyExpr, set its InstanceExpression.  This makes
20687         the `ICollection.Count' property work in System/Array.cs.
20688
20689 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
20690
20691         * driver.cs: Made error handling more consistent.  Errors now
20692         tracked by Report class, so many methods which used to return int
20693         now return void.  Main() now prints success/failure and 
20694         errors/warnings message.
20695
20696         Renamed '--probe' compiler argument to '--expect-error'.  Removed
20697         the magic number return values (123 and 124).  Now, if the
20698         expected error occurs, the compiler exits with success (exit value
20699         0).  If the compilation completes without seeing that particular
20700         error, the compiler exits with failure (exit value 1).  The
20701         makefile in mcs/errors has been changed to handle the new behaviour.
20702
20703         * report.cs: Made 'expected error' number a property and renamed
20704         it from 'Probe' to 'ExpectedError'.
20705
20706         * genericparser.cs: Removed error handling support, since it is
20707         now all done by Report class.
20708
20709         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
20710         class, so parse() no longer returns an int.
20711
20712         * namespace.cs: Use Report.Error instead of GenericParser.error
20713
20714 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
20715
20716         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
20717         TypeContainer.AddOperator): At the front of the list put the
20718         explicit implementations, so they get resolved/defined first. 
20719
20720 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
20721
20722         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
20723         interface type is implemented by this TypeContainer.  Used during
20724         explicit interface implementation.
20725
20726         (Property.Define, Indexer.Define, Method.Define): Validate that
20727         the given interface in the explicit implementation is one of the
20728         base classes for the containing type.
20729
20730         Also if we are explicitly implementing an interface, but there is
20731         no match in the pending implementation table, report an error.
20732
20733         (Property.Define): Only define the property if we are
20734         not explicitly implementing a property from an interface.  Use the
20735         correct name also for those properties (the same CSC uses,
20736         although that is really not needed).
20737
20738         (Property.Emit): Do not emit attributes for explicitly implemented
20739         properties, as there is no TypeBuilder.
20740
20741         (Indexer.Emit): ditto.
20742
20743         Hiding then means that we do not really *implement* a pending
20744         implementation, which makes code fail.
20745
20746 2002-06-22  Martin Baulig  <martin@gnome.org>
20747
20748         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
20749         the return value of Object.GetType().  [FIXME: we need to do this whenever
20750         we get a type back from the reflection library].
20751
20752 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
20753
20754         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
20755
20756 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
20757
20758         * attribute.cs: Return null if we can not look up the type.
20759
20760         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
20761         the interface types found.
20762
20763         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
20764         interface types found.
20765
20766         * typemanager.cs (GetInterfaces): Make this routine returns alll
20767         the interfaces and work around the lame differences between
20768         System.Type and System.Reflection.Emit.TypeBuilder in the results
20769         result for GetInterfaces.
20770
20771         (ExpandInterfaces): Given an array of interface types, expand and
20772         eliminate repeated ocurrences of an interface.  This expands in
20773         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
20774         be IA, IB, IC.
20775
20776 2002-06-21  Martin Baulig  <martin@gnome.org>
20777
20778         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
20779         on System.Enum.
20780
20781 2002-06-21  Martin Baulig  <martin@gnome.org>
20782
20783         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
20784         and called with one of the core types, return the corresponding typebuilder for
20785         that type.
20786
20787         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
20788         element type.
20789
20790 2002-06-21  Martin Baulig  <martin@gnome.org>
20791
20792         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
20793         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
20794         (Expression.ConvertReferenceExplicit): Likewise.
20795
20796         * expression.cs (ElementAccess.DoResolve): Likewise.
20797         (ElementAccess.DoResolveLValue): Likewise.
20798
20799 2002-06-10  Martin Baulig  <martin@gnome.org>
20800
20801         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
20802         add the "value" parameter to the parameter list.
20803
20804         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
20805         to our caller.
20806
20807 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
20808
20809         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
20810         the argument to an int, uint, long or ulong, per the spec.  Also
20811         catch negative constants in array creation.
20812
20813 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
20814
20815         * class.cs: do not allow the same interface to appear twice in
20816         the definition list.
20817
20818 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
20819
20820         * ecore.cs: don't use ldlen with System.Array.
20821
20822 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
20823
20824         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
20825
20826 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
20827
20828         * modifiers.cs: produce correct field attributes for protected
20829         internal. Easy fix so miguel can work on ther harder stuff:-)
20830
20831 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
20832
20833         * pending.cs: New file.  Move the code from class.cs here.
20834         Support clearning the pending flag for all methods (when not doing
20835         explicit interface implementation).
20836
20837 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
20838
20839         * rootcontext.cs: added a couple more types needed to bootstrap.
20840
20841 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
20842
20843         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
20844         constructor in the type, instead of any constructor in the type
20845         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
20846         a bug in the Mono runtime when applying the params attribute). 
20847
20848 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
20849         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
20850
20851 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
20852
20853         * expression.cs (Unary.ResolveOperator): Use TypeManager
20854         to resolve the type.
20855
20856 2002-06-13  Ravi Pratap  <ravi@ximian.com>
20857
20858         * cs-parser.jay (enum_member_declaration): Pass in the attributes
20859         attached.
20860
20861         * enum.cs (AddEnumMember): Add support to store the attributes associated 
20862         with each member too.
20863
20864         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
20865         field builders too - this takes care of the enum member case.
20866
20867 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
20868
20869         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
20870         address-of operator on both value types and pointers.
20871
20872 2002-06-10  Martin Baulig  <martin@gnome.org>
20873
20874         * interface.cs (Interface.PopulateIndexer): Add the indexer's
20875         PropertyBuilder to the `property_builders' list.
20876
20877         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
20878         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
20879         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
20880         find any indexers which are inherited from an interface.
20881
20882 2002-06-09  Martin Baulig  <martin@gnome.org>
20883
20884         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
20885         the same type as the constant if necessary.  There's also a test-130.cs
20886         for this.
20887
20888         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
20889
20890         * typemanager.cs (TypeManager.ChangeType): Previously known as
20891         Enum.ChangeEnumType().
20892
20893 2002-06-09  Martin Baulig  <martin@gnome.org>
20894
20895         * expression.cs (Cast.TryReduce): Added support for consts.
20896
20897 2002-06-08  Ravi Pratap  <ravi@ximian.com>
20898
20899         * class.cs (Accessor): Hold attributes information so we can pass
20900         it along.
20901
20902         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
20903         Modify to pass in attributes attached to the methods.
20904
20905         (add_accessor_declaration, remove_accessor_declaration): Ditto.
20906
20907         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
20908         to handle the Accessor kind :-)
20909
20910         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
20911
20912 2002-06-08  Martin Baulig  <martin@gnome.org>
20913
20914         * expression.cs (Unary.TryReduceNegative): Added support for
20915         ULongConstants.
20916
20917 2002-06-08  Martin Baulig  <martin@gnome.org>
20918
20919         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
20920         name can't be found in the `defined_names' - the caller will do a
20921         MemberLookup in this case and thus find methods in System.Enum
20922         such as Enum.IsDefined().
20923
20924 2002-06-08  Martin Baulig  <martin@gnome.org>
20925
20926         * enum.cs (Enum.ChangeEnumType): This is a custom version of
20927         Convert.ChangeType() which works with TypeBuilder created types.
20928         (Enum.LookupEnumValue, Enum.Define): Use it here.
20929
20930         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
20931         `TypeBuilder.BaseType != null' check.
20932         (TypeContainer.FindMembers): Only lookup parent members if we
20933         actually have a parent.
20934         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
20935         (ConstructorInitializer.Resolve): Likewise.
20936
20937         * interface.cs (Interface.FindMembers): Added
20938         `TypeBuilder.BaseType != null' check.
20939
20940         * rootcontext.cs (RootContext.ResolveCore): Added
20941         "System.Runtime.CompilerServices.IndexerNameAttribute" to
20942         classes_second_stage.
20943
20944         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
20945         debug_type and trace_type when compiling with --nostdlib.       
20946
20947 2002-06-07  Martin Baulig  <martin@gnome.org>
20948
20949         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
20950         (AddField): Set it to true when adding a non-static field.
20951         (DefineType): Use `have_nonstatic_fields' to find out whether we
20952         have non-static fields, not `Fields != null'.
20953
20954 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
20955
20956         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
20957         dereferencing a null on the static-field code path)
20958
20959 2002-05-30  Martin Baulig  <martin@gnome.org>
20960
20961         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
20962         to take command line arguments.  Use reflection to call the new
20963         custom `Initialize' function on the symbol writer and pass it the
20964         command line arguments.
20965
20966         * driver.cs (--debug-args): New command line argument to pass command
20967         line arguments to the symbol writer.
20968
20969 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
20970
20971         * assign.cs (DoResolve): Forgot to do the implicit conversion to
20972         the target type for indexers and properties.  Thanks to Joe for
20973         catching this.
20974
20975 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
20976
20977         * typemanager.cs (MethodFlags): returns the method flags
20978         (Obsolete/ShouldIgnore) that control warning emission and whether
20979         the invocation should be made, or ignored. 
20980
20981         * expression.cs (Invocation.Emit): Remove previous hack, we should
20982         not do this on matching a base type, we should do this based on an attribute
20983
20984         Only emit calls to System.Diagnostics.Debug and
20985         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
20986         on the command line.
20987
20988         * rootcontext.cs: Global settings for tracing and debugging.
20989
20990         * cs-tokenizer.cs (define): New utility function to track
20991         defines.   Set the global settings for TRACE and DEBUG if found.
20992
20993 2002-05-25  Ravi Pratap  <ravi@ximian.com>
20994
20995         * interface.cs (Populate*): Pass in the TypeContainer as well as
20996         the DeclSpace as parameters so that we can create EmitContexts and
20997         then use that to apply attributes etc.
20998
20999         (PopulateMethod, PopulateEvent, PopulateProperty)
21000         (PopulateIndexer): Apply attributes everywhere.
21001
21002         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
21003         etc.
21004
21005         (ApplyAttributes): Update accordingly.
21006
21007         We now apply interface attributes for all members too.
21008
21009 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
21010
21011         * class.cs (Indexer.Define); Correctly check if we are explicit
21012         implementation (instead of checking the Name for a ".", we
21013         directly look up if the InterfaceType was specified).
21014
21015         Delay the creation of the PropertyBuilder.
21016
21017         Only create the PropertyBuilder if we are not an explicit
21018         interface implementation.   This means that explicit interface
21019         implementation members do not participate in regular function
21020         lookups, and hence fixes another major ambiguity problem in
21021         overload resolution (that was the visible effect).
21022
21023         (DefineMethod): Return whether we are doing an interface
21024         implementation. 
21025
21026         * typemanager.cs: Temporary hack until we get attributes in
21027         interfaces (Ravi is working on that) and we get IndexerName
21028         support in interfaces.
21029
21030         * interface.cs: Register the indexers as properties.
21031
21032         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
21033         warning, I have verified that this is a bug in the .NET runtime
21034         (JavaScript suffers of the same problem).
21035
21036         * typemanager.cs (MemberLookup): When looking up members for
21037         interfaces, the parent of an interface is the implicit
21038         System.Object (so we succeed in searches of Object methods in an
21039         interface method invocation.  Example:  IEnumerable x;  x.ToString
21040         ()) 
21041
21042 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
21043
21044         * class.cs (Event): Events should also register if they do
21045         implement the methods that an interface requires.
21046
21047         * typemanager.cs (MemberLookup); use the new GetInterfaces
21048         method. 
21049
21050         (GetInterfaces): The code used to lookup interfaces for a type is
21051         used in more than one place, factor it here. 
21052
21053         * driver.cs: Track the errors at the bottom of the file, we kept
21054         on going.
21055
21056         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
21057         instance if the method we are calling is static!
21058
21059 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
21060
21061         * attribute.cs (ApplyAttributes): Make this function filter out
21062         the IndexerName attribute (as that attribute in reality is never
21063         applied) and return the string constant for the IndexerName
21064         attribute. 
21065
21066         * class.cs (TypeContainer.Emit): Validate that all the indexers
21067         have the same IndexerName attribute, and if so, set the
21068         DefaultName attribute on the class. 
21069
21070         * typemanager.cs: The return value might contain other stuff (not
21071         only methods).  For instance, consider a method with an "Item"
21072         property and an Item method.
21073
21074         * class.cs: If there is a problem with the parameter types,
21075         return. 
21076
21077 2002-05-24  Ravi Pratap  <ravi@ximian.com>
21078
21079         * ecore.cs (ImplicitConversionExists): Wrapper function which also
21080         looks at user defined conversion after making a call to 
21081         StandardConversionExists - we need this for overload resolution.
21082
21083         * expression.cs : Update accordingly the various method calls.
21084
21085         This fixes 2 bugs filed against implicit user defined conversions 
21086
21087 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
21088
21089         * statement.cs: Track the result of the assignment.
21090
21091 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
21092
21093         * expression.cs (MemberAccess): Improved error reporting for
21094         inaccessible members.
21095
21096 2002-05-22  Martin Baulig  <martin@gnome.org>
21097
21098         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
21099         itself with debugging support.
21100
21101 2002-05-22  Martin Baulig  <martin@gnome.org>
21102
21103         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
21104         Removed, this isn't needed anymore.
21105
21106 2002-05-20  Martin Baulig  <martin@gnome.org>
21107
21108         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
21109         be underlying type for an enum.
21110
21111 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
21112
21113         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
21114         that splits out the loading of just the core types.
21115
21116         * rootcontext.cs (ResolveCore): Split the struct resolution in
21117         two, so we can load the enumeration underlying types before any
21118         enums are used.
21119
21120         * expression.cs (Is): Bandaid until we fix properly Switch (see
21121         bug #24985 for details).
21122
21123         * typemanager.cs (ImplementsInterface): The hashtable will contain
21124         a null if there are no interfaces implemented.
21125
21126 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
21127
21128         * cs-parser.jay (indexer_declarator): It is fine to have array
21129         parameters
21130
21131 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
21132
21133         * typemanager.cs: (RegisterBuilder): New function used to register
21134         TypeBuilders that implement interfaces.  Since
21135         TypeBuilder.GetInterfaces (as usual) does not work with lame
21136         Reflection.Emit. 
21137         (AddUserType): register interfaces.
21138
21139         (ImplementsInterface): Use the builder_to_ifaces hash if we are
21140         dealing with TypeBuilder.  Also, arrays are showing up as
21141         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
21142         methods can not be invoked on them!
21143
21144         * ecore.cs (ExplicitReferenceConversionExists): Made public.
21145         (ImplicitReferenceConversionExists): Split out from
21146         StandardConversionExists. 
21147
21148         * expression.cs (As): We were only implementing one of the three
21149         cases for the as operator.  We now implement them all.
21150         (Is): Implement the various other cases for Is as well.
21151
21152         * typemanager.cs (CACHE): New define used to control if we want or
21153         not the FindMembers cache.  Seems to have a negative impact on
21154         performance currently
21155
21156         (MemberLookup): Nested types have full acess to
21157         enclosing type members
21158
21159         Remove code that coped with instance/static returns for events, we
21160         now catch this in RealFindMembers.
21161
21162         (RealFindMembers): only perform static lookup if the instance
21163         lookup did not return a type or an event.  
21164
21165 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
21166
21167         * assign.cs (CompoundAssign): We pass more semantic information
21168         now to Compound Assignments than we did before: now we have all
21169         the information at hand, and now we resolve the target *before* we
21170         do the expression expansion, which allows the "CacheValue" method
21171         to have the effect we intended (before, a [x] += 1 would generate
21172         two differen ArrayAccess expressions from the ElementAccess,
21173         during the resolution process).
21174
21175         (CompoundAssign.DoResolve): Resolve target and original_source here.
21176
21177 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
21178
21179         * expression.cs (ArrayAccess): dropped debugging information. 
21180
21181         * typemanager.cs: Small bug fix: I was always returning i_members,
21182         instead of one of i_members or s_members (depending on which had
21183         the content).
21184
21185         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
21186         method is invoked before any code generation takes place, and it
21187         is a mechanism to inform that the expression will be invoked more
21188         than once, and that the method should use temporary values to
21189         avoid having side effects
21190
21191         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
21192
21193         * ecore.cs (Expression.CacheTemporaries): Provide empty default
21194         implementation.
21195
21196         * expression.cs (Indirection, ArrayAccess): Add support for
21197         CacheTemporaries in these two bad boys. 
21198
21199         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
21200         ldobj or ldind_ref.  
21201         (StoreFromPtr): Handle stobj as well.
21202
21203         * expression.cs (UnaryMutator): Share more code.
21204
21205         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
21206         down: I was not tracking the Filter function as well, which
21207         was affecting the results of the cache.
21208
21209 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
21210
21211         * attribute.cs: Remove the hack to handle the CharSet property on
21212         StructLayouts. 
21213
21214 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
21215
21216         * attribute.cs (DoResolve): More uglyness, we now only try to
21217         resolve the attribute partially, to extract the CharSet
21218         information (only if we are a StructLayout attribute).  Otherwise 
21219
21220         (GetExtraTypeInfo): Add some code to conditionally kill in the
21221         future this.   I am more and more convinced that the .NET
21222         framework has special code to handle the attribute setting on
21223         certain elements.
21224
21225         * expression.cs (IsParamsMethodApplicable): Revert my previous
21226         foreach change here, it was wrong.
21227
21228 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
21229
21230         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
21231         (pp_expr): do not abort on unknown input, just return.
21232         (eval): abort if there are pending chars.
21233
21234         * attribute.cs (Attribute.Resolve): Positional parameters are
21235         optional.  Deal with that case.
21236
21237         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
21238         the Ansi/Unicode/Auto information for the type.
21239
21240         (TypeContainer.DefineType): instantiate the EmitContext here, as
21241         we will be using it during the type definition (to resolve
21242         attributes) and during the emit phase.
21243
21244         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
21245         to pull type information out of the attributes
21246
21247         (Attribute.Resolve): track the constructor builder, and allow for
21248         multiple invocations (structs and classes will use this).
21249
21250         * ecore.cs (MemberLookupFinal): new version with all the
21251         parameters customizable.
21252
21253         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
21254         constructors.  Return if the result value is null (as the error
21255         would have been flagged already by MemberLookupFinal)
21256
21257         Do not allow instances of abstract classes or interfaces to be
21258         created.
21259
21260         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
21261         We have to compare the assembly property here when dealing with
21262         FamANDAssem and Assembly access modifiers, because we might be
21263         creating an assembly from *modules* (that means that we are not
21264         getting TypeBuilders for types defined in other modules that are
21265         part of this assembly).
21266
21267         (Method.Emit): If the method is marked abstract and has a body,
21268         emit an error. 
21269
21270         (TypeContainer.DefineMembers): If both the defined member and the
21271         parent name match are methods, then do not emit any warnings: let
21272         the Method.Define routine take care of flagging warnings.  But if
21273         there is a mismatch (method overrides something else, or method is
21274         overriwritten by something, then emit warning).
21275
21276         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
21277         set to null, this means `do not check for the return type on the
21278         signature'. 
21279
21280         (Method.Define): set the return type for the method signature to
21281         null, so that we get methods with the same name and parameters and
21282         different return types.  This is used to flag warning 114 (you are
21283         hiding a method, and you probably want to use the new/override
21284         keywords instead).
21285
21286         * typemanager.cs (MemberLookup): Implemented proper access
21287         control, closing a long standing set of bug reports.  The problem
21288         was that the Framework only has two bits: Public and NonPublic,
21289         and NonPublic includes private and protected methods, but we need
21290         to enforce the FamANDAssem, FamOrAssem and Family. 
21291
21292 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
21293
21294         * statement.cs (GotoCase): Return true: Ammounts to giving up
21295         knowledge on whether we return or not, and letting the other case
21296         be responsible for it.
21297
21298 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
21299
21300         * driver.cs: Do not load directories for each file processed, only
21301         do it if there is a pattern.
21302
21303         * ecore.cs: Report readonly assigns here as well, as we might have
21304         been resolved only by MemberAccess.
21305
21306         (SimpleName.SimpleNameResolve): Also be useful for LValue
21307         resolution.   We need this to propagate assign to local readonly variables
21308
21309         * typemanager.cs: Use a ptrhashtable for the criteria, because we
21310         do not want to reuse potential criteria memory.
21311
21312         * class.cs (MyEventBuilder): Set reflected_type;
21313
21314         * ecore.cs (Constantify): Added support for constifying bools.
21315
21316         (RootContext.LookupType): Added a cache for values looked up in
21317         the declaration space.
21318
21319         * typemanager.cs (FindMembers): Now is a front-end to
21320         RealFindMembers, and provides a two-level hashtable-based cache to
21321         the request.  
21322
21323         15% performance improvement: from 22.5 to 19.2 seconds.
21324
21325         * expression.cs (IsParamsMethodApplicable): use foreach.
21326         (Invocation.DoResolve): ditto.
21327         (New.DoResolve): ditto.
21328         (ArrayCreation.DoResolve): ditto.
21329
21330         * ecore.cs (FindMostEncompassingType): use foreach.
21331
21332         * delegate.cs (NewDelegate.DoResolve): Use foreach
21333
21334         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
21335         (RemoveMethods): use foreach.
21336
21337         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
21338         nested foreach statements instead of for, and also break out of
21339         the inner loop once a match is found.
21340
21341         (Invocation.OverloadResolve): Use foreach, simplify the code. 
21342
21343 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
21344
21345         * cfold.cs (BinaryFold): During an enumeration evaluation context,
21346         we actually unwrap the expression to allow for extra information
21347         to be extracted. 
21348
21349         * expression.cs: Use Shr_Un on unsigned operations. 
21350
21351 2002-05-08  Ravi Pratap  <ravi@ximian.com>
21352
21353         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
21354         applicable operators was not being considered correctly. This closes
21355         the bug Miguel reported.
21356
21357 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
21358
21359         * attribute.cs: check that the type derives from System.Attribute
21360         and report the correct error in that case (moved the duplicate code to
21361         its own method, too).
21362
21363 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
21364
21365         * attribute.cs: lookup attribute type name as the spec says: first the
21366         bare attribute name and then name + "Attribute" (nant compiles with
21367         mcs after this fix).
21368
21369 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
21370
21371         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
21372         Because of the way we parse things, we should try to see if a
21373         UIntConstant can fit in an integer.
21374
21375 2002-05-07  Ravi Pratap  <ravi@ximian.com>
21376
21377         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
21378         when we are in an explicit context.
21379
21380         (ConvertReferenceExplicit): When converting from Iface type S to Class
21381         T make sure the rules are implemented as an OR.
21382
21383         * parameter.cs (ParameterType): Make it a property for now although the
21384         purpose really isn't anything immediate.
21385
21386         * expression.cs (Is*Applicable): Do better checking on the parameter type
21387         of a ref/out parameter. The ones from the system assemblies are already 
21388         marked with the correct type so we don't need to do any correction.
21389
21390         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
21391         the object type is standard too so include that.
21392
21393 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
21394
21395         * ecore.cs (StandardConversionExists): Augment with missing code:
21396         deal with IntConstant, LongConstants and Enumerations.
21397
21398         * assign.cs: Report the error, instead of failing silently
21399
21400         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
21401         typecontainer that they are declared, because the
21402         typecontainer/namespace will have the list of using clauses that
21403         need to be applied.
21404
21405         Assembly Attributes were escaping the normal registration
21406         mechanism. 
21407
21408         (EmitCode): Apply attributes within an EmitContext that represents
21409         the container they were declared on.
21410
21411         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
21412
21413 2002-05-06  Ravi Pratap  <ravi@ximian.com>
21414
21415         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
21416         Revamp completely - make much cleaner as we now operate only
21417         on a set of Types.
21418
21419         (FindMostSpecificSource, FindMostSpecificTarget): New methods
21420         to implement the logic detailed in the spec more correctly.
21421
21422         (UserDefinedConversion): Update accordingly.
21423
21424 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
21425
21426         * statement.cs: Return flow analysis information up.
21427
21428         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
21429         and the default.
21430
21431         (token): Do not consume an extra character before calling
21432         decimal_digits.
21433
21434 2002-05-06  Piers Haken <piersh@friskit.com>
21435
21436         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
21437
21438 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
21439
21440         * class.cs (Constructor.Emit): Set the IsStatic flag in the
21441         EmitContext during the instance constructor initializer
21442         resolution, to stop access to instance variables.
21443
21444         This is mandated by the spec, last paragraph of the `constructor
21445         initializers' section. 
21446
21447 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
21448
21449         * cs-parser.jay, class.cs (Accessor): new class used to represent
21450         an accessor (get or set).  In the past we used `null' to represent
21451         a missing accessor.  But this is ambiguous because there was no
21452         way to tell in abstract indexers/properties if one of them was
21453         specified.
21454
21455         Now there is a way of addressing that.
21456
21457         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
21458         instead of FindMembers.
21459
21460         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
21461         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
21462
21463         * attribute.cs: Treat indexers and properties as the same in terms
21464         of applying attributes
21465
21466         * ecore.cs (FindMostEncompassedType): Use statically initialized
21467         EmptyExpressions()s like we do elsewhere to avoid creating useless
21468         objects (and we take this out of the tight loop).
21469
21470         (GetConversionOperators): Move the code to extract the actual
21471         operators to a separate routine to clean things up.
21472
21473 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
21474
21475         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
21476         events are always registered FieldBuilders.
21477
21478         * class.cs (FieldBase): New class shared by Fields 
21479
21480         * delegate.cs: If we are a toplevel delegate, use our full name.
21481         If we are a nested delegate, then only use our tail name.
21482
21483 2002-05-02  Ravi Pratap  <ravi@ximian.com>
21484
21485         * expression.cs (IsApplicable): Ensure that we add the "&" to
21486         ref/out types before comparing it with the type of the argument.
21487
21488         (IsParamsMethodApplicable): Ditto.
21489
21490         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
21491         silly me ;-)
21492
21493         * delegate.cs : Handle the case when we have more than one applicable
21494         method. Flag an error only when we finish checking all.
21495
21496 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
21497
21498         * expression.cs: Add support for boolean static initializers.
21499
21500 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
21501
21502         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
21503
21504         * parameter.cs (ComputeParameterTypes,
21505         ComputeAndDefineParameterTypes): Better error handling: now we
21506         clear the `types' cache if we fail during any of the type lookups.
21507         We also return the status code correctly to our caller
21508
21509         * delegate.cs: If we fail to define a delegate, abort the extra
21510         steps. 
21511
21512         * expression.cs (Binary.ResolveOperator): for
21513         operator==(object,object) and operator !=(object, object) we also
21514         have to verify that there is an implicit conversion from one to
21515         the other.
21516
21517         (ArrayAccess.DoResolve): Array Access can operate on
21518         non-variables. 
21519
21520 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
21521
21522         * assign.cs (CompoundAssign): A new class used as a "flag" that
21523         the assignment actually is happening as part of a compound
21524         assignment operator.
21525
21526         During compound assignment, a few new rules exist to enable things
21527         like:
21528
21529         byte b |= 1 + 2
21530
21531         From the spec:
21532
21533         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
21534         to the type of x) if y is implicitly convertible to the type of x,
21535         and the operator is a builtin operator and the return type of the
21536         operator is explicitly convertible to the type of x. 
21537
21538         * rootcontext.cs: Reset warning level to 2.  4 catches various
21539         "interesting" features in mcs, we must clean this up at some
21540         point, but currently am trying to kill other bugs ;-)
21541
21542         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
21543         in container classes as well.  
21544
21545         * expression.cs (Binary.ResolveOperator): Handle string case
21546         before anything else (as operator overloading does emit an error
21547         before doing anything else).
21548
21549         This code could go away when we move to a table driven model, but
21550         i could not come up with a good plan last night.
21551
21552 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
21553
21554         * typemanager.cs (CSharpName): reimplementation using regex.
21555         * class.cs: added null check for fields in Emit
21556         * rootcontext.cs: set warninglevel to 4
21557
21558 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
21559
21560         * typemanager.cs (CSharpName): reimplemented with Lupus
21561         suggestion.
21562
21563 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
21564
21565         * statement.cs (If): correclty implement Resolve, because we were
21566         not catching sem errors in there.  The same process is needed
21567         everywhere else. 
21568         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
21569
21570
21571         (Statement.Warning_DeadCodeFound): Factorize code.
21572         (While): Report dead code here too.
21573
21574         (Statement): Added Resolve virtual method to allow
21575         for resolution split from the emit code.
21576
21577 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
21578
21579         * statement.cs (EmitBoolExpression): No longer try to resolve the
21580         expression here.    
21581         (MakeBoolean): New utility function that resolve, implicitly
21582         converts to boolean and tags the expression. 
21583
21584
21585         (If, Do): Implement dead code elimination.
21586         (While): Implement loop inversion
21587
21588         (Do, While, For, If): Resolve the expression prior to calling our
21589         code generation.
21590
21591 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
21592
21593         * class.cs:
21594           - added method Report28 (warning: program has more than one entry point)
21595           - added method IsEntryPoint, implements paragraph 10.1 of the spec
21596           - modified method Method.Define, the part at the end of the method
21597
21598         * rootcontext.cs: added static public Location EntryPointLocation;
21599           
21600         * ../errors/cs0028.cs : Add test case for the above warning.              
21601
21602         * typemanager.cs:
21603           - modified method CSharpName to allow arrays of primitive type to
21604             be printed nicely (e.g. instead of System.Int32[][] it now prints
21605             int[][])
21606           - added method CSharpSignature: returns the signature of a method
21607             in string format to be used in reporting errors, warnings, etc.
21608
21609         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
21610         with String.Empty.
21611
21612 2002-04-26  Ravi Pratap  <ravi@ximian.com>
21613
21614         * delegate.cs (Define): Fix extremely silly bug where I was
21615         setting the type of the 'object' parameter of the BeginInvoke
21616         method to System.IAsyncResult instead of System.Object ;-)
21617
21618 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
21619
21620         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
21621         here. 
21622
21623         (Constructor.Emit): return if we fail to initialize the
21624         constructor.  Another door closed!  
21625
21626         * expression.cs (New.DoResolve): Improve error message (from -6 to
21627         1501).  Use DeclaredOnly lookup to find the exact constructor.
21628
21629         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
21630         loop.  This is useful.
21631
21632         * cs-parser.jay: Adjust the default parameters so that destructors
21633         have the proper signature.
21634
21635 2002-04-26  Martin Baulig  <martin@gnome.org>
21636
21637         * driver.cs (LoadAssembly): If `assembly' contains any characters
21638         which are only valid in path names and not in assembly names
21639         (currently slash, backslash and point), use Assembly.LoadFrom ()
21640         instead of Assembly.Load () on the `assembly' (before iteration
21641         over the link_paths).
21642
21643 2002-04-26  Martin Baulig  <martin@gnome.org>
21644
21645         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
21646
21647 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
21648
21649         * class.cs (Property): use the new typemanager.MemberLookup
21650
21651         (TypeContainer.MemberLookup): Implement using the
21652         TypeManager.MemberLookup now. 
21653
21654         * typemanager.cs: Make MemberLookup a function of the TypeManager,
21655         and return MemberInfos, so that these can be used without an
21656         EmitContext (what we had before).
21657
21658 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
21659
21660         * expression.cs: Fix the case where the argument to params if the
21661         type of the params.  I omitted handling this before.   Fixed
21662
21663 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
21664
21665         * driver.cs: Call BootCorlib_PopulateCoreType
21666
21667         * class.cs (Property.CheckBase): Check for properties only, not
21668         for all members. 
21669
21670         * interface.cs: Temporary hack: try/catch around the
21671         CustomAttributeBuilder, because I am getting an exception that I
21672         do not understand.
21673
21674         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
21675         types whose definitions are required to be there (attributes are
21676         defined before standard types).
21677
21678         Compute definitions as we boot the various types, as they are used
21679         immediately (value_type class will need object_type, but if we do
21680         not initialize object_type, we will pass a null, which will let
21681         the runtime pick the System.Object from the existing corlib, which
21682         is not what we want).
21683
21684 2002-04-22  Patrik Torstensson <totte@labs2.com>
21685
21686         * cs-tokenizer.cs: fixed a number of trim() issues.
21687
21688 2002-04-22  Ravi Pratap  <ravi@ximian.com>
21689
21690         * expression.cs (Argument.Type): Ensure that we return the correct
21691         type when we have out or ref parameters [in which case we 
21692         append a "&"].
21693
21694 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
21695
21696         * class.cs (Property, Indexer): Allow extern modifier in there. 
21697
21698         * typemanager.cs (InitBaseTypes): Initializes object_type and
21699         value_type, since those will be used early on during the bootstrap
21700         process to compile corlib.
21701
21702         (InitCoreTypes): Move code from here to InitBaseTypes.
21703
21704 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
21705
21706         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
21707         single-dimension arrays as using the ldlen opcode.  
21708
21709         Daniel Lewis discovered this optimization.  
21710
21711         * typemanager.cs: Add signature for System.Array::get_Length
21712
21713 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21714
21715         * statement.cs: report the error when the foreach does not apply to an
21716         array nor a collection.
21717
21718 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
21719
21720         * expression.cs: Add implicit conversions to the operator ~.
21721
21722         * constant.cs (DecimalConstant.Emit): Emit decimal value.
21723
21724         * typemanager.cs: Locate the decimal constructor.
21725
21726 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21727
21728         * attribute.cs: use the new property of TypeOf.
21729         * expression.cs: added 'get' property around typearg.
21730
21731         These changes fix a build breaker reported by NickD. Is this the
21732         correct way to fix?  If not, please, revert my changes and make it
21733         work :-).
21734
21735 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
21736
21737         * attribute.cs: Add support for typeof in attribute invocations.
21738         I am not sure that this is right though.
21739
21740 2002-04-14  Duncan Mak  <duncan@ximian.com>
21741
21742         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
21743         Binary.Operator.Division case.
21744
21745 2002-04-13  Ravi Pratap  <ravi@ximian.com>
21746
21747         * class.cs (DefineType): Ensure that we do a proper check on
21748         attribute types and also register it with the TypeManager.
21749
21750         (TypeContainer.Targets): The default for attribute types is
21751         AttributeTargets.All.
21752
21753         * attribute.cs (ApplyAttributes): Registering the attribute type
21754         is done elsewhere, not when we discover we have a Usage attribute.
21755
21756 2002-04-12  Ravi Pratap  <ravi@ximian.com>
21757
21758         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
21759         and get rid of is_delegate parameter.
21760
21761         * everywhere : update.
21762
21763 2002-04-12  Ravi Pratap  <ravi@ximian.com>
21764
21765         * cs-parser.jay (compilation_unit): Revamp completely to use
21766         some new ideas that I got from Rhys' grammar to solve the problems
21767         with assembly level attributes.
21768
21769         (outer_declaration): New grammar production.
21770
21771         (attribute_sections): Add.
21772
21773         (opt_attributes): Base on attribute_sections
21774
21775         (namespace_declaration): Allow opt_attributes to tackle the case
21776         when we have assembly level attributes - we are clever in this
21777         regard now ;-)
21778
21779         * attribute.cs (ApplyAttributes): Do not worry about assembly 
21780         attributes in the non-global context.
21781
21782         * rootcontext.cs (AddGlobalAttributes): Go back to using this
21783         instead of SetGlobalAttributes.
21784
21785         * class.cs, rootcontext.cs : Ensure we define and generate 
21786         attribute types before anything else.
21787
21788         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
21789         and flag the new error -20 for the case when the attribute type
21790         does not have valid targets specified. csc does not catch this.
21791
21792         * ../errors/errors.txt : update for error # -20
21793
21794 2002-04-11  Ravi Pratap  <ravi@ximian.com>
21795
21796         * support.cs (InternalParameters.ParameterModifier): Do some null
21797         checking and return sane values.
21798
21799         * class.cs (Method.Define): If we are a PInvoke method, ensure
21800         that we are static and extern. Report error # 601
21801
21802         * ../errors/cs0601.cs : Add test case for the above error.
21803
21804 2002-04-07  Ravi Pratap  <ravi@ximian.com>
21805
21806         * rootcontext.cs (attribute_types): We need to keep type of
21807         all attribute types separately and emit code for them first.
21808
21809         (RegisterAttribute) : Implement.
21810
21811         * class.cs (DefineType): Check if the current Type is a custom
21812         attribute type and register it accordingly.
21813
21814         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
21815         adding the first attribute twice and rename to
21816
21817         (SetGlobalAttributes): this.
21818
21819         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
21820         lookups.
21821
21822         * attribute.cs (ApplyAttributes): Take an additional argument telling us
21823         if we are processing global arguments. Hmm, I am unsure of this.
21824
21825 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21826
21827         * expression.cs: added static array of strings to avoid calling
21828         Enum.ToString () for Operator in Binary. Significant recover of
21829         performance.
21830
21831 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
21832
21833         * class.cs (FindMembers): Allow the Builders of the various
21834         members to be null.  If they are skip them.  This only happens
21835         during the PInvoke declaration.
21836
21837 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
21838
21839         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
21840         failure, so we do not keep going afterwards.
21841
21842         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
21843         wanted to pass `false' as the `is_delegate' argument.  If this is
21844         the case, why not use delegate_type == null to mean `is_delegate =
21845         false' and anything else as is_delegate = true.
21846
21847 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
21848
21849         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
21850         code for the section, not the beginning of the tests.
21851
21852 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
21853
21854         * cfold.cs: Handle operator + (Enum x, Underlying x) 
21855
21856         * expression.cs (Binary): same.  Warn about errors where we have
21857         Enum/Enum in operator + as well.
21858
21859 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
21860
21861         * statement.cs:
21862                 - added support for switch(bool)
21863                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
21864                 - add TableSwitchEmit() to handle table-based switch statements
21865
21866 2002-04-05  Ravi Pratap  <ravi@ximian.com>
21867
21868         * expression.cs (Invocation.OverloadResolve): Factor out code which
21869         does parameter compatibility checking with arguments so that we can 
21870         re-use the code even from Delegate.VerifyApplicability
21871
21872         (VerifyArgumentsCompat): Move above code here.
21873
21874         * delegate.cs (VerifyApplicability): Get rid of duplicate code
21875         and instead make a call to the above method.
21876
21877 2002-03-31  Ravi Pratap  <ravi@ximian.com>
21878
21879         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
21880         We use it to keep track of classes which are attribute types.
21881
21882 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
21883
21884         * delegate.cs (Delegate.Define): Correctly define the types in the
21885         presence of fixed and array parameters.
21886
21887         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
21888         doing FindMembers.
21889
21890         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
21891         include NonPublic after the first iteration.
21892
21893         * class.cs (Indexer.CheckBase): Only check if both parents are
21894         non-null. 
21895
21896         * cs-parser.jay (accessor_body): If empty, set to null.
21897
21898         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
21899         same code path here to resolve constants names that we did have in
21900         MemberAccess.DoResolve.  There is too much code duplicated here.
21901
21902 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
21903
21904         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
21905
21906         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
21907         to MakeUnionSet.
21908
21909         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
21910         tokens, numbers and strings.
21911
21912         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
21913         parenthesis.
21914
21915         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
21916         asyncronous parameters and the regular parameters.  
21917
21918         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
21919         specify the target directory.
21920
21921         * expression.cs: (This.DoResolve): Simplify
21922         (As.Emit): Optimize, do not generate IsInst if the expression is
21923         always of the given type.
21924
21925         (Is.DoResolve): Bug fix, we were reporting both always/never for
21926         the is expression.
21927
21928         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
21929         creating too many unnecessary arrays.
21930
21931 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
21932
21933         * class.cs (EmitFieldInitializer): Use Assign expression to assign
21934         fields instead of rolling our own initializer.   Takes care of all
21935         implicit conversions, and drops unnecessary static checks/argument.
21936
21937 2002-03-31  Dick Porter  <dick@ximian.com>
21938
21939         * driver.cs: use the GetDirectories() return values properly, and
21940         use "/" as path separator.
21941
21942 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
21943
21944         * expression.cs (Unary): Optimize - - expr into expr.
21945         (Binary): Optimize a + (-b) into a -b.
21946
21947         * codegen.cs (CodeGen): Made all methods static.
21948
21949 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
21950
21951         * rootcontext.cs: 
21952
21953         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
21954         TypeBuilder property.
21955
21956         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
21957         instead. 
21958
21959         * tree.cs: Removed the various RecordXXXX, and replaced with a
21960         single RecordDecl.  Removed all the accessor methods, and just
21961         left a single access point Type 
21962
21963         * enum.cs: Rename DefineEnum to DefineType.
21964
21965         * decl.cs: New abstract method `DefineType' used to unify the
21966         Defines for Enumerations, Interfaces, TypeContainers and
21967         Delegates.
21968
21969         (FindType): Moved LookupInterfaceOrClass here.  Moved the
21970         LookupBaseClasses method that used to live in class.cs and
21971         interface.cs here, and renamed to FindType.
21972
21973         * delegate.cs: Implement DefineType.  Take advantage of the
21974         refactored pattern for locating the parent builder without taking
21975         the parent_builder argument (which we know does not work if we are
21976         nested, and triggering a toplevel definition).
21977
21978 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
21979
21980         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
21981         accessibility of a member has changed during override and report
21982         an error if so.
21983
21984         * class.cs (Method.Define, Property.Define): Only complain on
21985         overrides if the method is private, any other accessibility is
21986         fine (and since we just checked the permission is the same, we are
21987         good to go).
21988
21989         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
21990         and elif are processed always.  The other pre-processing
21991         directives are only processed if we are "taking" the path
21992
21993 2002-03-29  Martin Baulig  <martin@gnome.org>
21994
21995         * class.cs (Method.Emit): Only emit symbolic debugging info if the
21996         current location is not Null.
21997
21998         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
21999         a separate method so we can profile it.
22000
22001         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
22002         `span.Seconds' are just seconds, but no minutes or hours.
22003         (MainDriver): Profile the CodeGen.SaveSymbols calls.
22004
22005 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
22006
22007         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
22008         Remove the gratuitous set of Final:
22009
22010                                 // If an interface implementation, then we can set Final.
22011                                 if (((flags & MethodAttributes.Abstract) == 0) &&
22012                                     implementing.DeclaringType.IsInterface)
22013                                         flags |= MethodAttributes.Final;
22014
22015         I do not know what I was smoking when I used that.
22016
22017
22018         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
22019         step into fixing the name resolution issues for delegates and
22020         unifying the toplevel name resolution.
22021
22022 2002-03-28  Martin Baulig  <martin@gnome.org>
22023
22024         * class.cs (Method.Emit): If we have a symbol writer, call its
22025         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
22026         tell it about the current method.
22027
22028         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
22029         writer that we're going to emit the first byte of IL code for a new
22030         statement (a new source line).
22031         (EmitContext.EmitTopBlock): If we have a symbol writer, call
22032         EmitContext.Mark() before emitting any code.
22033
22034         * location.cs (SymbolDocument): Return null when we're Null.
22035
22036         * statement.cs (Statement): Moved the `Location loc' variable here.
22037         (Statement.EmitBoolExpression): If we have a symbol writer, call
22038         ec.Mark() before emitting any code to tell it that we're at the
22039         beginning of a new statement.
22040         (StatementExpression): Added `Location' argument to the constructor.
22041         (Block): Added public readonly variable `StartLocation' and public
22042         variable `EndLocation'.  The latter is to be set using SetEndLocation().
22043         (Block): Added constructor which takes a start and end location.
22044         (Block.SetEndLocation): New method. This sets the end location.
22045         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
22046         local variables we create.
22047         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
22048         each statement and do also mark the begin and end of the block.
22049
22050         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
22051         tell it the current lexer.Location, use Location.Null for the end of the
22052         block.
22053         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
22054         current block, set its end location using SetEndLocation().
22055         (statement_expression): StatementExpression constructor now takes the
22056         lexer.Location as additional argument.
22057         (for_statement, declare_local_variables): Likewise.
22058         (declare_local_variables): When creating a new implicit block, use the
22059         new Block constructor and pass it the lexer.Location.
22060
22061 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
22062
22063         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
22064         members also on the parent interfaces recursively.
22065
22066 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
22067
22068         * report.cs: Use new formats, since Gonzalo finished the missing
22069         bits. 
22070
22071         * expression.cs (Binary.ResolveOperator): added missing operator|
22072         operator& and operator^ for bool/bool.
22073
22074         * cs-parser.jay: CheckDef now takes a Location argument that is
22075         used to report errors more precisly (instead of reporting the end
22076         of a definition, we try to track something which is a lot closer
22077         to the source of the problem).
22078
22079         * cs-tokenizer.cs: Track global token use, so we can properly flag
22080         the use of #define/#undef after the first token has been seen.
22081
22082         Also, rename the reportXXXX to Error_DescriptiveName
22083
22084         * decl.cs (DeclSpace.IsTopLevel): Move property here from
22085         TypeContainer, so that Enum and Interface can use this too.
22086
22087         * class.cs (TypeContainer.LookupInterfaceOrClass,
22088         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
22089         `builder' argument.  Typically this was used to pass the parent
22090         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
22091         the definition).  
22092
22093         The problem is that a nested class could trigger the definition of
22094         a toplevel class, and the builder would be obviously wrong in that
22095         case. 
22096
22097         So we drop this argument, and we compute dynamically the
22098         TypeBuilder/ModuleBuilder (the correct information was available
22099         to us anyways from DeclSpace.Parent)
22100
22101         * interface.cs (Interface.DefineInterface): Drop builder
22102         parameter cleanup like class.cs
22103
22104         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
22105         like class.cs
22106
22107         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
22108         values. 
22109
22110         (Try.Emit): Propagate the returns value from the statement.
22111
22112         (Return.Emit): Even if we are leavning 
22113
22114         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
22115
22116         * modifiers.cs: Fix the computation of MethodAttributes flags.
22117
22118 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
22119
22120         * driver.cs: allow compilation of files that start with '/'.
22121         Add a default case when checking the argument of --target.
22122
22123 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
22124
22125         * interface.cs: Implement the same search algorithm for types in
22126         the interface code.
22127
22128         * delegate.cs: Do not allow multiple definition.
22129
22130         * Recovered ChangeLog that got accidentally amputated
22131
22132         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
22133
22134         * rootcontext.cs: Load manually enum to allow core classes to
22135         contain enumerations.
22136
22137         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
22138         Update to new static methods in TypeManager.
22139
22140         * typemanager.cs (GetMethod, GetConstructor): Use our
22141         implementation of FindMembers to find the members, since during
22142         corlib compilation, the types are TypeBuilders and GetMethod and
22143         GetConstructor do not work.
22144
22145         Make all methods in TypeManager static.
22146
22147         (InitCodeHelpers): Split the functionality from
22148         the InitCodeTypes function.
22149
22150         * driver.cs: Call InitCodeHelpers after we have populated the
22151         types. 
22152
22153         * cs-parser.jay (delegate_declaration): we did not used to compute
22154         the delegate name correctly for void delegates.
22155
22156 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
22157
22158         * rootcontext.cs (RootContext): Init the interface_resolve_order
22159         and type_container_resolve_order always.
22160
22161         (ResolveCore, BootstrapCorlib_ResolveClass,
22162         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
22163         compiler when compiling with --nostdlib
22164
22165         * class.cs (TypeContainer.DefineType): Check that our parent is
22166         not null.  This test is most important when we are bootstraping
22167         the core types.
22168
22169         * codegen.cs: Split out the symbol writing code.
22170
22171 2002-03-25  Martin Baulig  <martin@gnome.org>
22172
22173         * driver.cs (-g): Made -g an alias for --debug.
22174
22175 2002-03-24  Martin Baulig  <martin@gnome.org>
22176
22177         * codegen.cs (SymbolWriter): New public variable. Returns the
22178         current symbol writer.
22179         (CodeGen): Added `bool want_debugging_support' argument to the
22180          constructor. If true, tell the ModuleBuild that we want debugging
22181         support and ask it for the ISymbolWriter.
22182         (Save): If we have a symbol writer, call it's Close() method after
22183         saving the assembly.
22184
22185         * driver.c (--debug): New command line argument to create a
22186         debugger information file.
22187
22188         * location.cs (SymbolDocument): New public property. Returns an
22189         ISymbolDocumentWriter object for the current source file or null
22190         if we don't have a symbol writer.
22191
22192 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
22193
22194         * driver.cs (LoadAssembly): Correctly return when all the paths
22195         have been tried and not before.
22196
22197         * statement.cs (Switch.Emit): return the actual coverage for this
22198         statement (returns/not-returns)
22199
22200         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
22201         switch of the statement if we are the last switch section.  That
22202         kills two problems: try/catch problems (we used to emit an empty
22203         nop at the end) and switch statements where all branches would
22204         return. 
22205
22206 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
22207
22208         * driver.cs: Add default assemblies (the equivalent to the
22209         Microsoft CSC.RSP file)
22210
22211         * cs-tokenizer.cs: When updating `cols and setting it to zero,
22212         also update tokens_seen and set it to false.
22213
22214         * driver.cs: Implement --recurse for Mike.
22215
22216         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
22217         correctly splitting out the paths.
22218
22219 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
22220
22221         * interface.cs (Interface.PopulateProperty): Instead of using
22222         `parent' as the declaration space for the set parameters, use
22223         `this' 
22224
22225         * support.cs (InternalParameters): InternalParameters constructor
22226         takes a DeclSpace instead of a TypeContainer.
22227
22228         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
22229         types are being initialized, load the address of it before calling
22230         the function.  
22231
22232         (New): Provide a mechanism to disable the generation of local
22233         value type temporaries when the caller will be providing us with
22234         an address to store it.
22235
22236         (ArrayCreation.EmitDynamicInitializers): Use it.
22237
22238 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
22239
22240         * expression.cs (Invocation.EmitArguments): Only probe for array
22241         property if there is more than one argument.  Sorry about that.
22242
22243         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
22244         empty param arrays.
22245
22246         * class.cs (Method.LabelParameters): Fix incorrect code path that
22247         prevented the `ParamArrayAttribute' from being applied to the
22248         params attribute.
22249
22250 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
22251
22252         * support.cs (ReflectionParameters): Correctly compute whether the
22253         last argument is a params array.  Fixes the problem with
22254         string.Split ('a')
22255
22256         * typemanager.cs: Make the assemblies array always be non-null
22257         (empty, but non-null)
22258
22259         * tree.cs (RecordDecl): New function that abstracts the recording
22260         of names.  This reports error 101, and provides a pointer to the
22261         previous declaration.  Fixes a crash in the compiler.
22262
22263         * cs-parser.jay (constructor_declaration): Update to new grammar,
22264         and provide a constructor_body that can be empty.
22265
22266 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
22267
22268         * driver.cs: Add support for --resources.
22269
22270         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
22271         Make all types for the various array helper methods be integer.
22272
22273         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
22274         CheckState to ConvCast.
22275
22276         (ConvCast): Now it takes a `checked' state argument, to avoid
22277         depending on the emit context for the conversion, and just using
22278         the resolve time setting.
22279
22280         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
22281         instead of Invocation.EmitArguments.  We do not emit the original
22282         arguments, instead we emit those which have been converted to
22283         unsigned int expressions.
22284
22285         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
22286
22287         * codegen.cs: ditto.
22288
22289         * expression.cs (LocalVariableReference): Drop the use of the
22290         Store function that depended on the variable index.
22291
22292         * statement.cs (VariableInfo): Drop the `Idx' property from this
22293         class, as this is not taking into account the indexes for
22294         temporaries tat we generate during the execution, getting the
22295         indexes wrong.
22296
22297         * class.cs: First emit class initializers, then call the parent
22298         constructor. 
22299
22300         * expression.cs (Binary): Fix opcode emision.
22301         (UnaryMutator.EmitCode): Support checked code generation
22302
22303         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
22304         matches for events for both the Static and Instance scans,
22305         pointing to the same element.   Fix that.
22306
22307 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
22308
22309         * rootcontext.cs (ResolveTree): Always set the
22310         interface_resolve_order, because nested interfaces will be calling
22311         into us.
22312
22313         * class.cs (GetInterfaceOrClass): Track the same resolution
22314         process used by TypeManager.LookupType.  This fixes the nested
22315         type lookups in class declarations (separate path from
22316         LookupType). 
22317
22318         (TypeContainer.DefineType): Also define nested interfaces.
22319         (TypeContainer.RegisterOrder): New public function used to
22320         register the order in which child interfaces need to be closed.
22321
22322         Nested interfaces need to be closed after their parents have been
22323         created. 
22324
22325         * interface.cs (InterfaceAttr): Put all the logic for computing
22326         the interface attribute here. 
22327
22328         (DefineInterface): Register our interface order with the
22329         RootContext or with the TypeContainer depending on the case.
22330
22331 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
22332
22333         * cs-parser.jay: rework foreach statement to work with the new
22334         changes to the policy on SimpleNames.
22335
22336         * report.cs: support Stacktrace on warnings as well.
22337
22338         * makefile: drop --unsafe and /unsafe from the compile.
22339
22340 2002-03-13  Ravi Pratap  <ravi@ximian.com>
22341
22342         * ecore.cs (StandardConversionExists): Modify to take an Expression
22343         as the first parameter. Ensure we do null -> reference type conversion
22344         checking.
22345
22346         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
22347         temporary Expression objects.
22348
22349 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
22350
22351         * interface.cs: workaround bug in method overloading resolution
22352         (there is already a bugzilla bug for it).
22353
22354 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
22355
22356         We could also solve this problem by having a separate path for
22357         performing type lookups, instead of DoResolve, we could have a
22358         ResolveType entry point, and only participating pieces of the
22359         production (simplename, deref, array) would implement this. 
22360
22361         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
22362         signal SimpleName to only resolve type names and not attempt to
22363         resolve anything else.
22364
22365         * expression.cs (Cast): Set the flag.
22366
22367         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
22368
22369         * class.cs: Only report 108 if there is no `new' modifier.
22370
22371         * cs-parser.jay: rework foreach statement to work with the new
22372         changes to the policy on SimpleNames.
22373
22374         * report.cs: support Stacktrace on warnings as well.
22375
22376         * makefile: drop --unsafe and /unsafe from the compile.
22377
22378 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
22379
22380         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22381         lookups here, instead of doing that at parse time.  This means
22382         that our grammar will not introduce `LocalVariableReferences' as
22383         expressions at this point.  That solves the problem of code like
22384         this:
22385
22386         class X {
22387            static void Main ()
22388            { int X = 1;
22389             { X x = null }}}
22390
22391         This is only half the fix.  The full fix requires parameters to
22392         also be handled in this way.
22393
22394         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
22395         makes the use more obvious of the DeclSpace.  The
22396         ec.TypeContainer.TypeBuilder is now only used to pull the
22397         TypeBuilder for it.
22398
22399         My theory is that I can get rid of the TypeBuilder completely from
22400         the EmitContext, and have typecasts where it is used (from
22401         DeclSpace to where it matters).  
22402
22403         The only pending problem is that the code that implements Aliases
22404         is on TypeContainer, and probably should go in DeclSpace.
22405
22406         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22407         lookups here, instead of doing that at parse time.  This means
22408         that our grammar will not introduce `LocalVariableReferences' as
22409         expressions at this point.  That solves the problem of code like
22410         this:
22411
22412         class X {
22413            static void Main ()
22414            { int X = 1;
22415             { X x = null }}}
22416
22417         This is only half the fix.  The full fix requires parameters to
22418         also be handled in this way.
22419
22420         * class.cs (Property.DefineMethod): When implementing an interface
22421         method, set newslot, when implementing an abstract method, do not
22422         set the flag (before we tried never setting it, or always setting
22423         it, which is the difference).
22424         (Indexer.DefineMethod): same.
22425         (Method.DefineMethod): same.
22426
22427         * ecore.cs: Only set the status used flag if we get back a Field.
22428
22429         * attribute.cs: Temporary hack, so Paolo can keep working.
22430
22431 2002-03-08  Ravi Pratap  <ravi@ximian.com>
22432
22433         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
22434         the unmanaged type in the case we have a MarshalAs attribute.
22435
22436         (Resolve): Handle the case when we are parsing the special MarshalAs
22437         attribute [we need to store the unmanaged type to use later]
22438
22439         * typemanager.cs (marshal_as_attr_type): Built in type for the 
22440         MarshalAs Attribute.
22441
22442         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
22443         on parameters and accordingly set the marshalling info.
22444
22445 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
22446
22447         * class.cs: Optimizing slightly by removing redundant code after
22448         we switched to the `NoTypes' return value.
22449         (Property.DefineMethod): use NoTypes here too.
22450
22451         This fixes the bug I introduced in my last batch of changes.
22452
22453 2002-03-05  Ravi Pratap  <ravi@ximian.com>
22454
22455         * tree.cs (RecordEnum): Add. We now keep track of enums too.
22456
22457         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
22458         Enums since those are types too. 
22459
22460         * cs-parser.jay (enum_declaration): Record enums as we parse them.
22461
22462         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
22463         thanks to a call during the lookup process.
22464
22465 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
22466
22467         * statement.cs (Foreach): Lots of work to accomodate a particular
22468         kind of foreach statement that I had not kept in mind.  It is
22469         possible to have foreachs on classes that provide a GetEnumerator
22470         method that return objects that implement the "pattern" for using
22471         a foreach, there is no need to support GetEnumerator
22472         specifically. 
22473
22474         This is needed to compile nant.
22475
22476         * decl.cs: Only report 114 if the member is not `Finalize' and if
22477         the warning level is at least 2.
22478
22479         * class.cs: Moved the compare function from Method to
22480         MethodSignature. 
22481
22482         (MethodSignature.InheritableMemberSignatureCompare): Add new
22483         filter function that is used to extract inheritable methods from a
22484         class. 
22485
22486         (Method.Define): Use the new `inheritable_method_signature_filter'
22487         delegate
22488
22489         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
22490         command. 
22491
22492 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
22493
22494         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
22495
22496         * cs-parser.jay: Add opt_semicolon to the interface declaration.
22497
22498         * expression.cs: Pass location information to
22499         ConvertImplicitStandard. 
22500
22501         * class.cs: Added debugging code to track return values from
22502         interfaces. 
22503
22504 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
22505
22506         * expression.cs (Is.DoResolve): If either side of the `is' is an
22507         interface, do not flag the warning.
22508
22509         * ecore.cs (ImplicitReferenceConversion): We need a separate test
22510         for interfaces
22511
22512         * report.cs: Allow for --fatal to be used with --probe.
22513
22514         * typemanager.cs (NoTypes): Move the definition for the empty Type
22515         array here. 
22516
22517         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
22518         properties. 
22519         (TypeContainer.DefineProxy): New function used to proxy to parent
22520         implementations when implementing interfaces.
22521         (TypeContainer.ParentImplements): used to lookup if our parent
22522         implements a public function that is required by an interface.
22523         (TypeContainer.VerifyPendingMethods): Hook this up.
22524
22525         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
22526         `modules' and `assemblies' arraylists into arrays.  We only grow
22527         these are the very early start up of the program, so this improves
22528         the speedof LookupType (nicely measured).
22529
22530         * expression.cs (MakeByteBlob): Replaced unsafe code with
22531         BitConverter, as suggested by Paolo.
22532
22533         * cfold.cs (ConstantFold.Binary): Special case: perform constant
22534         folding of string concatenation, but if either side is a string,
22535         and the other is not, then return null, and let the runtime use
22536         the concatenation on the string plus the object (using
22537         `Object.ToString'). 
22538
22539 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
22540
22541         Constant Folding has been implemented now.
22542
22543         * expression.cs (Unary.Reduce): Do not throw an exception, catch
22544         the error instead on types that are not supported in one's
22545         complement. 
22546
22547         * constant.cs (Constant and all children): New set of functions to
22548         perform implict and explicit conversions.
22549
22550         * ecore.cs (EnumConstant): Implement the new functions to perform
22551         conversion by proxying to the child expression.
22552
22553         * codegen.cs: (ConstantCheckState): Constant evaluation has its
22554         own separate setting that can not be turned off from the command
22555         line using --unchecked or --checked and is only controlled using
22556         the checked/unchecked statements and expressions.  This setting is
22557         used by the constant folder to flag errors.
22558
22559         * expression.cs (CheckedExpr, UncheckedExpr): Set the
22560         ConstantCheckState as well.   
22561
22562         During Resolve, they also have to flag the state, because the
22563         constant folder runs completely in the Resolve phase.
22564
22565         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
22566         well.
22567
22568 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
22569
22570         * cfold.cs: New file, this file contains the constant folder.
22571
22572         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
22573         argument to track whether we are using the resulting address to
22574         load or store a value and provide better error messages. 
22575
22576         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
22577         new AddressOf arguments.
22578
22579         * statement.cs (Foreach.EmitCollectionForeach): Update
22580
22581         * expression.cs (Argument.Emit): Call AddressOf with proper
22582         arguments to track usage.
22583
22584         (New.DoEmit): Call AddressOf with new arguments.
22585
22586         (Unary.Emit): Adjust AddressOf call.
22587
22588 2002-03-01  Ravi Pratap  <ravi@ximian.com>
22589
22590         * cs-parser.jay (member_access): Change the case for pre-defined types
22591         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
22592         this suggestion.
22593
22594         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
22595         a method body.
22596
22597         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
22598         essentially like methods and apply attributes like MethodImplOptions to them too.
22599
22600         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
22601         not being null.
22602
22603         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
22604         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
22605         is the DeclSpace.
22606
22607         * Update code everywhere accordingly.
22608
22609         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
22610
22611         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
22612
22613 2002-02-28  Ravi Pratap  <ravi@ximian.com>
22614
22615         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
22616         try performing lookups against those instead of jumping straight into using
22617         the 'using' clauses.
22618
22619         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
22620
22621         (LookupType): Perform lookups in implicit parents too.
22622
22623         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
22624         sequence as RootContext.LookupType. 
22625
22626         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
22627         the various cases of namespace lookups into this method.
22628
22629 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
22630
22631         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
22632         in positional arguments)
22633
22634         * class.cs (Operator): Update the AllowedModifiers to contain
22635         extern. 
22636
22637         * cs-parser.jay: Update operator declaration to allow for the
22638         operator body to be empty.
22639
22640         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
22641         values. 
22642
22643 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
22644
22645         * class.cs (Method.Emit): Label parameters.
22646
22647         * driver.cs: Return 1 or 0 as the program exit code.
22648
22649 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
22650
22651         * expression.cs: Special case the `null' object when trying to
22652         auto-compute the type, as anything can be explicitly converted to
22653         that. 
22654
22655         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
22656         spotting this Paolo.
22657
22658         (Expression.ImplicitNumericConversion): Perform comparissions of
22659         the type using the underlying type in the case of an enumeration
22660         rather than using the enumeration type for the compare.
22661
22662         Cope with the underlying == type case, which is not possible to
22663         catch before. 
22664
22665         (Expression.ConvertNumericExplicit): Perform comparissions of
22666         the type using the underlying type in the case of an enumeration
22667         rather than using the enumeration type for the compare.
22668
22669         * driver.cs: If the user does not supply an extension, assume .exe
22670
22671         * cs-parser.jay (if_statement): Rewrote so that we can track the
22672         location for the if statement.
22673
22674         * expression.cs (Binary.ConstantFold): Only concat strings when
22675         the operation is "+", not everything ;-)
22676
22677         * statement.cs (Statement.EmitBoolExpression): Take a location
22678         argument. 
22679         (If, While, Do): Track location.
22680
22681         * expression.cs (Binary.ResolveOperator): In the object + string
22682         case, I was missing a call to ConvertImplicit
22683
22684 2002-02-25  Ravi Pratap  <ravi@ximian.com>
22685
22686         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
22687         Location arguments. Ensure we use RootContext.LookupType to do our work
22688         and not try to do a direct Type.GetType and ModuleBuilder.GetType
22689
22690         * interface.cs (PopulateMethod): Handle the type of the parameter being
22691         null gracefully.
22692
22693         * expression.cs (Invocation.BetterFunction): Handle the case when we 
22694         have a params method with no fixed arguments and a call is made with no
22695         arguments.
22696
22697 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
22698
22699         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
22700         the verbatim-string-literal
22701
22702         * support.cs (InternalParameters.ParameterModifier): handle null
22703         fixed parameters.
22704         (InternalParameters.ParameterType): ditto.
22705
22706         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
22707         duplicating the name of the variable parameter.
22708         (GetParameterByName): Fix bug where we were not looking up array
22709         paramters if they were the only present (thanks Paolo!).
22710         (GetParameterInfo): We only have an empty set of types if both
22711         fixed and array are set to null.
22712         (GetParameterInfo-idx): Handle FixedParameter == null
22713
22714         * cs-parser.jay: Handle the case where there is no catch
22715         statements (missing null test).
22716
22717 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
22718
22719         * driver.cs (MainDriver): Be conservative on our command line
22720         handling.
22721
22722         Catch DirectoryNotFoundException when calling GetFiles.
22723
22724         (SplitPathAndPattern): Used to split the input specification into
22725         a path and a pattern that we can feed to Directory.GetFiles.
22726
22727 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
22728
22729         * statement.cs (Fixed): Implement the last case of the Fixed
22730         statement (string handling).
22731
22732         * expression.cs (StringPtr): New class used to return a char * to
22733         a string;  Used by the Fixed statement.
22734
22735         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
22736
22737         * expression.cs (Binary.ResolveOperator): Remove redundant
22738         MemberLookup pn parent type.
22739         Optimize union call, we do not need a union if the types are the same.
22740         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
22741         type.
22742
22743         Specialize the use of MemberLookup everywhere, instead of using
22744         the default settings. 
22745
22746         (StackAlloc): Implement stackalloc keyword.
22747
22748         * cs-parser.jay: Add rule to parse stackalloc.
22749
22750         * driver.cs: Handle /h, /help, /?
22751
22752         * expression.cs (MakeByteBlob): Removed the hacks we had in place
22753         before we supported unsafe code.
22754
22755         * makefile: add --unsafe to the self compilation of mcs.
22756
22757 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
22758
22759         * expression.cs (PointerArithmetic): New class that is used to
22760         perform pointer arithmetic.
22761         (Binary.Resolve): Handle pointer arithmetic
22762         Handle pointer comparission.
22763         (ArrayPtr): Utility expression class that is used to take the
22764         address of an array.
22765
22766         (ElementAccess): Implement array access for pointers
22767
22768         * statement.cs (Fixed): Implement fixed statement for arrays, we
22769         are missing one more case before we are done.
22770
22771         * expression.cs (Indirection): Implement EmitAssign and set the
22772         ExprClass to Variable.  This allows pointer dereferences to be
22773         treated as variables, and to have values assigned to them.
22774
22775         * ecore.cs (Expression.StoreFromPtr): New utility function to
22776         store values dereferencing.
22777
22778 2002-02-20  Ravi Pratap  <ravi@ximian.com>
22779
22780         * expression.cs (Binary.ResolveOperator): Ensure that we are
22781         not trying to operate on a void type - this fixes the reported
22782         bug.
22783
22784         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
22785         the parent implementation is sealed.
22786
22787         * ../errors/cs0239.cs : Add.
22788
22789         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
22790
22791         * typemanager.cs (unverifiable_code_type): Corresponds to 
22792         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
22793         which have unsafe code in them.
22794
22795         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
22796         unsafe context.
22797
22798 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
22799
22800         * cs-tokenizer.cs: Add support for @"litreal strings"
22801
22802         Make tokenizer accept pre-processor directives
22803         on any column (remove the old C-like limitation). 
22804
22805         * rootcontext.cs (EmitCode): Emit any global attributes.
22806         (AddGlobalAttributes): Used to keep track of assembly attributes. 
22807
22808         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
22809
22810         * cs-parser.jay: Add support for global attributes.  
22811
22812 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
22813
22814         * expression.cs (Indirection): New helper class.  Unary will
22815         create Indirection classes to be able to implement the
22816         IMemoryLocation interface on it.
22817
22818 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
22819
22820         * cs-parser.jay (fixed_statement): reference the right statement.
22821
22822         * statement.cs (Fixed.Emit): Finish implementing the fixed
22823         statement for the &x case.
22824
22825 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
22826
22827         * class.cs (Property.Define, Method.Define): Remove newslot when
22828         `implementing'.  
22829
22830         * modifiers.cs: My use of NewSlot when `Abstract' was set was
22831         wrong.  NewSlot should only be used if the `new' keyword is present.
22832
22833         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
22834         locating our system dir.  Sorry about this.
22835
22836 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
22837
22838         * driver.cs (GetSystemDir): Compute correctly the location of our
22839         system assemblies.  I was using the compiler directory instead of
22840         the library directory.
22841
22842 2002-02-13  Ravi Pratap  <ravi@ximian.com>
22843
22844         * expression.cs (BetterFunction): Put back in what Miguel commented out
22845         since it is the correct fix. The problem is elsewhere ;-)
22846
22847         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
22848         parameters of the parms method are themselves compatible or not !
22849
22850         (StandardConversionExists): Fix very dangerous bug where we were forgetting
22851         to check that a class implements an interface before saying that an implicit
22852         conversion was allowed. Use ImplementsInterface to do the checking.
22853
22854 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
22855
22856         * class.cs (Method.Define): Track whether we are an explicit
22857         implementation or not.  And only call DefineMethodOverride if we
22858         are an explicit implementation.
22859
22860         (Property.DefineMethod): Ditto.
22861
22862 2002-02-11  Ravi Pratap  <ravi@ximian.com>
22863
22864         * expression.cs (BetterFunction): Catch hideous bug which was
22865          preventing us from detecting ambiguous calls due to implicit casts i.e
22866         cs0121.
22867
22868 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
22869
22870         * support.cs (Pair): Remove un-needed method.  I figured why I was
22871         getting the error in cs-parser.jay, the variable in a foreach loop
22872         is readonly, and the compiler does not really treat this as a variable.
22873
22874         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
22875         instead of EQUALS in grammar.  
22876
22877         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
22878
22879         * expression.cs (Unary.DoResolve): Check whether the argument is
22880         managed or not.
22881
22882 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
22883
22884         * support.cs: Api for Pair to set a value.  Despite the fact that
22885         the variables are public the MS C# compiler refuses to compile
22886         code that accesses the field if the variable is part of a foreach
22887         statement. 
22888
22889         * statement.cs (Fixed): Begin implementation of the fixed
22890         statement.
22891
22892         (Block.AddVariable): Return the VariableInfo on success and null
22893         on failure instead of true/false. 
22894
22895         * cs-parser.jay (foreach): Catch errors on variables already
22896         defined (we were ignoring this value before) and properly unwind
22897         the block hierarchy
22898
22899         (fixed_statement): grammar for the fixed statement.
22900
22901 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
22902
22903         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
22904         pointer types to be incretemented.
22905
22906         (SizeOf): Implement.
22907
22908         * cs-parser.jay (pointer_member_access): Implement
22909         expr->IDENTIFIER production.
22910
22911         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
22912         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
22913         on safe contexts.
22914
22915         (Unary): Implement indirection.
22916
22917         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
22918         use in non-unsafe context).
22919
22920         (SimpleName.DoResolve): Check for pointers in field access on safe
22921         contexts. 
22922
22923         (Expression.LoadFromPtr): Factor the load-indirect code in this
22924         function.  This was duplicated in UnboxCast and ParameterReference
22925
22926 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
22927
22928         * expression.cs (ComposedCast): report an error if a pointer cast
22929         is used in a safe region.
22930
22931         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
22932         pointer type casts in unsafe context.
22933
22934         * codegen.cs (EmitContext): Set up IsUnsafe.
22935
22936         * cs-parser.jay (non_expression_type): Add productions for pointer
22937         casts. 
22938
22939         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
22940         code.  We should not use force into static mode if the method is
22941         not virtual.  Fixes bug in MIS
22942
22943         * statement.cs (Do.Emit, While.Emit, For.Emit,
22944         Statement.EmitBoolExpression): Add support to Do and While to
22945         propagate infinite loop as `I do return' semantics.
22946
22947         Improve the For case to also test for boolean constants.
22948
22949         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
22950         to the list of attributes we can add.
22951
22952         Remove `EmitContext' argument.
22953
22954         * class.cs (Method.Define): Apply parameter attributes.
22955         (Constructor.Define): Apply parameter attributes.
22956         (MethodCore.LabelParameters): Move here the core of labeling
22957         parameters. 
22958
22959         * support.cs (ReflectionParameters.ParameterModifier,
22960         InternalParameters.ParameterModifier): Use IsByRef on the type and
22961         only return the OUT bit for these parameters instead of in/out/ref
22962         flags.
22963
22964         This is because I miss-understood things.  The ParameterInfo.IsIn
22965         and IsOut represent whether the parameter has the [In] and [Out]
22966         attributes set.  
22967
22968 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
22969
22970         * ecore.cs (FieldExpr.Emit): Release temporaries.
22971
22972         * assign.cs (LocalTemporary.Release): new function.
22973
22974         * codegen.cs (EmitContext.GetTemporaryStorage,
22975         EmitContext.FreeTemporaryStorage): Rework the way we deal with
22976         temporary storage.  Now we can "put back" localbuilders when we
22977         are done with them
22978
22979 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
22980
22981         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
22982         need to make a copy of the variable to generate verifiable code.
22983
22984 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
22985
22986         * driver.cs: Compute dynamically the system directory.
22987
22988         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
22989         Slower, but more generally useful.  Used by the abstract
22990         registering implementation. 
22991
22992         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
22993         the rules for the special rule on Type/instances.  First check if
22994         we have the same name, and if so, try that special static path
22995         rather than the instance path.
22996
22997 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
22998
22999         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
23000         for, while and if.
23001
23002         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
23003         Enum, ValueType, Delegate or Array for non-corlib compiles.
23004
23005         * cs-tokenizer.cs: Catch long identifiers (645)
23006
23007         * typemanager.cs (IndexerPropetyName): Ravi never tested this
23008         piece of code.
23009
23010         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
23011         fix, we were returning too early, so we were not registering
23012         pending methods from abstract classes.
23013
23014         Do not register pending methods if the class is abstract.
23015
23016         * expression.cs (Conditional.DoResolve): Report circular implicit
23017         conversions when we neecd to compute it for conditional
23018         expressions. 
23019
23020         (Is.DoResolve): If the expression is always of the provided type,
23021         flag warning 183.  If the expression can not ever be of the
23022         provided type flag warning 184.
23023
23024         * class.cs: Catch 169 as well.
23025
23026         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
23027         read. 
23028
23029 2002-01-18  Nick Drochak  <ndrochak@gol.com>
23030
23031         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
23032
23033 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
23034
23035         * interface.cs: (PopulateMethod): Check for pointers being defined
23036         only if the unsafe context is active.
23037         (PopulateProperty): ditto.
23038         (PopulateIndexer): ditto.
23039
23040         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
23041         specified.  If pointers are present, make sure that they are
23042         present in an unsafe context.
23043         (Constructor, Constructor.Define): ditto.
23044         (Field, Field.Define): ditto.
23045         (Property, Property.Define): ditto.
23046         (Event, Event.Define): ditto.
23047
23048         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
23049         hashtable if there are classes or structs defined.
23050
23051         * expression.cs (LocalVariableReference.DoResolve): Simplify this
23052         code, as the constant resolution moved.
23053
23054         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
23055         the metadata, so we can flag error 133. 
23056
23057         * decl.cs (MemberCore.UnsafeOK): New function to test that a
23058         pointer is being declared in an unsafe context.
23059
23060 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
23061
23062         * modifiers.cs (Modifiers.Check): Require a Location argument.
23063         Report error 227 for Unsafe use.
23064
23065         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
23066
23067         * statement.cs (For.Emit): If the test is null, then report that
23068         we do `return', as we wont reach anything afterwards.
23069
23070         (Switch.SwitchGoverningType): Track the expression that matched
23071         the conversion.
23072
23073         * driver.cs: Allow negative numbers as an error code to flag.
23074
23075         * cs-parser.jay: Handle 1551.
23076
23077         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
23078
23079 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
23080
23081         * cs-parser.jay: Report 1518 (type declaration can only contain
23082         class, struct, interface, enum or delegate)
23083
23084         (switch_label): Report 1523 (keywords `case' or `default' must
23085         preced code)
23086
23087         (opt_switch_sections): Report 1522 (empty switch)
23088
23089         * driver.cs: Report 1515 (response file specified multiple times)
23090         Report 1516 (Source file specified multiple times).
23091
23092         * expression.cs (Argument.Resolve): Signal 1510
23093
23094         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
23095         access not allowed in static code)
23096
23097 2002-01-11  Ravi Pratap  <ravi@ximian.com>
23098
23099         * typemanager.cs (IsPointerType): Utility method which we are going
23100         to need a lot.
23101
23102         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
23103         the object type, so we take care of that.
23104
23105         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
23106
23107         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
23108         added to non-params parameters :-)
23109
23110         * typemanager.cs (CSharpName): Include 'void' type too. 
23111
23112         (void_ptr_type): Include in the set of core types.
23113
23114         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
23115         duplicating code.
23116
23117         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
23118         an unsafe context.
23119
23120         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
23121         completely forgotten about it.
23122
23123 2002-01-10  Ravi Pratap  <ravi@ximian.com>
23124
23125         * cs-parser.jay (pointer_type): Add. This begins our implementation
23126         of parsing rules for unsafe code.
23127
23128         (unsafe_statement): Implement.
23129
23130         (embedded_statement): Modify to include the above.
23131
23132         * statement.cs (Unsafe): Implement new class for unsafe blocks.
23133
23134         * codegen.cs (EmitContext.InUnsafe): Add. This determines
23135         if the current context is an unsafe one.
23136
23137         * cs-parser.jay (local_variable_pointer_type): Since local variable types
23138         are handled differently, we need separate rules for them.
23139
23140         (local_variable_declaration): Update to use local_variable_pointer_type
23141         to allow variable declarations of unmanaged pointer types.
23142
23143         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
23144         in unsafe contexts.
23145
23146         * ../errors/cs0214.cs : Add.
23147
23148 2002-01-16  Nick Drochak  <ndrochak@gol.com>
23149
23150         * makefile: remove 'response' file when cleaning.
23151
23152 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
23153
23154         * cs-parser.jay: Report 1524.
23155
23156 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
23157
23158         * typemanager.cs (RegisterMethod): drop checking if we have
23159         registered this from here
23160
23161 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
23162
23163         * class.cs (Method.EmitDestructor): Implement calling our base
23164         destructor. 
23165
23166         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
23167         value of InFinally.
23168
23169         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
23170         this routine and will wrap the call in a try/catch block.  Deal
23171         with the case.
23172
23173 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
23174
23175         * ecore.cs (Expression.MemberLookup): instead of taking a
23176         parameter `same_type' that was used to tell whether we could
23177         access private members we compute our containing type from the
23178         EmitContext.
23179
23180         (FieldExpr): Added partial support for volatile fields.  This does
23181         not work for volatile fields exposed from assemblies, as I can not
23182         figure out how to extract the modreq from it.
23183
23184         Updated all the source files to use this.
23185
23186         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
23187         because it is referenced by MemberLookup very often. 
23188
23189 2002-01-09  Ravi Pratap  <ravi@ximian.com>
23190
23191         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
23192         TypeBuilder.GetCustomAttributes to retrieve what we need.
23193
23194         Get rid of redundant default_member_attr_type as this is the same as
23195         default_member_type which already exists.
23196
23197         * interface.cs, attribute.cs : Update accordingly.
23198
23199 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
23200
23201         * typemanager.cs: Enable IndexerPropertyName again.  It does not
23202         work for TYpeBuilders though.  Ravi, can you please fix this?
23203
23204         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
23205
23206         * expression.cs (Argument.Emit): Handle the case of ref objects
23207         being passed to ref functions;  
23208
23209         (ParameterReference.EmitLoad): Loads the content of the pointer
23210         without dereferencing.
23211
23212 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
23213
23214         * cs-tokenizer.cs: Implemented the pre-processing expressions.
23215
23216 2002-01-08  Ravi Pratap  <ravi@ximian.com>
23217
23218         * class.cs (Indexer.DefineMethod): Incorporate the interface
23219         type in the name of the method if we are doing explicit interface
23220         implementation.
23221
23222         * expression.cs (ConversionExists): Remove as it is completely obsolete.
23223
23224         (BetterConversion): Fix extremely trivial bug where we were referring to
23225         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
23226         again !
23227
23228         * ../errors/bug16.cs : Add although we have fixed it.
23229
23230 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
23231
23232         * expression.cs (BaseIndexer): Begin implementation.
23233
23234         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
23235
23236         * cs-parser.jay (indexer_declarator): Use qualified_identifier
23237         production directly to remove a shift/reduce, and implement
23238         explicit interface implementation.
23239
23240         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
23241         after a floating point suffix.
23242
23243         * expression.cs (DoNumericPromotions): Improved the conversion for
23244         uint/uint.  If we have a constant, we avoid doing a typecast to a
23245         larger type.
23246
23247         * class.cs (Indexer): Implement explicit interface implementation
23248         for indexers.
23249
23250 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
23251
23252         * class.cs: make the default instance constructor public and hidebysig.
23253
23254 2001-01-03  Ravi Pratap  <ravi@ximian.com>
23255
23256         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
23257         so we can call it from elsewhere.
23258
23259         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
23260         we emit it internally if the class has a defined indexer; otherwise the user
23261         emits it by decorating the class definition with the DefaultMemberAttribute.
23262
23263         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
23264         attribute is not used on a type which defines an indexer.
23265
23266         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
23267         character when we skip whitespace.
23268
23269         * ../errors/cs0646.cs : Add.
23270
23271 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
23272
23273         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
23274         again. 
23275
23276         * makefile: Add practical target `mcs3.exe' which builds the third
23277         generation compiler. 
23278
23279         * expression.cs (New): Fix structures constructor calling.
23280
23281         * class.cs (Property, Method, Indexer): Emit Final flag on the
23282         method if we are an interface implementation and we are not
23283         abstract. 
23284
23285         * ecore.cs (PropertyExpr): New public field `IsBase', tells
23286         whether this property is referencing a `base' method.
23287
23288         * expression.cs (Invocation.EmitCall): take an extra argument:
23289         is_base, this is used to determine whether the `call' or
23290         `callvirt' opcode should be used.
23291
23292
23293         * delegate.cs: update EmitCall.
23294
23295         * class.cs (Method.Define): Set NewSlot for the cases where we are
23296         not implementing an interface method.
23297
23298         (Property.Define): ditto.
23299
23300 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
23301
23302         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
23303         'r'.  Allows mcs to parse itself fully.
23304
23305 2002-01-02  Ravi Pratap  <ravi@ximian.com>
23306
23307         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
23308         of the number of initializers that require the InitializeArray method.
23309
23310         (CheckIndices): Store the Expression in all cases - not the plain value. Also
23311         update the above field where necessary.
23312
23313         (MakeByteBlob): Update accordingly.
23314
23315         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
23316         greater than 2.
23317
23318         (EmitDynamicInitializers): Update in accordance with the new optimization.
23319
23320         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
23321         same OpCode applies.
23322
23323         * cs-parser.jay : Fix some glaring errors I introduced.
23324
23325 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
23326
23327         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
23328         so that we can check for name clashes there too.
23329
23330         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
23331         for interface indexers.
23332
23333         * interfaces.cs (Define): Emit the default member attribute.
23334
23335         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
23336         variable was being referred to while setting the value ;-)
23337
23338 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
23339
23340         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
23341         byte-by-byte information when we know the data is zero.
23342
23343         Make the block always a multiple of 4, because
23344         DefineInitializedData has a bug.
23345
23346         * assign.cs: Fix, we should assign from the temporary, not from
23347         the source. 
23348
23349         * expression.cs (MakeByteBlob): Fix my incorrect code.
23350
23351 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
23352
23353         * typemanager.cs (EnumToUnderlying): This function is used to get
23354         the underlying type from an enumeration, because it does not
23355         always work. 
23356
23357         * constant.cs: Use the I4_S form for values between -128 and 127.
23358
23359         * statement.cs (Block.LookupLabel): Looks up a label.
23360         (Block): Drop support for labeled blocks.
23361
23362         (LabeledStatement): New kind of statement that represents a label
23363         only.
23364
23365         (Goto): Finally implement this bad boy.
23366
23367         * cs-parser.jay: Update to reflect new mechanism to implement
23368         labels.
23369
23370 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
23371
23372         * codegen.cs (EmitContext.This): a codegen property that keeps the
23373         a single instance of this instead of creating many different this
23374         instances. 
23375
23376         * delegate.cs (Delegate.DoResolve): Update to use the property;
23377
23378         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
23379
23380         * expression.cs (BaseAccess.DoResolve): Ditto.
23381
23382 2001-12-29  Ravi Pratap  <ravi@ximian.com>
23383
23384         * typemanager.cs (methodimpl_attr_type): Add to hold the type
23385         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
23386
23387         (InitCoreTypes): Update accordingly.
23388
23389         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
23390         so we can quickly store the state.
23391
23392         (ApplyAttributes): Set the correct implementation flags
23393         for InternalCall methods.
23394
23395 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
23396
23397         * expression.cs (EmitCall): if a method is not virtual, then do
23398         not use callvirt on it.
23399
23400         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
23401         user defined stuff) requires the use of stobj, which takes an
23402         address on the stack instead of an array and an index.  So emit
23403         the Ldelema operation for it.
23404
23405         (EmitStoreOpcode): Use stobj for valuetypes.
23406
23407         (UnaryMutator.EmitCode): Use the right 1 value depending on
23408         whether we are dealing with int64/uint64, float or doubles.
23409
23410         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
23411         constructors that I implemented last night.
23412
23413         (Constructor.IsDefault): Fix to work properly for static
23414         constructors.
23415
23416         * cs-parser.jay (CheckDef): report method signature errors.
23417         Update error number 103 to be 132.
23418
23419         * decl.cs: New AdditionResult enumeration value: MethodExists.
23420         Although we do this check for methods later on in the semantic
23421         analysis, catching repeated default constructors is so easy that
23422         we catch these here. 
23423
23424         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
23425         promotions code.
23426
23427         (ParameterReference.EmitAssign, Emit): handle
23428         bools as bytes.
23429
23430         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
23431         (ArrayAccess.EmitStoreOpcode): ditto.
23432
23433         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
23434
23435         * expression.cs (MakeByteBlob): Complete all the missing types
23436         (uint, short, ushort, byte, sbyte)
23437
23438         * class.cs: Only init instance field initializers on instance
23439         constructors. 
23440
23441         Rename `constructors' to instance_constructors. 
23442
23443         (TypeContainer.AddConstructor): Only add constructors to the list
23444         if it is not static.
23445
23446         Make sure that we handle default_static_constructor independently
23447         everywhere where we handle instance_constructors
23448
23449 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
23450
23451         * class.cs: Do not lookup or create a base initializer for a
23452         static constructor.
23453
23454         (ConstructorInitializer.Resolve): use the proper type to lookup
23455         for constructors.
23456
23457         * cs-parser.jay: Report error 1585 (modifiers between type and name).
23458
23459         * enum.cs, interface.cs: Remove CloseType, this is taken care by
23460         in DeclSpace. 
23461
23462         * decl.cs: CloseType is now an virtual method, the default
23463         implementation just closes this type.
23464
23465 2001-12-28  Ravi Pratap  <ravi@ximian.com>
23466
23467         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
23468         to PreserveSig by default. Also emit HideBySig on such methods.
23469
23470         Basically, set the defaults to standard values.
23471
23472         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
23473         argument, if candidate is better, it can't be worse than the best !
23474
23475         (Invocation): Re-write bits to differentiate between methods being
23476         applicable in their expanded form and their normal form - for params
23477         methods of course.
23478
23479         Get rid of use_standard everywhere as only standard conversions are allowed
23480         in overload resolution. 
23481
23482         More spec conformance.
23483
23484 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
23485
23486         * driver.cs: Add --timestamp, to see where the compiler spends
23487         most of its time.
23488
23489         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
23490         `this' in static code.
23491
23492         (SimpleName.DoResolve): Implement in terms of a helper function
23493         that allows static-references to be passed upstream to
23494         MemberAccess.
23495
23496         (Expression.ResolveWithSimpleName): Resolve specially simple
23497         names when called by MemberAccess to implement the special
23498         semantics. 
23499
23500         (Expression.ImplicitReferenceConversion): Handle conversions from
23501         Null to reference types before others, as Null's type is
23502         System.Object. 
23503
23504         * expression.cs (Invocation.EmitCall): Handle the special case of
23505         calling methods declared on a reference type from a ValueType
23506         (Base classes System.Object and System.Enum)
23507
23508         (MemberAccess.Resolve): Only perform lookups on Enumerations if
23509         the left hand side is a TypeExpr, not on every enumeration. 
23510
23511         (Binary.Resolve): If types are reference types, then do a cast to
23512         object on operators != and == of both arguments.
23513
23514         * typemanager.cs (FindMembers): Extract instance and static
23515         members if requested.
23516
23517         * interface.cs (PopulateProperty): Use void_type instead of null
23518         as the return type for the setter method.
23519
23520         (PopulateIndexer): ditto.
23521
23522 2001-12-27  Ravi Pratap  <ravi@ximian.com>
23523
23524         * support.cs (ReflectionParameters): Fix minor bug where we
23525         were examining the wrong parameter for the ParamArray attribute.
23526
23527         Cope with requests for the type of the parameter at position
23528         greater than the params parameter's. We now return the element
23529         type of the params array as that makes more sense.
23530
23531         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
23532         accordingly as we no longer have to extract the element type
23533         ourselves.
23534
23535         (Invocation.OverloadResolve): Update.
23536
23537 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
23538
23539         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
23540         against IEnumerator, test whether the return value is a descendant
23541         of the IEnumerator interface.
23542
23543         * class.cs (Indexer.Define): Use an auxiliary method to implement
23544         the other bits of the method definition.  Begin support for
23545         explicit interface implementation.
23546
23547         (Property.DefineMethod): Use TypeManager.void_type instead of null
23548         for an empty return value.
23549
23550 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
23551
23552         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
23553         dealing with a FieldExpr which is composed of a FieldBuilder, in
23554         the code path we did extract the constant, but we should have
23555         obtained the underlying value to be able to cast it (otherwise we
23556         end up in an infinite loop, this is what Ravi was running into).
23557
23558         (ArrayCreation.UpdateIndices): Arrays might be empty.
23559
23560         (MemberAccess.ResolveMemberAccess): Add support for section
23561         14.5.4.1 that deals with the special case of E.I when E is a type
23562         and something else, that I can be a reference to a static member.
23563
23564         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
23565         handle a particular array type to create byte blobs, it is just
23566         something we dont generate byteblobs for.
23567
23568         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
23569         arguments. 
23570
23571         * location.cs (Push): remove the key from the hashtable that we
23572         are about to add.   This happens for empty files.
23573
23574         * driver.cs: Dispose files after we have parsed them.
23575
23576         (tokenize): new function that only runs the tokenizer on its
23577         input, for speed testing.
23578
23579 2001-12-26  Ravi Pratap  <ravi@ximian.com>
23580
23581         * class.cs (Event.Define): Define the private field only if there
23582         are no accessors defined.
23583
23584         * expression.cs (ResolveMemberAccess): If there is no associated
23585         field with the event, that means we have an event defined with its
23586         own accessors and we should flag error cs0070 since transforming
23587         ourselves into a field is not valid in that case.
23588
23589         * ecore.cs (SimpleName.DoResolve): Same as above.
23590
23591         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
23592         and charset to sane values.
23593
23594 2001-12-25  Ravi Pratap  <ravi@ximian.com>
23595
23596         * assign.cs (DoResolve): Perform check on events only if they 
23597         are being accessed outside the declaring type.
23598
23599         * cs-parser.jay (event_declarations): Update rules to correctly
23600         set the type of the implicit parameter etc.
23601
23602         (add_accessor, remove_accessor): Set current local parameters.
23603
23604         * expression.cs (Binary): For delegate addition and subtraction,
23605         cast the return value from the method into the appropriate delegate
23606         type.
23607
23608 2001-12-24  Ravi Pratap  <ravi@ximian.com>
23609
23610         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
23611         of these as the workaround is unnecessary.
23612
23613         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
23614         delegate data - none of that is needed at all.
23615
23616         Re-write bits to extract the instance expression and the delegate method
23617         correctly.
23618
23619         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
23620         on delegates too.
23621
23622         * attribute.cs (ApplyAttributes): New method to take care of common tasks
23623         of attaching attributes instead of duplicating code everywhere.
23624
23625         * everywhere : Update code to do attribute emission using the above method.
23626
23627 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
23628
23629         * expression.cs (IsParamsMethodApplicable): if there are not
23630         parameters, return immediately.
23631
23632         * ecore.cs: The 0 literal can be implicity converted to an enum
23633         type. 
23634
23635         (SimpleName.DoResolve): First lookup the type, then lookup the
23636         members. 
23637
23638         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
23639         want to get its address.  If the InstanceExpression is not
23640         addressable, store the result in a temporary variable, then get
23641         the address of it.
23642
23643         * codegen.cs: Only display 219 errors on warning level or above. 
23644
23645         * expression.cs (ArrayAccess): Make it implement the
23646         IMemoryLocation interface.
23647
23648         (Binary.DoResolve): handle the operator == (object a, object b)
23649         and operator != (object a, object b) without incurring into a
23650         BoxedCast (because 5 != o should never be performed).
23651
23652         Handle binary enumerator operators.
23653
23654         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
23655         value type, otherwise use Ldelem_ref.
23656
23657         Use precomputed names;
23658
23659         (AddressOf): Implement address of
23660
23661         * cs-parser.jay (labeled_statement): Fix recursive block
23662         addition by reworking the production.
23663
23664         * expression.cs (New.DoEmit): New has a special case:
23665                 
23666                  If we are dealing with a ValueType, we have a few
23667                  situations to deal with:
23668                 
23669                     * The target of New is a ValueType variable, that is
23670                       easy, we just pass this as the variable reference
23671                 
23672                     * The target of New is being passed as an argument,
23673                       to a boxing operation or a function that takes a
23674                       ValueType.
23675                 
23676                       In this case, we need to create a temporary variable
23677                       that is the argument of New.
23678
23679
23680 2001-12-23  Ravi Pratap  <ravi@ximian.com>
23681
23682         * rootcontext.cs (LookupType): Check that current_type is not null before
23683         going about looking at nested types.
23684
23685         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
23686         not implement the IAssignMethod interface any more.
23687
23688         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
23689         where we tranform them into FieldExprs if they are being resolved from within
23690         the declaring type.
23691
23692         * ecore.cs (SimpleName.DoResolve): Do the same here.
23693
23694         * assign.cs (DoResolve, Emit): Clean up code considerably. 
23695
23696         * ../errors/bug10.cs : Add.
23697
23698         * ../errors/cs0070.cs : Add.
23699
23700         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
23701
23702         * assign.cs : Get rid of EventIsLocal everywhere.
23703
23704 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
23705
23706         * ecore.cs (ConvertIntLiteral): finished the implementation.
23707
23708         * statement.cs (SwitchLabel): Convert the value we are using as a
23709         key before looking up the table.
23710
23711 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
23712
23713         * codegen.cs (EmitTopBlock): Require a Location argument now.
23714
23715         * cs-parser.jay (constructor_declarator): We need to setup
23716         current_local_parameters before we parse the
23717         opt_constructor_initializer, to allow the variables to be bound
23718         to the constructor arguments.
23719
23720         * rootcontext.cs (LookupType): First lookup nested classes in our
23721         class and our parents before we go looking outside our class.
23722
23723         * expression.cs (ConstantFold): Extract/debox the values at the
23724         beginnning. 
23725
23726         * rootcontext.cs (EmitCode): Resolve the constants first before we
23727         resolve the types.  This is not really needed, but it helps debugging.
23728
23729         * statement.cs: report location.
23730
23731         * cs-parser.jay: pass location to throw statement.
23732
23733         * driver.cs: Small bug fix.
23734
23735         * report.cs: Updated format to be 4-zero filled digits.
23736
23737 2001-12-22  Ravi Pratap  <ravi@ximian.com>
23738
23739         * expression.cs (CheckIndices): Fix minor bug where the wrong
23740         variable was being referred to ;-)
23741
23742         (DoEmit): Do not call EmitStaticInitializers when the 
23743         underlying type is System.Object.
23744
23745 2001-12-21  Ravi Pratap  <ravi@ximian.com>
23746
23747         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
23748         and do the usual workaround for SRE.
23749
23750         * class.cs (MyEventBuilder.EventType): New member to get at the type
23751         of the event, quickly.
23752
23753         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
23754
23755         * assign.cs (Assign.DoResolve): Handle the case when the target
23756         is an EventExpr and perform the necessary checks.
23757
23758         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
23759         interface.
23760
23761         (SimpleName.MemberStaticCheck): Include check for EventExpr.
23762
23763         (EventExpr): Set the type in the constructor itself since we 
23764         are meant to be born fully resolved.
23765
23766         (EventExpr.Define): Revert code I wrote earlier.
23767                 
23768         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
23769         instance expression is null. The instance expression is a This in that case
23770         or a null, depending on whether it is a static method or not.
23771
23772         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
23773         refers to more than one method.
23774
23775         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
23776         and accordingly flag errors.
23777
23778 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
23779
23780         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
23781
23782 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
23783
23784         * location.cs (ToString): Provide useful rutine.
23785
23786 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
23787
23788         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
23789         objects, return the actual integral boxed.
23790
23791         * statement.cs (SwitchLabel): define an ILLabel for each
23792         SwitchLabel. 
23793
23794         (Switch.CheckSwitch): If the value is a Literal, extract
23795         the underlying literal.
23796
23797         Also in the unused hashtable we had, add the SwitchLabel so we can
23798         quickly look this value up.
23799
23800         * constant.cs: Implement a bunch of new constants.  Rewrite
23801         Literal based on this.  Made changes everywhere to adapt to this.
23802
23803         * expression.cs (Expression.MakeByteBlob): Optimize routine by
23804         dereferencing array only once, and also copes with enumrations.
23805
23806         bytes are two bytes wide, not one.
23807
23808         (Cast): Perform constant conversions.
23809
23810         * ecore.cs (TryImplicitIntConversion): Return literals instead of
23811         wrappers to the literals here.
23812
23813         * expression.cs (DoNumericPromotions): long literals can converted
23814         to ulong implicity (this is taken care of elsewhere, but I was
23815         missing this spot).
23816
23817         * ecore.cs (Expression.Literalize): Make the return type Literal,
23818         to improve type checking.
23819
23820         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
23821
23822 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
23823
23824         * literal.cs: Revert code from ravi that checked the bounds.  The
23825         bounds are sane by the definition of the type itself. 
23826
23827         * typemanager.cs: Fix implementation of ImplementsInterface.  We
23828         need to actually look up in our parent hierarchy for interfaces
23829         implemented. 
23830
23831         * const.cs: Use the underlying type for enumerations
23832
23833         * delegate.cs: Compute the basename for the delegate creation,
23834         that should fix the delegate test case, and restore the correct
23835         Type Lookup semantics in rootcontext
23836
23837         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
23838         referencing a nested type with the Reflection API is using the "+"
23839         sign. 
23840
23841         * cs-parser.jay: Do not require EOF token at the end.
23842
23843 2001-12-20  Ravi Pratap  <ravi@ximian.com>
23844
23845         * rootcontext.cs (LookupType): Concatenate type names with
23846         a '.' instead of a '+' The test suite passes again.
23847
23848         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
23849         field of the enumeration.
23850
23851         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
23852         the case when the member is an EventExpr.
23853
23854         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
23855         static has an associated instance expression.
23856
23857         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
23858
23859         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
23860
23861         * class.cs (Event.Define): Register event and perform appropriate checks
23862         for error #111.
23863
23864         We define the Add and Remove methods even if the use provides none because
23865         in that case, we provide default implementations ourselves.
23866
23867         Define a private field of the type of the event. This is done by the CSC compiler
23868         and we should be doing it too ;-)
23869
23870         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
23871         More methods we use in code we generate.
23872
23873         (multicast_delegate_type, delegate_type): Two separate types since the distinction
23874         is important.
23875
23876         (InitCoreTypes): Update accordingly for the above.
23877
23878         * class.cs (Event.Emit): Generate code for default accessors that we provide
23879
23880         (EmitDefaultMethod): Do the job in the above.
23881
23882         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
23883         appropriate place.
23884
23885 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
23886
23887         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
23888         builders even if we were missing one.
23889
23890         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
23891         pass the Basename as our class name instead of the Name.  The
23892         basename will be correctly composed for us.
23893
23894         * parameter.cs (Paramters): Now takes a Location argument.
23895
23896         * decl.cs (DeclSpace.LookupType): Removed convenience function and
23897         make all the code call directly LookupType in RootContext and take
23898         this chance to pass the Location information everywhere.
23899
23900         * Everywhere: pass Location information.
23901
23902 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
23903
23904         * class.cs (Constructor.Define): Updated way of detecting the
23905         length of the parameters.
23906
23907         (TypeContainer.DefineType): Use basename as the type name for
23908         nested types.
23909
23910         (TypeContainer.Define): Do not recursively define types here, as
23911         definition is taken care in order by the RootContext.
23912
23913         * tree.cs: Keep track of namespaces in a per-file basis.
23914
23915         * parameter.cs (Parameter.ComputeSignature): Update to use
23916         DeclSpace. 
23917
23918         (Parameters.GetSignature): ditto.
23919
23920         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
23921         instead of a TypeContainer.
23922
23923         (Interface.SemanticAnalysis): Use `this' instead of our parent to
23924         resolve names.  Because we need to be resolve in our context, not
23925         our parents.
23926
23927         * driver.cs: Implement response files.
23928
23929         * class.cs (TypeContainer.DefineType): If we are defined, do not
23930         redefine ourselves.
23931
23932         (Event.Emit): Emit the code for add/remove handlers.
23933         (Event.Define): Save the MethodBuilders for add/remove.
23934
23935         * typemanager.cs: Use pair here too.
23936
23937         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
23938         DictionaryEntry requires the first argument to be non-null.  
23939
23940         (enum_declaration): Compute full name for registering the
23941         enumeration.
23942
23943         (delegate_declaration): Instead of using
23944         formal_parameter_list, use opt_formal_parameter_list as the list
23945         can be empty.
23946
23947         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
23948         (EventParsing): New property that controls whether `add' and
23949         `remove' are returned as tokens or identifiers (for events);
23950
23951 2001-12-19  Ravi Pratap  <ravi@ximian.com>
23952
23953         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
23954         use MyEventBuilder only and let it wrap the real builder for us.
23955
23956         (MyEventBuilder): Revamp constructor etc.
23957
23958         Implement all operations that we perform on EventBuilder in precisely the same
23959         way here too.
23960
23961         (FindMembers): Update to use the EventBuilder member.
23962
23963         (Event.Emit): Update accordingly.
23964
23965 2001-12-18  Ravi Pratap  <ravi@ximian.com>
23966
23967         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
23968         by calling the appropriate methods.
23969
23970         (GetCustomAttributes): Make stubs as they cannot possibly do anything
23971         useful.
23972
23973         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
23974
23975 2001-12-17  Ravi Pratap  <ravi@ximian.com>
23976
23977         * delegate.cs (Delegate.Populate): Check that the return type
23978         and various parameters types are indeed accessible.
23979
23980         * class.cs (Constructor.Define): Same here.
23981
23982         (Field.Define): Ditto.
23983
23984         (Event.Define): Ditto.
23985
23986         (Operator.Define): Check that the underlying Method defined itself
23987         correctly - so it's MethodBuilder should not be null.
23988
23989         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
23990         expression happens to be null.
23991
23992         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
23993         members but as of now we don't seem to be able to do anything really useful with it.
23994
23995         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
23996         not the EventBuilder.
23997
23998 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
23999
24000         * cs-tokenizer.cs: Add support for defines.
24001         Add support for #if, #elif, #else, #endif
24002
24003         (eval_var): evaluates a variable.
24004         (eval): stubbed for evaluating functions.
24005
24006         * cs-parser.jay: Pass the defines information
24007
24008         * driver.cs: Add --define command line option.
24009
24010         * decl.cs: Move MemberCore here.
24011
24012         Make it the base class for DeclSpace.  This allows us to catch and
24013         report 108 and 109 for everything now.
24014
24015         * class.cs (TypeContainer.Define): Extract all the members
24016         before populating and emit the warning 108 (new keyword required
24017         to override) instead of having each member implement this.
24018
24019         (MemberCore.Define): New abstract method, we will be using this in
24020         the warning reporting engine in Populate.
24021
24022         (Operator.Define): Adjust to new MemberCore protocol. 
24023
24024         * const.cs (Const): This does not derive from Expression, it is a
24025         temporary object we use to create fields, it is a MemberCore. 
24026
24027         * class.cs (Method.Define): Allow the entry point to be in a
24028         specific class.
24029
24030         * driver.cs: Rewrite the argument handler to clean it up a bit.
24031
24032         * rootcontext.cs: Made it just an auxiliary namespace feature by
24033         making everything static.
24034
24035         * driver.cs: Adapt code to use RootContext type name instead of
24036         instance variable.
24037
24038         * delegate.cs: Remove RootContext argument.
24039
24040         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
24041         argument. 
24042
24043         * class.cs (Event.Define): The lookup can fail.
24044
24045         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
24046
24047         * expression.cs: Resolve the this instance before invoking the code.
24048
24049 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
24050
24051         * cs-parser.jay: Add a production in element_access that allows
24052         the thing to become a "type" reference.  This way we can parse
24053         things like "(string [])" as a type.
24054
24055         Note that this still does not handle the more complex rules of
24056         casts. 
24057
24058
24059         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
24060
24061         * ecore.cs: (CopyNewMethods): new utility function used to
24062         assemble the list of methods from running FindMembers.
24063
24064         (MemberLookup): Rework FindMembers so that 
24065
24066 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
24067
24068         * class.cs (TypeContainer): Remove Delegates who fail to be
24069         defined.
24070
24071         * delegate.cs (Populate): Verify that we dont get null return
24072         values.   TODO: Check for AsAccessible.
24073
24074         * cs-parser.jay: Use basename to emit error 574 (destructor should
24075         have the same name as container class), not the full name.
24076
24077         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
24078         possible representation.  
24079
24080         Also implements integer type suffixes U and L.
24081
24082 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
24083
24084         * expression.cs (ArrayCreation.DoResolve): We need to do the
24085         argument resolution *always*.
24086
24087         * decl.cs: Make this hold the namespace.  Hold the root context as
24088         well.
24089         (LookupType): Move here.
24090
24091         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
24092
24093         * location.cs (Row, Name): Fixed the code, it was always returning
24094         references to the first file.
24095
24096         * interface.cs: Register properties defined through interfaces.
24097
24098         * driver.cs: Add support for globbing on the command line
24099
24100         * class.cs (Field): Make it derive from MemberCore as well.
24101         (Event): ditto.
24102
24103 2001-12-15  Ravi Pratap  <ravi@ximian.com>
24104
24105         * class.cs (Event::Define): Check that the type of the event is a delegate
24106         type else flag error #66.
24107
24108         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
24109         same.
24110
24111         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
24112         values of EntryPoint, CharSet etc etc.
24113
24114         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
24115
24116         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
24117         be null and we should ignore this. I am not sure if this is really clean. Apparently,
24118         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
24119         which needs this to do its work.
24120
24121         * ../errors/cs0066.cs : Add.
24122
24123 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
24124
24125         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
24126         helper functions.
24127
24128         * class.cs: (MethodSignature.MethodSignature): Removed hack that
24129         clears out the parameters field.
24130         (MemberSignatureCompare): Cleanup
24131
24132         (MemberCore): New base class used to share code between MethodCore
24133         and Property.
24134
24135         (RegisterRequiredImplementations) BindingFlags.Public requires
24136         either BindingFlags.Instace or Static.  Use instance here.
24137
24138         (Property): Refactored code to cope better with the full spec.
24139
24140         * parameter.cs (GetParameterInfo): Return an empty array instead
24141         of null on error.
24142
24143         * class.cs (Property): Abstract or extern properties have no bodies.
24144
24145         * parameter.cs (GetParameterInfo): return a zero-sized array.
24146
24147         * class.cs (TypeContainer.MethodModifiersValid): Move all the
24148         method modifier validation to the typecontainer so we can reuse
24149         this on properties.
24150
24151         (MethodCore.ParameterTypes): return an empty sized array of types.
24152
24153         (Property.Define): Test property modifier validity.
24154
24155         Add tests for sealed/override too.
24156
24157         (Method.Emit): abstract or extern methods have no bodies.
24158
24159 2001-12-14  Ravi Pratap  <ravi@ximian.com>
24160
24161         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
24162         thing.
24163
24164         (Method::Define, ::Emit): Modify accordingly.
24165
24166         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
24167
24168         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
24169
24170         * makefile: Pass in /unsafe.
24171
24172 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
24173
24174         * class.cs (MakeKey): Kill routine.
24175
24176         * class.cs (TypeContainer.Define): Correctly define explicit
24177         method implementations (they require the full interface name plus
24178         the method name).
24179
24180         * typemanager.cs: Deply the PtrHashtable here and stop using the
24181         lame keys.  Things work so much better.
24182
24183         This of course broke everyone who depended on `RegisterMethod' to
24184         do the `test for existance' test.  This has to be done elsewhere.
24185
24186         * support.cs (PtrHashtable): A hashtable that avoid comparing with
24187         the object stupid Equals method (because, that like fails all over
24188         the place).  We still do not use it.
24189
24190         * class.cs (TypeContainer.SetRequiredInterface,
24191         TypeContainer.RequireMethods): Killed these two routines and moved
24192         all the functionality to RegisterRequiredImplementations.
24193
24194         (TypeContainer.RegisterRequiredImplementations): This routine now
24195         registers all the implementations required in an array for the
24196         interfaces and abstract methods.  We use an array of structures
24197         which can be computed ahead of time to reduce memory usage and we
24198         also assume that lookups are cheap as most classes will not
24199         implement too many interfaces.
24200
24201         We also avoid creating too many MethodSignatures.
24202
24203         (TypeContainer.IsInterfaceMethod): Update and optionally does not
24204         clear the "pending" bit if we find that there are problems with
24205         the declaration.
24206
24207         (TypeContainer.VerifyPendingMethods): Update to report errors of
24208         methods that look like implementations but are not.
24209
24210         (TypeContainer.Define): Add support for explicit interface method
24211         implementation. 
24212
24213 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
24214
24215         * typemanager.cs: Keep track of the parameters here instead of
24216         being a feature of the TypeContainer.
24217
24218         * class.cs: Drop the registration of parameters here, as
24219         InterfaceMethods are also interface declarations.
24220
24221         * delegate.cs: Register methods with the TypeManager not only with
24222         the TypeContainer.  This code was buggy.
24223
24224         * interface.cs: Full registation here.
24225
24226 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
24227
24228         * expression.cs: Remove reducer for binary expressions, it can not
24229         be done this way.
24230
24231         * const.cs: Put here the code that used to go into constant.cs
24232
24233         * constant.cs: Put here the code for constants, this is a new base
24234         class for Literals.
24235
24236         * literal.cs: Make Literal derive from Constant.
24237
24238 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
24239
24240         * statement.cs (Return.Emit): Report error 157 if the user
24241         attempts to return from a finally block.
24242
24243         (Return.Emit): Instead of emitting a return, jump to the end of
24244         the function.
24245
24246         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
24247         LocalBuilder to store the result of the function.  ReturnLabel is
24248         the target where we jump.
24249
24250
24251 2001-12-09  Radek Doulik  <rodo@ximian.com>
24252
24253         * cs-parser.jay: remember alias in current namespace
24254
24255         * ecore.cs (SimpleName::DoResolve): use aliases for types or
24256         namespaces
24257
24258         * class.cs (LookupAlias): lookup alias in my_namespace
24259
24260         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
24261         aliases hashtable
24262         (LookupAlias): lookup alias in this and if needed in parent
24263         namespaces
24264
24265 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
24266
24267         * support.cs: 
24268
24269         * rootcontext.cs: (ModuleBuilder) Made static, first step into
24270         making things static.  I need this to avoid passing the
24271         TypeContainer when calling ParameterType.
24272
24273         * support.cs (InternalParameters.ParameterType): Remove ugly hack
24274         that did string manipulation to compute the type and then call
24275         GetType.  Use Parameter.ParameterType instead.
24276
24277         * cs-tokenizer.cs: Consume the suffix for floating values.
24278
24279         * expression.cs (ParameterReference): figure out whether this is a
24280         reference parameter or not.  Kill an extra variable by computing
24281         the arg_idx during emission.
24282
24283         * parameter.cs (Parameters.GetParameterInfo): New overloaded
24284         function that returns whether a parameter is an out/ref value or not.
24285
24286         (Parameter.ParameterType): The type of the parameter (base,
24287         without ref/out applied).
24288
24289         (Parameter.Resolve): Perform resolution here.
24290         (Parameter.ExternalType): The full type (with ref/out applied).
24291
24292         * statement.cs (Using.Emit, Using.EmitExpression): Implement
24293         support for expressions on the using statement.
24294
24295 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
24296
24297         * statement.cs (Using.EmitLocalVariableDecls): Split the
24298         localvariable handling of the using statement.
24299
24300         (Block.EmitMeta): Keep track of variable count across blocks.  We
24301         were reusing slots on separate branches of blocks.
24302
24303         (Try.Emit): Emit the general code block, we were not emitting it. 
24304
24305         Check the type of the declaration to be an IDisposable or
24306         something that can be implicity converted to it. 
24307
24308         Emit conversions if required.
24309
24310         * ecore.cs (EmptyExpression): New utility class.
24311         (Expression.ImplicitConversionExists): New utility function.
24312
24313 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
24314
24315         * statement.cs (Using): Implement.
24316
24317         * expression.cs (LocalVariableReference): Support read only variables.
24318
24319         * statement.cs: Remove the explicit emit for the Leave opcode.
24320         (VariableInfo): Add a readonly field.
24321
24322 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
24323
24324         * ecore.cs (ConvCast): new class used to encapsulate the various
24325         explicit integer conversions that works in both checked and
24326         unchecked contexts.
24327
24328         (Expression.ConvertNumericExplicit): Use new ConvCast class to
24329         properly generate the overflow opcodes.
24330
24331 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
24332
24333         * statement.cs: The correct type for the EmptyExpression is the
24334         element_type, not the variable type.  Ravi pointed this out.
24335
24336 2001-12-04  Ravi Pratap  <ravi@ximian.com>
24337
24338         * class.cs (Method::Define): Handle PInvoke methods specially
24339         by using DefinePInvokeMethod instead of the usual one.
24340
24341         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
24342         above to do the task of extracting information and defining the method.
24343
24344 2001-12-04  Ravi Pratap  <ravi@ximian.com>
24345
24346         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
24347         of the condition for string type.
24348
24349         (Emit): Move that here. 
24350
24351         (ArrayCreation::CheckIndices): Keep string literals in their expression
24352         form.
24353
24354         (EmitDynamicInitializers): Handle strings appropriately.
24355
24356 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
24357
24358         * codegen.cs (EmitContext): Replace multiple variables with a
24359         single pointer to the current Switch statement.
24360
24361         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
24362         EmitContext.
24363
24364 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
24365
24366         * statement.cs 
24367
24368         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
24369         default'.
24370
24371         (Foreach.Emit): Foreach on arrays was not setting
24372         up the loop variables (for break/continue).
24373
24374         (GotoCase): Semi-implented.
24375
24376 2001-12-03  Ravi Pratap  <ravi@ximian.com>
24377
24378         * attribute.cs (CheckAttribute): Handle system attributes by using
24379         Attribute.GetAttributes to examine information we need.
24380
24381         (GetValidPlaces): Same here.
24382
24383         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
24384
24385         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
24386
24387         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
24388
24389         (Method::Define): Set appropriate flags if we have a DllImport attribute.
24390
24391         (Method::Emit): Handle the case when we are a PInvoke method.
24392
24393 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
24394
24395         * expression.cs: Use ResolveWithSimpleName on compound names.
24396
24397 2001-12-02  Ravi Pratap  <ravi@ximian.com>
24398
24399         * constant.cs (EmitConstant): Make sure we resolve the associated expression
24400         before trying to reduce it.
24401
24402         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
24403
24404         * constant.cs (LookupConstantValue): Implement.
24405
24406         (EmitConstant): Use the above in emitting the constant.
24407
24408         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
24409         that are user-defined by doing a LookupConstantValue on them.
24410
24411         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
24412         too, like above.
24413
24414 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
24415
24416         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
24417
24418         (BaseAccess.DoResolve): Implement.
24419
24420         (MemberAccess.DoResolve): Split this routine into a
24421         ResolveMemberAccess routine that can be used independently
24422
24423 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
24424
24425         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
24426         As that share bits of the implementation.  Is returns a boolean,
24427         while As returns the Type that is being probed.
24428
24429 2001-12-01  Ravi Pratap  <ravi@ximian.com>
24430
24431         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
24432         instead of a Literal - much easier.
24433
24434         (EnumInTransit): Remove - utterly useless :-)
24435
24436         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
24437
24438         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
24439
24440         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
24441         chain when we have no associated expression.
24442
24443 2001-11-30  Ravi Pratap  <ravi@ximian.com>
24444
24445         * constant.cs (Define): Use Location while reporting the errror.
24446
24447         Also emit a warning when 'new' is used and there is no inherited
24448         member to hide.
24449
24450         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
24451         populated.
24452
24453         (LookupEnumValue): Implement to lookup an enum member's value and define it
24454         if necessary.
24455
24456         (Populate): Re-write accordingly to use the above routine.
24457
24458 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
24459
24460         * expression.cs (This): Fix prototype for DoResolveLValue to
24461         override the base class DoResolveLValue.
24462
24463         * cs-parser.cs: Report errors cs574 and cs575 (destructor
24464         declarations) 
24465
24466         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
24467         (we need to load the address of the field here).  This fixes
24468         test-22. 
24469
24470         (FieldExpr.DoResolveLValue): Call the DoResolve
24471         function to initialize the Instance expression.
24472
24473         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
24474         correctly the GetEnumerator operation on a value type.
24475
24476         * cs-parser.jay: Add more simple parsing error catches.
24477
24478         * statement.cs (Switch): Add support for string switches.
24479         Handle null specially.
24480
24481         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
24482
24483 2001-11-28  Ravi Pratap  <ravi@ximian.com>
24484
24485         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
24486
24487         (declare_local_constant): New helper function.
24488
24489         * statement.cs (AddConstant): Keep a separate record of constants
24490
24491         (IsConstant): Implement to determine if a variable is a constant.
24492
24493         (GetConstantExpression): Implement.
24494
24495         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
24496
24497         * statement.cs (IsVariableDefined): Re-write.
24498
24499 2001-11-27  Ravi Pratap  <ravi@ximian.com>
24500
24501         * class.cs (TypeContainer::FindMembers): Look for constants
24502         in the case when we are looking for MemberTypes.Field
24503
24504         * expression.cs (MemberAccess::DoResolve): Check that in the
24505         case we are a FieldExpr and a Literal, we are not being accessed
24506         by an instance reference.
24507
24508         * cs-parser.jay (local_constant_declaration): Implement.
24509
24510         (declaration_statement): Implement for constant declarations.
24511
24512 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
24513
24514         * statement.cs (Switch): Catch double defaults.
24515
24516         (Switch): More work on the switch() statement
24517         implementation.  It works for integral values now, need to finish
24518         string support.
24519
24520
24521 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
24522
24523         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
24524         integer literals into other integer literals.  To be used by
24525         switch. 
24526
24527 2001-11-24  Ravi Pratap  <ravi@ximian.com>
24528
24529         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
24530         some memory.
24531
24532         (EmitDynamicInitializers): Cope with the above since we extract data
24533         directly from ArrayData now.
24534
24535         (ExpectInitializers): Keep track of whether initializers are mandatory
24536         or not.
24537
24538         (Bounds): Make it a hashtable to prevent the same dimension being 
24539         recorded for every element in that dimension.
24540
24541         (EmitDynamicInitializers): Fix bug which prevented the Set array method
24542         from being found.
24543
24544         Also fix bug which was causing the indices to be emitted in the reverse
24545         order.
24546
24547 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
24548
24549         * expression.cs (ArrayCreation): Implement the bits that Ravi left
24550         unfinished.  They do not work, because the underlying code is
24551         sloppy.
24552
24553 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
24554
24555         * cs-parser.jay: Remove bogus fixme.
24556
24557         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
24558         on Switch statement.
24559
24560 2001-11-23  Ravi Pratap  <ravi@ximian.com>
24561
24562         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
24563         the same. 
24564
24565         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
24566         parameter. Apparently, any expression is allowed. 
24567
24568         (ValidateInitializers): Update accordingly.
24569
24570         (CheckIndices): Fix some tricky bugs thanks to recursion.
24571
24572         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
24573         I was being completely brain-dead.
24574
24575         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
24576         and re-write acordingly.
24577
24578         (DelegateInvocation): Re-write accordingly.
24579
24580         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
24581
24582         (MakeByteBlob): Handle types more correctly.
24583
24584         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
24585         initialization from expressions but it is incomplete because I am a complete
24586         Dodo :-|
24587
24588 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
24589
24590         * statement.cs (If.Emit): Fix a bug that generated incorrect code
24591         on If.  Basically, we have to return `true' (ie, we do return to
24592         our caller) only if both branches of the if return.
24593
24594         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
24595         short-circuit operators, handle them as short circuit operators. 
24596
24597         (Cast.DoResolve): Resolve type.
24598         (Cast.Cast): Take an expression as the target type.
24599
24600         * cs-parser.jay (cast_expression): Remove old hack that only
24601         allowed a limited set of types to be handled.  Now we take a
24602         unary_expression and we resolve to a type during semantic
24603         analysis.
24604
24605         Use the grammar productions from Rhys to handle casts (this is
24606         not complete like Rhys syntax yet, we fail to handle that corner
24607         case that C# has regarding (-x), but we will get there.
24608
24609 2001-11-22  Ravi Pratap  <ravi@ximian.com>
24610
24611         * class.cs (EmitFieldInitializer): Take care of the case when we have a
24612         field which is an array type.
24613
24614         * cs-parser.jay (declare_local_variables): Support array initialization too.
24615
24616         * typemanager.cs (MakeKey): Implement.
24617
24618         (everywhere): Use the above appropriately.
24619
24620         * cs-parser.jay (for_statement): Update for array initialization while
24621         declaring variables.
24622
24623         * ecore.cs : The error message was correct, it's the variable's names that
24624         were misleading ;-) Make the code more readable.
24625
24626         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
24627         the correct type etc.
24628
24629         (ConvertExplicit): Handle Enum types by examining the underlying type.
24630
24631 2001-11-21  Ravi Pratap  <ravi@ximian.com>
24632
24633         * parameter.cs (GetCallingConvention): Always return
24634         CallingConventions.Standard for now.
24635
24636 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
24637
24638         * expression.cs (Binary.ResolveOperator): Update the values of `l'
24639         and `r' after calling DoNumericPromotions.
24640
24641         * ecore.cs: Fix error message (the types were in the wrong order).
24642
24643         * statement.cs (Foreach.ProbeCollectionType): Need to pass
24644         BindingFlags.Instance as well 
24645
24646         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
24647         implicit int literal conversion in an empty cast so that we
24648         propagate the right type upstream.
24649
24650         (UnboxCast): new class used to unbox value types.
24651         (Expression.ConvertExplicit): Add explicit type conversions done
24652         by unboxing.
24653
24654         (Expression.ImplicitNumericConversion): Oops, forgot to test for
24655         the target type before applying the implicit LongLiterals to ULong
24656         literal cast.
24657
24658 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
24659
24660         * cs-parser.jay (for_statement): Reworked the way For works: now
24661         we declare manually any variables that are introduced in
24662         for_initializer to solve the problem of having out-of-band code
24663         emition (that is what got for broken).
24664
24665         (declaration_statement): Perform the actual variable declaration
24666         that used to be done in local_variable_declaration here.
24667
24668         (local_variable_declaration): Do not declare anything, just pass
24669         the information on a DictionaryEntry
24670
24671 2001-11-20  Ravi Pratap  <ravi@ximian.com>
24672
24673         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
24674         re-write of the logic to now make it recursive.
24675
24676         (UpdateIndices): Re-write accordingly.
24677
24678         Store element data in a separate ArrayData list in the above methods.
24679
24680         (MakeByteBlob): Implement to dump the array data into a byte array.
24681
24682 2001-11-19  Ravi Pratap  <ravi@ximian.com>
24683
24684         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
24685         into CheckIndices.
24686
24687         * constant.cs (Define): Implement.
24688
24689         (EmitConstant): Re-write fully.
24690
24691         Pass in location info.
24692
24693         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
24694         respectively.
24695
24696         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
24697         DictionaryEntry since we need location info too.
24698
24699         (constant_declaration): Update accordingly.
24700
24701         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
24702         code into another method : UpdateIndices.
24703
24704 2001-11-18  Ravi Pratap  <ravi@ximian.com>
24705
24706         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
24707         some type checking etc.
24708
24709 2001-11-17  Ravi Pratap  <ravi@ximian.com>
24710
24711         * expression.cs (ArrayCreation::ValidateInitializers): Implement
24712         bits to provide dimension info if the user skips doing that.
24713
24714         Update second constructor to store the rank correctly.
24715
24716 2001-11-16  Ravi Pratap  <ravi@ximian.com>
24717
24718         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
24719         and try to implement.
24720
24721         * ../errors/cs0150.cs : Add.
24722
24723         * ../errors/cs0178.cs : Add.
24724
24725 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
24726
24727         * statement.cs: Implement foreach on multi-dimensional arrays. 
24728
24729         * parameter.cs (Parameters.GetParameterByName): Also lookup the
24730         name of the params argument.
24731
24732         * expression.cs: Use EmitStoreOpcode to get the right opcode while
24733         initializing the array.
24734
24735         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
24736         we can use this elsewhere.
24737
24738         * statement.cs: Finish implementation of foreach for single
24739         dimension arrays.
24740
24741         * cs-parser.jay: Use an out-of-band stack to pass information
24742         around, I wonder why I need this.
24743
24744         foreach_block: Make the new foreach_block the current_block.
24745
24746         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
24747         function used to return a static Parameters structure.  Used for
24748         empty parameters, as those are created very frequently.
24749
24750         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
24751
24752 2001-11-15  Ravi Pratap  <ravi@ximian.com>
24753
24754         * interface.cs : Default modifier is private, not public. The
24755         make verify test passes again.
24756
24757 2001-11-15  Ravi Pratap  <ravi@ximian.com>
24758
24759         * support.cs (ReflectionParameters): Fix logic to determine
24760         whether the last parameter is a params one. Test 9 passes again.
24761
24762         * delegate.cs (Populate): Register the builders we define with
24763         RegisterParameterForBuilder. Test 19 passes again.
24764
24765         * cs-parser.jay (property_declaration): Reference $6 instead
24766         of $$ to get at the location.
24767
24768         (indexer_declaration): Similar stuff.
24769
24770         (attribute): Ditto.
24771
24772         * class.cs (Property): Register parameters for the Get and Set methods
24773         if they exist. Test 23 passes again.
24774
24775         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
24776         call to EmitArguments as we are sure there aren't any params arguments. 
24777         Test 32 passes again.
24778
24779         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
24780         IndexOutOfRangeException. 
24781
24782         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
24783         Test 33 now passes again.
24784
24785 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
24786
24787         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
24788         broke a bunch of things.  Will have to come up with a better way
24789         of tracking locations.
24790
24791         * statement.cs: Implemented foreach for single dimension arrays.
24792
24793 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
24794
24795         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
24796         an error.  This removes the lookup from the critical path.
24797
24798         * cs-parser.jay: Removed use of temporary_loc, which is completely
24799         broken. 
24800
24801 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
24802
24803         * support.cs (ReflectionParameters.ParameterModifier): Report
24804         whether the argument is a PARAMS argument or not.
24805
24806         * class.cs: Set the attribute `ParamArrayAttribute' on the
24807         parameter argument.
24808
24809         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
24810         and cons_param_array_attribute (ConstructorInfo for
24811         ParamArrayAttribute)., 
24812
24813         * codegen.cs: Emit the return using the `Return' statement, that
24814         way we can report the error correctly for missing return values. 
24815
24816         * class.cs (Method.Emit): Clean up.
24817
24818         * expression.cs (Argument.Resolve): Take another argument: the
24819         location where this argument is used.  Notice that this is not
24820         part of the "Argument" class as to reduce the size of the
24821         structure (we know the approximate location anyways).
24822
24823         Test if the argument is a variable-reference, if not, then
24824         complain with a 206.
24825
24826         (Argument.Emit): Emit addresses of variables.
24827
24828         (Argument.FullDesc): Simplify.
24829
24830         (Invocation.DoResolve): Update for Argument.Resolve.
24831
24832         (ElementAccess.DoResolve): ditto.
24833
24834         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
24835         method should be virtual, as this method is always virtual.
24836
24837         (NewDelegate.DoResolve): Update for Argument.Resolve.
24838
24839         * class.cs (ConstructorInitializer.DoResolve): ditto.
24840
24841         * attribute.cs (Attribute.Resolve): ditto.
24842
24843 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
24844
24845         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
24846
24847         * expression.cs (ParameterReference): Drop IStackStorage and implement
24848         IAssignMethod instead. 
24849
24850         (LocalVariableReference): ditto.
24851
24852         * ecore.cs (FieldExpr): Drop IStackStorage and implement
24853         IAssignMethod instead. 
24854
24855 2001-11-13  Miguel de Icaza <miguel@ximian.com>
24856
24857         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
24858         enumerations that are used in heavily used structures derive from
24859         byte in a laughable and pathetic attempt to reduce memory usage.
24860         This is the kind of pre-optimzations that you should not do at
24861         home without adult supervision.
24862
24863         * expression.cs (UnaryMutator): New class, used to handle ++ and
24864         -- separatedly from the other unary operators.  Cleans up the
24865         code, and kills the ExpressionStatement dependency in Unary.
24866
24867         (Unary): Removed `method' and `Arguments' from this class, making
24868         it smaller, and moving it all to SimpleCall, so I can reuse this
24869         code in other locations and avoid creating a lot of transient data
24870         strucutres when not required.
24871
24872         * cs-parser.jay: Adjust for new changes.
24873
24874 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
24875
24876         * enum.cs (Enum.Populate): If there is a failure during
24877         definition, return
24878
24879         * cs-parser.jay (opt_enum_base): we used to catch type errors
24880         here, but this is really incorrect.  The type error should be
24881         catched during semantic analysis.
24882
24883 2001-12-11  Ravi Pratap  <ravi@ximian.com>
24884
24885         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
24886         current_local_parameters as expected since I, in my stupidity, had forgotten
24887         to do this :-)
24888
24889         * attribute.cs (GetValidPlaces): Fix stupid bug.
24890
24891         * class.cs (Method::Emit): Perform check on applicability of attributes.
24892
24893         (Constructor::Emit): Ditto.
24894
24895         (Field::Emit): Ditto.
24896
24897         (Field.Location): Store location information.
24898
24899         (Property, Event, Indexer, Operator): Ditto.
24900
24901         * cs-parser.jay (field_declaration): Pass in location for each field.
24902
24903         * ../errors/cs0592.cs : Add.
24904
24905 2001-11-12  Ravi Pratap  <ravi@ximian.com>
24906
24907         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
24908
24909         (InitCoreTypes): Update accordingly.
24910
24911         (RegisterAttrType, LookupAttr): Implement.
24912
24913         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
24914         info about the same.
24915
24916         (Resolve): Update to populate the above as necessary.
24917
24918         (Error592): Helper.
24919
24920         (GetValidPlaces): Helper to the above.
24921
24922         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
24923
24924         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
24925
24926 2001-11-12  Ravi Pratap  <ravi@ximian.com>
24927
24928         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
24929
24930         * ../errors/cs0617.cs : Add.
24931
24932 2001-11-11  Ravi Pratap  <ravi@ximian.com>
24933
24934         * enum.cs (Emit): Rename to Populate to be more consistent with what
24935         we expect it to do and when exactly it is called.
24936
24937         * class.cs, rootcontext.cs : Update accordingly.
24938
24939         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
24940         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
24941
24942         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
24943
24944         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
24945         of a fieldinfo using the above, when dealing with a FieldBuilder.
24946
24947 2001-11-10  Ravi Pratap  <ravi@ximian.com>
24948
24949         * ../errors/cs0031.cs : Add.
24950
24951         * ../errors/cs1008.cs : Add.
24952
24953         * ../errrors/cs0543.cs : Add.
24954
24955         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
24956         enum type.
24957
24958         (FindMembers): Implement.
24959
24960         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
24961         enums and delegates too.
24962
24963         (enum_types): Rename to builder_to_enum.
24964
24965         (delegate_types): Rename to builder_to_delegate.
24966
24967         * delegate.cs (FindMembers): Implement.
24968
24969 2001-11-09  Ravi Pratap  <ravi@ximian.com>
24970
24971         * typemanager.cs (IsEnumType): Implement.
24972
24973         * enum.cs (Emit): Re-write parts to account for the underlying type
24974         better and perform checking etc.
24975
24976         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
24977         of the underlying type.
24978
24979         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
24980         value
24981
24982         * enum.cs (error31): Helper to report error #31.
24983
24984         * cs-parser.jay (enum_declaration): Store location of each member too.
24985
24986         * enum.cs (member_to_location): New hashtable. 
24987
24988         (AddEnumMember): Update location hashtable.
24989
24990         (Emit): Use the location of each member while reporting errors.
24991
24992 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
24993
24994         * cs-parser.jay: A for_initializer if is a
24995         local_variable_declaration really ammount to have an implicit
24996         block with the variable declaration and no initializer for for.
24997
24998         * statement.cs (For.Emit): Cope with null initializers.
24999
25000         This fixes the infinite loop on for initializers.
25001
25002 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
25003
25004         * enum.cs: More cleanup.
25005
25006         * ecore.cs: Remove dead code.
25007
25008         * class.cs (Property.Emit): More simplification.
25009         (Event.Emit): ditto.
25010
25011         Reworked to have less levels of indentation.
25012
25013 2001-11-08  Ravi Pratap  <ravi@ximian.com>
25014
25015         * class.cs (Property): Emit attributes.
25016
25017         (Field): Ditto.
25018
25019         (Event): Ditto.
25020
25021         (Indexer): Ditto.
25022
25023         (Operator): Ditto.
25024
25025         * enum.cs (Emit): Ditto.
25026
25027         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
25028         Enums too.
25029
25030         * class.cs (Field, Event, etc.): Move attribute generation into the
25031         Emit method everywhere.
25032
25033         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
25034         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
25035         as we had no way of defining nested enums !
25036
25037         * rootcontext.cs : Adjust code accordingly.
25038
25039         * typemanager.cs (AddEnumType): To keep track of enum types separately.
25040
25041 2001-11-07  Ravi Pratap  <ravi@ximian.com>
25042
25043         * expression.cs (EvalConstantExpression): Move into ecore.cs
25044
25045         * enum.cs (Enum): Rename some members and make them public and readonly
25046         according to our convention.
25047
25048         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
25049         nothing else.
25050
25051         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
25052
25053         (Enum::Emit): Write a simple version for now which doesn't try to compute
25054         expressions. I shall modify this to be more robust in just a while.
25055
25056         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
25057
25058         (TypeContainer::CloseType): Create the Enum types too.
25059
25060         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
25061
25062         * expression.cs (EvalConstantExpression): Get rid of completely.
25063
25064         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
25065         user-defined values and other cases.
25066
25067         (IsValidEnumLiteral): Helper function.
25068
25069         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
25070         out there in the case we had a literal FieldExpr.
25071
25072         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
25073
25074         (Literalize): Revamp a bit to take two arguments.
25075
25076         (EnumLiteral): New class which derives from Literal to wrap enum literals.
25077
25078 2001-11-06  Ravi Pratap  <ravi@ximian.com>
25079
25080         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
25081
25082         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
25083
25084         (Resolve): Use the above to ensure we have proper initializers.
25085
25086 2001-11-05  Ravi Pratap  <ravi@ximian.com>
25087
25088         * expression.cs (Expression::EvalConstantExpression): New method to 
25089         evaluate constant expressions.
25090
25091         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
25092
25093 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
25094
25095         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
25096         in an array.
25097
25098         (Binary.ResolveOperator): Handle operator != (object a, object b)
25099         and operator == (object a, object b);
25100
25101         (Binary.DoNumericPromotions): Indicate whether the numeric
25102         promotion was possible.
25103
25104         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
25105         Implement.  
25106
25107         Made the ArrayAccess implement interface IAssignMethod instead of
25108         IStackStore as the order in which arguments are passed reflects
25109         this.
25110
25111         * assign.cs: Instead of using expr.ExprClass to select the way of
25112         assinging, probe for the IStackStore/IAssignMethod interfaces.
25113
25114         * typemanager.cs: Load InitializeArray definition.
25115
25116         * rootcontext.cs (RootContext.MakeStaticData): Used to define
25117         static data that can be used to initialize arrays. 
25118
25119 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
25120
25121         * expression.cs: Handle operator== and operator!= for booleans.
25122
25123         (Conditioal.Reduce): Implement reducer for the ?: operator.
25124
25125         (Conditional.Resolve): Implement dead code elimination.
25126
25127         (Binary.Resolve): Catch string literals and return a new
25128         concatenated string.
25129
25130         (Unary.Reduce): Implement reduction of unary expressions.
25131
25132         * ecore.cs: Split out the expression core handling here.
25133
25134         (Expression.Reduce): New method used to perform constant folding
25135         and CSE.  This is needed to support constant-expressions. 
25136
25137         * statement.cs (Statement.EmitBoolExpression): Pass true and false
25138         targets, and optimize for !x.
25139
25140 2001-11-04  Ravi Pratap  <ravi@ximian.com>
25141
25142         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
25143         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
25144         set custom atttributes.
25145
25146         * literal.cs (Literal::GetValue): New abstract method to return the actual
25147         value of the literal, cast as an object.
25148
25149         (*Literal): Implement GetValue method.
25150
25151         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
25152         expressions to the arraylist but objects of type Argument.
25153
25154         * class.cs (TypeContainer::Emit): Emit our attributes too.
25155
25156         (Method::Emit, Constructor::Emit): Ditto.
25157
25158         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
25159         to be ignoring earlier.
25160
25161 2001-11-03  Ravi Pratap  <ravi@ximian.com>
25162
25163         * attribute.cs (AttributeSection::Define): Implement to do the business
25164         of constructing a CustomAttributeBuilder.
25165
25166         (Attribute): New trivial class. Increases readability of code.  
25167
25168         * cs-parser.jay : Update accordingly.
25169
25170         (positional_argument_list, named_argument_list, named_argument): New rules
25171
25172         (attribute_arguments): Use the above so that we are more correct.
25173
25174 2001-11-02  Ravi Pratap  <ravi@ximian.com>
25175
25176         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
25177         to perform all checks for a method with a params parameter.
25178
25179         (Invocation::OverloadResolve): Update to use the above method and therefore
25180         cope correctly with params method invocations.
25181
25182         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
25183         params too.
25184
25185         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
25186         constructors in our parent too because we can't afford to miss out on 
25187         protected ones ;-)
25188
25189         * attribute.cs (AttributeSection): New name for the class Attribute
25190
25191         Other trivial changes to improve readability.
25192
25193         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
25194         use the new class names.
25195
25196 2001-11-01  Ravi Pratap  <ravi@ximian.com>
25197
25198         * class.cs (Method::Define): Complete definition for params types too
25199
25200         (Indexer::Define): Ditto.
25201
25202         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
25203         Cope everywhere with a request for info about the array parameter.
25204
25205 2001-11-01  Ravi Pratap  <ravi@ximian.com>
25206
25207         * tree.cs (RecordNamespace): Fix up to check for the correct key.
25208
25209         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
25210         local_variable_type to extract the string corresponding to the type.
25211
25212         (local_variable_type): Fixup the action to use the new helper method.
25213
25214         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
25215         go.
25216
25217         * expression.cs : Clean out code which uses the above.
25218
25219 2001-10-31  Ravi Pratap  <ravi@ximian.com>
25220
25221         * typemanager.cs (RegisterMethod): Check if we already have an existing key
25222         and bale out if necessary by returning a false.
25223
25224         (RegisterProperty): Ditto.
25225
25226         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
25227         and print out appropriate error messages.
25228
25229         * interface.cs (everywhere): Ditto.
25230
25231         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
25232         location to constructor.
25233
25234         * class.cs (Property, Event, Indexer): Update accordingly.
25235
25236         * ../errors/cs111.cs : Added.
25237
25238         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
25239         of a method, as laid down by the spec.
25240
25241         (Invocation::OverloadResolve): Use the above method.
25242
25243 2001-10-31  Ravi Pratap  <ravi@ximian.com>
25244
25245         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
25246         now take a TypeContainer and a Parameters object.
25247
25248         (ParameterData): Modify return type of ParameterModifier method to be 
25249         Parameter.Modifier and not a string.
25250
25251         (ReflectionParameters, InternalParameters): Update accordingly.
25252
25253         * expression.cs (Argument::GetParameterModifier): Same here.
25254
25255         * support.cs (InternalParameters::ParameterType): Find a better way of determining
25256         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
25257         symbol in it at all so maybe this is only for now.
25258
25259 2001-10-30  Ravi Pratap  <ravi@ximian.com>
25260
25261         * support.cs (InternalParameters): Constructor now takes an extra argument 
25262         which is the actual Parameters class.
25263
25264         (ParameterDesc): Update to provide info on ref/out modifiers.
25265
25266         * class.cs (everywhere): Update call to InternalParameters to pass in
25267         the second argument too.
25268
25269         * support.cs (ParameterData): Add ParameterModifier, which is a method 
25270         to return the modifier info [ref/out etc]
25271
25272         (InternalParameters, ReflectionParameters): Implement the above.
25273
25274         * expression.cs (Argument::ParameterModifier): Similar function to return
25275         info about the argument's modifiers.
25276
25277         (Invocation::OverloadResolve): Update to take into account matching modifiers 
25278         too.
25279
25280         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
25281         a new SetFormalParameters object which we pass to InternalParameters.
25282
25283 2001-10-30  Ravi Pratap  <ravi@ximian.com>
25284
25285         * expression.cs (NewArray): Merge into the ArrayCreation class.
25286
25287 2001-10-29  Ravi Pratap  <ravi@ximian.com>
25288
25289         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
25290         NewUserdefinedArray into one as there wasn't much of a use in having
25291         two separate ones.
25292
25293         * expression.cs (Argument): Change field's name to ArgType from Type.
25294
25295         (Type): New readonly property which returns the proper type, taking into 
25296         account ref/out modifiers.
25297
25298         (everywhere): Adjust code accordingly for the above.
25299
25300         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
25301         whether we are emitting for a ref or out parameter.
25302
25303         * expression.cs (Argument::Emit): Use the above field to set the state.
25304
25305         (LocalVariableReference::Emit): Update to honour the flag and emit the
25306         right stuff.
25307
25308         * parameter.cs (Attributes): Set the correct flags for ref parameters.
25309
25310         * expression.cs (Argument::FullDesc): New function to provide a full desc.
25311
25312         * support.cs (ParameterData): Add method ParameterDesc to the interface.
25313
25314         (ReflectionParameters, InternalParameters): Implement the above method.
25315
25316         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
25317         reporting errors.
25318
25319         (Invocation::FullMethodDesc): Ditto. 
25320
25321 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
25322
25323         * cs-parser.jay: Add extra production for the second form of array
25324         creation. 
25325
25326         * expression.cs (ArrayCreation): Update to reflect the above
25327         change. 
25328
25329         * Small changes to prepare for Array initialization.
25330
25331 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
25332
25333         * typemanager.cs (ImplementsInterface): interface might be null;
25334         Deal with this problem;
25335
25336         Also, we do store negative hits on the cache (null values), so use
25337         this instead of calling t.GetInterfaces on the type everytime.
25338
25339 2001-10-28  Ravi Pratap  <ravi@ximian.com>
25340
25341         * typemanager.cs (IsBuiltinType): New method to help determine the same.
25342
25343         * expression.cs (New::DoResolve): Get rid of array creation code and instead
25344         split functionality out into different classes.
25345
25346         (New::FormArrayType): Move into NewBuiltinArray.
25347
25348         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
25349         quite useless.
25350
25351         (NewBuiltinArray): New class to handle creation of built-in arrays.
25352
25353         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
25354         account creation of one-dimensional arrays.
25355
25356         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
25357
25358         (NewUserdefinedArray::DoResolve): Implement.
25359
25360         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
25361
25362         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
25363         we maintain inside the TypeManager. This is necessary to perform lookups on the
25364         module builder.
25365
25366         (LookupType): Update to perform GetType on the module builders too.     
25367
25368         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
25369
25370         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
25371
25372 2001-10-23  Ravi Pratap  <ravi@ximian.com>
25373
25374         * expression.cs (New::DoResolve): Implement guts of array creation.
25375
25376         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
25377
25378 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
25379
25380         * expression.cs: Fix bug I introduced lsat night that broke
25381         Delegates. 
25382
25383         (Expression.Resolve): Report a 246 error (can not resolve name)
25384         if we find a SimpleName in the stream.
25385
25386         (Expression.ResolveLValue): Ditto.
25387
25388         (Expression.ResolveWithSimpleName): This function is a variant of
25389         ResolveName, this one allows SimpleNames to be returned without a
25390         warning.  The only consumer of SimpleNames is MemberAccess
25391
25392 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
25393
25394         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
25395         might arrive here.  I have my doubts that this is correct.
25396
25397         * statement.cs (Lock): Implement lock statement.
25398
25399         * cs-parser.jay: Small fixes to support `lock' and `using'
25400
25401         * cs-tokenizer.cs: Remove extra space
25402
25403         * driver.cs: New flag --checked, allows to turn on integer math
25404         checking. 
25405
25406         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
25407         Threading.Monitor.Exit 
25408
25409 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
25410
25411         * expression.cs (IndexerAccess::DoResolveLValue): Set the
25412         Expression Class to be IndexerAccess.
25413
25414         Notice that Indexer::DoResolve sets the eclass to Value.
25415
25416 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
25417
25418         * class.cs (TypeContainer::Emit): Emit code for indexers.
25419
25420         * assign.cs (IAssignMethod): New interface implemented by Indexers
25421         and Properties for handling assignment.
25422
25423         (Assign::Emit): Simplify and reuse code. 
25424
25425         * expression.cs (IndexerAccess, PropertyExpr): Implement
25426         IAssignMethod, clean up old code. 
25427
25428 2001-10-22  Ravi Pratap  <ravi@ximian.com>
25429
25430         * typemanager.cs (ImplementsInterface): New method to determine if a type
25431         implements a given interface. Provides a nice cache too.
25432
25433         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
25434         method.
25435
25436         (ConvertReferenceExplicit): Ditto.
25437
25438         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
25439         various methods, with correct names etc.
25440
25441         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
25442         Operator.UnaryNegation.
25443
25444         * cs-parser.jay (operator_declarator): Be a little clever in the case where
25445         we have a unary plus or minus operator.
25446
25447         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
25448         UnaryMinus.
25449
25450         * everywhere : update accordingly.
25451
25452         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
25453         respectively.
25454
25455         * class.cs (Method::Define): For the case where we are implementing a method
25456         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
25457         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
25458
25459 2001-10-21  Ravi Pratap  <ravi@ximian.com>
25460
25461         * interface.cs (FindMembers): Implement to work around S.R.E
25462         lameness.
25463
25464         * typemanager.cs (IsInterfaceType): Implement.
25465
25466         (FindMembers): Update to handle interface types too.
25467
25468         * expression.cs (ImplicitReferenceConversion): Re-write bits which
25469         use IsAssignableFrom as that is not correct - it doesn't work.
25470
25471         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
25472         and accordingly override EmitStatement.
25473
25474         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
25475         using the correct logic :-)
25476
25477 2001-10-19  Ravi Pratap  <ravi@ximian.com>
25478
25479         * ../errors/cs-11.cs : Add to demonstrate error -11 
25480
25481 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
25482
25483         * assign.cs (Assign::Resolve): Resolve right hand side first, and
25484         then pass this as a hint to ResolveLValue.
25485
25486         * expression.cs (FieldExpr): Add Location information
25487
25488         (FieldExpr::LValueResolve): Report assignment to readonly
25489         variable. 
25490
25491         (Expression::ExprClassFromMemberInfo): Pass location information.
25492
25493         (Expression::ResolveLValue): Add new method that resolves an
25494         LValue. 
25495
25496         (Expression::DoResolveLValue): Default invocation calls
25497         DoResolve. 
25498
25499         (Indexers): New class used to keep track of indexers in a given
25500         Type. 
25501
25502         (IStackStore): Renamed from LValue, as it did not really describe
25503         what this did.  Also ResolveLValue is gone from this interface and
25504         now is part of Expression.
25505
25506         (ElementAccess): Depending on the element access type
25507
25508         * typemanager.cs: Add `indexer_name_type' as a Core type
25509         (System.Runtime.CompilerServices.IndexerNameAttribute)
25510
25511         * statement.cs (Goto): Take a location.
25512
25513 2001-10-18  Ravi Pratap  <ravi@ximian.com>
25514
25515         * delegate.cs (Delegate::VerifyDelegate): New method to verify
25516         if two delegates are compatible.
25517
25518         (NewDelegate::DoResolve): Update to take care of the case when
25519         we instantiate a delegate from another delegate.
25520
25521         * typemanager.cs (FindMembers): Don't even try to look up members
25522         of Delegate types for now.
25523
25524 2001-10-18  Ravi Pratap  <ravi@ximian.com>
25525
25526         * delegate.cs (NewDelegate): New class to take care of delegate
25527         instantiation.
25528
25529         * expression.cs (New): Split the delegate related code out into 
25530         the NewDelegate class.
25531
25532         * delegate.cs (DelegateInvocation): New class to handle delegate 
25533         invocation.
25534
25535         * expression.cs (Invocation): Split out delegate related code into
25536         the DelegateInvocation class.
25537
25538 2001-10-17  Ravi Pratap  <ravi@ximian.com>
25539
25540         * expression.cs (New::DoResolve): Implement delegate creation fully
25541         and according to the spec.
25542
25543         (New::DoEmit): Update to handle delegates differently.
25544
25545         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
25546         because of which we were printing out arguments in reverse order !
25547
25548         * delegate.cs (VerifyMethod): Implement to check if the given method
25549         matches the delegate.
25550
25551         (FullDelegateDesc): Implement.
25552
25553         (VerifyApplicability): Implement.
25554
25555         * expression.cs (Invocation::DoResolve): Update to accordingly handle
25556         delegate invocations too.
25557
25558         (Invocation::Emit): Ditto.
25559
25560         * ../errors/cs1593.cs : Added.
25561
25562         * ../errors/cs1594.cs : Added.
25563
25564         * delegate.cs (InstanceExpression, TargetMethod): New properties.
25565
25566 2001-10-16  Ravi Pratap  <ravi@ximian.com>
25567
25568         * typemanager.cs (intptr_type): Core type for System.IntPtr
25569
25570         (InitCoreTypes): Update for the same.
25571
25572         (iasyncresult_type, asynccallback_type): Ditto.
25573
25574         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
25575         correct.
25576
25577         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
25578         too.
25579
25580         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
25581         the builders for the 4 members of a delegate type :-)
25582
25583         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
25584         type.
25585
25586         * expression.cs (New::DoResolve): Implement guts for delegate creation.
25587
25588         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
25589
25590 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
25591
25592         * statement.cs (Break::Emit): Implement.   
25593         (Continue::Emit): Implement.
25594
25595         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
25596         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
25597         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
25598         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
25599         end loop
25600
25601         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
25602         properties that track the label for the current loop (begin of the
25603         loop and end of the loop).
25604
25605 2001-10-15  Ravi Pratap  <ravi@ximian.com>
25606
25607         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
25608         use of emitting anything at all.
25609
25610         * class.cs, rootcontext.cs : Get rid of calls to the same.
25611
25612         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
25613
25614         (Populate): Define the constructor correctly and set the implementation
25615         attributes.
25616
25617         * typemanager.cs (delegate_types): New hashtable to hold delegates that
25618         have been defined.
25619
25620         (AddDelegateType): Implement.
25621
25622         (IsDelegateType): Implement helper method.
25623
25624         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
25625
25626         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
25627         and accordingly handle it.
25628
25629         * delegate.cs (Populate): Take TypeContainer argument.
25630         Implement bits to define the Invoke method. However, I still haven't figured out
25631         how to take care of the native int bit :-(
25632
25633         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
25634         Qualify the name of the delegate, not its return type !
25635
25636         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
25637         conversion.
25638
25639         (StandardConversionExists): Checking for array types turns out to be recursive.
25640
25641         (ConvertReferenceExplicit): Implement array conversion.
25642
25643         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
25644
25645 2001-10-12  Ravi Pratap  <ravi@ximian.com>
25646
25647         * cs-parser.jay (delegate_declaration): Store the fully qualified
25648         name as it is a type declaration.
25649
25650         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
25651         readonly.
25652
25653         (DefineDelegate): Renamed from Define. Does the same thing essentially,
25654         as TypeContainer::DefineType.
25655
25656         (Populate): Method in which all the definition of the various methods (Invoke)
25657         etc is done.
25658
25659         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
25660         see.
25661
25662         (CloseDelegate): Finally creates the delegate.
25663
25664         * class.cs (TypeContainer::DefineType): Update to define delegates.
25665         (Populate, Emit and CloseType): Do the same thing here too.
25666
25667         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
25668         delegates in all these operations.
25669
25670 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
25671
25672         * expression.cs: LocalTemporary: a new expression used to
25673         reference a temporary that has been created.
25674
25675         * assign.cs: Handle PropertyAccess back here, so that we can
25676         provide the proper semantic access to properties.
25677
25678         * expression.cs (Expression::ConvertReferenceExplicit): Implement
25679         a few more explicit conversions. 
25680
25681         * modifiers.cs: `NEW' modifier maps to HideBySig.
25682
25683         * expression.cs (PropertyExpr): Make this into an
25684         ExpressionStatement, and support the EmitStatement code path. 
25685
25686         Perform get/set error checking, clean up the interface.
25687
25688         * assign.cs: recognize PropertyExprs as targets, and if so, turn
25689         them into toplevel access objects.
25690
25691 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
25692
25693         * expression.cs: PropertyExpr::PropertyExpr: use work around the
25694         SRE.
25695
25696         * typemanager.cs: Keep track here of our PropertyBuilders again to
25697         work around lameness in SRE.
25698
25699 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
25700
25701         * expression.cs (LValue::LValueResolve): New method in the
25702         interface, used to perform a second resolution pass for LValues. 
25703
25704         (This::DoResolve): Catch the use of this in static methods.
25705
25706         (This::LValueResolve): Implement.
25707
25708         (This::Store): Remove warning, assigning to `this' in structures
25709         is 
25710
25711         (Invocation::Emit): Deal with invocation of
25712         methods on value types.  We need to pass the address to structure
25713         methods rather than the object itself.  (The equivalent code to
25714         emit "this" for structures leaves the entire structure on the
25715         stack instead of a pointer to it). 
25716
25717         (ParameterReference::DoResolve): Compute the real index for the
25718         argument based on whether the method takes or not a `this' pointer
25719         (ie, the method is static).
25720
25721         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
25722         value types returned from functions when we need to invoke a
25723         method on the sturcture.
25724
25725
25726 2001-10-11  Ravi Pratap  <ravi@ximian.com>
25727
25728         * class.cs (TypeContainer::DefineType): Method to actually do the business of
25729         defining the type in the Modulebuilder or Typebuilder. This is to take
25730         care of nested types which need to be defined on the TypeBuilder using
25731         DefineNestedMethod.
25732
25733         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
25734         methods in RootContext, only ported to be part of TypeContainer.
25735
25736         (TypeContainer::GetInterfaceOrClass): Ditto.
25737
25738         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
25739
25740         * interface.cs (Interface::DefineInterface): New method. Does exactly
25741         what RootContext.CreateInterface did earlier, only it takes care of nested types 
25742         too.
25743
25744         (Interface::GetInterfaces): Move from RootContext here and port.
25745
25746         (Interface::GetInterfaceByName): Same here.
25747
25748         * rootcontext.cs (ResolveTree): Re-write.
25749
25750         (PopulateTypes): Re-write.
25751
25752         * class.cs (TypeContainer::Populate): Populate nested types too.
25753         (TypeContainer::Emit): Emit nested members too.
25754
25755         * typemanager.cs (AddUserType): Do not make use of the FullName property,
25756         instead just use the name argument passed in as it is already fully
25757         qualified.
25758
25759         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
25760         to TypeContainer mapping to see if a type is user-defined.
25761
25762         * class.cs (TypeContainer::CloseType): Implement. 
25763
25764         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
25765         the default constructor.
25766
25767         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
25768         twice.
25769
25770         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
25771
25772         * interface.cs (CloseType): Create the type here.
25773
25774         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
25775         the hierarchy.
25776
25777         Remove all the methods which are now in TypeContainer.
25778
25779 2001-10-10  Ravi Pratap  <ravi@ximian.com>
25780
25781         * delegate.cs (Define): Re-write bits to define the delegate
25782         correctly.
25783
25784 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
25785
25786         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
25787
25788         * expression.cs (ImplicitReferenceConversion): handle null as well
25789         as a source to convert to any reference type.
25790
25791         * statement.cs (Return): Perform any implicit conversions to
25792         expected return type.  
25793
25794         Validate use of return statement.  
25795
25796         * codegen.cs (EmitContext): Pass the expected return type here.
25797
25798         * class.cs (Method, Constructor, Property): Pass expected return
25799         type to EmitContext.
25800
25801 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
25802
25803         * expression.cs: Make DoResolve take an EmitContext instead of a
25804         TypeContainer.
25805
25806         Replaced `l' and `location' for `loc', for consistency.
25807
25808         (Error, Warning): Remove unneeded Tc argument.
25809
25810         * assign.cs, literal.cs, constant.cs: Update to new calling
25811         convention. 
25812
25813         * codegen.cs: EmitContext now contains a flag indicating whether
25814         code is being generated in a static method or not.
25815
25816         * cs-parser.jay: DecomposeQI, new function that replaces the old
25817         QualifiedIdentifier.  Now we always decompose the assembled
25818         strings from qualified_identifier productions into a group of
25819         memberaccesses.
25820
25821 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
25822
25823         * rootcontext.cs: Deal with field-less struct types correctly now
25824         by passing the size option to Define Type.
25825
25826         * class.cs: Removed hack that created one static field. 
25827
25828 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
25829
25830         * statement.cs: Moved most of the code generation here. 
25831
25832 2001-10-09  Ravi Pratap  <ravi@ximian.com>
25833
25834         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
25835         seem very right.
25836
25837         (ElementAccess): Remove useless bits for now - keep checks as the spec
25838         says.
25839
25840 2001-10-08  Ravi Pratap  <ravi@ximian.com>
25841
25842         * expression.cs (ElementAccess::DoResolve): Remove my crap code
25843         and start performing checks according to the spec.
25844
25845 2001-10-07  Ravi Pratap  <ravi@ximian.com>
25846
25847         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
25848         rank_specifiers instead.
25849
25850         (rank_specifiers): Change the order in which the rank specifiers are stored
25851
25852         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
25853
25854         * expression.cs (ElementAccess): Implement the LValue interface too.
25855
25856 2001-10-06  Ravi Pratap  <ravi@ximian.com>
25857
25858         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
25859         except that user defined conversions are not included.
25860
25861         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
25862         perform the conversion of the return type, if necessary.
25863
25864         (New::DoResolve): Check whether we are creating an array or an object
25865         and accordingly do the needful.
25866
25867         (New::Emit): Same here.
25868
25869         (New::DoResolve): Implement guts of array creation.
25870
25871         (New::FormLookupType): Helper function.
25872
25873 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
25874
25875         * codegen.cs: Removed most of the code generation here, and move the
25876         corresponding code generation bits to the statement classes. 
25877
25878         Added support for try/catch/finalize and throw.
25879
25880         * cs-parser.jay: Added support for try/catch/finalize.
25881
25882         * class.cs: Catch static methods having the flags override,
25883         virtual or abstract.
25884
25885         * expression.cs (UserCast): This user cast was not really doing
25886         what it was supposed to do.  Which is to be born in fully resolved
25887         state.  Parts of the resolution were being performed at Emit time! 
25888
25889         Fixed this code.
25890
25891 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
25892
25893         * expression.cs: Implicity convert the result from UserCast.
25894
25895 2001-10-05  Ravi Pratap  <ravi@ximian.com>
25896
25897         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
25898         prevented it from working correctly. 
25899
25900         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
25901         merely ConvertImplicit.
25902
25903 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
25904
25905         * typemanager.cs: Make the LookupTypeContainer function static,
25906         and not per-instance.  
25907
25908         * class.cs: Make static FindMembers (the one that takes a Type
25909         argument). 
25910
25911         * codegen.cs: Add EmitForeach here.
25912
25913         * cs-parser.jay: Make foreach a toplevel object instead of the
25914         inline expansion, as we need to perform semantic analysis on it. 
25915
25916 2001-10-05  Ravi Pratap  <ravi@ximian.com>
25917
25918         * expression.cs (Expression::ImplicitUserConversion): Rename to
25919         UserDefinedConversion.
25920
25921         (Expression::UserDefinedConversion): Take an extra argument specifying 
25922         whether we look for explicit user conversions too.
25923
25924         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
25925
25926         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
25927
25928         (ExplicitUserConversion): Make it a call to UserDefinedConversion
25929         with the appropriate arguments.
25930
25931         * cs-parser.jay (cast_expression): Record location too.
25932
25933         * expression.cs (Cast): Record location info.
25934
25935         (Expression::ConvertExplicit): Take location argument.
25936
25937         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
25938         to determine if we are doing explicit conversions.
25939
25940         (UserCast::Emit): Update accordingly.
25941
25942         (Expression::ConvertExplicit): Report an error if everything fails.
25943
25944         * ../errors/cs0030.cs : Add.
25945
25946 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
25947
25948         * modifiers.cs: If the ABSTRACT keyword is present, also set the
25949         virtual and newslot bits. 
25950
25951         * class.cs (TypeContainer::RegisterRequiredImplementations):
25952         Record methods we need.
25953
25954         (TypeContainer::MakeKey): Helper function to make keys for
25955         MethodBases, since the Methodbase key is useless.
25956
25957         (TypeContainer::Populate): Call RegisterRequiredImplementations
25958         before defining the methods.   
25959
25960         Create a mapping for method_builders_to_methods ahead of time
25961         instead of inside a tight loop.
25962
25963         (::RequireMethods):  Accept an object as the data to set into the
25964         hashtable so we can report interface vs abstract method mismatch.
25965
25966 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
25967
25968         * report.cs: Make all of it static.
25969
25970         * rootcontext.cs: Drop object_type and value_type computations, as
25971         we have those in the TypeManager anyways.
25972
25973         Drop report instance variable too, now it is a global.
25974
25975         * driver.cs: Use try/catch on command line handling.
25976
25977         Add --probe option to debug the error reporting system with a test
25978         suite. 
25979
25980         * report.cs: Add support for exiting program when a probe
25981         condition is reached.
25982
25983 2001-10-03  Ravi Pratap  <ravi@ximian.com>
25984
25985         * expression.cs (Binary::DoNumericPromotions): Fix the case when
25986         we do a forcible conversion regardless of type, to check if 
25987         ForceConversion returns a null.
25988
25989         (Binary::error19): Use location to report error.
25990
25991         (Unary::error23): Use location here too.
25992
25993         * ../errors/cs0019.cs : Check in.
25994
25995         * ../errors/cs0023.cs : Check in.
25996
25997         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
25998         case of a non-null MethodInfo object with a length of 0 !
25999
26000         (Binary::ResolveOperator): Flag error if overload resolution fails to find
26001         an applicable member - according to the spec :-)
26002         Also fix logic to find members in base types.
26003
26004         (Unary::ResolveOperator): Same here.
26005
26006         (Unary::report23): Change name to error23 and make first argument a TypeContainer
26007         as I was getting thoroughly confused between this and error19 :-)
26008
26009         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
26010         (::FindMostEncompassedType): Implement.
26011         (::FindMostEncompassingType): Implement.
26012         (::StandardConversionExists): Implement.
26013
26014         (UserImplicitCast): Re-vamp. We now need info about most specific
26015         source and target types so that we can do the necessary conversions.
26016
26017         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
26018         mathematical union with no duplicates.
26019
26020 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
26021
26022         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
26023         in order from base classes to child classes, so that we can in
26024         child classes look up in our parent for method names and
26025         attributes (required for handling abstract, virtual, new, override
26026         constructs: we need to instrospect our base class, and if we dont
26027         populate the classes in order, the introspection might be
26028         incorrect.  For example, a method could query its parent before
26029         the parent has any methods and would determine that the parent has
26030         no abstract methods (while it could have had them)).
26031
26032         (RootContext::CreateType): Record the order in which we define the
26033         classes.
26034
26035 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
26036
26037         * class.cs (TypeContainer::Populate): Also method definitions can
26038         fail now, keep track of this.
26039
26040         (TypeContainer::FindMembers): Implement support for
26041         DeclaredOnly/noDeclaredOnly flag.
26042
26043         (Constructor::Emit) Return the ConstructorBuilder.
26044
26045         (Method::Emit) Return the MethodBuilder. 
26046         Check for abstract or virtual methods to be public.
26047
26048         * rootcontext.cs (RootContext::CreateType): Register all the
26049         abstract methods required for the class to be complete and the
26050         interface methods that must be implemented. 
26051
26052         * cs-parser.jay: Report error 501 (method requires body if it is
26053         not marked abstract or extern).
26054
26055         * expression.cs (TypeOf::Emit): Implement.
26056
26057         * typemanager.cs: runtime_handle_type, new global type.
26058
26059         * class.cs (Property::Emit): Generate code for properties.
26060
26061 2001-10-02  Ravi Pratap  <ravi@ximian.com>
26062
26063         * expression.cs (Unary::ResolveOperator): Find operators on base type
26064         too - we now conform exactly to the spec.
26065
26066         (Binary::ResolveOperator): Same here.
26067
26068         * class.cs (Operator::Define): Fix minor quirk in the tests.
26069
26070         * ../errors/cs0215.cs : Added.
26071
26072         * ../errors/cs0556.cs : Added.
26073
26074         * ../errors/cs0555.cs : Added.
26075
26076 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
26077
26078         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
26079         single integer which is really efficient
26080
26081 2001-10-01  Ravi Pratap  <ravi@ximian.com>
26082
26083         *  expression.cs (Expression::ImplicitUserConversion): Use location
26084         even in the case when we are examining True operators.
26085  
26086         * class.cs (Operator::Define): Perform extensive checks to conform
26087         with the rules for operator overloading in the spec.
26088
26089         * expression.cs (Expression::ImplicitReferenceConversion): Implement
26090         some of the other conversions mentioned in the spec.
26091
26092         * typemanager.cs (array_type): New static member for the System.Array built-in
26093         type.
26094
26095         (cloneable_interface): For System.ICloneable interface.
26096
26097         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
26098         we start resolving the tree and populating types.
26099
26100         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
26101  
26102 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
26103
26104         * expression.cs (Expression::ExprClassFromMemberInfo,
26105         Expression::Literalize): Create literal expressions from
26106         FieldInfos which are literals.
26107
26108         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
26109         type casts, because they were wrong.  The test suite in tests
26110         caught these ones.
26111
26112         (ImplicitNumericConversion): ushort to ulong requires a widening
26113         cast. 
26114
26115         Int32 constant to long requires widening cast as well.
26116
26117         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
26118         for integers because the type on the stack is not i4.
26119
26120 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
26121
26122         * expression.cs (report118): require location argument. 
26123
26124         * parameter.cs: Do not dereference potential null value.
26125
26126         * class.cs: Catch methods that lack the `new' keyword when
26127         overriding a name.  Report warnings when `new' is used without
26128         anything being there to override.
26129
26130         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
26131
26132         * class.cs: Only add constructor to hashtable if it is non-null
26133         (as now constructors can fail on define).
26134
26135         (TypeManager, Class, Struct): Take location arguments.
26136
26137         Catch field instance initialization in structs as errors.
26138
26139         accepting_filter: a new filter for FindMembers that is static so
26140         that we dont create an instance per invocation.
26141
26142         (Constructor::Define): Catch errors where a struct constructor is
26143         parameterless 
26144
26145         * cs-parser.jay: Pass location information for various new
26146         constructs. 
26147
26148         * delegate.cs (Delegate): take a location argument.
26149
26150         * driver.cs: Do not call EmitCode if there were problesm in the
26151         Definition of the types, as many Builders wont be there. 
26152
26153         * decl.cs (Decl::Decl): Require a location argument.
26154
26155         * cs-tokenizer.cs: Handle properly hex constants that can not fit
26156         into integers, and find the most appropiate integer for it.
26157
26158         * literal.cs: Implement ULongLiteral.
26159
26160         * rootcontext.cs: Provide better information about the location of
26161         failure when CreateType fails.
26162
26163 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
26164
26165         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
26166         as well.
26167
26168         * expression.cs (Binary::CheckShiftArguments): Add missing type
26169         computation.
26170         (Binary::ResolveOperator): Add type to the logical and and logical
26171         or, Bitwise And/Or and Exclusive Or code paths, it was missing
26172         before.
26173
26174         (Binary::DoNumericPromotions): In the case where either argument
26175         is ulong (and most signed types combined with ulong cause an
26176         error) perform implicit integer constant conversions as well.
26177
26178 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
26179
26180         * expression.cs (UserImplicitCast): Method should always be
26181         non-null. 
26182         (Invocation::BetterConversion): Simplified test for IntLiteral.
26183
26184         (Expression::ImplicitNumericConversion): Split this routine out.
26185         Put the code that performs implicit constant integer conversions
26186         here. 
26187
26188         (Expression::Resolve): Become a wrapper around DoResolve so we can
26189         check eclass and type being set after resolve.
26190
26191         (Invocation::Badness): Remove this dead function
26192
26193         (Binary::ResolveOperator): Do not compute the expensive argumnets
26194         unless we have a union for it.
26195
26196         (Probe::Emit): Is needs to do an isinst and then
26197         compare against null.
26198
26199         (::CanConvert): Added Location argument.  If the Location argument
26200         is null (Location.Null), then we do not report errors.  This is
26201         used by the `probe' mechanism of the Explicit conversion.  We do
26202         not want to generate an error for something that the user
26203         explicitly requested to be casted.  But the pipeline for an
26204         explicit cast first tests for potential implicit casts.
26205
26206         So for now, if the Location is null, it means `Probe only' to
26207         avoid adding another argument.   Might have to revise this
26208         strategy later.
26209
26210         (ClassCast): New class used to type cast objects into arbitrary
26211         classes (used in Explicit Reference Conversions).
26212
26213         Implement `as' as well.
26214
26215         Reverted all the patches from Ravi below: they were broken:
26216
26217                 * The use of `level' as a mechanism to stop recursive
26218                   invocations is wrong.  That was there just to catch the
26219                   bug with a strack trace but not as a way of addressing
26220                   the problem.
26221
26222                   To fix the problem we have to *understand* what is going
26223                   on and the interactions and come up with a plan, not
26224                   just get things going.
26225
26226                 * The use of the type conversion cache that I proposed
26227                   last night had an open topic: How does this work across
26228                   protection domains.  A user defined conversion might not
26229                   be public in the location where we are applying the
26230                   conversion, a different conversion might be selected
26231                   (ie, private A->B (better) but public B->A (worse),
26232                   inside A, A->B applies, but outside it, B->A will
26233                   apply).
26234
26235                 * On top of that (ie, even if the above is solved),
26236                   conversions in a cache need to be abstract.  Ie, `To
26237                   convert from an Int to a Short use an OpcodeCast', not
26238                   `To convert from an Int to a Short use the OpcodeCast on
26239                   the variable 5' (which is what this patch was doing).
26240
26241 2001-09-28  Ravi Pratap  <ravi@ximian.com>
26242
26243         * expression.cs (Invocation::ConversionExists): Re-write to use
26244         the conversion cache
26245
26246         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
26247         cache all conversions done, not just user-defined ones.
26248
26249         (Invocation::BetterConversion): The real culprit. Use ConversionExists
26250         to determine if a conversion exists instead of acutually trying to 
26251         perform the conversion. It's faster too.
26252
26253         (Expression::ConvertExplicit): Modify to use ConversionExists to check
26254         and only then attempt the implicit conversion.
26255
26256 2001-09-28  Ravi Pratap  <ravi@ximian.com>
26257
26258         * expression.cs (ConvertImplicit): Use a cache for conversions
26259         already found. Check level of recursion and bail out if necessary.
26260
26261 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
26262
26263         * typemanager.cs (string_concat_string_string, string_concat_object_object):
26264         Export standard methods that we expect for string operations.
26265
26266         * statement.cs (Block::UsageWarning): Track usage of variables and
26267         report the errors for not used variables.
26268
26269         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
26270         operator. 
26271
26272 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
26273
26274         * codegen.cs: remove unnneded code 
26275
26276         * expression.cs: Removed BuiltinTypeAccess class
26277
26278         Fix the order in which implicit conversions are
26279         done.  
26280
26281         The previous fixed dropped support for boxed conversions (adding a
26282         test to the test suite now)
26283
26284         (UserImplicitCast::CanConvert): Remove test for source being null,
26285         that code is broken.  We should not feed a null to begin with, if
26286         we do, then we should track the bug where the problem originates
26287         and not try to cover it up here.
26288
26289         Return a resolved expression of type UserImplicitCast on success
26290         rather than true/false.  Ravi: this is what I was talking about,
26291         the pattern is to use a static method as a "constructor" for
26292         objects. 
26293
26294         Also, do not create arguments until the very last minute,
26295         otherwise we always create the arguments even for lookups that
26296         will never be performed. 
26297
26298         (UserImplicitCast::Resolve): Eliminate, objects of type
26299         UserImplicitCast are born in a fully resolved state. 
26300
26301         * typemanager.cs (InitCoreTypes): Init also value_type
26302         (System.ValueType). 
26303
26304         * expression.cs (Cast::Resolve): First resolve the child expression.
26305
26306         (LValue): Add new method AddressOf to be used by
26307         the `&' operator.  
26308
26309         Change the argument of Store to take an EmitContext instead of an
26310         ILGenerator, because things like FieldExpr need to be able to call
26311         their children expression to generate the instance code. 
26312
26313         (Expression::Error, Expression::Warning): Sugar functions for
26314         reporting errors.
26315
26316         (Expression::MemberLookup): Accept a TypeContainer instead of a
26317         Report as the first argument.
26318
26319         (Expression::ResolvePrimary): Killed.  I still want to improve
26320         this as currently the code is just not right.
26321
26322         (Expression::ResolveMemberAccess): Simplify, but it is still
26323         wrong. 
26324
26325         (Unary::Resolve): Catch errors in AddressOf operators.
26326
26327         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
26328         index to a byte for the short-version, or the compiler will choose
26329         the wrong Emit call, which generates the wrong data.
26330
26331         (ParameterReference::Emit, ::Store): same.
26332
26333         (FieldExpr::AddressOf): Implement.
26334
26335         * typemanager.cs: TypeManager: made public variable instead of
26336         property.
26337
26338         * driver.cs: document --fatal.
26339
26340         * report.cs (ErrorMessage, WarningMessage): new names for the old
26341         Error and Warning classes.
26342
26343         * cs-parser.jay (member_access): Turn built-in access to types
26344         into a normal simplename
26345
26346 2001-09-27  Ravi Pratap  <ravi@ximian.com>
26347
26348         * expression.cs (Invocation::BetterConversion): Fix to cope
26349         with q being null, since this was introducing a bug.
26350
26351         * expression.cs (ConvertImplicit): Do built-in conversions first.
26352
26353 2001-09-27  Ravi Pratap  <ravi@ximian.com>
26354
26355         * expression.cs (UserImplicitCast::Resolve): Fix bug.
26356
26357 2001-09-27  Ravi Pratap  <ravi@ximian.com>
26358
26359         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
26360         I had introduced long ago (what's new ?).
26361
26362         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
26363         the work of all the checking. 
26364         (ConvertImplicit): Call CanConvert and only then create object if necessary.
26365         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
26366
26367         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
26368         that is the right way. 
26369
26370         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
26371         overloading resolution. Use everywhere instead of cutting and pasting code.
26372
26373         (Binary::ResolveOperator): Use MakeUnionSet.
26374
26375         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
26376         we have to convert to bool types. Not complete yet.
26377
26378 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
26379
26380         * typemanager.cs (TypeManager::CSharpName): support ushort.
26381
26382         * expression.cs (Expression::TryImplicitIntConversion): Attempts
26383         to provide an expression that performsn an implicit constant int
26384         conversion (section 6.1.6).
26385         (Expression::ConvertImplicitRequired): Reworked to include
26386         implicit constant expression conversions.
26387
26388         (Expression::ConvertNumericExplicit): Finished.
26389
26390         (Invocation::Emit): If InstanceExpression is null, then it means
26391         that we perform a call on this.
26392
26393 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
26394
26395         * expression.cs (Unary::Emit): Remove some dead code.
26396         (Probe): Implement Resolve and Emit for `is'.
26397         (Expression::ConvertImplicitRequired): Attempt to do constant
26398         expression conversions here.  Maybe should be moved to
26399         ConvertImplicit, but I am not sure.
26400         (Expression::ImplicitLongConstantConversionPossible,
26401         Expression::ImplicitIntConstantConversionPossible): New functions
26402         that tell whether is it possible to apply an implicit constant
26403         expression conversion.
26404
26405         (ConvertNumericExplicit): Started work on explicit numeric
26406         conversions.
26407
26408         * cs-parser.jay: Update operator constants.
26409
26410         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
26411         (Parameters::GetSignature): Hook up VerifyArgs here.
26412         (Parameters::VerifyArgs): Verifies that no two arguments have the
26413         same name. 
26414
26415         * class.cs (Operator): Update the operator names to reflect the
26416         ones that the spec expects (as we are just stringizing the
26417         operator names).
26418
26419         * expression.cs (Unary::ResolveOperator): Fix bug: Use
26420         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
26421         previous usage did only work for our methods.
26422         (Expression::ConvertImplicit): Handle decimal implicit numeric
26423         conversions as well.
26424         (Expression::InternalTypeConstructor): Used to invoke constructors
26425         on internal types for default promotions.
26426
26427         (Unary::Emit): Implement special handling for the pre/post
26428         increment/decrement for overloaded operators, as they need to have
26429         the same semantics as the other operators.
26430
26431         (Binary::ResolveOperator): ditto.
26432         (Invocation::ConversionExists): ditto.
26433         (UserImplicitCast::Resolve): ditto.
26434
26435 2001-09-26  Ravi Pratap  <ravi@ximian.com>
26436
26437         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
26438         operator, return after emitting body. Regression tests pass again !
26439
26440         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
26441         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
26442         (Invocation::OverloadResolve): Ditto.
26443         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
26444
26445         * everywhere : update calls to the above methods accordingly.
26446
26447 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
26448
26449         * assign.cs (Assign): Make it inherit from ExpressionStatement.
26450
26451         * expression.cs (ExpressionStatement): New base class used for
26452         expressions that can appear in statements, so that we can provide
26453         an alternate path to generate expression that do not leave a value
26454         on the stack.
26455
26456         (Expression::Emit, and all the derivatives): We no longer return
26457         whether a value is left on the stack or not.  Every expression
26458         after being emitted leaves a single value on the stack.
26459
26460         * codegen.cs (EmitContext::EmitStatementExpression): Use the
26461         facilties of ExpressionStatement if possible.
26462
26463         * cs-parser.jay: Update statement_expression.
26464
26465 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
26466
26467         * driver.cs: Change the wording of message
26468
26469 2001-09-25  Ravi Pratap  <ravi@ximian.com>
26470
26471         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
26472         the type of the expression to the return type of the method if
26473         we have an overloaded operator match ! The regression tests pass again !
26474         (Unary::ResolveOperator): Ditto.
26475
26476         * expression.cs (Invocation::ConversionExists): Correct the member lookup
26477         to find "op_Implicit", not "implicit" ;-)
26478         (UserImplicitCast): New class to take care of user-defined implicit conversions.
26479         (ConvertImplicit, ForceConversion): Take TypeContainer argument
26480
26481         * everywhere : Correct calls to the above accordingly.
26482
26483         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
26484         (ConvertImplicit): Do user-defined conversion if it exists.
26485
26486 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
26487
26488         * assign.cs: track location.
26489         (Resolve): Use implicit conversions on assignment.
26490
26491         * literal.cs: Oops.  Not good, Emit of short access values should
26492         pass (Bytes) or the wrong argument will be selected.
26493
26494         * expression.cs (Unary::Emit): Emit code for -expr.
26495
26496         (Unary::ResolveOperator): Handle `Substract' for non-constants
26497         (substract from zero from the non-constants).
26498         Deal with Doubles as well. 
26499
26500         (Expression::ConvertImplicitRequired): New routine that reports an
26501         error if no implicit conversion exists. 
26502
26503         (Invocation::OverloadResolve): Store the converted implicit
26504         expressions if we make them
26505
26506 2001-09-24  Ravi Pratap  <ravi@ximian.com>
26507
26508         * class.cs (ConstructorInitializer): Take a Location argument.
26509         (ConstructorBaseInitializer): Same here.
26510         (ConstructorThisInitializer): Same here.
26511
26512         * cs-parser.jay : Update all calls accordingly.
26513
26514         * expression.cs (Unary, Binary, New): Take location argument.
26515         Update accordingly everywhere.
26516
26517         * cs-parser.jay : Update all calls to the above to take a location
26518         argument.
26519
26520         * class.cs : Ditto.
26521
26522 2001-09-24  Ravi Pratap  <ravi@ximian.com>
26523
26524         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
26525         (Invocation::BetterConversion): Same here
26526         (Invocation::ConversionExists): Ditto.
26527
26528         (Invocation::ConversionExists): Implement.
26529
26530 2001-09-22  Ravi Pratap  <ravi@ximian.com>
26531
26532         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
26533         Also take an additional TypeContainer argument.
26534
26535         * All over : Pass in TypeContainer as argument to OverloadResolve.
26536
26537         * typemanager.cs (CSharpName): Update to check for the string type and return
26538         that too.
26539
26540         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
26541         a given method.
26542
26543 2001-09-21  Ravi Pratap  <ravi@ximian.com>
26544
26545         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
26546         (Invocation::BetterFunction): Implement.
26547         (Invocation::BetterConversion): Implement.
26548         (Invocation::ConversionExists): Skeleton, no implementation yet.
26549
26550         Okay, things work fine !
26551
26552 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
26553
26554         * typemanager.cs: declare and load enum_type, delegate_type and
26555         void_type. 
26556
26557         * expression.cs (Expression::Emit): Now emit returns a value that
26558         tells whether a value is left on the stack or not.  This strategy
26559         might be reveted tomorrow with a mechanism that would address
26560         multiple assignments.
26561         (Expression::report118): Utility routine to report mismatches on
26562         the ExprClass.
26563
26564         (Unary::Report23): Report impossible type/operator combination
26565         utility function.
26566
26567         (Unary::IsIncrementableNumber): Whether the type can be
26568         incremented or decremented with add.
26569         (Unary::ResolveOperator): Also allow enumerations to be bitwise
26570         complemented. 
26571         (Unary::ResolveOperator): Implement ++, !, ~,
26572
26573         (Invocation::Emit): Deal with new Emit convetion.
26574
26575         * All Expression derivatives: Updated their Emit method to return
26576         whether they leave values on the stack or not.
26577
26578         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
26579         stack for expressions that are statements. 
26580
26581 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
26582
26583         * expression.cs (LValue): New interface.  Must be implemented by
26584         LValue objects.
26585         (LocalVariableReference, ParameterReference, FieldExpr): Implement
26586         LValue interface.
26587
26588         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
26589         interface for generating code, simplifies the code.
26590
26591 2001-09-20  Ravi Pratap  <ravi@ximian.com>
26592
26593         * expression.cs (everywhere): Comment out return statements in ::Resolve
26594         methods to avoid the warnings.
26595
26596 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
26597
26598         * driver.cs (parse): Report error 2001 if we can not open the
26599         source file.
26600
26601         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
26602         not resolve it.
26603
26604         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
26605         object. 
26606
26607         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
26608         otherwise nested blocks end up with the same index.
26609
26610         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
26611
26612         * expression.cs:  Instead of having FIXMEs in the Resolve
26613         functions, throw exceptions so it is obvious that we are facing a
26614         bug. 
26615
26616         * cs-parser.jay (invocation_expression): Pass Location information.
26617
26618         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
26619         Use a basename for those routines because .NET does not like paths
26620         on them. 
26621
26622         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
26623         already defined.
26624
26625 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
26626
26627         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
26628         are loading the correct data types (throws an exception if not).
26629         (TypeManager::InitCoreTypes): Use CoreLookupType
26630
26631         * expression.cs (Unary::ResolveOperator): return the child
26632         expression for expressions which are just +expr.
26633         (Unary::ResolveOperator): Return negative literals for -LITERAL
26634         expressions (otherwise they are Unary {Literal}).
26635         (Invocation::Badness): Take into account `Implicit constant
26636         expression conversions'.
26637
26638         * literal.cs (LongLiteral): Implement long literal class.
26639         (IntLiteral): export the `Value' of the intliteral. 
26640
26641 2001-09-19  Ravi Pratap  <ravi@ximian.com>
26642
26643         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
26644
26645         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
26646         instead of 'Operator'
26647
26648         * expression.cs (Binary::ResolveOperator): Update accordingly.
26649         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
26650         and 'Minus'
26651
26652         * cs-parser.jay (unary_expression): Update to use the new names.
26653
26654         * gen-treedump.cs (GetUnary): Same here.
26655
26656         * expression.cs (Unary::Resolve): Implement.
26657         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
26658         operators are found instead of making noise ;-)
26659         (Unary::ResolveOperator): New method to do precisely the same thing which
26660         Binary::ResolveOperator does for Binary expressions.
26661         (Unary.method, .Arguments): Add.
26662         (Unary::OperName): Implement.   
26663         (Unary::ForceConversion): Copy and Paste !
26664
26665         * class.cs (Operator::Define): Fix a small bug for the case when we have 
26666         a unary operator.
26667
26668         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
26669         for the inbuilt operators. Only overloading works for now ;-)
26670
26671 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
26672
26673         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
26674         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
26675
26676         * expression.cs (This::Emit): Implement. 
26677         (This::Resolve): Implement.
26678         (TypeOf:Resolve): Implement.
26679         (Expression::ResolveSimpleName): Add an implicit this to instance
26680         field references. 
26681         (MemberAccess::Resolve): Deal with Parameters and Fields. 
26682         Bind instance variable to Field expressions.
26683         (FieldExpr::Instance): New field used to track the expression that
26684         represents the object instance.
26685         (FieldExpr::Resolve): Track potential errors from MemberLookup not
26686         binding 
26687         (FieldExpr::Emit): Implement.
26688
26689         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
26690         the last instruction contains a return opcode to avoid generating
26691         the last `ret' instruction (this generates correct code, and it is
26692         nice to pass the peverify output).
26693
26694         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
26695         initializer for static and instance variables.
26696         (Constructor::Emit): Allow initializer to be null in the case of
26697         static constructors.  Only emit initializer for instance
26698         constructors. 
26699
26700         (TypeContainer::FindMembers): Return a null array if there are no
26701         matches.
26702
26703         Also fix the code for the MemberTypes.Method branch, as it was not
26704         scanning that for operators (or tried to access null variables before).
26705
26706         * assign.cs (Assign::Emit): Handle instance and static fields. 
26707
26708         * TODO: Updated.
26709
26710         * driver.cs: Stop compilation if there are parse errors.
26711
26712         * cs-parser.jay (constructor_declaration): Provide default base
26713         initializer for non-static constructors.
26714         (constructor_declarator): Do not provide a default base
26715         initializers if none was specified.
26716         Catch the fact that constructors should not have parameters.
26717
26718         * class.cs: Do not emit parent class initializers for static
26719         constructors, that should be flagged as an error.
26720
26721 2001-09-18  Ravi Pratap  <ravi@ximian.com>
26722
26723         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
26724         Move back code into TypeContainer::Populate.
26725
26726 2001-09-18  Ravi Pratap  <ravi@ximian.com>
26727
26728         * class.cs (TypeContainer::AddConstructor): Fix the check to
26729         compare against Name, not Basename. 
26730         (Operator::OpType): Change Plus and Minus to Add and Subtract.
26731
26732         * cs-parser.jay : Update accordingly.
26733
26734         * class.cs (TypeContainer::FindMembers): For the case where we are searching
26735         for methods, don't forget to look into the operators too.
26736         (RegisterMethodBuilder): Helper method to take care of this for
26737         methods, constructors and operators.
26738         (Operator::Define): Completely revamp.
26739         (Operator.OperatorMethod, MethodName): New fields.
26740         (TypeContainer::Populate): Move the registering of builders into
26741         RegisterMethodBuilder.
26742         (Operator::Emit): Re-write.
26743
26744         * expression.cs (Binary::Emit): Comment out code path to emit method
26745         invocation stuff for the case when we have a user defined operator. I am
26746         just not able to get it right !
26747
26748 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
26749
26750         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
26751         argument. 
26752
26753         (Expression::MemberLookup): Provide a version that allows to
26754         specify the MemberTypes and BindingFlags. 
26755
26756         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
26757         so it was not fetching variable information from outer blocks.
26758
26759         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
26760         Beforefieldinit as it was buggy.
26761
26762         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
26763         that Ravi put here.  
26764
26765         * class.cs (Constructor::Emit): Only emit if block is not null.
26766         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
26767         deal with this by semantically definining it as if the user had
26768         done it.
26769
26770         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
26771         constructors as we now "emit" them at a higher level.
26772
26773         (TypeContainer::DefineDefaultConstructor): Used to define the
26774         default constructors if none was provided.
26775
26776         (ConstructorInitializer): Add methods Resolve and Emit. 
26777
26778         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
26779
26780 2001-09-17  Ravi Pratap  <ravi@ximian.com>
26781
26782         * class.cs (TypeContainer::EmitDefaultConstructor): Register
26783         the default constructor builder with our hashtable for methodbuilders
26784         to methodcores.
26785
26786         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
26787         and argument_count is 0 in which case we have a match.
26788         (Binary::ResolveOperator): More null checking and miscellaneous coding
26789         style cleanup.
26790
26791 2001-09-17  Ravi Pratap  <ravi@ximian.com>
26792
26793         * rootcontext.cs (IsNameSpace): Compare against null.
26794
26795         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
26796
26797         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
26798         and Unary::Operator.
26799
26800         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
26801         accordingly.
26802
26803         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
26804         we have overloaded operators.
26805         (Binary::ResolveOperator): Implement the part which does the operator overload
26806         resolution.
26807
26808         * class.cs (Operator::Emit): Implement.
26809         (TypeContainer::Emit): Emit the operators we have too.
26810
26811         * expression.cs (Binary::Emit): Update to emit the appropriate code for
26812         the case when we have a user-defined operator.
26813
26814 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
26815
26816         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
26817
26818 2001-09-16  Ravi Pratap  <ravi@ximian.com>
26819
26820         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
26821         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
26822         (Constructor::Emit): Implement.
26823         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
26824         if we have no work to do. 
26825         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
26826         Emit method.
26827
26828         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
26829         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
26830
26831         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
26832         of parent.parent.
26833
26834 2001-09-15  Ravi Pratap  <ravi@ximian.com>
26835
26836         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
26837         in the source.
26838         (Tree::RecordNamespace): Method to do what the name says ;-)
26839         (Tree::Namespaces): Property to get at the namespaces hashtable.
26840
26841         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
26842         keep track.
26843
26844         * rootcontext.cs (IsNamespace): Fixed it :-)
26845
26846 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
26847
26848         * class.cs (TypeContainer::FindMembers): Add support for
26849         constructors. 
26850         (MethodCore): New class that encapsulates both the shared aspects
26851         of a Constructor and a Method.  
26852         (Method, Constructor): Factored pieces into MethodCore.
26853
26854         * driver.cs: Added --fatal which makes errors throw exceptions.
26855         Load System assembly as well as part of the standard library.
26856
26857         * report.cs: Allow throwing exceptions on errors for debugging.
26858
26859         * modifiers.cs: Do not use `parent', instead use the real type
26860         container to evaluate permission settings.
26861
26862         * class.cs: Put Ravi's patch back in.  He is right, and we will
26863         have to cope with the
26864
26865 2001-09-14  Ravi Pratap  <ravi@ximian.com>
26866
26867         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
26868         FamORAssem, not FamANDAssem.
26869
26870 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
26871
26872         * driver.cs: Added --parse option that only parses its input files
26873         and terminates.
26874
26875         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
26876         incorrect.  IsTopLevel is not used to tell whether an object is
26877         root_types or not (that can be achieved by testing this ==
26878         root_types).  But to see if this is a top-level *class* (not
26879         necessarly our "toplevel" container). 
26880
26881 2001-09-14  Ravi Pratap  <ravi@ximian.com>
26882
26883         * enum.cs (Enum::Define): Modify to call the Lookup method on the
26884         parent instead of a direct call to GetType.
26885
26886 2001-09-14  Ravi Pratap  <ravi@ximian.com>
26887
26888         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
26889         Modifiers.TypeAttr. This should just be a call to that method.
26890
26891         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
26892         object so that we can determine if we are top-level or not.
26893
26894         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
26895         TypeContainer too.
26896
26897         * enum.cs (Enum::Define): Ditto.
26898
26899         * modifiers.cs (FieldAttr): Re-write.
26900
26901         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
26902         (TypeContainer::HaveStaticConstructor): New property to provide access
26903         to precisely that info.
26904
26905         * modifiers.cs (MethodAttr): Re-write.
26906         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
26907
26908         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
26909         of top-level types as claimed.
26910
26911 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
26912
26913         * expression.cs (MemberLookup): Fruitless attempt to lookup
26914         constructors.  Maybe I need to emit default constructors?  That
26915         might be it (currently .NET emits this for me automatically).
26916         (Invocation::OverloadResolve): Cope with Arguments == null.
26917         (Invocation::EmitArguments): new function, shared by the new
26918         constructor and us.
26919         (Invocation::Emit): Handle static and instance methods.  Emit
26920         proper call instruction for virtual or non-virtual invocations.
26921         (New::Emit): Implement.
26922         (New::Resolve): Implement.
26923         (MemberAccess:Resolve): Implement.
26924         (MethodGroupExpr::InstanceExpression): used conforming to the spec
26925         to track instances.
26926         (FieldExpr::Resolve): Set type.
26927
26928         * support.cs: Handle empty arguments.
26929                 
26930         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
26931         SimpleLookup): Auxiliary routines to help parse a qualifier
26932         identifier.  
26933
26934         Update qualifier_identifier rule.
26935
26936         * codegen.cs: Removed debugging messages.
26937
26938         * class.cs: Make this a global thing, this acts just as a "key" to
26939         objects that we might have around.
26940
26941         (Populate): Only initialize method_builders_to_methods once.
26942
26943         * expression.cs (PropertyExpr): Initialize type from the
26944         PropertyType. 
26945
26946         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
26947         Resolve pattern.  Attempt to implicitly convert value to boolean.
26948         Emit code.
26949
26950         * expression.cs: Set the type for the int32/int32 argument case.
26951         (Binary::ResolveOperator): Set the return type to boolean for
26952         comparission operators
26953
26954         * typemanager.cs: Remove debugging print code.
26955
26956         (Invocation::Resolve): resolve type.
26957
26958         * class.cs: Allocate a MemberInfo of the correct size, as the code
26959         elsewhere depends on the test to reflect the correct contents.
26960
26961         (Method::) Keep track of parameters, due to System.Reflection holes
26962
26963         (TypeContainer::Populate): Keep track of MethodBuilders to Method
26964         mapping here.
26965
26966         (TypeContainer::FindMembers): Use ArrayList and then copy an array
26967         of the exact size and return that.
26968
26969         (Class::LookupMethodByBuilder): New function that maps
26970         MethodBuilders to its methods.  Required to locate the information
26971         on methods because System.Reflection bit us again.
26972
26973         * support.cs: New file, contains an interface ParameterData and
26974         two implementations: ReflectionParameters and InternalParameters
26975         used to access Parameter information.  We will need to grow this
26976         as required.
26977
26978         * expression.cs (Invocation::GetParameterData): implement a cache
26979         and a wrapper around the ParameterData creation for methods. 
26980         (Invocation::OverloadResolve): Use new code.
26981
26982 2001-09-13  Ravi Pratap  <ravi@ximian.com>
26983
26984         * class.cs (TypeContainer::EmitField): Remove and move into 
26985         (Field::Define): here and modify accordingly.
26986         (Field.FieldBuilder): New member.
26987         (TypeContainer::Populate): Update accordingly.
26988         (TypeContainer::FindMembers): Implement.
26989
26990 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
26991
26992         * statement.cs: (VariableInfo::VariableType): New field to be
26993         initialized with the full type once it is resolved. 
26994
26995 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
26996
26997         * parameter.cs (GetParameterInfo): Use a type cache to compute
26998         things only once, and to reuse this information
26999
27000         * expression.cs (LocalVariableReference::Emit): Implement.
27001         (OpcodeCast::Emit): fix.
27002
27003         (ParameterReference::Resolve): Implement.
27004         (ParameterReference::Emit): Implement.
27005
27006         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
27007         that are expressions need to stay as Expressions.
27008
27009         * typemanager.cs (CSharpName): Returns the C# name of a type if
27010         possible. 
27011
27012         * expression.cs (Expression::ConvertImplicit): New function that
27013         implements implicit type conversions.
27014
27015         (Expression::ImplicitReferenceConversion): Implements implicit
27016         reference conversions.
27017
27018         (EmptyCast): New type for transparent casts.
27019
27020         (OpcodeCast): New type for casts of types that are performed with
27021         a sequence of bytecodes.
27022
27023         (BoxedCast): New type used for casting value types into reference
27024         types.  Emits a box opcode.
27025
27026         (Binary::DoNumericPromotions): Implements numeric promotions of
27027         and computation of the Binary::Type.
27028
27029         (Binary::EmitBranchable): Optimization.
27030
27031         (Binary::Emit): Implement code emission for expressions.
27032
27033         * typemanager.cs (TypeManager): Added two new core types: sbyte
27034         and byte.
27035
27036 2001-09-12  Ravi Pratap  <ravi@ximian.com>
27037
27038         * class.cs (TypeContainer::FindMembers): Method which does exactly
27039         what Type.FindMembers does, only we don't have to use reflection. No
27040         implementation yet.
27041
27042         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
27043         typecontainer objects as we need to get at them.
27044         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
27045
27046         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
27047         typecontainer object.
27048
27049         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
27050         of just a Report object.
27051
27052 2001-09-11  Ravi Pratap  <ravi@ximian.com>
27053
27054         * class.cs (Event::Define): Go back to using the prefixes "add_" and
27055         "remove_"
27056         (TypeContainer::Populate): Now define the delegates of the type too.
27057         (TypeContainer.Delegates): Property to access the list of delegates defined
27058         in the type.
27059
27060         * delegates.cs (Delegate::Define): Implement partially.
27061
27062         * modifiers.cs (TypeAttr): Handle more flags.
27063
27064 2001-09-11  Ravi Pratap  <ravi@ximian.com>
27065
27066         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
27067         and not <=
27068         (Operator::Define): Re-write logic to get types by using the LookupType method
27069         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
27070         (Indexer::Define): Ditto.
27071         (Event::Define): Ditto.
27072         (Property::Define): Ditto.
27073
27074 2001-09-10  Ravi Pratap  <ravi@ximian.com>
27075
27076         * class.cs (TypeContainer::Populate): Now define operators too. 
27077         (TypeContainer.Operators): New property to access the list of operators
27078         in a type.
27079         (Operator.OperatorMethodBuilder): New member to hold the method builder
27080         for the operator we are defining.
27081         (Operator::Define): Implement.
27082
27083 2001-09-10  Ravi Pratap  <ravi@ximian.com>
27084
27085         * class.cs (Event::Define): Make the prefixes of the accessor methods
27086         addOn_ and removeOn_ 
27087
27088         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
27089         of the location being passed in too. Ideally, this should go later since all
27090         error reporting should be done through the Report object.
27091
27092         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
27093         (Populate): Iterate thru the indexers we have and define them too.
27094         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
27095         for the get and set accessors.
27096         (Indexer::Define): Implement.
27097
27098 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
27099
27100         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
27101         my previous implementation, did not work.
27102
27103         * typemanager.cs: Add a couple of missing types (the longs).
27104
27105         * literal.cs: Use TypeManager.bool_type instead of getting it.
27106
27107         * expression.cs (EventExpr): New kind of expressions.
27108         (Expressio::ExprClassFromMemberInfo): finish
27109
27110 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
27111
27112         * assign.cs: Emit stores to static fields differently.
27113
27114 2001-09-08  Ravi Pratap  <ravi@ximian.com>
27115
27116         * Merge in changes and adjust code to tackle conflicts. Backed out my
27117         code in Assign::Resolve ;-) 
27118
27119 2001-09-08  Ravi Pratap  <ravi@ximian.com>
27120
27121         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
27122         instead Report.Error and also pass in the location.
27123         (CSharpParser::Lexer): New readonly property to return the reference
27124         to the Tokenizer object.
27125         (declare_local_variables): Use Report.Error with location instead of plain 
27126         old error.
27127         (CheckDef): Ditto.
27128
27129         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
27130         (Operator.CheckBinaryOperator): Ditto.
27131
27132         * cs-parser.jay (operator_declarator): Update accordingly.
27133
27134         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
27135         (CheckBinaryOperator): Same here.
27136
27137         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
27138         on the name without any prefixes of namespace names etc. This is because we
27139         already might have something already fully qualified like 
27140         'System.Console.WriteLine'
27141
27142         * assign.cs (Resolve): Begin implementation. Stuck ;-)
27143
27144 2001-09-07  Ravi Pratap  <ravi@ximian.com>
27145
27146         * cs-tokenizer.cs (location): Return a string which also contains
27147         the file name.
27148
27149         * expression.cs (ElementAccess): New class for expressions of the
27150         type 'element access.'
27151         (BaseAccess): New class for expressions of the type 'base access.'
27152         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
27153         respectively.
27154
27155         * cs-parser.jay (element_access): Implement action.
27156         (base_access): Implement actions.
27157         (checked_expression, unchecked_expression): Implement.
27158
27159         * cs-parser.jay (local_variable_type): Correct and implement.
27160         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
27161
27162         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
27163
27164         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
27165         name and the specifiers.
27166
27167         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
27168
27169         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
27170         making them all public ;-)
27171
27172         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
27173         class anyways.
27174
27175 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
27176
27177         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
27178         PropertyExprs.
27179         (FieldExpr, PropertyExprs): New resolved expressions.
27180         (SimpleName::MemberStaticCheck): Perform static checks for access
27181         to non-static fields on static methods. Maybe this should be
27182         generalized for MemberAccesses. 
27183         (SimpleName::ResolveSimpleName): More work on simple name
27184         resolution. 
27185
27186         * cs-parser.jay (primary_expression/qualified_identifier): track
27187         the parameter index.
27188
27189         * codegen.cs (CodeGen::Save): Catch save exception, report error.
27190         (EmitContext::EmitBoolExpression): Chain to expression generation
27191         instead of temporary hack.
27192         (::EmitStatementExpression): Put generic expression code generation.
27193
27194         * assign.cs (Assign::Emit): Implement variable assignments to
27195         local variables, parameters and fields.
27196
27197 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
27198
27199         * statement.cs (Block::GetVariableInfo): New method, returns the
27200         VariableInfo for a variable name in a block.
27201         (Block::GetVariableType): Implement in terms of GetVariableInfo
27202
27203         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
27204         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
27205
27206 2001-09-06  Ravi Pratap  <ravi@ximian.com>
27207
27208         * cs-parser.jay (operator_declaration): Continue on my quest : update
27209         to take attributes argument.
27210         (event_declaration): Ditto.
27211         (enum_declaration): Ditto.
27212         (indexer_declaration): Ditto.
27213
27214         * class.cs (Operator::Operator): Update constructor accordingly.
27215         (Event::Event): Ditto.
27216
27217         * delegate.cs (Delegate::Delegate): Same here.
27218
27219         * enum.cs (Enum::Enum): Same here.
27220
27221 2001-09-05  Ravi Pratap  <ravi@ximian.com>
27222
27223         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
27224
27225         * ../tests/cs0658.cs : New file to demonstrate error 0658.
27226
27227         * attribute.cs (Attributes): New class to encapsulate all attributes which were
27228         being passed around as an arraylist.
27229         (Attributes::AddAttribute): Method to add attribute sections.
27230
27231         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
27232         (struct_declaration): Update accordingly.
27233         (constant_declaration): Update.
27234         (field_declaration): Update.
27235         (method_header): Update.
27236         (fixed_parameter): Update.
27237         (parameter_array): Ditto.
27238         (property_declaration): Ditto.
27239         (destructor_declaration): Ditto.
27240
27241         * class.cs (Struct::Struct): Update constructors accordingly.
27242         (Class::Class): Ditto.
27243         (Field::Field): Ditto.
27244         (Method::Method): Ditto.
27245         (Property::Property): Ditto.
27246         (TypeContainer::OptAttribute): update property's return type.
27247
27248         * interface.cs (Interface.opt_attributes): New member.
27249         (Interface::Interface): Update to take the extra Attributes argument.
27250
27251         * parameter.cs (Parameter::Parameter): Ditto.
27252
27253         * constant.cs (Constant::Constant): Ditto.
27254
27255         * interface.cs (InterfaceMemberBase): New OptAttributes field.
27256         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
27257         the attributes as a parameter.
27258         (InterfaceProperty): Update constructor call.
27259         (InterfaceEvent): Ditto.
27260         (InterfaceMethod): Ditto.
27261         (InterfaceIndexer): Ditto.
27262
27263         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
27264         pass the attributes too.
27265         (interface_event_declaration): Ditto.
27266         (interface_property_declaration): Ditto.
27267         (interface_method_declaration): Ditto.
27268         (interface_declaration): Ditto.
27269
27270 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
27271
27272         * class.cs (Method::Define): Track the "static Main" definition to
27273         create an entry point. 
27274
27275         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
27276         EntryPoint if we find it. 
27277
27278         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
27279         (EmitContext::ig): Make this variable public.
27280
27281         * driver.cs: Make the default output file be the first file name
27282         with the .exe extension.  
27283
27284         Detect empty compilations
27285
27286         Handle various kinds of output targets.  Handle --target and
27287         rename -t to --dumper.
27288
27289         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
27290         methods inherited from Expression return now an Expression.  This
27291         will is used during the tree rewriting as we resolve them during
27292         semantic analysis.
27293
27294         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
27295         the spec.  Missing entirely is the information about
27296         accessability of elements of it.
27297
27298         (Expression::ExprClassFromMemberInfo): New constructor for
27299         Expressions that creates a fully initialized Expression based on
27300         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
27301         a Type.
27302
27303         (Invocation::Resolve): Begin implementing resolution of invocations.
27304
27305         * literal.cs (StringLiteral):  Implement Emit.
27306
27307 2001-09-05  Ravi Pratap  <ravi@ximian.com>
27308
27309         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
27310         member.
27311
27312 2001-09-04  Ravi Pratap  <ravi@ximian.com>
27313
27314         * cs-parser.jay (attribute_arguments): Implement actions.
27315         (attribute): Fix bug in production. Implement action.
27316         (attribute_list): Implement.
27317         (attribute_target): Implement.
27318         (attribute_target_specifier, opt_target_specifier): Implement
27319         (CheckAttributeTarget): New method to check if the attribute target
27320         is valid.
27321         (attribute_section): Implement.
27322         (opt_attributes): Implement.
27323
27324         * attribute.cs : New file to handle attributes.
27325         (Attribute): Class to hold attribute info.
27326
27327         * cs-parser.jay (opt_attribute_target_specifier): Remove production
27328         (attribute_section): Modify production to use 2 different rules to 
27329         achieve the same thing. 1 s/r conflict down !
27330         Clean out commented, useless, non-reducing dimension_separator rules.
27331
27332         * class.cs (TypeContainer.attributes): New member to hold list
27333         of attributes for a type.
27334         (Struct::Struct): Modify to take one more argument, the attribute list.
27335         (Class::Class): Ditto.
27336         (Field::Field): Ditto.
27337         (Method::Method): Ditto.
27338         (Property::Property): Ditto.
27339
27340         * cs-parser.jay (struct_declaration): Update constructor call to
27341         pass in the attributes too.
27342         (class_declaration): Ditto.
27343         (constant_declaration): Ditto.
27344         (field_declaration): Ditto.
27345         (method_header): Ditto.
27346         (fixed_parameter): Ditto.
27347         (parameter_array): Ditto.
27348         (property_declaration): Ditto.
27349
27350         * constant.cs (Constant::Constant): Update constructor similarly.
27351         Use System.Collections.
27352
27353         * parameter.cs (Parameter::Parameter): Update as above.
27354
27355 2001-09-02  Ravi Pratap  <ravi@ximian.com>
27356
27357         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
27358         (TypeContainer.delegates): New member to hold list of delegates.
27359
27360         * cs-parser.jay (delegate_declaration): Implement the action correctly 
27361         this time as I seem to be on crack ;-)
27362
27363 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
27364
27365         * rootcontext.cs (RootContext::IsNamespace): new function, used to
27366         tell whether an identifier represents a namespace.
27367
27368         * expression.cs (NamespaceExpr): A namespace expression, used only
27369         temporarly during expression resolution.
27370         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
27371         utility functions to resolve names on expressions.
27372
27373 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
27374
27375         * codegen.cs: Add hook for StatementExpressions. 
27376
27377         * class.cs: Fix inverted test for static flag in methods.
27378
27379 2001-09-02  Ravi Pratap  <ravi@ximian.com>
27380
27381         * class.cs (Operator::CheckUnaryOperator): Correct error number used
27382         to make it coincide with MS' number.
27383         (Operator::CheckBinaryOperator): Ditto.
27384
27385         * ../errors/errors.txt : Remove error numbers added earlier.
27386
27387         * ../errors/cs1019.cs : Test case for error # 1019
27388
27389         * ../errros/cs1020.cs : Test case for error # 1020
27390
27391         * cs-parser.jay : Clean out commented cruft.
27392         (dimension_separators, dimension_separator): Comment out. Ostensibly not
27393         used anywhere - non-reducing rule.
27394         (namespace_declarations): Non-reducing rule - comment out.
27395
27396         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
27397         with TypeContainer::AddEnum.
27398
27399         * delegate.cs : New file for delegate handling classes.
27400         (Delegate): Class for declaring delegates.
27401
27402         * makefile : Update.
27403
27404         * cs-parser.jay (delegate_declaration): Implement.
27405
27406 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
27407
27408         * class.cs (Event::Define): Implement.
27409         (Event.EventBuilder): New member.
27410
27411         * class.cs (TypeContainer::Populate): Update to define all enums and events
27412         we have.
27413         (Events): New property for the events arraylist we hold. Shouldn't we move to using
27414         readonly fields for all these cases ?
27415
27416 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
27417
27418         * class.cs (Property): Revamp to use the convention of making fields readonly.
27419         Accordingly modify code elsewhere.
27420
27421         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
27422         the Define method of the Property class.
27423
27424         * class.cs : Clean up applied patch and update references to variables etc. Fix 
27425         trivial bug.
27426         (TypeContainer::Populate): Update to define all the properties we have. Also
27427         define all enumerations.
27428
27429         * enum.cs (Define): Implement.
27430
27431 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
27432
27433         * cs-parser.jay (overloadable_operator): The semantic value is an
27434         enum of the Operator class.
27435         (operator_declarator): Implement actions.
27436         (operator_declaration): Implement.
27437
27438         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
27439         validity of definitions.
27440         (Operator::CheckBinaryOperator): Static method to check for binary operators
27441         (TypeContainer::AddOperator): New method to add an operator to a type.
27442
27443         * cs-parser.jay (indexer_declaration): Added line to actually call the
27444         AddIndexer method so it gets added ;-)
27445
27446         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
27447         already taken care of by the MS compiler ?  
27448
27449 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
27450
27451         * class.cs (Operator): New class for operator declarations.
27452         (Operator::OpType): Enum for the various operators.
27453
27454 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
27455
27456         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
27457         ostensibly handle this in semantic analysis.
27458
27459         * cs-parser.jay (general_catch_clause): Comment out
27460         (specific_catch_clauses, specific_catch_clause): Ditto.
27461         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
27462         (catch_args, opt_catch_args): New productions.
27463         (catch_clause): Rewrite to use the new productions above
27464         (catch_clauses): Modify accordingly.
27465         (opt_catch_clauses): New production to use in try_statement
27466         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
27467         and re-write the code in the actions to extract the specific and
27468         general catch clauses by being a little smart ;-)
27469
27470         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
27471         Hooray, try and catch statements parse fine !
27472
27473 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
27474
27475         * statement.cs (Block::GetVariableType): Fix logic to extract the type
27476         string from the hashtable of variables.
27477
27478         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
27479         I end up making that mistake ;-)
27480         (catch_clauses): Fixed gross error which made Key and Value of the 
27481         DictionaryEntry the same : $1 !!
27482
27483 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
27484
27485         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
27486
27487         * cs-parser.jay (event_declaration): Correct to remove the semicolon
27488         when the add and remove accessors are specified. 
27489
27490 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
27491
27492         * cs-parser.jay (IndexerDeclaration): New helper class to hold
27493         information about indexer_declarator.
27494         (indexer_declarator): Implement actions.
27495         (parsing_indexer): New local boolean used to keep track of whether
27496         we are parsing indexers or properties. This is necessary because 
27497         implicit_parameters come into picture even for the get accessor in the 
27498         case of an indexer.
27499         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
27500
27501         * class.cs (Indexer): New class for indexer declarations.
27502         (TypeContainer::AddIndexer): New method to add an indexer to a type.
27503         (TypeContainer::indexers): New member to hold list of indexers for the
27504         type.
27505
27506 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
27507
27508         * cs-parser.jay (add_accessor_declaration): Implement action.
27509         (remove_accessor_declaration): Implement action.
27510         (event_accessors_declaration): Implement
27511         (variable_declarators): swap statements for first rule - trivial.
27512
27513         * class.cs (Event): New class to hold information about event
27514         declarations.
27515         (TypeContainer::AddEvent): New method to add an event to a type
27516         (TypeContainer::events): New member to hold list of events.
27517
27518         * cs-parser.jay (event_declaration): Implement actions.
27519
27520 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
27521
27522         * cs-parser.jay (dim_separators): Implement. Make it a string
27523         concatenating all the commas together, just as they appear.
27524         (opt_dim_separators): Modify accordingly
27525         (rank_specifiers): Update accordingly. Basically do the same
27526         thing - instead, collect the brackets here.
27527         (opt_rank_sepcifiers): Modify accordingly.
27528         (array_type): Modify to actually return the complete type string
27529         instead of ignoring the rank_specifiers.
27530         (expression_list): Implement to collect the expressions
27531         (variable_initializer): Implement. We make it a list of expressions
27532         essentially so that we can handle the array_initializer case neatly too.
27533         (variable_initializer_list): Implement.
27534         (array_initializer): Make it a list of variable_initializers
27535         (opt_array_initializer): Modify accordingly.
27536
27537         * expression.cs (New::NType): Add enumeration to help us
27538         keep track of whether we have an object/delegate creation
27539         or an array creation.
27540         (New:NewType, New::Rank, New::Indices, New::Initializers): New
27541         members to hold data about array creation.
27542         (New:New): Modify to update NewType
27543         (New:New): New Overloaded contructor for the array creation
27544         case.
27545
27546         * cs-parser.jay (array_creation_expression): Implement to call
27547         the overloaded New constructor.
27548
27549 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
27550
27551         * class.cs (TypeContainer::Constructors): Return member
27552         constructors instead of returning null.
27553
27554 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
27555
27556         * typemanager.cs (InitCoreTypes): Initialize the various core
27557         types after we have populated the type manager with the user
27558         defined types (this distinction will be important later while
27559         compiling corlib.dll)
27560
27561         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
27562         on Expression Classification.  Now all expressions have a method
27563         `Resolve' and a method `Emit'.
27564
27565         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
27566         generation from working.     Also add some temporary debugging
27567         code. 
27568
27569 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
27570
27571         * codegen.cs: Lots of code generation pieces.  This is only the
27572         beginning, will continue tomorrow with more touches of polish.  We
27573         handle the fundamentals of if, while, do, for, return.  Others are
27574         trickier and I need to start working on invocations soon.
27575
27576         * gen-treedump.cs: Bug fix, use s.Increment here instead of
27577         s.InitStatement. 
27578
27579         * codegen.cs (EmitContext): New struct, used during code
27580         emission to keep a context.   Most of the code generation will be
27581         here. 
27582
27583         * cs-parser.jay: Add embedded blocks to the list of statements of
27584         this block.  So code generation proceeds in a top down fashion.
27585
27586 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
27587
27588         * statement.cs: Add support for multiple child blocks.
27589
27590 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
27591
27592         * codegen.cs (EmitCode): New function, will emit the code for a
27593         Block of code given a TypeContainer and its ILGenerator. 
27594
27595         * statement.cs (Block): Standard public readonly optimization.
27596         (Block::Block constructors): Link children. 
27597         (Block::Child): Child Linker.
27598         (Block::EmitVariables): Emits IL variable declarations.
27599
27600         * class.cs: Drop support for MethodGroups here, delay until
27601         Semantic Analysis.
27602         (Method::): Applied the same simplification that I did before, and
27603         move from Properties to public readonly fields.
27604         (Method::ParameterTypes): Returns the parameter types for the
27605         function, and implements a cache that will be useful later when I
27606         do error checking and the semantic analysis on the methods is
27607         performed.
27608         (Constructor::GetCallingConvention): Renamed from CallingConvetion
27609         and made a method, optional argument tells whether this is a class
27610         or a structure to apply the `has-this' bit.
27611         (Method::GetCallingConvention): Implement, returns the calling
27612         convention. 
27613         (Method::Define): Defines the type, a second pass is performed
27614         later to populate the methods.
27615
27616         (Constructor::ParameterTypes): implement a cache similar to the
27617         one on Method::ParameterTypes, useful later when we do semantic
27618         analysis. 
27619
27620         (TypeContainer::EmitMethod):  New method.  Emits methods.
27621
27622         * expression.cs: Removed MethodGroup class from here.
27623
27624         * parameter.cs (Parameters::GetCallingConvention): new method.
27625
27626 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
27627
27628         * class.cs (TypeContainer::Populate): Drop RootContext from the
27629         argument. 
27630
27631         (Constructor::CallingConvention): Returns the calling convention.
27632         (Constructor::ParameterTypes): Returns the constructor parameter
27633         types. 
27634
27635         (TypeContainer::AddConstructor): Keep track of default constructor
27636         and the default static constructor.
27637
27638         (Constructor::) Another class that starts using `public readonly'
27639         instead of properties. 
27640
27641         (Constructor::IsDefault): Whether this is a default constructor. 
27642
27643         (Field::) use readonly public fields instead of properties also.
27644
27645         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
27646         track of static constructors;  If none is used, turn on
27647         BeforeFieldInit in the TypeAttributes. 
27648
27649         * cs-parser.jay (opt_argument_list): now the return can be null
27650         for the cases where there are no arguments. 
27651
27652         (constructor_declarator): If there is no implicit `base' or
27653         `this', then invoke the default parent constructor. 
27654
27655         * modifiers.cs (MethodAttr): New static function maps a set of
27656         modifiers flags into a MethodAttributes enum
27657         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
27658         MethodAttr, TypeAttr to represent the various mappings where the
27659         modifiers are used.
27660         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
27661
27662 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
27663
27664         * parameter.cs (GetParameterInfo): Fix bug where there would be no
27665         method arguments.
27666
27667         * interface.cs (PopulateIndexer): Implemented the code generator
27668         for interface indexers.
27669
27670 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
27671
27672         * interface.cs (InterfaceMemberBase): Now we track the new status
27673         here.  
27674
27675         (PopulateProperty): Implement property population.  Woohoo!  Got
27676         Methods and Properties going today. 
27677
27678         Removed all the properties for interfaces, and replaced them with
27679         `public readonly' fields. 
27680
27681 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
27682
27683         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
27684         initialize their hashtables/arraylists only when they are needed
27685         instead of doing this always.
27686
27687         * parameter.cs: Handle refs and out parameters.
27688
27689         * cs-parser.jay: Use an ArrayList to construct the arguments
27690         instead of the ParameterCollection, and then cast that to a
27691         Parameter[] array.
27692
27693         * parameter.cs: Drop the use of ParameterCollection and use
27694         instead arrays of Parameters.
27695
27696         (GetParameterInfo): Use the Type, not the Name when resolving
27697         types. 
27698
27699 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
27700
27701         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
27702         and instead use public readonly fields.
27703
27704         * class.cs: Put back walking code for type containers.
27705
27706 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
27707
27708         * class.cs (MakeConstant): Code to define constants.
27709
27710         * rootcontext.cs (LookupType): New function.  Used to locate types 
27711
27712
27713 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
27714
27715         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
27716         this System.Reflection code is.  Kudos to Microsoft
27717
27718         * typemanager.cs: Implement a type cache and avoid loading all
27719         types at boot time.  Wrap in LookupType the internals.  This made
27720         the compiler so much faster.  Wow.  I rule!
27721
27722         * driver.cs: Make sure we always load mscorlib first (for
27723         debugging purposes, nothing really important).
27724
27725         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
27726         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
27727
27728         * rootcontext.cs: Lookup types on their namespace;  Lookup types
27729         on namespaces that have been imported using the `using' keyword.
27730
27731         * class.cs (TypeContainer::TypeAttr): Virtualize.
27732         (Class::TypeAttr): Return attributes suitable for this bad boy.
27733         (Struct::TypeAttr): ditto.
27734         Handle nested classes.
27735         (TypeContainer::) Remove all the type visiting code, it is now
27736         replaced with the rootcontext.cs code
27737
27738         * rootcontext.cs (GetClassBases): Added support for structs. 
27739
27740 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
27741
27742         * interface.cs, statement.cs, class.cs, parameter.cs,
27743         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
27744         Drop use of TypeRefs, and use strings instead.
27745
27746 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
27747
27748         * rootcontext.cs: 
27749
27750         * class.cs (Struct::Struct): set the SEALED flags after
27751         checking the modifiers.
27752         (TypeContainer::TypeAttr): new property, returns the
27753         TypeAttributes for a class.  
27754
27755         * cs-parser.jay (type_list): Oops, list production was creating a
27756         new list of base types.
27757
27758         * rootcontext.cs (StdLib): New property.
27759         (GetInterfaceTypeByName): returns an interface by type name, and
27760         encapsulates error handling here.
27761         (GetInterfaces): simplified.
27762         (ResolveTree): Encapsulated all the tree resolution here.
27763         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
27764         types. 
27765
27766         * driver.cs: Add support for --nostdlib, to avoid loading the
27767         default assemblies.
27768         (Main): Do not put tree resolution here. 
27769
27770         * rootcontext.cs: Beginning of the class resolution.
27771
27772 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
27773
27774         * rootcontext.cs: Provide better error reporting. 
27775
27776         * cs-parser.jay (interface_base): set our $$ to be interfaces.
27777
27778         * rootcontext.cs (CreateInterface): Handle the case where there
27779         are no parent interfaces.
27780
27781         (CloseTypes): Routine to flush types at the end.
27782         (CreateInterface): Track types.
27783         (GetInterfaces): Returns an array of Types from the list of
27784         defined interfaces.
27785
27786         * typemanager.c (AddUserType): Mechanism to track user types (puts
27787         the type on the global type hash, and allows us to close it at the
27788         end). 
27789
27790 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
27791
27792         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
27793         RecordInterface instead.
27794
27795         * cs-parser.jay: Updated to reflect changes above.
27796
27797         * decl.cs (Definition): Keep track of the TypeBuilder type that
27798         represents this type here.  Not sure we will use it in the long
27799         run, but wont hurt for now.
27800
27801         * driver.cs: Smaller changes to accomodate the new code.
27802
27803         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
27804         when done. 
27805
27806         * rootcontext.cs (CreateInterface):  New method, used to create
27807         the System.TypeBuilder type for interfaces.
27808         (ResolveInterfaces): new entry point to resolve the interface
27809         hierarchy. 
27810         (CodeGen): Property, used to keep track of the code generator.
27811
27812 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
27813
27814         * cs-parser.jay: Add a second production for delegate_declaration
27815         with `VOID'.
27816
27817         (enum_body): Put an opt_comma here instead of putting it on
27818         enum_body or enum_member_declarations so we can handle trailing
27819         commas on enumeration members.  Gets rid of a shift/reduce.
27820
27821         (type_list): Need a COMMA in the middle.
27822
27823         (indexer_declaration): Tell tokenizer to recognize get/set
27824
27825         * Remove old targets.
27826
27827         * Re-add the parser target.
27828
27829 2001-07-13  Simon Cozens <simon@simon-cozens.org>
27830
27831         * cs-parser.jay: Add precendence rules for a number of operators
27832         ot reduce the number of shift/reduce conflicts in the grammar.
27833
27834 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
27835
27836         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
27837         and put it here.
27838
27839         Get rid of old crufty code.
27840
27841         * rootcontext.cs: Use this to keep track of the parsed
27842         representation and the defined types available to the program. 
27843
27844         * gen-treedump.cs: adjust for new convention.
27845
27846         * type.cs: Split out the type manager, and the assembly builder
27847         from here. 
27848
27849         * typemanager.cs: the type manager will live here now.
27850
27851         * cil-codegen.cs: And the code generator here. 
27852
27853 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
27854
27855         * makefile: Fixed up for easy making.
27856
27857 2001-07-13  Simon Cozens <simon@simon-cozens.org>
27858
27859         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
27860         the 
27861
27862         (unary_expression): Expand pre_increment_expression and
27863         post_decrement_expression to reduce a shift/reduce.
27864
27865 2001-07-11  Simon Cozens
27866
27867         * cs-tokenizer.cs: Hex numbers should begin with a 0.
27868
27869         Improve allow_keyword_as_indent name.
27870
27871 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
27872
27873         * Adjustments for Beta2. 
27874
27875 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
27876
27877         * decl.cs: Added `Define' abstract method.
27878         (InTransit): new property, used to catch recursive definitions. 
27879
27880         * interface.cs: Implement `Define'. 
27881
27882         * modifiers.cs: Map Modifiers.constants to
27883         System.Reflection.TypeAttribute flags.
27884
27885         * class.cs: Keep track of types and user-defined types.
27886         (BuilderInit): New method for creating an assembly
27887         (ResolveType): New function to launch the resolution process, only
27888         used by interfaces for now.
27889
27890         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
27891         that are inserted into the name space. 
27892
27893 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
27894
27895         * ARGH.  I have screwed up my tree so many times due to the use of
27896         rsync rather than using CVS.  Going to fix this at once. 
27897
27898         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
27899         load types.
27900
27901 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
27902
27903         * Experiment successful: Use System.Type rather that our own
27904         version of Type.  
27905
27906 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
27907
27908         * cs-parser.jay: Removed nsAliases from here.
27909
27910         Use new namespaces, handle `using XXX;' 
27911
27912         * namespace.cs: Reimplemented namespace handling, use a recursive
27913         definition of the class.  Now we can keep track of using clauses
27914         and catch invalid using clauses.
27915
27916 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
27917
27918         * gen-treedump.cs: Adapted for all the renaming.
27919
27920         * expression.cs (Expression): this class now has a Type property
27921         which returns an expression Type.
27922
27923         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
27924         `Type', as this has a different meaning now in the base
27925
27926 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
27927
27928         * interface.cs, class.cs: Removed from all the sources the
27929         references to signature computation, as we can not do method
27930         signature computation during the parsing time, as we are not
27931         trying to solve at that point distinguishing:
27932
27933         class X {
27934                 void a (Blah x) {}
27935                 void a (NS.Blah x) {}
27936         }
27937
27938         Which depending on the context might be valid or not, as we do not
27939         know if Blah is the same thing as NS.Blah at that point.
27940
27941         * Redid everything so the code uses TypeRefs now instead of
27942         Types.  TypeRefs are just temporary type placeholders, that need
27943         to be resolved.  They initially have a pointer to a string and the
27944         current scope in which they are used.  This is used later by the
27945         compiler to resolve the reference to an actual Type. 
27946
27947         * DeclSpace is no longer a CIR.Type, and neither are
27948         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
27949         are all DeclSpaces, but no Types. 
27950
27951         * type.cs (TypeRefManager): This implements the TypeRef manager,
27952         which keeps track of all the types that need to be resolved after
27953         the parsing has finished. 
27954
27955 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
27956
27957         * ARGH.  We are going to have to store `foreach' as a class rather
27958         than resolving it, as we need to verify error 1579 after name
27959         resolution.   *OR* we could keep a flag that says `This request to
27960         IEnumerator comes from a foreach statement' which we can then use
27961         to generate the error.
27962
27963 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
27964
27965         * class.cs (TypeContainer.AddMethod): we now add methods to the
27966         MethodGroup instead of the method hashtable.  
27967
27968         * expression.cs: Add MethodGroup abstraction, which gets us one
27969         step closer to the specification in the way we handle method
27970         declarations.  
27971
27972         * cs-parser.jay (primary_expression): qualified_identifier now
27973         tried to match up an identifier to a local variable reference or
27974         to a parameter reference.
27975
27976         current_local_parameters is now a parser global variable that
27977         points to the current parameters for the block, used during name
27978         lookup.
27979
27980         (property_declaration): Now creates an implicit `value' argument to
27981         the set accessor.
27982
27983 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
27984
27985         * parameter.cs: Do not use `param' arguments as part of the
27986         signature, per the spec.
27987
27988 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
27989
27990         * decl.cs: Base class for classes, structs and interfaces.  This
27991         is the "Declaration Space" 
27992
27993         * cs-parser.jay: Use CheckDef for checking declaration errors
27994         instead of having one on each function.
27995
27996         * class.cs: Factor out some code for handling error handling in
27997         accordance to the "Declarations" section in the "Basic Concepts"
27998         chapter in the ECMA C# spec.
27999
28000         * interface.cs: Make all interface member classes derive from
28001         InterfaceMemberBase.
28002
28003 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
28004
28005         * Many things: all interfaces are parsed and generated in
28006         gen-treedump.  Support for member variables, constructors,
28007         destructors, properties, constants is there.
28008
28009         Beginning of the IL backend, but very little done, just there for
28010         testing purposes. 
28011
28012 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
28013
28014         * cs-parser.jay: Fix labeled statement.
28015
28016         * cs-tokenizer.cs (escape): Escape " and ' always.
28017         ref_line, ref_name: keep track of the line/filename as instructed
28018         by #line by the compiler.
28019         Parse #line.
28020
28021 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
28022
28023         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
28024         to match the values in System.CodeDOM.
28025
28026         Divid renamed to Divide.
28027
28028         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
28029         statements. 
28030         (Statements.set): remove.
28031
28032         * System.CodeDOM/CodeCatchClause.cs: always have a valid
28033         statements. 
28034
28035         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
28036         falseStatements always have valid values. 
28037
28038         * cs-parser.jay: Use System.CodeDOM now.
28039