fix some whitespace
[mono.git] / mcs / mcs / ChangeLog
1 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
2
3         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
4         MethodBuilder.
5
6 2008-02-19  Marek Safar  <marek.safar@gmail.com>
7
8         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
9
10 2008-02-19  Marek Safar  <marek.safar@gmail.com>
11
12         A fix for bug #328136
13         * expression.cs: Do not fold immediately LogicalAnd operators when the left
14         side is a false constant, because we still need to evaluate the right-hand
15         side.
16
17         * statement.cs (If): Emit two types of boolean constants (simple constant,
18         side-effect constant).
19
20 2008-02-19  Marek Safar  <marek.safar@gmail.com>
21
22         * constant.cs (SideEffectConstant): Don't emit boolean constant.
23
24         * expression.cs: Fold immediately LogicalAnd operators when both sides are
25         constants.
26
27 2008-02-18  Marek Safar  <marek.safar@gmail.com>
28
29         A fix for bug #361457
30         * ecore.cs (IsApplicable): Params methods have lower priority.
31
32         * support.cs: Return correct parameter modifier for params types.
33
34 2008-02-18  Marek Safar  <marek.safar@gmail.com>
35
36         * generic.cs (TypeParameter): Cache attribute target name.
37
38         * support.cs: Removed unused variable.
39
40         * typemanager.cs: Removed debugging leftover.
41
42         * ecore.cs: Use local type instead of a property;
43
44         * class.cs (VerifyMembers): Consider also parent to test whether type member
45         is local or public.
46
47         * expression.cs (FullMethodDesc): Removed.
48
49         * attribute.cs (IsValidArgumentType): Made static.
50
51 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
52
53         Cleanup to be more readable.
54         * Makefile (GMCS_PROFILE): Remove.
55         (COMPILER_NAME): New helper.
56
57 2008-02-15  Miguel de Icaza  <miguel@novell.com>
58
59         * cs-tokenizer.cs: if a conditional expression happens inside a
60         (...) this also means that we do not need to de-ambiguate between
61         an parenthesized expression and a cast.
62
63         Fixes 346484.
64
65         * constant.cs (SideEffectConstant): a constant value that happens
66         to have a side effect.
67
68         Fixes the build regressions introduced by the fix for #359789
69
70 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
71
72         * expression.cs (Conditional.Emit): when emitting the ternary
73         operator, use local variables to generate code verifiable code.
74
75         The verifier cannot infer that the type on stack before the
76         stloc.0 is executed is of type ParentB. This happens because the
77         stack merge algorithm uses only parent types when deciding which
78         is the common type.  This is described in Part III 1.8.1.3 of ECMA
79         335.
80
81         This code compiled with mcs is not verifiable under MS. The MS
82         verifier picks the first common interface of Foo and Bar, which is
83         wrong, but doesn't use a full join type of the 2 interfaces.
84
85         CSC uses a clever hack to compile such code in a verifiable
86         way. It stores the intermediate values in a local variable with
87         the expected type.
88
89         Fixes: #358102
90
91 2008-02-14  Miguel de Icaza  <miguel@novell.com>
92
93         * expression.cs: Do not fold BitwiseAnd operators when the left
94         side is a false constant, because we still need to evaluate the
95         right-hand side.
96
97         Fixes #359789
98
99         * support.cs: Instead of throwing an InternalErrorException when
100         the position of the stream is outside the boundary of our buffer,
101         reset the state of the reader, and restart the reading from the
102         beginning of the file.
103
104 2008-02-14  Marek Safar  <marek.safar@gmail.com>
105
106         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
107
108 2008-02-14  Marek Safar  <marek.safar@gmail.com>
109
110         A fix for bug #361686
111         * decl.cs: A protected types used inside a private class which parents
112         derives from the protected class are accessible.
113
114 2008-02-13  Marek Safar  <marek.safar@gmail.com>
115
116         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
117         the parameterless constructor.
118
119 2008-02-13  Marek Safar  <marek.safar@gmail.com>
120
121         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
122         lookup methods to use standard member cache when doing member lookup.
123
124 2008-02-12  Marek Safar  <marek.safar@gmail.com>
125
126         * driver.cs: Don't report full path for referenced module as assembly error.
127
128 2008-02-12  Marek Safar  <marek.safar@gmail.com>
129
130         * Makefile: Fixed `qh' target to work on all machines.
131
132         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
133         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
134         and HasElementType with TypeManager implementation.
135
136 2008-02-08  Marek Safar  <marek.safar@gmail.com>
137
138         A fix for bugs #325134, #359749
139         * expression.cs, ecore.cs: Try to resolve an extension method even if the
140         first binds point to non-method member expression.
141
142 2008-02-08  Marek Safar  <marek.safar@gmail.com>
143
144         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
145
146 2008-02-08  Marek Safar  <marek.safar@gmail.com>
147
148         A fix for bugs #321394, #323028
149         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
150         Reworked naive IsAccessibleAs implementation to handle nested types.
151
152 2008-02-05  Jb Evain  <jbevain@novell.com>
153
154         * class.cs: use generic type comparison for parameters
155         as well.
156
157 2008-02-05  Marek Safar  <marek.safar@gmail.com>
158
159         A fix for bug #325372
160         * class.cs: Use generic type comparison when testing method signatures.
161
162 2008-02-05  Marek Safar  <marek.safar@gmail.com>
163
164         A fix for bug #357047
165         * ecore.cs: Applied C# 3.0 changes to better conversion.
166
167 2008-02-05  Marek Safar  <marek.safar@gmail.com>
168
169         A fix for bug #358374
170         * cs-parser.jay: Correctly set modifiers for all constructor types.
171
172 2008-02-04  Marek Safar  <marek.safar@gmail.com>
173
174         A fix for bug #355251
175         * generic.cs: Added base class constraint based type inference.
176
177 2008-02-01  Marek Safar  <marek.safar@gmail.com>
178
179         A fix for bug #357255
180         * decl.cs: One more missing visibility check.
181
182 2008-02-01  Marek Safar  <marek.safar@gmail.com>
183
184         * support.cs: Fixed broken return.
185
186 2008-01-25  Marek Safar  <marek.safar@gmail.com>
187
188         * report.cs: Correctly reset warnings count after probing.
189
190 2008-01-25  Martin Baulig  <martin@ximian.com>
191
192         * namespace.cs
193         (NamespaceEntry.SymbolFileID): Make this work again after
194         MemberName.ToString() is gone.
195
196 2008-01-25  Marek Safar  <marek.safar@gmail.com>
197
198         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
199         expressions.
200
201 2008-01-25  Marek Safar  <marek.safar@gmail.com>
202
203         * generic.cs: Use full implicit conversion for type inference fixing.
204
205 2008-01-24  Marek Safar  <marek.safar@gmail.com>
206
207         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
208         Fixed user operator conversions.
209
210 2008-01-24  Marek Safar  <marek.safar@gmail.com>
211
212         * generic.cs: Do nullable type to null comparison optimization during
213         resolve phase.
214
215 2008-01-24  Marek Safar  <marek.safar@gmail.com>
216
217         A fix for bug #355163
218         * generic.cs: Enabled l-value resolve on nullable expressions.
219
220 2008-01-24  Marek Safar  <marek.safar@gmail.com>
221
222         A fix for bug #353986
223         * class.cs: Ingore static ctors with parameters for any further checks.
224
225 2008-01-24  Marek Safar  <marek.safar@gmail.com>
226
227         A fix for bug #354310
228         * namespace.cs: Removed redundant check.
229
230 2008-01-24  Marek Safar  <marek.safar@gmail.com>
231
232         A fix for bug #354928
233         * expression.cs: ElementInitializers can be resolved only once.
234
235 2008-01-24  Marek Safar  <marek.safar@gmail.com>
236
237         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
238         Condition expressions.
239
240 2008-01-23  Marek Safar  <marek.safar@gmail.com>
241
242         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
243
244 2008-01-22  Marek Safar  <marek.safar@gmail.com>
245
246         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
247         not allowed.
248
249         * generic.cs: Implemented coalesce expression.
250
251 2008-01-22  Marek Safar  <marek.safar@gmail.com>
252
253         A fix for bug #355145
254         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
255         expression tree type inference.
256
257 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
258
259         Fix #354663
260         * expression.cs (Binary.IsUnsignedType): Fix typo.
261
262 2008-01-22  Marek Safar  <marek.safar@gmail.com>
263
264         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
265
266 2008-01-22  Marek Safar  <marek.safar@gmail.com>
267
268         A fix for bug #355161
269         * ecore.cs, expression.cs: Wider range of extension method supported
270         expressions.
271
272 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
273
274         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
275         AssemblyBuilder to operate in compiler context. Fixes mcs part of
276         bug #354970.
277
278 2008-01-22  Marek Safar  <marek.safar@gmail.com>
279
280         A fix for bug #355148
281         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
282
283 2008-01-22  Miguel de Icaza  <miguel@novell.com>
284
285         * expression.cs (CreateExpressionTree): Add support for or and
286         logical or, and indent following the coding conventions.
287
288         * typemanager.cs (LinqExpression): renamed from
289         ExpressionTreeManager, for a shorter name.
290
291         Use TypeManager.CoreLookupType to lookup types from our core
292         assemblies and turn those into "Type" variables.
293
294         Consumers that previously used "Namespace" and "Type" from this
295         class should instead use the TypeExpression which is a type that
296         is fully resolved (without involving the regular C# resolution
297         rules). 
298
299         This typically looks like this:
300
301         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
302         new MemberAccess (texpr, name, type_arguments, loc)
303
304         This avoids the problem in: #355178
305
306 2008-01-21  Marek Safar  <marek.safar@gmail.com>
307
308         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
309         feature in parser only as we do in other cases.
310         
311 2008-01-21  Marek Safar  <marek.safar@gmail.com>
312
313         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
314         typemanager.cs: A refactoring of params arguments to reuse existing
315         expressions (params -> array initializer) to emit params argument instead
316         of specialized handling.
317         It was required by expression tree implementation and it has other benefits
318         as well, we now apply same optimization for params arguments as we do for
319         array initializers.
320         
321 2008-01-18  Marek Safar  <marek.safar@gmail.com>
322
323         A fix for bug #353526
324         * generic.cs: A type inference of params arguments may not required any
325         temporary array creation.
326         
327 2008-01-18  Marek Safar  <marek.safar@gmail.com>
328
329         A fix for bug #353534
330         * generic.cs, ecore.cs, expression.cs: A method group type inference is
331         supported for delegates only.
332         
333 2008-01-18  Marek Safar  <marek.safar@gmail.com>
334
335         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
336         type for more than 1 candidates.
337         
338 2008-01-18  Marek Safar  <marek.safar@gmail.com>
339
340         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
341         expressions.
342         
343 2008-01-16  Marek Safar  <marek.safar@gmail.com>
344
345         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
346         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
347         operator) expressions. 
348                 
349 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
350
351         * statement.cs: Avoid declaring an IL variable for this_variable since it is
352         not accessed from the generated IL.
353
354 2008-01-14  Marek Safar  <marek.safar@gmail.com>
355
356         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
357         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
358         statement.cs: The first expression tree implementation drop, mostly
359         infrastructure work.
360
361 2008-01-14  Marek Safar  <marek.safar@gmail.com>
362
363         * ecore.cs (IsNestedChild): Refactored.
364
365 2008-01-11  Marek Safar  <marek.safar@gmail.com>
366
367         * lambda.cs: Don't use a cast on unknown expression statement.
368
369 2008-01-10  Geoff Norton  <gnorton@novell.com>
370
371         * cs-tokenizer.cs: One more token to distinguish between method and lambda
372         arguments
373
374 2008-01-09  Marek Safar  <marek.safar@gmail.com>
375
376         * doc.cs: Report better /doc crash details.
377         
378 2008-01-09  Marek Safar  <marek.safar@gmail.com>
379
380         A fix for bug #352536
381         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
382
383 2008-01-08  Marek Safar  <marek.safar@gmail.com>
384
385         A fix for bug #352287
386         * ecore.cs, expression.cs: Do `this' access checking in all member access
387         expressions.
388         
389 2008-01-08  Marek Safar  <marek.safar@gmail.com>
390
391         * rootcontext.cs, driver.cs: Switch to linq mode by default.
392         
393         * report.cs: Reset message stacks.
394         
395 2008-01-08  Marek Safar  <marek.safar@gmail.com>
396
397         * generic.cs (InferInPhases): Correctly calculate params position.
398         
399 2008-01-08  Marek Safar  <marek.safar@gmail.com>
400
401         * cs-tokenizer.cs: No need to parse full string when parsing lambda
402         arguments.
403
404 2008-01-07  Marek Safar  <marek.safar@gmail.com>
405
406         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
407         
408         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
409         
410         * driver.cs: Updated --help option.
411         
412 2008-01-07  Marek Safar  <marek.safar@gmail.com>
413
414         * generic.cs (InferParamsTypeArguments): Removed.
415         (InferInPhases): Add params type inference.
416         (LowerBoundInference): Fixed scoring mechanism.
417         
418         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
419         
420 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
421
422         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
423         byte array for unsigned "baked" assemblies.
424
425 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
426
427         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
428         array for assemblies that are not strongnamed.
429
430 2008-01-04  Marek Safar  <marek.safar@gmail.com>
431
432         A fix for bug #351481
433         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
434         declaring type for nested generic types.
435         
436 2008-01-04  Marek Safar  <marek.safar@gmail.com>
437
438         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
439         instead of ToString.
440         
441 2008-01-03  Marek Safar  <marek.safar@gmail.com>
442
443         A fix for bug #351047
444         * expression.cs (Binary.ResolveOperator): Allow equality operators between
445         null and structs only when equality and inequality operators are defined
446         either as an user-operators or predefined operators.
447         
448 2008-01-03  Marek Safar  <marek.safar@gmail.com>
449
450         A fix for bug #351047
451         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
452         
453 2008-01-03  Marek Safar  <marek.safar@gmail.com>
454
455         A fix for bug #351257
456         * cs-tokenizer.cs: Advance line number for '\r' correctly.
457         
458 2008-01-03  Marek Safar  <marek.safar@gmail.com>
459
460         A fix for bug #351157
461         * class.cs (Using): Fixed yet another broken cloning.
462         
463         (Block): Put back more sensible default value for statements.
464         
465 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
466
467         * codegen.cs: Allow AssemblyVersion with only major version component.
468         Fixes bug #351055.
469
470 2007-12-29  Marek Safar  <marek.safar@gmail.com>
471
472         A fix for bug #324654
473         * class.cs: Use FullName property as member name.
474
475 2007-12-28  Marek Safar  <marek.safar@gmail.com>
476
477         A fix for bug #342117
478         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
479         constructor constraint.
480
481 2007-12-28  Marek Safar  <marek.safar@gmail.com>
482
483         A fix for bug #338273
484         * class.cs (ProbertyBase): Access modifier checks are required for overrides
485         only.
486
487 2007-12-28  Marek Safar  <marek.safar@gmail.com>
488
489         A fix for bug #350839
490         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
491
492 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
493
494         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
495         GHOP:
496         
497         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
498
499         * statement.cs: Changed some Hashtables to use HybridDictionaries
500         instead. It was observed that some HashTables only contained a few
501         items in the vast majority of cases. Since HybridDictionary is
502         more efficient on small sets (<10 elements), "known_variables"
503         from class ExplicitBlock as well as "labels" and "constants " from
504         class Block were changed to HybridDictionaries. 
505
506         Atsai results: (56216kb->54987kb)
507
508         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
509
510
511 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
512
513         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
514         GHOP:
515         
516         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
517         
518         * expression.cs: foreach loop to for loop, saved on allocation of
519         enumerator (59333kb->59141kb)
520
521         * statement.cs. Changed foreach loops to for loops, saved on
522         allocation of enumerator (59141kb->59006kb)
523
524         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
525         when constructed with no specified capacity. This was causing a
526         few ArrayLists to allocate more memory than they would potentially
527         need in the Block class and MemberCache class. Setting the
528         ArrayLists to construct with a capacity of 1 saves some
529         memory. (56216kb->55585kb)
530
531 2007-12-27  Marek Safar  <marek.safar@gmail.com>
532
533         A fix for bug #347189 (2nd issue)
534         * expression.cs (MemberAccess): Nested type can be found in base non-generic
535         type.
536
537 2007-12-27  Miguel de Icaza  <miguel@novell.com>
538         
539         * report.cs: Do not use colors if stdout and stderr are not a
540         terminal.
541
542 2007-12-27  Marek Safar  <marek.safar@gmail.com>
543
544         A fix for bug #346998
545         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
546         overloads.
547
548 2007-12-27  Marek Safar  <marek.safar@gmail.com>
549
550         A fix for bug #343465
551         * class.cs: Explicit method name for nested types uses dots only.
552
553 2007-12-27  Marek Safar  <marek.safar@gmail.com>
554
555         A fix for bug #343707
556         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
557
558 2007-12-27  Marek Safar  <marek.safar@gmail.com>
559
560         * ecore.cs: Report type inference errors only when arguments count matches
561         parameter count.
562         
563         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
564         
565         * expression.cs, report.cs: New warning.
566         
567         * typemanager.cs: Catch anonymous method type too.
568
569 2007-12-23  Marek Safar  <marek.safar@gmail.com>
570
571         A fix for bug #346379
572         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
573
574 2007-12-23  Marek Safar  <marek.safar@gmail.com>
575
576         A fix for bug #347359
577         * expression.cs (Invocation): Don't resolve already resolved expression.
578
579 2007-12-23  Marek Safar  <marek.safar@gmail.com>
580
581         A fix for bug #347189
582         * class.cs (FixedField): Use non-dependent code only in the define phase.
583
584 2007-12-23  Marek Safar  <marek.safar@gmail.com>
585
586         A fix for bug #348076
587         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
588
589 2007-12-22  Marek Safar  <marek.safar@gmail.com>
590
591         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
592         discovered extension methods.
593
594 2007-12-22  Marek Safar  <marek.safar@gmail.com>
595
596         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
597         method.
598
599 2007-12-21  Miguel de Icaza  <miguel@novell.com>
600
601         * report.cs (ErrorMessage): Add support for using colors on
602         terminals that support it. 
603
604 2007-12-21  Marek Safar  <marek.safar@gmail.com>
605
606         * ecore.cs: Use information about expanded params for error reporting.
607
608 2007-12-21  Marek Safar  <marek.safar@gmail.com>
609
610         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
611         and logic for params overloads.
612         
613 2007-12-15  Miguel de Icaza  <miguel@novell.com>
614
615         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
616         as this is also created from the parser.  Fixes #349034
617
618 2007-12-12  Miguel de Icaza  <miguel@novell.com>
619
620         * statement.cs (Throw.CloneTo): it is valid to have empty
621         expressions for throw. 
622
623 2007-12-03  Marek Safar  <marek.safar@gmail.com>
624
625         * cs-parser.jay: Set delegate constraint parsing region correctly.
626
627 2007-12-03  Marek Safar  <marek.safar@gmail.com>
628
629         A fix for bug #345467
630         * typemanager.cs (IsEqual): Compare generic parameters position only.
631         
632 2007-11-28  Marek Safar  <marek.safar@gmail.com>
633
634         * expression.cs (BaseAccess): Type arguments can be null.
635
636 2007-11-27  Raja R Harinath  <harinath@gmail.com>
637
638         * statement.cs (Block.Resolve): Ensure flow-branching tree is
639         consistent even when an error has occured.
640         (Switch.Resolve): Likewise.
641
642 2007-11-22  Marek Safar  <marek.safar@gmail.com>
643
644         A fix for bug #334505
645         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
646         overrides.
647         
648 2007-11-22  Marek Safar  <marek.safar@gmail.com>
649
650         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
651         refactorings required to resolve extension methods correctly when mixing
652         generics and non-generics members.
653         
654 2007-11-20  Marek Safar  <marek.safar@gmail.com>
655
656         A fix for bug #342584
657         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
658         conversion.
659         
660 2007-11-19  Marek Safar  <marek.safar@gmail.com>
661
662         A fix for bug #342512
663         * delegate.cs: Use delegate argument expression when is available. Don't
664         emit virtual call when class is sealed.
665         
666 2007-11-16  Marek Safar  <marek.safar@gmail.com>
667
668         A fix for bug #325423
669         * assign.cs (FieldInitializer): Use resolved expression for emit.
670         
671         * class.cs: Print less confusing error message.
672         
673 2007-11-16  Marek Safar  <marek.safar@gmail.com>
674
675         * cs-tokenizer.cs: Removed GMCS ifdefs.
676         
677         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
678         mcs.
679         
680         * cs-parser.jay: Disabled nullable check.
681         
682         * generic-mcs: Copied more generic stuff.
683                 
684 2007-11-16  Marek Safar  <marek.safar@gmail.com>
685
686         * gcs-parser.jay: Merged to cs-parser.jay.
687         
688         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
689         * *.csproj, *.sources: Updated to use only jay parser file.
690
691 2007-11-16  Marek Safar  <marek.safar@gmail.com>
692
693         * gcs-parser.jay: Added nullable and default expression feature checks.
694         
695 2007-11-16  Marek Safar  <marek.safar@gmail.com>
696
697         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
698         it fixes many TODOs and hidden bugs.
699         
700         * expression: Removed duplicate error check.
701
702 2007-11-15  Marek Safar  <marek.safar@gmail.com>
703
704         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
705         implicitly type local variable only when it is used in a declaration.
706
707 2007-11-15  Marek Safar  <marek.safar@gmail.com>
708
709         * attribute.cs: Use CS0612 for empty strings.
710
711 2007-11-14  Marek Safar  <marek.safar@gmail.com>
712
713         * lambda.cs, statement.cs: Contextual return may act as a statement.
714
715 2007-11-14  Marek Safar  <marek.safar@gmail.com>
716
717         A fix for a regression cause by #324222
718         * class.cs: Don't report unused even when it implements an interface.
719         
720 2007-11-13  Marek Safar  <marek.safar@gmail.com>
721
722         A fix for bug #341205
723         * ecore.cs, expression.cs: Method group expression cannot do static
724         method access with an instance reference check before overloading takes
725         a place.
726         
727 2007-11-13  Marek Safar  <marek.safar@gmail.com>
728
729         A fix for bug #325359
730         * class.cs: Use predictable name for automatically generated property.
731         
732 2007-11-12  Marek Safar  <marek.safar@gmail.com>
733
734         A fix for bug #324996
735         * expression.cs (Is): Handle case where D is nullable and T is not
736         correctly.
737         
738         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
739         
740 2007-11-12  Marek Safar  <marek.safar@gmail.com>
741
742         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
743         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
744         Flush small error reporting changes.
745         
746 2007-11-09  Marek Safar  <marek.safar@gmail.com>
747
748         A fix for bug #324996
749         * expression.cs: Rewrote Is expression implementation to work with
750         generics, nullable types, anonymous method. A const result expression 
751         uses existing infrastructure instead of custom not fully-featured one.
752         
753 2007-11-08  Marek Safar  <marek.safar@gmail.com>
754
755         A fix for bug #340202
756         * class.cs: Consider generics for volatile field.
757
758 2007-11-08  Marek Safar  <marek.safar@gmail.com>
759
760         A fix for bug #335594
761         * expression.cs: Use conversion rules when handling string addition.
762         
763 2007-11-07  Marek Safar  <marek.safar@gmail.com>
764
765         A fix for bug #336651
766         * expression.cs: Fixed a crash when probing is on.
767         
768 2007-11-07  Marek Safar  <marek.safar@gmail.com>
769
770         A fix for bug #324242
771         * covert.cs: Added a conversion from any nullable-type with an 
772         underlying enum-type to the type System.Enum.
773         
774 2007-11-07  Marek Safar  <marek.safar@gmail.com>
775
776         A fix for bug #324222
777         * class.cs: Report all non-used event fields.
778         
779 2007-11-07  Marek Safar  <marek.safar@gmail.com>
780
781         A fix for bug #325161
782         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
783         qualifier for generic types.
784         
785 2007-11-07  Marek Safar  <marek.safar@gmail.com>
786
787         A fix for bug #322971
788         * expression.cs, ecore.cs: Added intermediate result value check for
789         indexers. 
790         
791 2007-11-07  Marek Safar  <marek.safar@gmail.com>
792
793         A fix for bug #324754
794         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
795         when it was requested.
796
797 2007-11-07  Marek Safar  <marek.safar@gmail.com>
798
799         A fix for bug #325101
800         * expression.cs: Do type not value comparison for `is' expression.
801
802 2007-11-07  Marek Safar  <marek.safar@gmail.com>
803
804         A fix for bug #320236
805         * convert.cs: Don't apply user conversion on underlying target type.
806
807 2007-11-06  Marek Safar  <marek.safar@gmail.com>
808
809         * expression.cs: Don't use unresolved expression for error reporting.
810  
811 2007-11-06  Marek Safar  <marek.safar@gmail.com>
812
813         A fix for bugs #337712, #324490
814         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
815         overloading resolution too.
816         
817         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
818         the process consistent and more robust.
819         
820         * expression.cs, linq.cs, report.cs: Update.
821
822 2007-11-02  Marek Safar  <marek.safar@gmail.com>
823
824         A fix for bug #332909
825         * attribute.cs: Resolve attributes in correct context using error
826         handling procedure.
827         
828         * rootcontext.cs: Define Obsolete attribute members as core members.
829         
830 2007-11-02  Marek Safar  <marek.safar@gmail.com>
831
832         * statement.cs: Removed unused methods.
833         
834 2007-10-31  Wade Berrier  <wberrier@novell.com>
835
836         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
837         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
838         during 'make dist')
839
840 2007-10-31  Marek Safar  <marek.safar@gmail.com>
841
842         A fix for bug #338102
843         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
844         methods registered as non-generics.
845         
846 2007-10-31  Marek Safar  <marek.safar@gmail.com>
847
848         A fix for bugs #337712, #324490
849         * delegate.cs: Delegate covariance and contravariance is not allowed for
850         value types.
851         
852 2007-10-31  Marek Safar  <marek.safar@gmail.com>
853
854         A fix for bug #337719 
855         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
856         `from' keyword.
857         
858 2007-10-30  Marek Safar  <marek.safar@gmail.com>
859  
860         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
861
862 2007-10-29  Marek Safar  <marek.safar@gmail.com>
863  
864         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
865         query expressions.
866
867 2007-10-29  Raja R Harinath  <rharinath@novell.com>
868
869         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
870
871 2007-10-29  Marek Safar  <marek.safar@gmail.com>
872  
873         A fix for bug #334652
874         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
875         extension methods when we have not found the best candidate in normal
876         container.
877
878 2007-10-27  Marek Safar  <marek.safar@gmail.com>
879
880         * AssemblyInfo.cs: Keep up-to-date.
881
882 2007-10-27  Marek Safar  <marek.safar@gmail.com>
883
884         * Makefile: Fixed generics compiler name.
885         
886 2007-10-27  Marek Safar  <marek.safar@gmail.com>
887
888         * lambda.test: removed, lambda parsing is done differently.
889         
890         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
891
892 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
893
894         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
895
896 2007-10-27  Marek Safar  <marek.safar@gmail.com>
897
898         * Makefile, *.sources : All C# compilers are in mcs folder.
899         
900         * *.cs: Use existing 2_1 define for smcs.
901
902 2007-10-26  Marek Safar  <marek.safar@gmail.com>
903
904         A fix for bug #335847
905         * assign.cs, expression.cs: Couple of changes to avoid creating a
906         temporary variable for each object initializer assignment statement. It
907         simplifies struct initialization too, otherwise two temporary variables
908         would be required.
909         Implemented optimization of redundant default element initializers.
910         
911 2007-10-25  Marek Safar  <marek.safar@gmail.com>
912
913         A fix for bug #336766
914         * expression.cs (Class.CheckBase): Use generic name when method is
915         generic.
916         
917 2007-10-25  Marek Safar  <marek.safar@gmail.com>
918
919         A fix for bug #334737
920         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
921         variable and not variable argument for prepared copies.
922
923 2007-10-24  Marek Safar  <marek.safar@gmail.com>
924
925         A fix for bug #325110
926         * class.cs, expression.cs, attribute.cs: Use open generic method when
927         checking conditional attribute.
928         
929 2007-10-24  Marek Safar  <marek.safar@gmail.com>
930
931         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
932         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
933         FeatureIsNotAvailable.
934
935 2007-10-24  Marek Safar  <marek.safar@gmail.com>
936
937         ** C# 3.0 Partial methods
938         
939         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
940         methods support. Because of member cache issue with generics only
941         non-generics partial methods are fully supported.
942         
943 2007-10-23  Marek Safar  <marek.safar@gmail.com>
944         
945         * class.cs, decl.cs: Rewrote member overloads check to cope with 
946         generics and to use member cache for member checking. It also improves
947         performance and fixes remaining overloads issues.
948         
949 2007-10-20  Marek Safar  <marek.safar@gmail.com>
950         
951         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
952         roottypes.cs, typemanager.cs:
953                 
954         A member cache creation logic changed to add members immediately and
955         not rely on fallback. The member cache is now only prefered way
956         how to access and find type declaration members. It saves 5 MB of memory
957         during MWF compilation and makes code ready for more optimizations and
958         clean-ups, it's also a pre-requirement for partial methods.
959         
960 2007-10-18  Raja R Harinath  <harinath@gmail.com>
961
962         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
963         handling for generic parameters.
964
965 2007-10-15  Marek Safar  <marek.safar@gmail.com>
966         
967         * class.cs (FixedField): Removed redundant volatile check.
968         
969 2007-10-15  Marek Safar  <marek.safar@gmail.com>
970         
971         * class.cs, decl.cs: Fixed overload members verification to do only one
972         check per possible collision.
973         
974 2007-10-13  Marek Safar  <marek.safar@gmail.com>
975         
976         A fix for bug #325478
977         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
978         and create only one disposable flags container.
979         
980 2007-10-12  Marek Safar  <marek.safar@gmail.com>
981         
982         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
983         * statement.cs (Fixed): Fixed variables cloning.
984         
985 2007-10-12  Marek Safar  <marek.safar@gmail.com>
986         
987         A fix for bug #333342
988         * class.cs (EventField): Don't mark value type event as synchronized. 
989         
990 2007-10-12  Marek Safar  <marek.safar@gmail.com>
991         
992         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
993         inference to identify best candidate method correctly.
994         (ProperyExpr): A range variable is read only and cannot be modified.
995         
996 2007-10-11  Marek Safar  <marek.safar@gmail.com>
997         
998         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
999         logic to identify best candidate method correctly.
1000         
1001 2007-10-11  Marek Safar  <marek.safar@gmail.com>
1002         
1003         * location.cs (Equals, GetHashCode): Removed.
1004         
1005 2007-10-11  Marek Safar  <marek.safar@gmail.com>
1006         
1007         * report.cs: Implemented message recorder. It is used mainly for lambda
1008         expressions to capture otherwise swallowed error messages.
1009         
1010         * anonymous.cs, lambda.cs.cs: Do full parameters check.
1011
1012         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
1013         and not at the top.
1014         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
1015                 
1016         * expression.cs (MemberAccess): Always report lookup failure.
1017         
1018         * location.cs: Implemented Equals, GetHashCode.
1019         
1020         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
1021         
1022 2007-10-10  Jb Evain  <jbevain@novell.com>
1023
1024         * codegen.cs: re-enable assembly version check.
1025
1026 2007-10-09  Marek Safar  <marek.safar@gmail.com>
1027         
1028         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
1029         checks.
1030         
1031         * namespace.cs (UsingAlias): Do correct version check.
1032         
1033 2007-10-08  Marek Safar  <marek.safar@gmail.com>
1034         
1035         * expresison.cs, ecore.cs: Issue extension method error message when
1036         appropriate.
1037         
1038         * rootcontext.cs: Added ISO_2 compiler mode option.
1039
1040 2007-10-08  Marek Safar  <marek.safar@gmail.com>
1041         
1042         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
1043          message.
1044         
1045 2007-10-08  Marek Safar  <marek.safar@gmail.com>
1046         
1047         * attribute.cs (GetString, GetBoolean): Work with both literal and
1048         constant.
1049         
1050         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
1051         Moved method overload specific methods to MethodGroupExpr.
1052         
1053         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
1054         it should be less memory consuming.
1055         
1056 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
1057
1058         * codegen.cs: remove the assembly version check until the buildbot is
1059         fixed.
1060
1061 2007-10-07  Jb Evain  <jbevain@novell.com>
1062
1063         * attribute.cs (Attribute.GetString): if the value
1064         expression is a StringConstant, return its string value.
1065
1066 2007-10-07  Jb Evain  <jbevain@novell.com>
1067
1068         * typemanager.cs: add `assembly_version_attribute_type`.
1069         * codegen.cs: on attribute emission, check that the
1070         AssemblyVersionAttribute doesn't overflow.
1071
1072 2007-10-05  Marek Safar  <marek.safar@gmail.com>
1073         
1074         A fix for bug #324677
1075         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
1076         parent container of a scope container with currently resolved one. 
1077         
1078 2007-10-05  Marek Safar  <marek.safar@gmail.com>
1079         
1080         A fix for bug #325534
1081         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
1082         only.
1083         
1084 2007-10-05  Marek Safar  <marek.safar@gmail.com>
1085         
1086         A fix for bug #327504
1087         * class.cs (Operator.Define): Refactored implicit and explicit user
1088         operator conversion rules.
1089         
1090 2007-10-05  Marek Safar  <marek.safar@gmail.com>
1091         
1092         A fix for bug #327520
1093         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
1094         
1095 2007-10-04  Marek Safar  <marek.safar@gmail.com>
1096         
1097         A fix for bug #328022
1098         * class.cs (MethodData.Define): Use correct method to check whether
1099         a method implementents an accessor.
1100         
1101 2007-10-04  Marek Safar  <marek.safar@gmail.com>
1102         
1103         A fix for bug #330069
1104         * statement.cs (Fixed.Resolve): Read the first array element only when
1105         an array is instantiated. 
1106         
1107 2007-10-04  Marek Safar  <marek.safar@gmail.com>
1108         
1109         * expression.cs, assign.cs, generics.cs: Print correct operator when
1110         compound assignment is used.
1111         
1112 2007-10-04  Marek Safar  <marek.safar@gmail.com>
1113         
1114         A fix for bug #325841
1115         * expression.cs (ArrayAccess): Use full argument cloning only for
1116         string compound concatenation.
1117         
1118 2007-10-03  Marek Safar  <marek.safar@gmail.com>
1119         
1120         A fix for bug #328774
1121         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
1122         assignment.
1123         (PropertyExpr.EmitAssign): Fixed string concatenation compound
1124         assignment.
1125
1126 2007-10-03  Raja R Harinath  <rharinath@novell.com>
1127
1128         Fix #328490
1129         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
1130         Event accessibility checks here.  Remove some bogus code that
1131         accidently made GenericMethods work.
1132         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
1133
1134 2007-09-25  Marek Safar  <marek.safar@gmail.com>
1135         
1136         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
1137         
1138         * statement.cs (Block): Refactored AddVariable to allow error handling
1139         customization.
1140         
1141         * generic.cs: New stub.
1142         
1143 2007-09-23  Marek Safar  <marek.safar@gmail.com>
1144         
1145         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
1146         flag.
1147         
1148 2007-09-17  Marek Safar  <marek.safar@gmail.com>
1149
1150         * class.cs: Use partial container to record whether any partial part
1151         contains static field initializer and therefore default contructor has
1152         to be defined.
1153         
1154 2007-09-14  Marek Safar  <marek.safar@gmail.com>
1155
1156         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
1157         mono-list when only one of two partial parts has defined accessibility
1158         modifier.
1159         
1160 2007-09-14  Marek Safar  <marek.safar@gmail.com>
1161
1162         A fix for bug #82845
1163         
1164         * class.cs (TypeContainer): Set correct resolve context for all field
1165         initializers.
1166         
1167 2007-09-13  Marek Safar  <marek.safar@gmail.com>
1168
1169         * assign.cs: Fixed a crash when field is resolved twice with an error.
1170         
1171         * codegen.cs: Changed InFieldInitializer to be flag.
1172         
1173         * anonymous.cs, ecore.cs, expression.cs: Update after
1174         IsInFieldInitializer rename.
1175         
1176         * const.cs: Removed unused parameter.
1177         
1178         * class.cs: Changed the way how we resolve and emit field initializers.
1179         The field initilizers have to have access to contructor block to emit
1180         compiler generated code.
1181
1182 2007-09-13  Marek Safar  <marek.safar@gmail.com>
1183
1184         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
1185         generics use TypeContainer instead.
1186         
1187 2007-09-12  Marek Safar  <marek.safar@gmail.com>
1188         
1189         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
1190
1191         * lambda.cs (ResolveParameters): Use more powerful
1192         InflateGenericArgument.
1193         
1194         * parameters.cs: Better exception message.
1195                 
1196 2007-09-10  Marek Safar  <marek.safar@gmail.com>
1197
1198         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
1199         correct expression block type. 
1200         
1201         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
1202         
1203         * expression.cs (Invocation): Extracted method group resolve to
1204         DoResolveOverload.
1205         
1206 2007-09-07  Marek Safar  <marek.safar@gmail.com>
1207
1208         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
1209         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
1210         
1211         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
1212         generic extension methods.
1213
1214 2007-09-06  Marek Safar  <marek.safar@gmail.com>
1215
1216         A fix for bug #82676 (Do I get it right now?)
1217         * convert.cs (Binary.ResolveOperator): An interface is converted to the
1218         object before a standard conversion is applied.
1219         
1220 2007-09-06  Marek Safar  <marek.safar@gmail.com>
1221
1222         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
1223         #82676.
1224         
1225 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1226
1227         A fix for bug #82676
1228         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
1229         non-generic interface types.
1230         
1231 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1232
1233         A fix for bug #82690
1234         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
1235         
1236 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1237
1238         A fix for bug #82571
1239         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
1240         modifier for container based methods.
1241         
1242 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1243
1244         A fix for bug #82676
1245         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
1246         any interface-type T means to any of interface type T.
1247
1248 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1249
1250         * namespace.cs: We have 2 versions of System.Core assembly.
1251
1252 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1253
1254         A fix for bug #82652
1255         * class.cs (Class.GetClassBases): Compare types and not expressions.
1256
1257 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1258
1259         A fix for bug #82620
1260         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
1261         actually never worked before.
1262         (IndexerAccess): Emit prepared arguments before they are modified.
1263         
1264 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1265
1266         A fix for bug #82563
1267         * assign.cs: Revert wrong fix.
1268         
1269         * expression.cs (VariableReference.EmitAssign): Handle ref reference
1270         correctly.
1271         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
1272         Instead of ldelema/stdind we have to use temporary variables to handle
1273         cases like String.Concat (params string[]).
1274         
1275 2007-08-31  Marek Safar  <marek.safar@gmail.com>
1276
1277         * class.cs: EmitAttributes to Emit rename.
1278         
1279         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
1280         null.
1281         (MemberCore.HasClsCompliantAttribute): Don't depend on 
1282         GetClsCompliantAttributeValue execution.
1283         
1284 2007-08-31  Marek Safar  <marek.safar@gmail.com>
1285
1286         * anonymous.cs: Use shorter type prefix.
1287         
1288         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
1289         when exist.
1290         
1291         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
1292         variables when probing is on.
1293         
1294         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
1295         unresolved variables.
1296         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
1297         handle transparent identifiers.
1298         
1299 2007-08-26  Marek Safar  <marek.safar@gmail.com>
1300
1301         * attribute.cs (IsClsCompliant): Add nullable types test.
1302         
1303 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
1304
1305         * doc.cs : catch other types of exception than XmlException to
1306           report CS1570. Fixed bug #82565.
1307
1308 2007-08-23  Marek Safar  <marek.safar@gmail.com>
1309
1310         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
1311         The number of delegate parameters has to match.
1312         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
1313         arrays.
1314
1315 2007-08-21  Marek Safar  <marek.safar@gmail.com>
1316
1317         * anonymous.cs (AnonymousMethod): Generate private anonymous method
1318         to fix problem with private arguments.
1319
1320 2007-08-20  Marek Safar  <marek.safar@gmail.com>
1321
1322         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
1323         
1324         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
1325         
1326         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
1327         empty. Add cloning suport.
1328         
1329         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
1330
1331 2007-08-20  Marek Safar  <marek.safar@gmail.com>
1332
1333         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
1334         to create EmptyCast. It handles EmptyConstantCast specialization for
1335         constants.
1336         
1337 2007-08-18  Marek Safar  <marek.safar@gmail.com>
1338
1339         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
1340         (EmitArrayArgument): One routine for array arguments.
1341         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
1342         
1343 2007-08-17  Marek Safar  <marek.safar@gmail.com>
1344
1345         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
1346
1347 2007-08-17  Marek Safar  <marek.safar@gmail.com>
1348
1349         * anonymous.cs: MemberLookupFinal update.
1350
1351         * class.cs (ConstructorInitializer): Is expression based.
1352         
1353         * delegate.cs: MethodGroupExpr update.
1354         
1355         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
1356         messages.
1357         (Error_MemberLookupFailed): Customizable error override.
1358         (MethodGroupExpr): Keep queried type for later usage.
1359         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
1360         resolve.
1361         
1362         * expression.cs: Error_MemberLookupFailed refactoring.
1363         (New.DoResolve): Resolve as much as possible.
1364         (ElementInitializer.Error_MemberLookupFailed): Object initializer
1365         customization for invalid member types.
1366
1367         * statement.cs: MethodGroupExpr update.
1368         
1369 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1370
1371         * modifier.cs (Check): Check all modifiers and not only accessibility
1372         ones.
1373
1374 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1375
1376         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
1377         type and not an expression.
1378
1379 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1380
1381         * statement.cs (Catch.Clone): Type and variable can be null.
1382
1383 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1384
1385         A fix for bug #81979
1386         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
1387         I am really not sure whether this is the best fix.
1388         
1389         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
1390         only once.
1391         
1392 2007-08-14  Marek Safar  <marek.safar@gmail.com>
1393
1394         ** C# 3.0 Object and collection initializers (major re-write)
1395         
1396         * assign.cs (DoResolve): Initializers are not assign related.
1397         
1398         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
1399         used during collection or object initialization.
1400         
1401         * expression.cs (Error_InvalidArguments): Add initializers specific
1402         messages. More will come later because it requires some general
1403         refactoring.
1404         (New.DoResolve): Better error handling for unsafe types.
1405         (EmptyExpressionStatement): New class.
1406         (ElementInitializer): An object initializer expression.
1407         (CollectionElementInitializer): A collection initializer expression.
1408         (CollectionOrObjectInitializers): A block of object or collection
1409         initializers.
1410         (NewInitialize): New expression with element/object initializers.
1411         
1412         * statement.cs: Reverted object/collection initializer hacks.
1413         
1414         * typemanager.cs (CSharpName): Filter __arglist type.
1415         
1416 2007-08-09  Marek Safar  <marek.safar@gmail.com>
1417
1418         ** C# 3.0 Anonymous Types (update to the latest standard)
1419         
1420         * expression.cs (Binary.ResolveOperator): Threat all null based types
1421         same.
1422         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
1423         (AnonymousTypeParameter): Updated.
1424         
1425         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
1426         (AnonymousTypeClass): New anonymous type container.
1427         
1428         * class.cs (AddField): Return operation result.
1429         
1430         * generic.cs: Another empty TypeArguments overload.
1431         
1432         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
1433         are stored at top of normal hierarchy.
1434         
1435         * typemanager.cs (CSharpName): Filter anonymous types.
1436         
1437 2007-08-09  Marek Safar  <marek.safar@gmail.com>
1438
1439         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
1440         as single Concat call. How could we miss that :-(
1441         
1442 2007-08-08  Marek Safar  <marek.safar@gmail.com>
1443
1444         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
1445         
1446 2007-08-07  Miguel de Icaza  <miguel@novell.com>
1447
1448         * expression.cs: Fix the previous commit, the creation of the
1449         arguments array list needs also to be conditional on the arguments
1450         not being null.
1451
1452         * class.cs: Add a little bit of help to help narrow down problems.
1453
1454         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
1455         not try to copy in that case. 
1456
1457         * driver.cs: When building SMCS, include a new different set of
1458         default assemblies here.   Do this here so we can control whether
1459         to include the default assemblies with /noconfig.
1460
1461 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1462
1463         A fix for bug #81979
1464         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
1465         only.
1466
1467 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1468
1469         A fix for bug #82300
1470
1471         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
1472         we are in probing scope.
1473
1474 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1475
1476         A fix for bug #82301
1477
1478         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
1479         (Statement.CloneTo): Clone and not map children blocks.
1480
1481 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1482
1483         A fix for bug #82299
1484
1485         * expression.cs (LocalVariableReference.CloneTo): Remap local info
1486         variable too.
1487         
1488         * statement.cs (Statement.CloneTo): Clone variables before statements
1489         to allow remaping of local variables.
1490
1491 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1492
1493         A fix for bug #82296
1494
1495         * anonymous.cs,
1496         * report.cs: Log crash details for future clone problems.
1497         
1498         * statement.cs (Return.Clone): Don't clone non-existent expression.
1499
1500 2007-08-03  Raja R Harinath  <harinath@gmail.com>
1501
1502         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
1503         (Class.AddBasesForPart): Move CS0537 check here from ...
1504         * cs-parser.jay (class_declaration): ... here.  Move calling of
1505         'AddBasesForPart' to ...
1506         (class_bases): ... here.
1507         (struct_declaration, interface_declaration): Update to changes.
1508
1509 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1510
1511         A fix for bug #81923
1512
1513         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
1514         conversion is allowed.
1515
1516 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1517
1518         A fix for bug #81564
1519
1520         * ecore.cs (EventExpr): Add IsBase handling.
1521
1522         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
1523         too.    
1524         
1525 2007-08-02  Raja R Harinath  <harinath@gmail.com>
1526
1527         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
1528         * cs-parser.jay: Some whitespace cleanups.
1529         (current_delegate): New.
1530         (type_name): New.
1531         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
1532         a dummy code block, and use 'type_name' instead of 'member_name'.
1533         (interface_declaration, class_declaration): Likewise.
1534         (delegate_declaration): Likewise.  Rearrange slightly and use
1535         'current_delegate'.
1536         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
1537         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
1538
1539 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1540
1541         A fix for bug #82039
1542
1543         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
1544         available.
1545
1546         * typemanager.cs (CSharpName): Split to string overload.
1547
1548 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1549
1550         * expression.cs,
1551         * report.cs: Updated warning CS0472.
1552
1553 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1554
1555         A fix for bug #82181
1556         * cs-parser.jay,
1557         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
1558
1559 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1560
1561         A fix for bug #82277
1562         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
1563
1564 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1565
1566         ** C# 3.0 Type Inference (major bits are working)
1567         
1568         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
1569         (.ImplicitStandardConversionExists): Uses compatible.
1570         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
1571         (.InferReturnType): New method.
1572         (.Compatible): Refactored.
1573         (.ResolveParameters): Uses factory to create resolved parameters.
1574         (.CompatibleMethod): Add probing mode support.
1575         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
1576         clearly distinguish between 2 different operations.
1577         (LambdaMethod): Moved to lambda.cs.
1578         (AnonymousMethod): Removed unused fields and methods.
1579         (AnonymousDelegate): Simplified.
1580         
1581         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
1582         
1583         * convert. cs (ImplicitConversionStandard): Compatible works differently.
1584         
1585         * delegate.cs (Delegate): New mehods to reduce code duplication.
1586         (.GetConstructor): New method.
1587         (.GetInvokeMethod): New method.
1588         (DelegateCreation): Updated.
1589         
1590         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
1591         does not exist.
1592         (OverloadResolve): Made probing little bit faster.
1593         
1594         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
1595         when probing is on.
1596         
1597         * generic.cs (TypeInferenceContext): Dummy implementation.
1598         
1599         * iterators.cs: Updated after Resolve/Define rename.
1600         
1601         * lambda.cs (LambdaExpression)
1602         (.ResolveParameters): Handles both type of arguments and type inference too.
1603         
1604         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
1605         (InflateTypes): Updated.
1606         
1607         * support.cs (InflateTypes): Changed signature and updated.
1608         
1609         * typemanager.cs (LookupMemberCache): Better dynamic type check.
1610         (MemberLookup_FindMembers): More MS tricks.
1611         (GetParameterData): Ditto.
1612         (GetDelegateParameters): Uses quick path for dynamic types.
1613         
1614 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1615
1616         * class.cs (MethodData.Define): EmitContext is required for generic stuff
1617         only.
1618
1619 2007-07-31  Marek Safar  <marek.safar@gmail.com>
1620
1621         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
1622         syntax.
1623         
1624 2007-07-26  Jb Evain  <jbevain@novell.com>
1625
1626         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
1627         which takes a boolean 'report_errors', similar to the GetMethod.
1628         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
1629         in .net 2.1, do not report errors here.
1630
1631         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
1632         System.Runtime.CompilerServices.RequiredAttributeAttribute and
1633         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
1634         in .net 2.1.
1635
1636         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
1637         of the type InternalsVisibleToAttribute before the first call
1638         to CoreLookupType which is allowed to fail (third boolean parameter
1639         to true). Because, during the resolution for a type that is not
1640         immediately found, we try to check if the type is not defined in
1641         a friend assembly, and to do so, we need the
1642         InternalVisibleToAttribute.
1643
1644 2007-07-23  Miguel de Icaza  <miguel@novell.com>
1645
1646         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
1647         feature that allows structs to be compared against null and inline
1648         the result as true or false.
1649
1650         Notice that the same code is not permitted inside a generic block
1651         of code that would do:
1652
1653         class Foo<T> where T : struct {
1654             bool Eval (T x)
1655             {
1656                  return x == null;
1657             }
1658         }
1659
1660         It is only allowed if the type of T is not bound (no where
1661         clause).   In my opinion, this CSC 2 behavior is broken but people
1662         seem to be using it (IronRuby does, a few bug reports on bugzilla
1663         have it and some people have complained about it).
1664
1665         All of the users that depend on this behavior have code that is
1666         very likely broken. 
1667         
1668         * report.cs (Warning, Error): make these take object arguments,
1669         not strings, as that allows us to take advantage of Format.
1670
1671 2007-07-20  William Holmes  <billholmes54@gmail.com>
1672
1673         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
1674           Left member variable for the Count.
1675         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
1676           MemberName.CountTypeArguments to avoid a NRE. 
1677
1678         This code is contributed under the MIT X11 license
1679
1680 2007-07-18  Marek Safar  <marek.safar@gmail.com>
1681
1682         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
1683
1684 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
1685
1686         * doc.cs : generic method arguments are written as ``x while generic
1687           type arguments are `x. Combined with the previous change, fixed bug
1688           #79706.
1689
1690 2007-07-18  Raja R Harinath  <rharinath@novell.com>
1691
1692         Fix #82120
1693         * expression.cs (Binary.ResolveOperator): When converting
1694         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
1695
1696 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
1697
1698         * doc.cs : when T: or whatever x: is specified, it does not really
1699           check the doc comment's syntax correctness. Fixed bug #82006.
1700
1701 2007-07-18  Marek Safar  <marek.safar@gmail.com>
1702
1703         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
1704         LambdaExpression better.
1705         
1706         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
1707         
1708         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
1709         
1710         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
1711         as it can be generated.
1712         
1713         * expression.cs (Invocation.Error_InvalidArguments): Show correct
1714         modifiers.
1715         
1716         * lambda.cs (LambdaExpression): Refactored to share same code with
1717         AnonymousMethodExpression.
1718         
1719 2007-07-17  Marek Safar  <marek.safar@gmail.com>
1720
1721         * anonymous.cs (MakeName): Include host name for easier debugging.
1722         (LambdaMethod): New class for lambda spcecific stuff.
1723         
1724         * attribute.cs: Set EmitContext return type.
1725
1726         * class.cs: Set EmitContext return type.
1727         
1728         * codegen.cs (EmitContext): Return type cannot be null to stop messing
1729         with null/void meaning.
1730         
1731         * iterators.cs (ContainerType): Implemented.
1732         
1733         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
1734         
1735         * statement.cs (Return): Updated to lambda expressions.
1736         (Block.CloneTo): Parent can be null.
1737                 
1738 2007-07-13  Marek Safar  <marek.safar@gmail.com>
1739
1740         A fix for bug #81917
1741         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
1742         
1743         * class.cs (FixedField): Check whether field is in unsafe scope.
1744
1745         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
1746         (FieldExpr.Emit): Fixed buffers cannot be volatile.
1747
1748         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
1749         FieldExpr.
1750         
1751         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
1752                 
1753 2007-07-13  Marek Safar  <marek.safar@gmail.com>
1754
1755         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
1756         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
1757         from Report class.
1758
1759 2007-07-13  Marek Safar  <marek.safar@gmail.com>
1760
1761         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
1762         
1763 2007-07-13  Marek Safar  <marek.safar@gmail.com>
1764
1765         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
1766         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
1767         
1768         * codegen.cs(EmitContext): Add ProbingMode flag.
1769         
1770         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
1771         
1772         * driver.cs: For now set both warning values.
1773         
1774         * ecore.cs (SimpleName): Name is readonly.
1775         (MethodGroup.OverloadResolve): One quick path for probing.
1776         
1777         * expression.cs (Unary): Set Oper r/o.
1778         (Binary): Set Oper r/o.
1779         (ParameterReference): Set few instance variables as r/o.
1780         (ParameterReference.DoResolveBase): Don't capture aruments when 
1781         the probing is on.
1782         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
1783         (Arglist): arguments are private.
1784         (SizeOf): type is private and r/o.
1785         (MemberAccess): arguments are private.
1786
1787         * report.cs: Enhanced reporting on/off capabilities.
1788         
1789         * lambda.cs: Uses ec.IsInProbingMode.
1790         (ContextualReturn): Derives from return.
1791         
1792         * rootcontext.cs: For now set both warning values.
1793         
1794         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
1795         copy if one exists.
1796         (Return.Resolve): Don't die immediately.
1797         (Block.Resolve): Speed-up probing.
1798         (Block.CloneTo): Clone only child blocks.
1799
1800 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
1801
1802         * iterators.cs: reverted Miguel's latest change (r81925) as it
1803         breaks the build in System.
1804
1805 2007-07-13  Miguel de Icaza  <miguel@novell.com>
1806
1807         * iterators.cs (Yield.CheckContext): Check for the iterator type
1808         also here as we can call into Yield even in codepaths that are not
1809         directly checked by
1810         (MethodOrOperator is the only path that was checked).
1811
1812         In addition to the standard check, use a more specific check for
1813         constructors to report a more verbose error. 
1814
1815 2007-07-12  Miguel de Icaza  <miguel@novell.com>
1816
1817         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
1818         report the warning and continue 
1819
1820         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
1821         values on the stack on the call to Emit.   Use EmitStatement if
1822         possible, or using Emit + Pop if not possible.   Fixes #82064
1823
1824 2007-07-12  Raja R Harinath  <rharinath@novell.com>
1825
1826         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
1827         avoid try...finally in some cases.
1828
1829 2007-07-10  Marek Safar  <marek.safar@gmail.com>
1830
1831         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
1832         
1833         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
1834         instead of method. Re-use standard error handling.
1835         (ConstructorInitializer.Emit): Simplified.
1836         
1837         * delegate.cs: Updated after Invocation.EmitCall change.
1838         
1839         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
1840         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
1841         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
1842         method and don't permanently changing input arguments.
1843         (MethodGroupExpr): Introduced resolved best_candidate, when method group
1844         is resolved it has one of the candidates is the best one which is later
1845         used to emit. Removed a few unused method.
1846         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
1847
1848         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
1849         (Binary.ResolveOperator): Ditto.
1850         (ConditionalLogicalOperator.DoResolve): Ditto.
1851         (Invocation): Uses method group.
1852         (Invocation.DoResolve): Simplified.
1853         (Invocation.EmitCall): Removed useless is_static.
1854         (Invocation.Emit): Delegate to method group.
1855         (Invocation.EmitStatement): Simplified.
1856         (New): Uses method group.
1857         (MemberAccess.DoResolve): Don't destroy original expression.
1858         
1859         * statement.cs (ForEach.Resolve): Use null for no method arguments.
1860         
1861 2007-07-04  Marek Safar  <marek.safar@gmail.com>
1862
1863         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
1864         
1865         * anonymous.cs,
1866         * lambda.cs: Add custom error message type.
1867
1868 2007-07-03  Marek Safar  <marek.safar@gmail.com>
1869
1870         * lambda.cs: Simplified little bit.
1871         
1872         * parameter.cs: Introduced ImplicitLambdaParameter.
1873         (Parameters.CreateFullyResolved): New factory instead of ctor.
1874         
1875         * anonymous.cs,
1876         * class.cs,
1877         * delegate.cs: Updated parameter creation.
1878         
1879 2007-07-03  Marek Safar  <marek.safar@gmail.com>
1880
1881         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
1882         arguments.
1883         
1884         * generic.cs: Synchronized with gmcs.
1885         
1886 2007-07-03  Marek Safar  <marek.safar@gmail.com>
1887
1888         * class.cs (Indexer): Check return type as soon as possible.
1889         
1890         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
1891         members too.
1892         
1893         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
1894         
1895         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
1896         
1897         * parameter.cs (Parameter): Use expression type when it is available.
1898         
1899         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
1900         method modifier for the first parameter only.
1901
1902 2007-06-24  Marek Safar  <marek.safar@gmail.com>
1903
1904         A fix for bug #81938
1905         * typemanager.cs (ChangeType): Fixed couple of char conversions.
1906         
1907         * constant.cs: Tide up an exception message.
1908
1909 2007-06-22  Marek Safar  <marek.safar@gmail.com>
1910
1911         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
1912         an uninitialized variable is used.
1913         
1914         * expression.cs (LocalVariableReference.DoResolve): Ditto.
1915
1916 2007-06-22  Marek Safar  <marek.safar@gmail.com>
1917
1918         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
1919         not found error handling.
1920
1921         * expression.cs (ArrayCreation): Removed redundant fields and little bit
1922         simplified.
1923         (ArrayCreation.ResolveArrayElement): To be ready to customization.
1924         (ArrayCreation.DoResolve): Simplified.
1925         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
1926         its own resolve process.
1927         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
1928
1929 2007-06-20  Marek Safar  <marek.safar@gmail.com>
1930
1931         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
1932         more error details.
1933         
1934 2007-06-20  Marek Safar  <marek.safar@gmail.com>
1935
1936         * cs-tokenizer.cs: Removed var related stuff.
1937         
1938         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
1939         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
1940         a type and a keyword at same time.
1941         
1942         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
1943         matches to "var".
1944         
1945         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
1946         implicitly typed arrays, more changes will follow.
1947         
1948         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
1949         
1950 2007-06-19  Marek Safar  <marek.safar@gmail.com>
1951
1952         * ecore.cs (VarExpr): Removed Handled field.
1953         
1954         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
1955         build-in assign functionality.
1956         (ForEach.Resolve): Removed all implicitly typed local variable code and
1957         simplified.
1958         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
1959         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
1960
1961 2007-06-18  Marek Safar  <marek.safar@gmail.com>
1962
1963         * assign.cs: Removed implicitly typed local variable check.
1964         
1965         * expression.cs (LocalVariableReference.DoResolve): Add check for self
1966         referencing implicitly typed local variable.
1967         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
1968         variable here.
1969         
1970         * statement.cs (Fixed): Removed unsupported implicitly typed local
1971         variable code.
1972
1973 2007-06-15  Marek Safar  <marek.safar@gmail.com>
1974
1975         * decl.cs (MemberName): Moved all Unbound stuff to parser.
1976
1977 2007-06-14  Marek Safar  <marek.safar@gmail.com>
1978
1979         A fix for bugs #81855 and #76274
1980         * attribute.cs (AttachTo): Always set owner for global attributes to
1981         prefined owner.
1982         
1983         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
1984         usefull too.
1985         
1986         * cs-parser.jay: Assembly and module attributes must precede all other
1987         elements except using clauses and extern alias declarations.
1988
1989 2007-06-13  Marek Safar  <marek.safar@gmail.com>
1990
1991         A fix for bug #81748
1992         * cs-tokenizer.cs,
1993         * expression.cs: More checks for non ISO-1 features.
1994
1995 2007-06-12  Marek Safar  <marek.safar@gmail.com>
1996
1997         A fix for bug #81807
1998         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
1999         present inside switch statement and it is required by nullable check.
2000
2001 2007-06-12  Marek Safar  <marek.safar@gmail.com>
2002
2003         A fix for bug #81840
2004         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
2005         when type matching fails.
2006         
2007         * namespace.cs: Tiny error message change.
2008
2009 2007-06-12  Marek Safar  <marek.safar@gmail.com>
2010
2011         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
2012         reporting. Added automatic property check.
2013         
2014         * class.cs: Updated after CheckAbstractAndExtern relocation.
2015         (AEventPropertyAccessor.GetSignatureForError): Customized.
2016         
2017 2007-06-11  Marek Safar  <marek.safar@gmail.com>
2018
2019         * class.cs (DefineBaseTypes): Base type can be undefined.
2020         
2021         * ecore.cs (TypeLookup): Minor refactoring.
2022         (DoResolveAsTypeStep): Removed redundant check.
2023
2024         * namespace.cs (Lookup): Removed redundant check.
2025                 
2026         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
2027         ResolveAsTypeTerminal step.
2028         (BootstrapCorlib_*): Simplified.
2029         (PopulateCoreType): Core types can be now external.
2030
2031 2007-06-07  Marek Safar  <marek.safar@gmail.com>
2032
2033         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
2034          verification only.
2035          (InferTypeArguments): Infers anonymous expression type arguments.
2036          (Compatible): Split to Compatible and InferTypeArguments. 
2037         
2038         * lambda.cs: Updated.
2039
2040 2007-06-08  Marek Safar  <marek.safar@gmail.com>
2041
2042         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
2043
2044 2007-06-07  Raja R Harinath  <harinath@gmail.com>
2045
2046         Fix #80477, cs0135-2.cs, cs0135-3.cs
2047         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
2048         names to the "known" variables list.
2049         (Block.CheckInvariantMeaningInBlock): Handle the fact the
2050         parameter names are also "known".
2051         (Block.CheckError136): Remove.
2052         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
2053         null.
2054
2055 2007-06-07  Marek Safar  <marek.safar@gmail.com>
2056
2057         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
2058
2059 2007-06-06  Marek Safar  <marek.safar@gmail.com>
2060
2061         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
2062         internal error not an user error.
2063          
2064         * expression.cs (IsApplicable): Refactored to make debugging easier.
2065
2066         * support.cs: More tricks for non-mono runtimes.
2067         
2068         * typemanager.cs (CoreLookupType): Made public.
2069         (InitSystemCore): All linq specific stuff moved to linq.cs
2070
2071 2007-06-05  Marek Safar  <marek.safar@gmail.com>
2072
2073         * typemanager.cs (CSharpSignature): One more missing build-in types
2074         replacement.
2075         More tricks for non-mono runtime.
2076
2077 2007-06-05  Raja R Harinath  <harinath@gmail.com>
2078
2079         * statement.cs (Block.CheckError136_InParents): Remove.
2080         (Block.AddVariable): Use GetParameterInfo instead.
2081         (ToplevelBlock.ProcessArguments): Likewise.
2082
2083 2007-06-04  Raja R Harinath  <rharinath@novell.com>
2084
2085         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
2086         information too.
2087         (ToplevelBlock.GetParameterInfo): Split out of ...
2088         (ToplevelBlock.GetParameterRefernce): ... this.
2089         (ToplevelBlock.ParameterMap): Remove.
2090         * expression.cs (ParameterReference): Update to use
2091         ToplevelParameterInfo.
2092
2093         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
2094         regression.
2095
2096         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
2097         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
2098
2099         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
2100         (ToplevelBlock.ProcessParameters) ... here.
2101         (ToplevelBlock..ctor): Invoke it.
2102
2103         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
2104         new parameters.
2105
2106         * statement.cs (IKnownVariable): New interface.
2107         (LocalInfo): Implement it.
2108         (ToplevelParameterInfo): New class.
2109         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
2110         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
2111         GetKnownVariableInfo.
2112
2113 2007-06-03  Raja R Harinath  <harinath@gmail.com>
2114
2115         Partly speed up CS0136 error checks.
2116         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
2117         'recurse' parameter.
2118         (Block.DoCheckError136): Only check errors in parameters.  Move
2119         local variable checks ...
2120         (Block.AddVariable): ... here, and ...
2121         (ToplevelBlock.ResolveMeta): ... here.
2122
2123 2007-06-02  Raja R Harinath  <harinath@gmail.com>
2124
2125         * statement.cs (Block.IsChildOf): Remove.
2126
2127         * statement.cs (Statement.Clone): Move special case code ...
2128         (Block.CloneTo): ... here.
2129
2130 2007-05-29  Raja R Harinath  <rharinath@novell.com>
2131
2132         * statement.cs (ToplevelBlock.container): Remove field.  It's
2133         redundant with 'Parent'.
2134         (ToplevelBlock.ContainerBlock): Remove accessor.
2135         (ToplevelBlock..ctor): Update to changes.  Register anonymous
2136         child with parent here, ...
2137         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
2138         current_block.
2139         (start_anonymous): Don't save current_block.
2140         (top_current_block): Remove.
2141
2142         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
2143         (Block.Resolve): Update to changes.
2144         (Block..ctor): Move setting of "correct" 'Toplevel'
2145         and 'Explicit' fields to ...
2146         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
2147
2148 2007-05-27  Raja R Harinath  <harinath@gmail.com>
2149
2150         Kill Block.Implicit
2151         * statement.cs (Block.Implicit): Remove.
2152         (Block): Update to changes.
2153         * flowanalysis.cs: Likewise.
2154
2155         Mildly speed up CheckInvariantMeaningInBlock
2156         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
2157         Recursively call AddKnownVariable to all enclosing blocks.
2158         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
2159         Remove recursive calls.
2160         (Block): Update to changes.
2161
2162         New ExplicitBlock invariants
2163         * statement.cs (Block.Explicit): New field.  It points to the
2164         immediately enclosing non-implicit block.
2165         (Block..ctor): Maintain the invariant.
2166         * cs-parser.jay: Take advantage of invariant.
2167
2168         Introduce ExplicitBlock
2169         * statement.cs (ExplicitBlock): New.
2170         (ToplevelBlock): Derive from it.
2171         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
2172         sense of flag.
2173         (Block.Implicit): Update to changes.
2174         * cs-parser.jay: Update to changes.
2175
2176         Remove unused field
2177         * codegen.cs (EmitContext.IsLastStatement): Remove.
2178         * statement.cs (Block.DoEmit): Update to changes.
2179
2180 2007-05-25  Raja R Harinath  <rharinath@novell.com>
2181
2182         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
2183         modifying current_block directly.
2184
2185 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
2186         
2187         * class.cs: Implemented automatic properties (C# 3.0)
2188           Thanks to Marek for the help.
2189
2190 2007-05-23  Raja R Harinath  <rharinath@novell.com>
2191
2192         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
2193         variable as assigned, note also that all its components are
2194         assigned too.
2195         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
2196
2197 2007-05-19  Marek Safar  <marek.safar@gmail.com>
2198
2199         * anonymous.cs, class.cs: Emit Compiler generated attribute when
2200         member is marked as compiler generated.
2201         
2202         * decl.cs (MemberCore): Refactored ModFlags into property.
2203
2204         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
2205         (Check): Check only accessibility modifiers.
2206
2207 2007-05-18  Raja R Harinath  <rharinath@novell.com>
2208
2209         Track all assignable slots in one bit array
2210         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
2211         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
2212         logic from VariableMap constructor here.  Use the same 'offset'
2213         variable that's later used for computing offsets of local
2214         variables.
2215         * flowanalysis.cs (UsageVector.parameters): Remove.
2216         (UsageVector): Update to changes.
2217         (VariableMap): Remove.
2218
2219         Avoid creating ParameterMap in every block
2220         * statement.cs (Block.ParameterMap): Move ...
2221         (ToplevelBlock.ParameterMap): ... here.
2222         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
2223         only once.
2224         * flowanalysis.cs (FlowBranching.param_map): Remove.
2225         (FlowBranching.UsageVector): Update to changes.
2226         (FlowBranchingToplevel.CheckOutParameters): Likewise.
2227
2228         * statement.cs (Block.CloneTo): Clone Toplevel field too.
2229
2230         * expression.cs (ParameterReference): Distinguish between block
2231         where parameter was referenced and declared.
2232
2233 2007-05-18  Marek Safar  <marek.safar@gmail.com>
2234
2235         * flowanalysis.cs, statement.cs: Put back improved error handling.
2236
2237 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
2238         
2239         * assign.cs:
2240         * expression.cs:
2241           Imporved object and collection initialization (C# 3.0).
2242
2243 2007-05-15  Marek Safar  <marek.safar@gmail.com>
2244
2245         A fix for bug #81380
2246         * expression.cs (Is.DoResolve): Only value types have constant `is'
2247         behaviour.
2248
2249 2007-05-15  Raja R Harinath  <rharinath@novell.com>
2250
2251         * statement.cs (ToplevelBlock.child): Remove.
2252
2253 2007-05-15  Raja R Harinath  <harinath@gmail.com>
2254
2255         Rationalize ResolveMeta: refactoring
2256         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
2257         out constant handling code into ...
2258         (Block.DoResolveConstants): ... this.
2259
2260         Rationalize ResolveMeta: kill local_map
2261         * statement.cs (Block.local_map, Block.LocalMap): Remove.
2262         (Block.AssignableSlots): New.
2263         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
2264         for locals -- move code from VariableMap here.  Avoid unnecessary
2265         allocations.
2266         * flowanalysis.cs (FlowBranching.local_map): Remove.
2267         (FlowBranching..ctor): Use Block.AssignableSlots.
2268         (VariableMap): Remove unused constructors.
2269
2270 2007-05-11  Raja R Harinath  <rharinath@novell.com>
2271
2272         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
2273
2274 2007-05-11  Marek Safar  <marek.safar@gmail.com>
2275
2276         * typemanager.cs (IsFriendAssembly): Should not be called for building
2277         assembly.
2278
2279 2007-05-09  Marek Safar  <marek.safar@gmail.com>
2280
2281         * literal.cs (NullConstant): Print null in all cases.
2282         
2283         * expression.cs (Binary.ResolveOperator): Implemented delegate
2284          comparison based on C# 2.0 changes.
2285
2286 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
2287
2288         This code is contributed under the MIT X11 license
2289         
2290         The following enables support for several C# 3.0 language features:
2291         
2292         * cs-tokenizer.cs: Added support for the "var" keyword.
2293         
2294         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
2295           Added VarExpr class to facilitate type inferencing.
2296         
2297         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
2298           to support anonymous types.
2299         
2300         * assign.cs: Added support for type inferencing and initialization.
2301         
2302         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
2303         
2304         * expression.cs: Added implicit array support to ArrayCreation.
2305           Added 5 types and 1 interface:
2306           
2307           IInitializable                Implementing classes can inject initializing
2308                                         statements after object instantiation.
2309           
2310           Initializer                   Stores data for object initialization.
2311           
2312           AnonymousType                 An expression for anonymous types.
2313           
2314           AnonymousTypeParameter        Stores data about an anonymous type's field.
2315           
2316           NewInitialize                 An expression for object initialization.
2317           
2318           CollectionInitialize          An expression for collection initialization.
2319         
2320         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
2321           statements.
2322
2323 2007-05-06  Marek Safar  <marek.safar@gmail.com>
2324
2325         A fix for bug #81500
2326         * cs-tokenizer.cs: Add special handling for coalescing operator.
2327
2328 2007-05-06  Marek Safar  <marek.safar@gmail.com>
2329
2330         A fix for bug #81529
2331         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
2332         its value from base class until it is redefined.
2333
2334 2007-05-02  Raja R Harinath  <rharinath@novell.com>
2335
2336         Fix regression in cs0631-3.cs
2337         * cs-parser.jay (operator_declarator): Add opt_attributes to error
2338         fallback.  Make error fallback catch more cases.
2339
2340 2007-05-01  Miguel de Icaza  <miguel@novell.com>
2341
2342         * cs-parser.jay: Allow parameters in operator declarations to have
2343         attributes. 
2344
2345 2007-04-27  Miguel de Icaza  <miguel@novell.com>
2346
2347         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
2348         exists. 
2349
2350         * lambda.cs (ContextualReturn.Resolve): An expression is valid
2351         inside the ContextualReturn, it does not have to be an
2352         ExpressionStatement. 
2353
2354 2007-04-24  Miguel de Icaza  <miguel@novell.com>
2355
2356         * lambda.cs (ContextualReturn.Resolve): if the return type is not
2357         set, set it.
2358
2359 2007-04-23  Miguel de Icaza  <miguel@novell.com>
2360
2361         * anonymous.cs (AnonymousContainer): split the virtual Resolve
2362         method in two methods: ResolveNoDefine and Resolve.
2363
2364         ResolveNoDefine will stop just after ResolveTopBlock has been
2365         called.   
2366
2367         Resolve will then continue by creating a method and issuing the
2368         call to method.Define ().
2369
2370         (AnonymousMethod): Split and implement the new Resolve and
2371         ResolveNoDefine as well.
2372
2373         * lambda.cs (LambdaExpression): Split the anonymous method
2374         resolution code into a separate routine (CoreCompatibilityTest)
2375         from DoCompatibleTest.
2376
2377         (LambdaExpression.TryBuild): New method, this method tries to
2378         build the LambdaExpression with the given set of types to be used
2379         as the types for the various parameters of the lambda expression. 
2380
2381         If the compilation succeed with the given types, the infered type
2382         of the Anonymous method is returned, otherwise null is returned.
2383
2384 2007-04-23  Marek Safar  <marek.safar@gmail.com>
2385
2386         A fix for bug #81414
2387         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
2388
2389 2007-04-22  Miguel de Icaza  <miguel@novell.com>
2390
2391         * cs-tokenizer.cs: Change various identifiers here from the
2392         camelCasing to the recommended Linux-like style for instance
2393         variables from the Coding Guidelines. 
2394
2395 2007-04-19  Martin Baulig  <martin@ximian.com>
2396
2397         * convert.cs
2398         (Convert.ImplicitReferenceConversionCore): Allow conversions from
2399         System.Enum to System.ValueType.
2400
2401 2007-04-13  Martin Baulig  <martin@ximian.com>
2402
2403         Rewrote implicit reference conversions.  We need to distinguish
2404         between implicit reference conversions (13.1.4) and implicit
2405         boxing conversions (13.1.5).
2406
2407         According to the spec, there's an an implicit conversion
2408         "From a one-dimensional array-type S[] to IList<T> and base
2409         interfaces of this interface, provided there is an implicit
2410         reference conversion from S to T."  Note that this does not
2411         include boxing conversions.
2412
2413         * convert.cs
2414         (Convert.ImplicitTypeParameterBoxingConversion): New method.
2415         (Convert.ImplicitReferenceConversion): Split into
2416         ImplicitReferenceConversionCore() and
2417         ImplicitBoxingConversionExist().
2418         (Convert.ImplicitReferenceConversionExists): Use the new
2419         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
2420
2421 2007-04-12  Martin Baulig  <martin@ximian.com>
2422
2423         * convert.cs (Convert.ImplicitReferenceConversion): Move the
2424         `TypeManager.null_type' checks up to the top of the method.
2425
2426 2007-04-11  Marek Safar  <marek.safar@gmail.com>
2427
2428         A fix for bug #81350
2429         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
2430         extension methods.
2431
2432 2007-04-11  Martin Baulig  <martin@ximian.com>
2433
2434         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
2435         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
2436         to make this work for generic classes; fixes #79561.
2437
2438 2007-04-11  Martin Baulig  <martin@ximian.com>
2439
2440         * expression.cs (As): Add support for nullable types; fixes #79371.
2441
2442 2007-04-11  Martin Baulig  <martin@ximian.com>
2443
2444         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
2445         `type.FullName' is null; fixes #80243.
2446
2447 2007-04-11  Martin Baulig  <martin@ximian.com>
2448
2449         * expression.cs (Invocation.IsApplicable): Don't modify the method
2450         if type inference succeeded, but the method was not applicable.
2451         Fixes #81250.
2452
2453 2007-04-10  Marek Safar  <marek.safar@gmail.com>
2454
2455         A fix for bug #81324
2456         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
2457         internal and external namespaces containers.
2458
2459 2007-04-10  Martin Baulig  <martin@ximian.com>
2460
2461         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
2462         TypeManager.DropGenericMethodArguments() so we also call
2463         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
2464
2465 2007-04-10  Martin Baulig  <martin@ximian.com>
2466
2467         * iterators.cs (Iterator.CreateIterator): Don't crash if
2468         `method.ReturnType' is null.  This happens if something went wrong
2469         while resolving that typ (we already reported an error in this case).
2470
2471 2007-04-10  Martin Baulig  <martin@ximian.com>
2472
2473         * expression.cs (New.DoResolve): Don't call CheckComImport() on
2474         generic interfaces; report the CS0144 directly.
2475
2476 2007-04-10  Martin Baulig  <martin@ximian.com>
2477
2478         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
2479         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
2480
2481 2007-04-10  Martin Baulig  <martin@ximian.com>
2482
2483         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
2484
2485 2007-04-09  Raja R Harinath  <rharinath@novell.com>
2486
2487         A better fix
2488         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
2489         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
2490
2491         Fix #81338
2492         * statement.cs (For.Resolve): If resolution fails, use
2493         KillFlowBranching.
2494
2495 2007-04-08  Marek Safar  <marek.safar@gmail.com>
2496
2497         * anonymous.cs (MakeName): Make faster and zero-based.
2498         (VerifyExplicitParameterCompatibility): Back to mode where generic
2499         parameter is ignored.
2500         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
2501
2502         * class.cs (EmitType): Method can emit another new method.
2503
2504         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
2505
2506         * driver.cs: Updated.
2507
2508         * lambda.cs: Reuse predefined empty parameters.
2509
2510         * parameter.cs: Updated
2511
2512         * support.cs: Implemented InflateTypes.
2513
2514         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
2515         (InitSystemCore): Introduced to isolate 3.0 dependencies.
2516
2517 2007-04-03  Martin Baulig  <martin@ximian.com>
2518
2519         Fix #80632.
2520
2521         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
2522         version of TypeManager.IsOverride() which also works with generic
2523         types.  
2524
2525 2007-04-03  Martin Baulig  <martin@ximian.com>
2526
2527         Fix #81044.
2528
2529         * convert.cs
2530         (Convert.ExplicitReferenceConversion): We need to cast when
2531         converting from IList<T> to S[].
2532
2533 2007-04-01  Marek Safar  <marek.safar@gmail.com>
2534
2535         * decl.cs (FindExtensionMethods): Consider all candidates with same name
2536         at this level.
2537         
2538         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
2539
2540 2007-03-31  Marek Safar  <marek.safar@gmail.com>
2541
2542         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
2543         argument and return type inferring.
2544
2545         * codegen.cs (InferReturnType): Flag whether return can be inferred.
2546         (ReturnType): Turned to property.
2547
2548         * statement.cs (Return): Implemented return type inferring.
2549
2550         * support.cs (ReflectionParameters): Use local types if possible.
2551
2552 2007-03-30  Raja R Harinath  <rharinath@novell.com>
2553
2554         * flowanalysis.cs (FlowBranching.Reachability): Remove.
2555         (FlowBranching.UsageVector): Update to changes.
2556
2557         Prepare to kill 'Reachability'
2558         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
2559         argument of constructor.
2560
2561 2007-03-29  Raja R Harinath  <rharinath@novell.com>
2562
2563         Prepare to kill 'Reachability'
2564         * flowanalysis.cs (UsageVector.is_unreachable): New.
2565         (UsageVector): Update to maintain 'is_unreachable' in parallel to
2566         'reachability', and verify they're consistent.
2567
2568         Fix #81121
2569         * expression.cs (New.EmitStatement): Handle type parameters here too.
2570
2571 2007-03-29  Martin Baulig  <martin@ximian.com>
2572
2573         Fix #79148.
2574
2575         * anonymous.cs
2576         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
2577         CompilerGeneratedClass.
2578         (ScopeInfo.EmitScopeInstance): Make this protected.
2579         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
2580         `ec.CurrentAnonymousMethod.Scope == Scope'.
2581
2582         * statement.cs (Block.ScopeInfo): Make this a property.
2583
2584 2007-03-27  Raja R Harinath  <harinath@gmail.com>
2585
2586         Prepare to kill 'Reachability'
2587         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
2588         (FlowBranching.UsageVector.Reachability): Remove property.
2589         (FlowBranching.UsageVector.IsUnreachable): New property.
2590         (FlowBranching.UsageVector.ResetBarrier): New.
2591         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
2592         * codegen.cs, statement.cs: Update to changes.
2593
2594 2007-03-27  Martin Baulig  <martin@ximian.com>
2595
2596         Fix #81209.
2597
2598         * decl.cs
2599         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
2600         generic types.
2601
2602 2007-03-26  Raja R Harinath  <rharinath@novell.com>
2603
2604         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
2605         instead of TriState.  Remove all mention of TriState.
2606
2607         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
2608         replaced by a boolean.  Add boolean 'is_unreachable' field, check
2609         and maintain invariants.
2610
2611 2007-03-25  Marek Safar  <marek.safar@gmail.com>
2612
2613         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
2614
2615 2007-03-25  Marek Safar  <marek.safar@gmail.com>
2616
2617         * expression.cs: Stop using obsolete 2.0 opcodes.
2618
2619 2007-03-25  Marek Safar  <marek.safar@gmail.com>
2620
2621         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
2622         one of the latests Martin's fixes.
2623
2624 2007-03-23  Miguel de Icaza  <miguel@novell.com>
2625
2626         * expression.cs: On BigEndian systems, swap the bytes, temporary
2627         solution until we get a new bitconverter class.
2628
2629 2007-03-23  Martin Baulig  <martin@ximian.com>
2630
2631         Fix #81158.
2632
2633         * decl.cs (MemberCache.AddMembers): Add generic methods both as
2634         "Method" and "Method`1".  Normally, a cache lookup is done on the
2635         "Method" form (ie. without the generic arity), but this one makes
2636         lookups on the full form work as well.
2637
2638 2007-03-22  Raja R Harinath  <rharinath@novell.com>
2639
2640         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
2641         unused properties.
2642
2643 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
2644         * class.cs: 
2645         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
2646         ordered_member_list, to TypeBuilder to store members to be defined
2647         in the order they were parsed in.
2648         - ordered_explicit_member_list contains all properties indexers
2649           and methods that are defined as explicit implementation of an
2650           interface or base class.
2651         - ordered_member_list contains all properties indexers and methods
2652           that are not defined as explicit implementation of an interface
2653           or base class.
2654
2655         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
2656         functionality in these removed classes has been replaced with 
2657         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
2658         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
2659
2660         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
2661         to CheckForDuplications inside GetMethod and SetMethod Define Method
2662         to handle method property and indexer name conflicts.
2663
2664         Fixes #79434
2665
2666         All code is contributed under the MIT/X11 license.
2667
2668 2007-03-20  Martin Baulig  <martin@ximian.com>
2669
2670         * class.cs (TypeContainer.Interfaces): Removed; they're now
2671         included in `TypeContainer.Types'.
2672
2673 2007-03-20  Martin Baulig  <martin@ximian.com>
2674
2675         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
2676
2677         * class.cs (TypeContainer.CreateType): New public method.  This is
2678         now called before DefineType() to create the TypeBuilders.
2679         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
2680         has already been created by CreateType().
2681         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
2682         don't resolve our base classes here; this has been moved into
2683         DefineBaseTypes().  We're now called from CreateType().
2684         (TypeContainer.DefineBaseTypes): New private method; resolve our
2685         base classes here.  We're now called from DefineType().
2686
2687         * rootcontext.cs
2688         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
2689         our types first to create all the TypeBuilders.  After that, call
2690         TypeContainer.DefineType() on all the types which'll resolve their
2691         base classes and setup the resolve order.
2692
2693 2007-03-20  Martin Baulig  <martin@ximian.com>
2694
2695         * class.cs (TypeContainer.Enums): Removed; they're now included in
2696         `TypeContainer.Types'.  
2697
2698 2007-03-20  Martin Baulig  <martin@ximian.com>
2699
2700         * class.cs
2701         (TypeContainer.DefineType): Don't call ResolveMembers() here.
2702         (TypeContainer.DoResolveMembers): Call DefineType() on our
2703         `compiler_generated' classes; moved here from DefineNestedTypes().
2704
2705         * rootcontext.cs
2706         (RootContext.ResolveTree): Call ResolveMembers() on all
2707         TypeContainer's in the `type_container_resolve_order'.
2708
2709 2007-03-19  Marek Safar  <marek.safar@gmail.com>
2710
2711         * class.cs: Use corlib to handle InternalMethodImplAttribute.
2712
2713 2007-03-17  Marek Safar  <marek.safar@gmail.com>
2714
2715         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
2716         implementation flags.
2717
2718 2007-03-17  Marek Safar  <marek.safar@gmail.com>
2719
2720         * class.cs: More optimizations for type parameters.
2721
2722 2007-03-15  Marek Safar  <marek.safar@gmail.com>
2723
2724         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
2725
2726         * ecore.cs, parameter.cs: More common code for both corlibs.
2727
2728         * typemanager.cs (IsGenericMethod): Simplified.
2729
2730 2007-03-15  Raja R Harinath  <rharinath@novell.com>
2731
2732         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2733         'returns'.
2734         * statement.cs, iterators.cs, lambda.cs: Update to changes.
2735
2736         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
2737         unconditionally.  Simplify explanation.
2738         (Try.Resolve, Using.Resolve): Likewise.
2739
2740 2007-03-15  Martin Baulig  <martin@ximian.com>
2741
2742         Fix #80731.
2743
2744         * decl.cs (DeclSpace): If we're a partial class, use our
2745         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
2746
2747 2007-03-15  Raja R Harinath  <rharinath@novell.com>
2748
2749         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2750         'throws'.
2751         (FlowBranching.UsageVector): Update to changes.
2752         (FlowBranching.MergeSiblings): Likewise.
2753         * statement.cs: Likewise.
2754
2755 2007-03-15  Martin Baulig  <martin@ximian.com>
2756
2757         Fix #79302.
2758
2759         * decl.cs
2760         (MemberCache): Added a special .ctor for type parameters.
2761
2762         * typemanager.cs
2763         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
2764         `MemberCache'.  
2765
2766 2007-03-09  Martin Baulig  <martin@ximian.com>
2767
2768         * enum.cs (Enum): Make this a TypeContainer.
2769         (EnumMember): Derive from `Const'.
2770
2771         * const.cs
2772         (Const.DoResolveValue): New protected virtual method; move most of
2773         the functionality of ResolveValue() here so we can override it in
2774         `EnumMember'.
2775         (Const.CreateConstantReference): Make this virtual.
2776
2777         * class.cs (Kind): Add `Kind.Enum'.
2778         (TypeContainer.Emit): Don't emit the enums here; they're already
2779         in the `RootContext.typecontainer_resolve_order'.
2780
2781         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
2782         here; they're already in the `typecontainer_resolve_order'.
2783
2784         * ecore.cs (EnumConstant.ConvertImplicitly): Add
2785         TypeManager.DropGenericTypeArguments().
2786
2787         * typemanager.cs
2788         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
2789         (TypeManager.IsEnumType): Likewise.
2790         (TypeManager.EnumToUnderlying): Likewise.
2791         (TypeManager.IsEqual): Add support for enums.
2792
2793 2007-03-12  Raja R Harinath  <rharinath@novell.com>
2794
2795         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
2796         DefaultParameterValueAttribute to be undefined, say if System.dll
2797         is not referenced.
2798
2799 2007-03-11  Marek Safar  <marek.safar@gmail.com>
2800
2801         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
2802         any mscorlib.
2803
2804 2007-03-10  Marek Safar  <marek.safar@gmail.com>
2805
2806         * class.cs, parameter.cs: Unified parameters verification.
2807
2808 2007-03-08  Martin Baulig  <martin@ximian.com>
2809
2810         * cs-parser.jay (constructor_header): Pass the location to the
2811         newly created TopLevelBlock.
2812
2813 2007-03-07  Martin Baulig  <martin@ximian.com>
2814
2815         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
2816
2817 2007-03-06  Miguel de Icaza  <miguel@novell.com>
2818
2819         * convert.cs (ExplicitReferenceConversionExists): Sync this method
2820         with the changes from David, fixes the build.
2821
2822 2007-03-05  David Mitchell  <dmitchell@logos.com>
2823
2824         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
2825         and its base interfaces to a one-dimensional array type S[],
2826         provided there is an implicit or explicit reference conversion
2827         from S to T.
2828
2829 2007-03-03  Marek Safar  <marek.safar@gmail.com>
2830
2831         * cs-tokenizer.cs: Implemented basic linq grammar.
2832
2833         * driver.cs: Set linq lang version on demand.
2834
2835 2007-02-26  Marek Safar  <marek.safar@gmail.com>
2836
2837         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
2838
2839 2007-02-25  Marek Safar  <marek.safar@gmail.com>
2840
2841         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
2842         (Fixes #80455)
2843
2844         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
2845         here.
2846         Check property and event extern attributes.
2847
2848         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
2849         charset.
2850
2851 2007-02-24  Marek Safar  <marek.safar@gmail.com>
2852
2853         A fix for bug #80407
2854         * ecore.cs: Don't report ambiguity error when methods have same parent.
2855
2856 2007-02-23  Marek Safar  <marek.safar@gmail.com>
2857
2858         A fix for bug #80878
2859         * class.cs, cs-parser.jay: Event property can host anonymous methods.
2860
2861 2007-02-22  Marek Safar  <marek.safar@gmail.com>
2862
2863         * attribute.cs: Enable ExtensionAttribute presence test.
2864
2865 2007-02-22  Marek Safar  <marek.safar@gmail.com>
2866
2867         * class.cs: Warn about missing GetHashCode only when Equals is override.
2868
2869         * decl.cs: Check accessibility of type arguments.
2870
2871         * typemanager.cs: Correctly report nullable array.
2872
2873 2007-02-20  Marek Safar  <marek.safar@gmail.com>
2874
2875         * class.cs, report.cs: Capture more details when things go wrong.
2876
2877 2007-02-20  Marek Safar  <marek.safar@gmail.com>
2878
2879         A fix for bug #80650
2880         * cs-parser.jay: Anonymous container starts at constructor declaration
2881         and not at block beginning because it has to be usable in constructor
2882         initializer.
2883
2884         * statement.cs: Use context location and not block one for error reporting.
2885
2886 2007-02-18  Marek Safar  <marek.safar@gmail.com>
2887
2888         A fix for bug #78712
2889         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
2890         too.
2891
2892 2007-02-18  Marek Safar  <marek.safar@gmail.com>
2893
2894         A fix for bug #80493 by Atsushi Enomoto
2895         * cs-parser.jay: Ignore invalid attribute target.
2896
2897 2007-02-18  Marek Safar  <marek.safar@gmail.com>
2898  
2899         * cs-tokenizer.cs: Ignore '\0' as white space character.
2900
2901 2007-02-17  Miguel de Icaza  <miguel@novell.com>
2902
2903         * cs-parser.jay: Add support for lambda expressions to the mcs
2904         compiler as well.
2905
2906         * lambda.cs: Only clone when we are probing, not on the final call
2907         (Compatible is the final call). 
2908
2909         * statement.cs (CloneContext): Introduce class to provide block
2910         remapping during clone.
2911
2912         All statements Clone themselves now.
2913
2914         (Clone): special handling for blocks, when we clone a block, we
2915         register the block inside this routine, as children of the block
2916         might trigger a lookup. 
2917         
2918         * expression.cs: Add support for CloneContext in all expressions. 
2919         
2920 2007-02-17  Marek Safar  <marek.safar@gmail.com>
2921  
2922         A fix for bug #80493
2923         * statement.cs: Report ambiguous warning when interfaces are not related.
2924
2925 2007-02-15  Marek Safar  <marek.safar@gmail.com>
2926
2927         C# 3.0 extension methods.
2928
2929         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
2930         cannot be used directly.
2931
2932         * class.cs (Class.Emit): Emit extension attribute if any class method
2933         is extension method.
2934         (Method.Define): Add basic extension method validation conditions.
2935         (Method.Emit): Emit extension attribute for method.
2936
2937         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
2938         extension method exists. Currently we follow same approach as Microsoft
2939         does, emit even if a method or a class are private but this can change
2940         later.
2941
2942         * cs-parser.jay: Add handling of `this' keyword in method parameters
2943         context.
2944
2945         * decl.cs (DeclSpace.IsStaticClass): New property.
2946         (MemberCache.FindExtensionMethods): Looks for extension methods with
2947         defined name and extension type.
2948
2949         * doc.cs: Updated after OverloadResolve changes.
2950
2951         * driver.cs: Add new soft reference to System.Core.dll.
2952
2953         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
2954         (ExtensionMethodGroupExpr): Represents group of extension methods.
2955
2956         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
2957         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
2958         to MethodGroupExpr and made non-static for easier customization.
2959         (Invocation.DoResolve): Add extension method lookup when no standard
2960         method was found.
2961         (MemberAccess.DoResolve): Try extension methods if no member exists.
2962
2963         * modifiers.cs: Add METHOD_EXTENSION modifier.
2964
2965         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
2966         as well as candidate extension type.
2967         (ComputeNamespaces): When assembly constains extension methods registers
2968         them.
2969         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
2970         extension method lookup.
2971         (Namespace.LookupExtensionMethod): Looks for extension method in this
2972         namespace.
2973         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
2974         find a method which matches name and extensionType.
2975
2976         * parameter.cs (Parameter): Add This modifer.
2977         (HasExtensionMethodModifier): New property.
2978         (Resolve): Add extension parameter check.
2979         (ModFlags): turned to property to exclude this modifier as it is not real
2980         parameter modifier.
2981         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
2982
2983         * support.cs (ParameterData): Add ExtensionMethodType.
2984         (ReflectionParameters): Implemented ExtensionMethodType interface property.
2985
2986         * typemanager.cs: Add type and ctor extension attribute type.
2987
2988 2007-02-15  Miguel de Icaza  <miguel@novell.com>
2989
2990         * report.cs (DisableErrors, EnableErrors): used to prevent error
2991         output when we are "trying" to compile various methods with
2992         different types. 
2993
2994         * ecore.cs (Expression): Add Clone method that calls the virtual
2995         CloneTo method.  The current CloneTo method in Expression throws
2996         an exception so we can track down all the places where this must
2997         be implemented (not using abstract, because that would be a lot of
2998         up-front-work before we can start testing the implementation
2999         idea). 
3000
3001         Important: we only need Clone capabilities for expressions created
3002         by the parser, as the expressions we will be cloning are
3003         expressions in the pre-resolved state.   This vastly simplifies
3004         the work required. 
3005         
3006         (SimpleName): Add CloneTo that does nothing.
3007         (EmptyCast): Add CloneTo.
3008         
3009         * expression.cs (Binary): Implement CloneTo.
3010         (Invocation.IsApplicable): Store the current ec in
3011         EmitContext.TempEc and restore it on return.  This is used so we
3012         do not have to sprinkle hundres of methods with an extra
3013         EmitContext, we know that the only user is the lambda expression
3014         ImplicitConversionExists code. 
3015         
3016         (Argument): Add Cloning capabilities.
3017         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
3018         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
3019         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
3020         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
3021         IndexerAccess): Add Clone capability.
3022
3023         (LocalVariableReference, This): TODO: needs cloned Block mapping.
3024
3025         (Argument): Add cloning capability.
3026
3027         * assign.cs (Assign): Implement CloneTo.
3028
3029         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
3030         
3031         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
3032         version by calling Convert with the EmitContext (that we are
3033         currently storing in ec, this is not great, but will do for now,
3034         to avoid passing EmitContext parameters to hundreds of functions
3035         that do not need them now).
3036
3037         (SetExpression): Remove, it is not needed.
3038         
3039         (ContextualReturn): Implement CloneTo.
3040
3041         * statement.cs (Statement): Implement cloning infrastructure,
3042         similar to expressions.
3043
3044         (Block): Partial implementation of Clone for statements.
3045
3046         (Return): Implement clone.
3047         
3048         * constant.cs (Constant.CloneTo): New method, does nothing.
3049
3050         * codegen.cs (TempEc): Add a static EmitContext as a temporary
3051         solution, until we decide how to exactly do this.  
3052         
3053 2007-02-14  Marek Safar  <marek.safar@gmail.com>
3054  
3055         A fix for bug #80493
3056         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
3057         a property is override we need to use second accessor.
3058
3059 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3060  
3061         A fix for bug #80418
3062         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
3063         methods.
3064
3065 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3066
3067         Another fix for bug #80749
3068         * pending.cs: Abstract class has priority over interfaces.
3069
3070 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3071
3072         Another fix for bug #80749
3073         * pending.cs: Abstract class has priority over interfaces.
3074
3075 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3076
3077         Another fix for bug #80749
3078         * pending.cs: Abstract class has priority over interfaces.
3079
3080 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3081
3082         Another fix for bug #80749
3083         * pending.cs: Abstract class has priority over interfaces.
3084
3085 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3086
3087         * class.cs Better error message.
3088
3089         * driver.cs: Add shorter versions of -optimize option.
3090
3091 2007-02-13  Martin Baulig  <martin@ximian.com>
3092
3093         * class.cs (Constructor.Emit): Check the return value of
3094         ec.ResolveTopBlock() and return on error.
3095
3096 2007-02-13  Raja R Harinath  <rharinath@novell.com>
3097
3098         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
3099         message to fix error message regression.
3100
3101 2007-02-12  Marek Safar  <marek.safar@gmail.com>
3102
3103         * delegate.cs: Delegate creation expression cannot be of Nullable type.
3104
3105 2007-02-12  Marek Safar  <marek.safar@gmail.com>
3106
3107         A fix for bug #80749
3108         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
3109         its parent container.
3110
3111         * class.cs (DefineFieldInitializers): Each initializer can has different
3112         resolve context.
3113
3114         * const.cs: Updated.
3115
3116 2007-02-11  Miguel de Icaza  <miguel@novell.com>
3117
3118         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
3119         now all the heavy lifting to check that embedded statements or
3120         expressions have the right form is done in the ContextualReturn.
3121
3122         (ContextualReturn): New class.  
3123
3124         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
3125         method that can be invoked to report 201, so we do not replicate
3126         this everywhere.
3127
3128         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
3129         
3130         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
3131         treating tabs as spaces. 
3132
3133 2007-02-09  Marek Safar  <marek.safar@gmail.com>
3134
3135         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
3136         * assign.cs: Use full implicit conversion for right side check.
3137
3138 2007-02-09  Marek Safar  <marek.safar@gmail.com>
3139
3140         * statement.cs (Switch): Switch over boolean type is not standardized.
3141
3142 2007-02-08  Marek Safar  <marek.safar@gmail.com>
3143
3144         A fix for bug #80755
3145         * decl.cs (FindBaseEvent): Don't use method cache for events.
3146
3147 2007-02-07  Marek Safar  <marek.safar@gmail.com>
3148
3149         * cs-parser.jay: Better syntax error handling.
3150
3151         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
3152         instead of underlying type value.
3153
3154 2007-02-06  Marek Safar  <marek.safar@gmail.com>
3155
3156         * driver.cs: Check define identifier before is registered.
3157
3158         * namespace.cs: Use existing error message.
3159
3160         * report.cs: New warning.
3161
3162 2007-02-06  Marek Safar  <marek.safar@gmail.com>
3163
3164         A fix for bug #80742
3165         * expression.cs: Delegate Invoke method can be called directly.
3166
3167 2007-02-06  Marek Safar  <marek.safar@gmail.com>
3168
3169         A fix for bug #80676
3170         * class.cs (IsEntryPoint): The Main method can have params modifier.
3171
3172 2007-02-04  Miguel de Icaza  <miguel@novell.com>
3173
3174         * parameter.cs (Parameter, Parameters): Add Clone method.
3175
3176         * anonymous.cs (Compatible): Turn method into virtual method, so
3177         LambdaExpression can implement a different behavior.
3178
3179         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
3180         out the basic checking here, so it can be used by
3181         LambdaExpressions.
3182         
3183         * lambda.cs: Introduce "Compatible" function that will do the
3184         heavy lifting.
3185
3186 2007-02-02  Marek Safar  <marek.safar@gmail.com>
3187
3188         * attribute.cs: Unified one error message.
3189
3190         * class.cs (Class): Use type attributes and not properties to test static
3191         class.
3192         (IsEntryPoint): Don's pass local variable.
3193
3194         * convert.cs: Removed duplicate check.
3195
3196         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
3197
3198         * driver.cs: Don't crash when soft reference does not exist.
3199
3200         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
3201         (UsingEntry): Removed redundant allocation.
3202
3203         * parameter.cs: Add fast path for type parameters.
3204
3205         * support.cs: Don't allocate attribute when it's not used.
3206
3207 2007-01-30  Miguel de Icaza  <miguel@novell.com>
3208
3209         * anonymous.cs
3210         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
3211         this into a virtual method, so we can override it in LambdaExpression.
3212
3213         * driver.cs: Improve diagnostics in case of failure. 
3214
3215         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
3216         write a function that is slightly more complex and that parses:
3217
3218         type identifier [, type identifier]* )
3219
3220         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
3221         this expression:
3222
3223                 (canEmpty ? i >= 0 : i > 0)
3224
3225 2007-01-30  Raja R Harinath  <rharinath@novell.com>
3226
3227         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
3228         exception on possibly valid code.
3229
3230 2007-01-29  Raja R Harinath  <rharinath@novell.com>
3231
3232         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
3233         Push/PopPosition.
3234         (parse_opt_type_arguments): Remove.  It's almost the same as
3235         parse_less_than.
3236         (parse_namespace_or_typename): Use parse_less_than.
3237
3238 2007-01-28  Miguel de Icaza  <miguel@novell.com>
3239
3240         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
3241         this bug took a few hours to find, because the state saved and
3242         restored by PushPosition and PopPosition was ignoring the state of
3243         parse_generic_less_than.
3244
3245         I can also now remove the handling of OP_LT and OP_GT, this solves
3246         the big mistery.
3247         
3248         * cs-tokenizer.cs: store the location for the ARROW token, we use
3249         that in the parser.
3250
3251         (PushPosition, PopPosition): save/restore also `current_token',
3252         restore `parse_generic_less_than' (was missing).
3253
3254         (parse_opt_type_arguments): use parse_type, not
3255         parse_namespace_or_typename to parse types.
3256
3257         * lambda.cs: Empty new file, will eventually have the lambda
3258         expression implementation.
3259
3260         * lambda.test: used to test the internal tokenizer. 
3261
3262         * report.cs (FeatureIsNotISO1): Rename from
3263         FeatureIsNotStandardized, because it was about the language level
3264         (1 vs 2) it was not about standarization.
3265
3266         (FeatureRequiresLINQ): New.
3267
3268         * support.cs (SeekableStreamReader): Only require that the reader
3269         is a TextReader, not a StreamReader, so we can plug StringReader. 
3270
3271         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
3272         given position in the input stream the following tokens can be
3273         parsed as a type followed by an identifier.
3274
3275         (is_punct): after a '(' if parse_type_and_parameter returns true,
3276         then return a special token OPEN_PARENS_LAMBDA which is used to
3277         avoid reduce/reduce errors in the grammar for the
3278         lambda_expression rules.
3279
3280         (parse_type): implement a type parser inside the
3281         tokenizer, the parser only returns true or false depending on
3282         whether the input at a given position can be parsed as a type.
3283
3284         (peek_token): new method used during type parsing.
3285
3286 2007-01-28  Raja R Harinath  <rharinath@novell.com>
3287
3288         Fix #80531
3289         * anonymous.cs (ScopeInfo.InflateParameters): New.
3290         (AnonymousContainer.Resolve): Use it to redirect types of
3291         delegate parameters.
3292
3293 2007-01-27  Raja R Harinath  <rharinath@novell.com>
3294
3295         Fix #80530
3296         * expression.cs (Error_InvalidArguments): Don't use two different
3297         messages for CS1503.  Use ExtraInformation and
3298         SymbolRelatedToPreviousError instead.
3299
3300         Fix #80358
3301         * decl.cs (DeclSpace.initialize_type_params): Don't access
3302         'type_params' of a partial class directly.
3303
3304 2007-01-26  Miguel de Icaza  <miguel@novell.com>
3305
3306         * constant.cs: Removed a handful of out-of-range checks that were
3307         not necessary. 
3308
3309 2007-01-25  Marek Safar  <marek.safar@gmail.com>
3310
3311         * expression.cs (CheckUselessComparison): Add additional check for char
3312         constants.
3313
3314         * namespace.cs: Fixed typo.
3315
3316 2007-01-23  Miguel de Icaza  <miguel@novell.com>
3317
3318         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
3319         gone, instead we inline the test, preventing the needless casts to
3320         longs, ulongs and doubles for the parameters, avoiding calls to
3321         methods that overchecked stuff, and instead inlined things
3322         nicely. 
3323
3324 2007-01-20  Marek Safar  <marek.safar@gmail.com>
3325
3326         * cs-parser.jay: Better parameter error handling.
3327
3328 2007-01-17  Marek Safar  <marek.safar@gmail.com>
3329
3330         A fix for bug #80368, #80522
3331         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
3332         whether array initializer contains constants only.
3333         (ArrayCreation.Emit): Use better formula to decide when
3334         are array initializers for static initialization.
3335         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
3336         have to emit even constants otherwise they are pre-initialized.
3337
3338 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
3339             Raja R Harinath  <rharinath@novell.com>
3340
3341         Fix emit order of 'get' vs. 'set'.
3342         * support.cs (Accessors): New.
3343         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
3344         Note the order in which accessors are declared in the source.
3345         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
3346         Refactored from Property.Define and Indexer.Define.
3347         (PropertyBase.DefineAccessors): New helper that calls the above in
3348         appropriate order as noted by the parser.
3349         (Property.Define, Indexer.Define): Update to changes.
3350         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
3351
3352 2007-01-17  Raja R Harinath  <rharinath@novell.com>
3353
3354         Fix cs0029-6.cs and gcs0029-2.cs (regression)
3355         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
3356         there's an implicit conversion from the current type to the target
3357         type before converting the underlying constant.
3358
3359 2007-01-16  Marek Safar  <marek.safar@gmail.com>
3360
3361         * const.cs (ResolveValue): Updated after constant conversion was made more
3362         generic.
3363
3364         * constant.cs (GetAttributableValue): constant to object conversion is
3365         used for attributes only.
3366         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
3367         constant conversions.
3368         (LongConstant.ConvertImplicitly): Ditto.
3369
3370         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
3371         (ImplicitConversionStandard): Handle constant conversion as extra step.
3372         It solves the issue when constant conversion was called indirectly like
3373         inside array initializer and constant folding was skipped.
3374
3375         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
3376         this change.
3377
3378         * statement.cs(ImplicitConversionStandard): Updated after constant
3379         conversion was made more generic.
3380
3381 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
3382
3383         * expression.cs (As.DoResolve): Use GenericConstraints instead of
3384         Constraints, solves the problem where the compiler incorrectly
3385         reported that a type parameter was not constrained to a class (Bug
3386         80518)
3387
3388 2007-01-14  Marek Habersack  <grendello@gmail.com>
3389
3390         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
3391
3392 2007-01-14  Marek Safar  <marek.safar@gmail.com>
3393
3394         A fix for bug #80368
3395         * assign.cs (FieldInitializer): New class implements field
3396         initializer statement.
3397
3398         * attribute.cs: Update after FieldMember rename.
3399
3400         * class.cs (PropertyBasedMember): New common class for property based
3401         types.
3402         (InterfaceMemberBase): New base class for all members which can be used as
3403         an interface members.
3404         (MethodCore): Moved really common code to InterfaceMemberBase.
3405         (Method.Define): Equal and GetHasCode detection is relevant for methods
3406         only.
3407         (MethodData.Define): Don't assume that public event implements an
3408         interface automatically.
3409         (MethodData.DefineMethodBuilder): Issue an error even if only extern
3410         modifier is used.
3411         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
3412         (FieldMember): Merged with FieldBase.
3413         (EventProperty.AEventPropertyAccessor): New specialization to check whether
3414         event extern modifier can be used.
3415         (EventField.EventFieldAccessor): Moved event field specific code here.
3416         (Event.AllowedModifiers): Even event can be extern.
3417         (Event.FindOutBaseMethod): New override specific to events.
3418         (Indexer.parameters): Reintroduce parameters because base class holds
3419         only properties common data.
3420         (Indexer.CheckForDuplications): Indexers are threated as methods so we
3421         need do extra parameters check.
3422
3423         * const.cs: Update after FieldMember rename.
3424
3425         * decl.cs (MemberCache.FindBaseEvent): New method.
3426
3427         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
3428         to reflect that indexer is now derived from PropertyBased.
3429
3430         * ecore.cs (GetMemberType): Made public.
3431         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
3432         obsolete event.
3433
3434         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
3435         
3436         * typemanager.cs (CSharpSignature): Correctly print event accessors.
3437         (RegisterEvent): Removed.
3438         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
3439         (GetPrivateFieldOfEvent): Renamed to GetEventField.
3440
3441 2007-01-11  Raja R Harinath  <rharinath@novell.com>
3442
3443         Fix #80249
3444         * statement.cs (CollectionForeach.TryType): Prefer generic
3445         GetEnumerator over non-generic variant.  Fix code to follow comments.
3446
3447 2007-01-09  Raja R Harinath  <rharinath@novell.com>
3448
3449         Fix #80446
3450         * support.cs (ReflectionParameter): Don't use an invalid index on
3451         the generic parameter data.
3452
3453 2007-01-08  Miguel de Icaza  <miguel@novell.com>
3454
3455         * driver.cs: Just add a tiny bit of infrastructure.
3456
3457 2007-01-02  Marek Safar  <marek.safar@gmail.com>
3458
3459         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
3460         where field type is struct from current assembly.
3461         
3462         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
3463         it is possible.
3464
3465 2007-01-02  Marek Safar  <marek.safar@gmail.com>
3466
3467         A fix for bug #80381
3468         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
3469         the core types.
3470
3471         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
3472         messages.
3473         (Namespace.LookupType): Always use core types from corlib when speficied.
3474
3475         * report.cs: A new warning.
3476
3477         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
3478         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
3479         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
3480
3481         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
3482         (InitCoreTypes): Set expression type of object_type and value_type
3483         immediately after lookup.
3484
3485 2007-01-01  Miguel de Icaza  <miguel@novell.com>
3486
3487         * cs-tokenizer.cs: Accept Pc class characters (Connector
3488         Punctuation) as valid identifiers.  Fixes #78259
3489
3490         * expression.cs (Invocation.DoResolve): Moved the check for the
3491         use of `this' for doing method calls to the Invocation resolution
3492         step, after overload resolution has taken place instead of doing
3493         the check at the low-level `This.DoResolve' level.
3494
3495         The `This.DoResolve'(appens before overload resolution, so it has
3496         no way of knowing if the method that will be called will be
3497         instace or static, triggering an erroneous report for cs0188 (Bug
3498         78113).
3499
3500         We now do the check for instance method invocations after we know
3501         what method will be called.
3502
3503         (This.CheckThisUsage): Move the actual use of this structure
3504         checking into its own method and expose it. 
3505
3506         * Everywhere that called Error_ValueCannotBeConverted: pass a new
3507         EmitContext.
3508
3509         Exceptions: Null.ConvertImplicitly,
3510         Constant.ImplicitConversionRequired as there are too many call
3511         sites for passing the ec. 
3512
3513         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
3514         EmitContext, if the value is null, then we do not try to provide
3515         the extra information from the error (If a userdefined conversion
3516         exists, as UserDefinedConversion requires a non null-EmitContext).
3517
3518         Fixes: #80347
3519
3520 2006-12-30  Raja R Harinath  <rharinath@novell.com>
3521
3522         * flowanalysis.cs (MyBitVector): Document some invariants.
3523         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
3524         introduced below, and add a couple of others, 
3525
3526 2006-12-30  Marek Safar  <marek.safar@gmail.com>
3527
3528         * attribute.cs (GetMethodObsoleteAttribute): Uses new
3529         GetPropertyFromAccessor and GetEventFromAccessor.
3530         
3531         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
3532         overrides non-obsolete one.
3533         (Indexer.Define): Error message has been moved to the parser.
3534
3535         * cs-parser.jay: Better syntax errors handling.
3536
3537         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
3538         when an invocation has no arguments.
3539
3540         * ecore.cs: Removed not used caching.
3541
3542         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
3543         implementation.
3544
3545         * report.cs: Add a new warning.
3546
3547         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
3548
3549         * typemanager.cs (enumeration_type): Removed.
3550         (CSharpSignature): Reuses IsSpecialMethod.
3551         (IsEqual): Hack for MS BCL.
3552         (GetPropertyFromAccessor): New method.
3553         (GetEventFromAccessor): New method.
3554         (IsSpecialMethod): Fixed to handle more cases.
3555
3556 2006-12-30  Marek Safar  <marek.safar@gmail.com>
3557
3558         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
3559         Made white spaces array static.
3560
3561         * ecore.cs (RemoveGenericArity): Optimized.
3562
3563         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
3564         10 times faster).
3565         (MyBitVector.initialize_vector): Simplified.
3566
3567 2006-12-22  Miguel de Icaza  <miguel@novell.com>
3568
3569         * ecore.cs: Am not entirely happy with this hack, but it seems to
3570         address the issue in 80257 (a small test case for
3571         CreativeDocs.NET). 
3572
3573         I set the MethodGroupExpr.Type to an internal compiler type
3574         (itself in this case) to force the resolution to take place.   Why
3575         it does not take place with a null is beyond me.
3576
3577 2006-12-20  Marek Safar  <marek.safar@gmail.com>
3578
3579         A fix for bug #80288
3580         * expression.cs (ResolveOperator): Consider user defined conversion for
3581         logical and operator too.
3582         (EmitBranchable): Optimization for logical and when full constant folding
3583         could not be applied but one operand is constant.
3584
3585 2006-12-19  Marek Safar  <marek.safar@gmail.com>
3586
3587         * class.cs (GetClassBases): Write 5 times every day, will never use
3588         FullName for error reporting.
3589
3590         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
3591
3592 2006-12-19  Martin Baulig  <martin@ximian.com>
3593
3594         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
3595         the symbol file info here.
3596
3597 2006-12-18  Marek Safar  <marek.safar@gmail.com>
3598
3599         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
3600         of `elseif' is taking then following sections are not taking.
3601         Fixes an issue reported on mono mailing list.
3602
3603 2006-12-18  Marek Safar  <marek.safar@gmail.com>
3604
3605         A fix for bug #80300
3606         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
3607         a caller is not taking.
3608
3609 2006-12-18  Raja R Harinath  <rharinath@novell.com>
3610
3611         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
3612         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
3613         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
3614         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
3615         * class.cs: Update to changes.
3616
3617 2006-12-17  Marek Safar  <marek.safar@gmail.com>
3618
3619         A fix for bug #79934
3620         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
3621         partial container.
3622
3623         * class.cs (ResolveMembers): Register an iterator in current container and
3624         not in shared one.
3625
3626 2006-12-16  Raja R Harinath  <rharinath@novell.com>
3627
3628         Fix test-543.cs
3629         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
3630         satisfy a params annotated parameter.
3631
3632 2006-12-16  Marek Safar  <marek.safar@gmail.com>
3633
3634         A fix for bug #77014
3635         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
3636         paramters correctly and not rely on hacks in Parameters class.
3637         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
3638         at any possition.
3639         (Invocation.VerifyArgumentsCompat): Ditto.
3640         (Invocation.EmitArguments): Changed to correctly emit params arguments at
3641         any possition.
3642
3643         * parameter.cs (HasParams): Don't assume that params is the last one.
3644
3645         * support.cs (ReflectionParameters.ctor): Look for params attribute
3646         correctly.
3647         (ReflectionParameters.ParameterType): Removed hack when we returned last
3648         parameter for out of range parameters.
3649         (ParameterName, ParameterModifier): Ditto.
3650
3651 2006-12-14  Marek Safar  <marek.safar@gmail.com>
3652
3653         A fix for bug #79987
3654         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
3655         when assembly is not CLS compliant but type is. I have no idea why is this
3656         allowed.
3657
3658         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
3659
3660 2006-12-13  Miguel de Icaza  <miguel@novell.com>
3661
3662         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
3663         in struct constructors, they are basically no-ops.
3664
3665 2006-12-12  Marek Safar  <marek.safar@gmail.com>
3666
3667         * cs-tokenizer.cs (Position): Save preprocessor status too.
3668
3669 2006-12-12  Marek Safar  <marek.safar@gmail.com>
3670
3671         A fix for bug #77794
3672         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
3673
3674 2006-12-12  Marek Safar  <marek.safar@gmail.com>
3675
3676         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
3677         Fixes #69299.
3678         (pp_expr): Report error for an invalid expression.
3679         (handle_preprocessing_directive): Simplified; add more error checking.
3680
3681 2006-12-11  Marek Safar  <marek.safar@gmail.com>
3682
3683         A fix for bug #74939
3684         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
3685         directives handling.
3686
3687 2006-12-10  Marek Safar  <marek.safar@gmail.com>
3688
3689         A fix for bugs #80093, and #75984
3690         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
3691         logic, it seems to me as it worked before "by coincidence".
3692         (xtoken): Simplified to use reworked handle_preprocessing_directive.
3693         (cleanup): Enabled endif check.
3694
3695 2006-12-09  Marek Safar  <marek.safar@gmail.com>
3696
3697         A fix for bug #80162
3698         * statement.cs (CollectionForeach.TryType): Generics and non-generics
3699         enumerators are never ambiguous.
3700
3701 2006-12-08  Raja R Harinath  <rharinath@novell.com>
3702
3703         Fix #80060
3704         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
3705
3706 2006-12-06  Marek Safar  <marek.safar@gmail.com>
3707
3708         A fix for bug #80144
3709         * class.cs (EventProperty.Define): Explicit implementation means
3710         that an even is used.
3711
3712 2006-12-06  Marek Safar  <marek.safar@gmail.com>
3713
3714         Fixes the operators implementation (part II)
3715
3716         * cfold.cs (DoConstantNumericPromotions): Renamed to
3717         DoBinaryNumericPromotions and simplified.
3718         (BinaryFold): Couple of conversion fixes; simplified.
3719
3720         * constant.cs, ecore.cs, literal.cs
3721         (ToType): Renamed to ConvertImplicitly.
3722         (Reduce): Renamed to ConvertExplicitly.
3723
3724         * class.cs, convert.cs: Updated.
3725
3726         * expression.cs: TryReduce doesn't throw an exception.
3727
3728 2006-12-01  Marek Safar  <marek.safar@gmail.com>
3729
3730         A fix for bug #80108
3731         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
3732         compatible.
3733
3734 2006-11-30  Marek Safar  <marek.safar@gmail.com>
3735
3736         Fixes unary operators implementation (part I)
3737         Also fixes #80026
3738
3739         * cfold.cs (Error_CompileTimeOverflow): Made internal
3740
3741         * const.cs (IConstant): Changed to use reference to constant and
3742         not constant itself.
3743         Updated IConstant implementations.
3744
3745         * constant.cs (CreateConstant): New factory method.
3746         Updated IConstant implementation.
3747
3748         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
3749
3750         * ecore.cs: Updated to use CreateConstantReference.
3751
3752         * enum.cs: Reflects IConstant changes.
3753
3754         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
3755
3756         * literal.cs (NullConstant): Change to be independently usable.
3757
3758 2006-11-29  Martin Baulig  <martin@ximian.com>
3759
3760         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
3761         we need to emit the scope initializer before calling the base .ctor.
3762
3763         * anonymous.cs: Merged back from the new anonymous methods branch.
3764         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
3765
3766         * expression.cs (ParameterReference.DoResolveBase): Create a
3767         "normal" ScopeInfo when capturing parameters rather than using the
3768         root scope; this makes things work with anonymous methods having
3769         parameters.
3770
3771         * statement.cs
3772         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
3773
3774 2006-11-22  Marek Safar  <marek.safar@gmail.com>
3775
3776         A fix for bug #79987
3777         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
3778         check to a base class.
3779         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
3780         only when assembly has missing attribute.
3781         * report.cs: Update.
3782
3783 2006-11-21  Marek Safar  <marek.safar@gmail.com>
3784
3785         * cs-tokenizer.cs: Merged with gmcs version.
3786
3787 2006-11-20  Marek Safar  <marek.safar@gmail.com>
3788
3789         * cs-tokenizer.cs,
3790         * cs-parser.jay: Better error message when partial keyword is misplaced.
3791
3792 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
3793
3794         A fix for bug #79810
3795         report.cs: CS1058 only applies to 2.0 profile (gmcs).
3796         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
3797         a RuntimeWrappedException by default.
3798
3799 2006-11-18  Marek Safar  <marek.safar@gmail.com>
3800
3801         A fix for bug #79843
3802         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
3803         implementation.
3804         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
3805
3806 2006-11-18  Marek Safar  <marek.safar@gmail.com>
3807
3808         * driver.cs, namespace.cs: Uses faster IndexOf version.
3809
3810 2006-11-17  Marek Safar  <marek.safar@gmail.com>
3811
3812         A fix for bug #79941
3813         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
3814         operators.
3815         (Operator.Define): Implicit/Explicit operator of same type is duplicate
3816         even if internal name is different.
3817         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
3818         (UserDefinedConversion): Simplified as the operators cannot be internal.
3819         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
3820         conversions.
3821         (MethodLookup): Replaced EmitContext with parentType.
3822         * expression.cs: Updated.
3823
3824 2006-11-09  Raja R Harinath  <rharinath@novell.com>
3825
3826         * driver.cs (BadAssembly): Handle all the ugliness of
3827         DefineDynamicAssembly.
3828
3829 2006-11-08  Raja R Harinath  <rharinath@novell.com>
3830
3831         Address parts of #58244 -- most of what's left is in the runtime
3832         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
3833         CS1509 error checks, and handle them for all assembly loads, not
3834         just the first invocation.
3835         (LoadModule): Likewise.  Move handling of 'adder_method' ...
3836         * codegen.cs (AssemblyClass.AddModule): ... here.
3837
3838 2006-11-02  Marek Safar  <marek.safar@gmail.com>
3839
3840         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
3841         IEnumerable<T> is ambiguous.
3842
3843 2006-10-31  Marek Safar  <marek.safar@gmail.com>
3844
3845         A fix for bug #67689
3846         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
3847         GetEnumerator is ambiguous.
3848
3849         * report.cs: Add new warning.
3850
3851 2006-10-29  Marek Safar  <marek.safar@gmail.com>
3852
3853         A fix for bug #78602
3854         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
3855         to protected member can be nested type.
3856
3857 2006-10-28  Marek Safar  <marek.safar@gmail.com>
3858
3859         A fix for bug #78965
3860         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
3861         to protected member must derive from current type.
3862
3863 2006-10-27  Marek Safar  <marek.safar@gmail.com>
3864
3865         assign.cs: Reuses error method.
3866
3867         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
3868         instead of type for constants.
3869         (Expression.Error_ValueAssignment): Common error method.
3870
3871         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
3872         for any assignment.
3873
3874 2006-10-27  Marek Safar  <marek.safar@gmail.com>
3875
3876         A fix for bug #79081
3877         * expression.cs (MemberAccess.DoResolve): Check nested type
3878         accessibility.
3879
3880 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
3881
3882         * doc.cs : nested delegates were not handled. Fixed bug #79754.
3883
3884 2006-10-26  Marek Safar  <marek.safar@gmail.com>
3885
3886         A fix for bug #76591
3887         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
3888
3889 2006-10-26  Marek Safar  <marek.safar@gmail.com>
3890
3891         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
3892         type forwarder of the same type multiple times.
3893
3894 2006-10-26  Raja R Harinath  <rharinath@novell.com>
3895
3896         Fix #78820
3897         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
3898         instance as an rvalue, even when we later resolve as an lvalue.
3899
3900 2006-10-25  Martin Baulig  <martin@ximian.com>
3901
3902         * anonymous.cs: Fix #79673.
3903
3904 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
3905
3906         A fix for bug #79666
3907         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
3908         ignored when is optimized (= default value) as its value is already set.
3909
3910 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
3911
3912         A fix for bug #79724
3913         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
3914         TypeContainer for type lookup.
3915
3916 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
3917
3918         A fix for bug #79231
3919         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
3920         * expression.cs (OverloadResolve): Always convert type name for
3921         an error message.
3922         (ResolveNamespaceOrType): Don't confuse a nested type with any 
3923         other member.
3924
3925 2006-10-18  Martin Baulig <martin@ximian.com>
3926
3927         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
3928
3929 2006-10-17  Miguel de Icaza  <miguel@novell.com>
3930
3931         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
3932         an int32, but requesting an int64 from the conversion
3933
3934 2006-10-12  Martin Baulig  <martin@ximian.com>
3935
3936         * anonymous.cs
3937         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
3938         
3939 2006-10-12  Martin Baulig  <martin@ximian.com>
3940
3941         * statement.cs
3942         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
3943
3944 2006-10-11  Miguel de Icaza  <miguel@novell.com>
3945
3946         * convert.cs: Remove broken code: I was doing the "Existance"
3947         tests for Implicit conversions.
3948
3949 2006-10-10  Miguel de Icaza  <miguel@novell.com>
3950
3951         * convert.cs: Added one missing case in
3952         ImplicitStandardConversionExists uint64 to intptr.
3953
3954         Fixes #59800
3955         
3956         * typemanager.cs (uintptr_type): another core known type.   
3957
3958         * ecore.cs (OperatorCast): routine used to do cast operations that
3959         depend on op_Explicit.  We could change some of the Decimal
3960         conversions to use this.
3961
3962         This one has a probe mechanism that checks both types for an op_
3963         which it coudl be used to eliminate two classes: CastToDecimal
3964         and CastFromDecimal.
3965
3966         * convert.cs: Implement the conversions documented in #59800
3967         
3968 2006-10-10  Martin Baulig  <martin@ximian.com>
3969
3970         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
3971         before RootScope.ResolveMembers().
3972
3973         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
3974         `CurrentType' if appropriate.
3975
3976 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
3977
3978         A fix for bug #78568
3979         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
3980         when contains binary operators.
3981         * cs-parser.jay: Updated.
3982
3983 2006-10-09  Martin Baulig  <martin@ximian.com>
3984
3985         * delegate.cs
3986         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
3987         moved that into Define() and also do the other type parameter
3988         checks there.  Fixes #79094.  Added gtest-292.cs.
3989
3990         * expression.cs
3991         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
3992         since that doesn't include type parameters; don't use `Ldelema'
3993         for type parameters.  Fixes #78980.  Added gtest-293.cs.
3994
3995 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
3996
3997         A fix for #77796
3998         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
3999         conversion is allowed.
4000
4001 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
4002
4003         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
4004         error reporting when no error occurs.
4005
4006 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
4007
4008         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
4009         does not exist.
4010
4011 2006-10-06  Raja R Harinath  <rharinath@novell.com>
4012
4013         Fix #79584
4014         * class.cs (DefineTypeBuilder): Check circular dependencies before
4015         setting the parent of the TypeBuilder.
4016         (CheckRecursiveDefinition): Don't use 'BaseType', since
4017         it may not be valid until after DefineTypeBuilder.  Use
4018         'base_type' instead.
4019
4020 2006-10-04  Martin Baulig  <martin@ximian.com>
4021
4022         Merged the Anonymous Methods patch.
4023
4024         * anonymous.cs, iterators.cs: The new anonymous methods code.
4025
4026         * statement.cs (Variable): New public abstract class.
4027         (LocalInfo.Variable): New public property.
4028         (LocalInfo.ResolveVariable): New public method.
4029         (Block.Flags): Add `IsIterator'.
4030         (Block.AddVariable): Improved the CS0136 check.
4031         (Block.AnonymousChildren): New public property.
4032         (Block.AddAnonymousChild): New public method.
4033         (ToplevelBlock): Update to use the new anonymous method framework.
4034         (ToplevelBlock.ctor): `container' is now a `Block' and not a
4035         `ToplevelBlock'; this is required to correctly implement the
4036         CS0136 check.
4037         (Fixed, Using): Use `TemporaryVariable' instead of directly
4038         creating the `LocalBuilder'.
4039
4040         * parameter.cs (Parameter.ResolveVariable): New public method.
4041         (Parameters.ResolveVariable): Likewise.
4042
4043         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
4044
4045         * class.cs (TypeContainer): Replaced the `iterators' list and
4046         corresponding methods with a list of `CompilerGeneratedClass'es.
4047         (TypeContainer.ResolveMembers): New public method.
4048         (Method): `IIteratorContainer' has been replaced by
4049         `IAnonymousHost'.
4050
4051         * expression.cs (VariableReference): New public abstract base
4052         class for `LocalVariableReference', `ParameterReference' and
4053         `This'.
4054
4055         * codegen.cs (EmitContext): Removed `capture_context',
4056         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
4057         (EmitContext.EmitThis): Removed.
4058
4059         * cs-parser.jay: Replace `iterator_container' with
4060         `anonymous_host'.       
4061
4062 2006-10-04  Martin Baulig  <martin@ximian.com>
4063
4064         * generic.cs (GenericMethod): Don't make this abstract.
4065         (Constraints.Clone): Added dummy implementation.
4066
4067 2006-10-04  Raja R Harinath  <harinath@gmail.com>
4068
4069         Fix #79577
4070         * namespace.cs (LookForAnyGenericType): Avoid nullref on
4071         'declspaces'.  Avoid allocating arrays willy-nilly.
4072
4073         Fix #79553
4074         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
4075         cases out of the switch.
4076
4077 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
4078
4079         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
4080         message when non-generic type is used with the type arguments.
4081         * expression.cs: Updated.
4082
4083 2006-09-28  Raja R Harinath  <rharinath@novell.com>
4084
4085         Fix #79013
4086         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
4087         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4088         Change semantics slightly.  Don't insist on having only one
4089         temporary EmptyExpression -- just throttle the creation of new ones.
4090
4091         Fix #79451
4092         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
4093         non-interfaces too.  If no methods are found, don't try to create
4094         a MethodGroupExpr.
4095
4096 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
4097
4098         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
4099         generic type.
4100
4101         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
4102         us produce better error message.
4103
4104 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
4105
4106         * expression.cs (Binary.ResolveOperator): Warn about a side effect
4107         of the `|' operator.
4108
4109         * report.cs: A new warning added.
4110
4111 2006-09-27  Martin Baulig  <martin@ximian.com>
4112
4113         * generic.cs (GenericMethod): Don't make this abstract.
4114
4115 2006-09-27  Martin Baulig  <martin@ximian.com>
4116
4117         * report.cs
4118         (InternalErrorException): Added overloaded ctor taking a params array.
4119
4120 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
4121
4122         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
4123         Fixed the cases when same error was reported twice.
4124
4125         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
4126         now report symbol information.
4127
4128 2006-09-25  Martin Baulig  <martin@ximian.com>
4129
4130         * class.cs: Completely unified with the gmcs version.
4131
4132 2006-09-25  Martin Baulig  <martin@ximian.com>
4133
4134         * typemanager.cs (TypeManager.IsNullableType): New public function.
4135         (TypeManager.IsNullableTypeOf): Likewise.
4136         (TypeManager.IsNullableValueType): Likewise.
4137
4138         * class.cs (MethodCore): Added the `GenericMethod' argument from
4139         gmcs and also unified all classes derived from `MethodCore' with gmcs.
4140
4141 2006-09-24  Raja R Harinath  <harinath@gmail.com>
4142
4143         * convert.cs: Unify with gmcs version.
4144
4145 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
4146
4147         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
4148         verify them as well.
4149
4150         * report.cs: New warning.
4151
4152 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
4153
4154         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
4155         for anonymous block with out argument.
4156
4157 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
4158
4159         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
4160         not used private events only.
4161
4162 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
4163
4164         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
4165
4166         * const.cs (Const.Define): Check for constant type.
4167         (Const.IsConstantTypeValid): Looks for valid constant types.
4168
4169         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
4170
4171         * ecore.cs (EmptyConstantCast): New common class for all constant based
4172         EmptyCast(s).
4173
4174         * expression.cs (Is.DoResolve): Handle null constant especially.
4175         (New.DoResolve): Check for new void().
4176         (MemberAccess.DoResolve): Cope with all kind of nulls.
4177
4178         * literal.cs (NullConstant): Uses EmptyConstantCast.
4179         (NullDefault): Based on EmptyConstantCast.
4180         (NullLiteral): Uses EmptyConstantCast.
4181
4182         * statement.cs (Block.ResolveMeta): Check for constant type.
4183
4184 2006-09-22  Martin Baulig  <martin@ximian.com>
4185
4186         * delegate.cs, attribute.cs: Merged with the gmcs versions.
4187
4188 2006-09-22  Raja R Harinath  <rharinath@novell.com>
4189
4190         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
4191         not the null type.
4192
4193         Fix part of #79451
4194         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
4195         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
4196         code slightly.
4197
4198 2006-09-22  Martin Baulig  <martin@ximian.com>
4199
4200         * ecore.cs: Merged with the gmcs version.
4201
4202         * generic.cs (ConstructedType): New dummy class.
4203         (TypeArguments): Don't make this abstract.
4204
4205         * typemanager.cs
4206         (TypeManager.IsGenericTypeDefinition): New method.
4207         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
4208
4209 2006-09-22  Raja R Harinath  <rharinath@novell.com>
4210
4211         * expression.cs (ComposedCast): Check for arrays of TypedReference
4212         before creating the type, not after.
4213
4214 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
4215
4216         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
4217         after ToType change.
4218
4219         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
4220         when constant must be implicitly convertible.
4221
4222         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
4223
4224         * ecore.cs (NullCast): Derives from NullConstant.
4225
4226         * expression.cs (Is.DoResolve): Removed useless variables.
4227         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
4228         (New.Constantify): Add enum support.
4229         (MemberAccess.DoResolve): Add warning when accessing null constant or
4230         variable.
4231
4232         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
4233         property.
4234
4235         * literal.cs (NullConstant): New abstract class with common
4236         functionality for all null specializations.
4237         (NullDefault): Represents default(X) when result can be
4238         reduced to null.
4239         (NullLiteral): Updated.
4240
4241         * report.cs: Add new warning.
4242
4243 2006-09-21  Martin Baulig  <martin@ximian.com>
4244
4245         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
4246
4247 2006-09-21  Martin Baulig  <martin@ximian.com>
4248
4249         * generic.cs (GenericConstraints): New dummy class.
4250         (Constraints): Likewise.
4251         (TypeParameter): Likewise.
4252         (TypeParameterName): Likewise.
4253         (GenericMethod): Likewise.
4254
4255         * typemanager.cs (TypeManager.GetGenericArguments): New method.
4256
4257         * decl.cs: Merged with the gmcs version.
4258
4259 2006-09-21  Raja R Harinath  <rharinath@novell.com>
4260
4261         * generic.cs (TypeParameter): Implement IMemberContainer.
4262         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
4263
4264         * rootcontext.cs: Unify with gmcs version.
4265
4266         * report.cs: Unify with gmcs version.
4267         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
4268         from gmcs/generics.cs.
4269         * generics.cs (TypeParameter): New dummy class.
4270
4271         * support.cs: Unify with gmcs version.
4272
4273 2006-09-20  Raja R Harinath  <rharinath@novell.com>
4274
4275         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
4276         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
4277
4278         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
4279         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
4280         * mcs.exe.sources: Add generic.cs.
4281
4282         * codegen.cs: Unify with gmcs version.
4283
4284         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
4285         (EmitContext): Add GenericDeclContainer implementation.
4286         * decl.cs (MemberCore, DeclSpace): Likewise.
4287         * namespace.cs: Remove #ifdef GMCS_SOURCE.
4288
4289         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
4290         MCS TypeManager has a corresponding dummy method.
4291
4292 2006-09-19  Martin Baulig  <martin@ximian.com>
4293
4294         * expression.cs: Completely merged with the gmcs version.
4295
4296 2006-09-19  Martin Baulig  <martin@ximian.com>
4297
4298         * expression.cs (Invocation): Merged with the gmcs version.
4299         (ArrayAccess.GetStoreOpcode): Likewise.
4300
4301 2006-09-19  Martin Baulig  <martin@ximian.com>
4302
4303         * typemanager.cs
4304         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
4305         (TypeManager.IsGenericMethodDefinition): Likewise.
4306
4307 2006-09-19  Martin Baulig  <martin@ximian.com>
4308
4309         * typemanager.cs
4310         (TypeManager.IsEqual): Moved the gmcs implementation here.
4311         (TypeManager.DropGenericTypeArguments): Likewise.
4312         (TypeManager.DropGenericMethodArguments): Likewise.
4313         (TypeManager.GetTypeArguments): Moved here from gmcs.
4314         (TypeManager.HasGenericArguments): Likewise.
4315
4316 2006-09-19  Martin Baulig  <martin@ximian.com>
4317
4318         * expression.cs (Binary): Merged with the gmcs version.
4319
4320 2006-09-19  Martin Baulig  <martin@ximian.com>
4321
4322         * expression.cs (Probe, As, Is): Merged with the gmcs version.
4323
4324 2006-09-19  Martin Baulig  <martin@ximian.com>
4325
4326         * typemanager.cs: Merged with the gmcs version.
4327
4328 2006-09-16  Raja R Harinath  <rharinath@novell.com>
4329
4330         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
4331         * driver.cs: Likewise.
4332
4333 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
4334
4335         A fix for #79401
4336         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
4337         only if parent type is class.
4338         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
4339         update.
4340
4341 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
4342
4343         * cs-parser.jay,
4344         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
4345         keywords are used.
4346         * typemanager.cs(CSharpName): Converts NullType to null.
4347
4348 2006-09-15  Martin Baulig  <martin@ximian.com>
4349
4350         * typemanager.cs
4351         (TypeManager.GetMethodName): Added mcs implementation.
4352         (TypeManager.IsEqual): Likewise.
4353
4354         * ecore.cs
4355         (SimpleName.RemoveGenericArity): Added dummy implementation.
4356
4357         * pending.cs: Merged with the gmcs version.     
4358
4359 2006-09-15  Martin Baulig  <martin@ximian.com>
4360
4361         * statement.cs: Merge with the gmcs version.
4362
4363 2006-09-15  Martin Baulig  <martin@ximian.com>
4364
4365         * statement.cs (Switch): Merge with the gmcs implementation
4366         (without nullables), which is newer.
4367
4368 2006-09-15  Martin Baulig  <martin@ximian.com>
4369
4370         * statement.cs (Block.Variables): Make this public.
4371         (ToplevelBlock.Parameters): Make this a property.
4372         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
4373
4374 2006-09-15  Martin Baulig  <martin@ximian.com>
4375
4376         * namespace.cs: Merge with the gmcs version.
4377
4378 2006-09-15  Martin Baulig  <martin@ximian.com>
4379
4380         * decl.cs (MemberName): Minor code cleanups.
4381
4382 2006-09-15  Martin Baulig  <martin@ximian.com>
4383
4384         * parameter.cs: Merge with the gmcs version.
4385
4386 2006-09-15  Martin Baulig  <martin@ximian.com>
4387
4388         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
4389         and an error in mcs.
4390
4391 2006-09-15  Martin Baulig  <martin@ximian.com>
4392
4393         * flowanalysis.cs: Merged from GMCS; added the generics code into
4394         a `GMCS_SOURCE' conditional so we can share this file.
4395
4396 2006-09-08  Martin Baulig  <martin@ximian.com>
4397
4398         * typemanager.cs (TypeManager.interlocked_type): New public field.
4399         (TypeManager.int_interlocked_compare-exchange): New public field.
4400         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
4401         enumerator types here and call InitGenericCoreTypes().
4402         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
4403         after calling InitEnumUnderlyingTypes().
4404
4405         * rootcontext.cs
4406         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
4407         `classes_second_stage'. 
4408
4409 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
4410
4411         * assign.cs, ecore.cs, expression.cs: Share error message text.
4412         * class.cs (FieldMember.Define): Check for varible of static type.
4413         * driver.cs (LoadAssembly): Uses error output for errors.
4414         * statement.cs: Updated.
4415
4416 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
4417
4418         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
4419         type instance.
4420
4421 2006-09-07  Martin Baulig  <martin@ximian.com>
4422
4423         * driver.cs
4424         (MainDriver): Revert r62663 from Marek; see #70506 for details.
4425
4426 2006-08-29  Miguel de Icaza  <miguel@novell.com>
4427
4428         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
4429         
4430 2006-08-17  Miguel de Icaza  <miguel@novell.com>
4431
4432         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
4433         #52019 and #79064, the use of the \uXXXX sequence in source code
4434         to represent unicode characters.
4435
4436 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
4437
4438         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
4439         support.
4440         * class.cs, ecore.cs, statement.cs: Merged to one error message.
4441
4442 2006-08-13  Miguel de Icaza  <miguel@novell.com>
4443
4444         * assign.cs: Catch attempts to assign to a method groups in += and
4445         report as 1656
4446
4447 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
4448
4449         A fix for #79056
4450         * cs-parser.jay: Don't destroy current array type by typeof of array's.
4451
4452 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
4453
4454         * class.cs (Method.Define): Issue a warning when generic method looks like
4455         an entry point.
4456         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
4457         as well.
4458
4459 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
4460  
4461         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
4462         looking for ctor.
4463         * decl.cs (MemberCache.FindMembers): When container is interface we need to
4464         search all base interfaces as a member can be ambiguous.
4465         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
4466         Constructor member type filter. 
4467         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
4468         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
4469         reporting for returned memberinfos.
4470         * report.cs: Updated.
4471         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
4472         version to work on all runtimes.
4473         (TypeManager.RealMemberLookup): Removed members filtering.
4474
4475 2006-08-08  Raja R Harinath  <rharinath@novell.com>
4476
4477         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
4478         (PropertyExpr.EmitAssign): Likewise.
4479         * expression.cs (Indirection.EmitAssign): Likewise.
4480         (LocalVariableReference.EmitAssign): Likewise.
4481         (ParameterReference.EmitAssign): Likewise.
4482         (Invocation.EmitArguments): Likewise.
4483         (ArrayAccess.EmitAssign): Likewise.
4484         (IndexerAccess.EmitAssign): Likewise.
4485         (This.EmitAssign): Likewise.
4486         (ConditionalLogicalOperator.Emit): Likewise.
4487
4488         Fix #79026
4489         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
4490         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
4491         leave it in after returning it.
4492         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
4493
4494 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
4495
4496         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
4497         message.
4498
4499 2006-08-03  Raja R Harinath  <rharinath@novell.com>
4500
4501         Fix cs0146-3.cs and cs0146-4.cs.
4502         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
4503         enclosing types don't depend on the current type.
4504
4505 2006-08-02  Raja R Harinath  <rharinath@novell.com>
4506
4507         Fix #77963
4508         * class.cs (TypeContainer.DoDefineMembers): Use
4509         FindBaseMemberWithSameName on Parent, since we're interested in
4510         whether we hide inherited members or not.
4511         (FindBaseMemberWithSameName): Make slightly more robust.
4512
4513         Fix the non-generic testcase from #77396
4514         * decl.cs (DeclSpace.DeclContainer): Remove override.
4515
4516         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
4517         declspaces for doppelgangers too.
4518         (UsingEntry): Implement IResolveContext.
4519         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
4520         'this' as the resolve context.
4521         (LocalAliasEntry): Likewise.
4522
4523         Implement parts of #77403
4524         * roottypes.cs (RootDeclSpace): New.  Used to represent the
4525         toplevel declaration space.  Each namespace declaration introduces
4526         a "partial" root declaretion space.
4527         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
4528         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
4529         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
4530         from 'current_namespace.SlaveDeclSpace'.
4531         (namespace_declaration): Likewise.
4532         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
4533         check.  It can't happen now.
4534         * decl.cs (DeclSpace.LookupType): Likewise.
4535         * driver.cs (MainDriver): Sanity check.
4536
4537 2006-08-01  Raja R Harinath  <rharinath@novell.com>
4538
4539         * decl.cs (DeclSpace.FindNestedType): Remove.
4540         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
4541         LookupTypeContainer to get the container of the nested type.
4542         * class.cs (TypeContainer.FindNestedType): Make non-override.
4543
4544 2006-07-31  Raja R Harinath  <rharinath@novell.com>
4545
4546         * decl.cs (DeclSpace.PartialContainer): Move field from ...
4547         * class.cs (TypeContainer.PartialContainer): ... here.
4548         (TypeContainer.AddBasesForPart): New helper.
4549         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
4550         instead.
4551         * cs-parser.jay (current_class): Convert to DeclSpace.
4552         (struct_declaration, interface_declaration, class_declaration):
4553         Use AddBasesForPart instead of .Bases directly.
4554         * const.cs, iterators.cs: Update to changes.
4555
4556 2006-07-28  Raja R Harinath  <rharinath@novell.com>
4557
4558         * class.cs (TypeContainer.AddMemberType): Rename from
4559         AddToTypeContainer.
4560         (TypeContainer.AddMember): Rename from AddToMemberContainer.
4561         (AddTypeContainer): New.  Combine AddClassOrStruct and
4562         AddInterface.
4563         (AddPartial): Update.  Add 'is_partial' argument.
4564         * roottypes.cs: Update to changes.
4565         * cs-parser.jay (push_current_class): New helper for handling
4566         current_container and current_class.
4567         (struct_declaration, interface_declaration, class_declaration):
4568         Use it.
4569
4570 2006-07-26  Raja R Harinath  <rharinath@novell.com>
4571
4572         * roottypes.cs: Rename from tree.cs.
4573
4574         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
4575         * tree.cs (Tree, ITreeDump): Remove types.
4576         * rootcontext.cs (tree, Tree): Remove fields.
4577         (root, ToplevelTypes): New.
4578         * *.cs: Update to rename.
4579
4580         * tree.cs (Tree.RecordDecl): Remove.
4581         (RootTypes.AddToTypeContainer): Record the toplevel type in its
4582         namespace here.
4583         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
4584
4585 2006-07-23  Raja R Harinath  <harinath@gmail.com>
4586
4587         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
4588         DoFlowAnalysis and OmitStructFlowAnalysis here.
4589         (ec.With): Rename from WithUnsafe and generalize.
4590         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
4591         (ec.WithFlowAnalyis): New.
4592         * ecore.cs, expression.cs, statement.cs: Update.
4593
4594 2006-07-22  Raja R Harinath  <harinath@gmail.com>
4595
4596         * statement.cs (Block.ResolveMeta): Simplify slightly.
4597
4598         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
4599         multiple boolean fields.  Convert InUnsafe, constant_check_state,
4600         check_state to flags.
4601         (CheckState, ConstantCheckState): Update.
4602         (InUnsafe): New read-only property.
4603         (FlagsHandle): Rename from CheckStateHandle and convert to handle
4604         arbitrary flags.
4605         (WithUnsafe): New helper similar to WithCheckState.
4606         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
4607         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
4608
4609 2006-07-21  Raja R Harinath  <rharinath@novell.com>
4610
4611         Make comparisons use the same IL irrespective of whether they're
4612         in a 'checked' or 'unchecked' context: one of the issues in #78899
4613         * codegen.cs (EmitContext.CheckState): Make read-only property.
4614         (EmitContext.ConstantCheckState): Likewise.
4615         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
4616         helper that implement a save/restore stack for CheckState
4617         values.  This is the only way to change check-state.
4618         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
4619         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
4620         (CheckedExpr.EmitBranchable): New forwarding method.
4621         (UnCheckedExpr): Likewise.
4622         * statement.cs (Block.ResolveMeta): Use WithCheckState.
4623         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
4624         (Checked.Resolve, checked.DoEmit): Likewise.
4625
4626 2006-07-20  Miguel de Icaza  <miguel@novell.com>
4627
4628         * anonymous.cs: Cache the resolved anonymous delegate, and return
4629         this so that the ResolveTopBlock is only triggered once, not
4630         twice.
4631
4632         Currently we trigger ResolvetopBlock twice due to a first pass of
4633         argument check compatibility, and a second pass that does the
4634         actual resolution.   
4635         
4636 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
4637
4638         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
4639         modifiers.
4640         * rootcontext.cs (Reset): Add helper_classes.
4641
4642 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
4643
4644         A fix for #78860
4645         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
4646         correctly.
4647
4648 2006-07-13  Miguel de Icaza  <miguel@novell.com>
4649
4650         * statement.cs (Lock): Handle expressions of type
4651         TypeManager.null_type specially.  Fixes #78770
4652
4653 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
4654
4655         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
4656         to an event.
4657
4658 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
4659
4660         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
4661         for accessors as well.
4662         * ecore.cs (EventExpr): Add AccessorTable.
4663
4664 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
4665
4666         A fix for #78738
4667         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
4668         for CS0122 where appropriate.
4669         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
4670         level attributes.
4671         (Filter): Assembly can be null in the case of top level attributes.
4672
4673 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
4674
4675         A fix for #78690
4676
4677         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
4678         is done at global level.
4679
4680 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
4681
4682         A fix for #77002, Implemented TypeForwarder support.
4683
4684         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
4685         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
4686         * typemanager.cs (): Add type_forwarder_attr_type.
4687
4688 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
4689
4690         * report.cs: Add CS0469 warning.
4691
4692 2006-06-21  Martin Baulig  <martin@ximian.com>
4693
4694         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
4695         the `try'-block, so we also report CS0016 etc. there.
4696
4697 2006-06-21  Martin Baulig  <martin@ximian.com>
4698
4699         * delegate.cs
4700         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
4701
4702 2006-06-21  Martin Baulig  <martin@ximian.com>
4703
4704         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
4705         also report CS1686 for parameters.
4706
4707 2006-06-21  Martin Baulig  <martin@ximian.com>
4708
4709         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
4710         instead of an error if the value is not implicitly convertible to
4711         the switch types; fixes #77964.
4712
4713 2006-06-21  Raja R Harinath  <rharinath@novell.com>
4714
4715         Fix #78673
4716         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
4717         FieldBuilder is null.
4718
4719         Fix #78662
4720         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
4721         'left' and 'right' before error-checking.
4722
4723 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
4724
4725         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
4726         Fixed bug #78601.
4727         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
4728         (FieldExpr.DoResolve): likewise.
4729         (PropertyExpr.InstanceResolve): likewise.
4730         (EventExpr.InstanceResolve): likewise. 
4731
4732 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
4733
4734         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
4735         attribute applicable tests for attribute argument.
4736
4737 2006-06-02  Raja R Harinath  <rharinath@novell.com>
4738
4739         Fix #78079
4740         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
4741         (Binary.OverloadResolve_PredefinedIntegral): New.
4742         (Binary.OverloadResolve_PredefinedFloating): New.
4743         (Binary.OverloadResolve_PredefinedString): New.
4744         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
4745         Follow the standard more closely, and treat numeric promotions in
4746         terms of overload resolution.
4747         (Binary.CheckShiftArguments): Simplify.
4748
4749 2006-06-01  Raja R Harinath  <rharinath@novell.com>
4750
4751         * flowanalysis.cs (MyBitVector): Simplify representation.
4752         (MyBitVector.Clone): Avoid allocating BitArray.
4753         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
4754         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
4755         (*): Update.  Change all references to MyBitVector.And and
4756         MyBitVector.Or to &= and |=.
4757
4758 2006-05-29  Raja R Harinath  <rharinath@novell.com>
4759
4760         Fix cs0231-[34].cs.
4761         * cs-parser.jay (formal_parameter_list): Extend the pattern below
4762         to param arguments too.
4763
4764 2006-05-26  Miguel de Icaza  <miguel@novell.com>
4765
4766         * cs-parser.jay: Catch another parsing form for arglist being
4767         followed by other arguments.  Fixes #78313.
4768
4769 2006-05-24  Raja R Harinath  <rharinath@novell.com>
4770
4771         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
4772         checking of out parameters to ...
4773         (FlowBranchingToplevel.Merge): ... here.
4774         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
4775         set, propagate the origin upward, and only complain if there was
4776         no other error.
4777         (FlowBranchingException.AddContinueOrigin): Likewise.
4778         (FlowBranchingException.AddReturnOrigin): Likewise.
4779         (FlowBranchingException.AddGotoOrigin): Likewise.       
4780
4781 2006-05-23  Raja R Harinath  <rharinath@novell.com>
4782
4783         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
4784         unreachable, skip it.
4785         (FlowBranchingException.Merge): Always propagate jumps, even if
4786         the finally block renders subsequent code unreachable.
4787
4788 2006-05-18  Raja R Harinath  <rharinath@novell.com>
4789
4790         Fix #77601
4791         * statement.cs (Goto.Resolve): Move responsibility for resolving
4792         'goto' to FlowBranching.AddGotoOrigin.
4793         (Goto.SetResolvedTarget): New.  Callback to set the
4794         LabeledStatement that's the target of the goto.
4795         (Goto.DoEmit): Use Leave instead of Br when crossing an
4796         unwind-protect boundary.
4797         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
4798         LookupLabel and adjust to new semantics.
4799         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
4800         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
4801         Goto.SetResolvedTarget to update target.
4802         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
4803         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
4804         AddBreakOrigin & co.  Delay propagation until ...
4805         (FlowBranchingException.Merge): ... this.
4806
4807         * statement.cs (Block.Resolve): Always depend on flow-branching to
4808         determine unreachability.  Kill workaround that originally emitted
4809         only one statement after an "unreachable" label (see infloop in
4810         test-515.cs).
4811
4812         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
4813         This is still "wrong", but anything better would probably need a
4814         multi-pass algorithm.
4815         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
4816         usage vector.  Force current usage vector to be reachable, to
4817         optimistically signify backward jumps.
4818         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
4819         detected.
4820         (FlowBranchingLabeled.Merge): New.  If no backward jump was
4821         detected, return the original salted-away usage vector instead,
4822         updated with appropriate changes.  Print unreachable warning if
4823         necessary.
4824         * statement.cs (Block.Resolve): Don't print unreachable warning on
4825         a labeled statement.
4826
4827 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
4828
4829         * driver.cs: Pass filename without path to AssemblyBuilder's 
4830         AddResourceFile. Fixes bug #78407.
4831
4832 2006-05-17  Raja R Harinath  <rharinath@novell.com>
4833
4834         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
4835         * flowanalysis.cs (FlowBranchingLabeled): ... here.
4836         (FlowBranching.MergeChild): Overwrite
4837         reachability information from Labeled branchings too.
4838
4839 2006-05-16  Raja R Harinath  <rharinath@novell.com>
4840
4841         * statement.cs (Goto.Resolve): Merge jump origins here ...
4842         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
4843
4844         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
4845         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
4846         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
4847         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
4848         here, ...
4849         * statement.cs (Goto.Resolve): ... not here.
4850         (Goto.Emit): Remove CS1632 check.
4851
4852 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
4853
4854         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
4855         error message.
4856
4857 2006-05-11  Raja R Harinath  <rharinath@novell.com>
4858
4859         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
4860         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
4861         (FlowBranchingException.Label): Likewise.
4862
4863         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
4864         given value.
4865         (MyBitVector.Or): Use it to avoid losing information (Count).
4866         (FlowBranching.MergeOrigins): Likewise.
4867
4868         * flowanalysis.cs (UsageVector.IsDirty): Remove.
4869         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
4870         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
4871         (UsageVector.ToString): Simplify.
4872         (UsageVector.MergeSiblings): Move here from ...
4873         (FlowBranching.Merge): ... here.
4874         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
4875         not a MyBitVector.
4876
4877 2006-05-10  Raja R Harinath  <rharinath@novell.com>
4878
4879         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
4880         null bitvector is treated as all-true.
4881
4882         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
4883         (MyBitVector): Rationalize invariants.  'vector != null' implies
4884         that we have our own copy of the bitvector.  Otherwise,
4885         'InheritsFrom == null' implies all inherited bits are true.
4886
4887 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
4888
4889         * statement.cs (LocalInfo): Add IsConstant.
4890         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
4891         local variable for constants.
4892
4893 2006-05-09  Raja R Harinath  <rharinath@novell.com>
4894
4895         * flowanalysis.cs (MyBitVector.Empty): New.
4896         (MyBitVector): Don't allow InheritedFrom to be null.
4897         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
4898         (UsageVector, FlowBranching): Update to changes.
4899
4900         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
4901         recursion.  The 'Parent == null' condition isn't sufficient for
4902         anonymous methods.
4903         (FlowBranching.AddBreakOrigin): Likewise.
4904         (FlowBranching.AddContinueOrigin): Likewise.
4905         (FlowBranching.AddReturnOrigin): Likewise.
4906         (FlowBranching.StealFinallyClauses): Likewise.
4907         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
4908         (FlowBranching.CheckOutParameters): Likewise.
4909         (FlowBranchingToplevel): Terminate all the above recursions here.
4910         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
4911         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
4912
4913         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
4914         toplevel block.
4915         (FlowBranchingToplevel): New.  Empty for now.
4916         (FlowBranching.MergeTopBlock): Update.
4917         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
4918         branching for the anonymous delegate.
4919         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
4920
4921         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
4922         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
4923         information at the start of the merge.  Reorganize.
4924
4925 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
4926
4927         * class.cs (MethodData.Define): Method cannot implement interface accessor.
4928
4929 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
4930
4931         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
4932         to newly introduced ctor.
4933
4934         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
4935         message to one place.
4936         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
4937         global namespace.
4938
4939 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
4940
4941         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
4942
4943         * ecore.cs (Expression.ResolveAsConstant): Updated.
4944
4945         * statement.cs (ResolveMeta): Updated.
4946
4947 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
4948
4949         * cs-parser.jay: __arglist cannot be used in initializer.
4950
4951 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
4952
4953         A fix for #77879
4954         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
4955         private types.
4956
4957 2006-05-05  Raja R Harinath  <rharinath@novell.com>
4958
4959         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
4960         (LabeledStatement): Add 'name' parameter.
4961         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
4962         (Block.AddLabel): Update to changes.
4963         * cs-parser.jay (labeled_statement): Likewise.
4964
4965         * flowanalysis.cs (BranchingType.Labeled): New.
4966         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
4967         (FlowBranchingLabeled): New.  Does nothing for now, but will
4968         eventually handle 'goto' flows.
4969         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
4970         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
4971         that's terminated ...
4972         (Block.Resolve): ... here.
4973
4974         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
4975         (UsageVector.MergeFinallyOrigins): Likewise.
4976         (FlowBranching.InTryOrCatch): Likewise.
4977         (FlowBranching.AddFinallyVector): Likewise.
4978         (FlowBranchingException): Update to changes.
4979
4980         Fix #78290
4981         * statement.cs (Return.Resolve): Move error checking to ...
4982         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
4983         (FlowBranchingException): Handle return origins like break and
4984         continue origins.
4985         (FlowBranching.UsageVector.CheckOutParameters): Remove.
4986
4987 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
4988
4989         A fix for #76122
4990         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
4991         filter.
4992
4993 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
4994
4995         A fix for #77543
4996         * class.cs (MethodData.Define): Do public accessor check only when method
4997         implements an interface.
4998
4999 2006-05-04  Raja R Harinath  <rharinath@novell.com>
5000
5001         Remove special handling of 'break'
5002         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
5003         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
5004         (UsageVector.Break): Remove.
5005         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
5006         reachability.
5007         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
5008
5009         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
5010         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
5011
5012 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
5013
5014         A fix for #75726
5015         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
5016         be the interface member.
5017
5018 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
5019
5020         A fix for #60069
5021         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
5022         for emitting small (int) values.
5023
5024 2006-05-03  Raja R Harinath  <rharinath@novell.com>
5025
5026         Fix #59427
5027         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
5028         control-flow passes through the 'finally' after merging-in all the
5029         control-flows from 'try' and the 'catch' clauses.
5030
5031         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
5032         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
5033         always true at the only non-recursive entry point.
5034         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
5035         FlowBranchingBreakable.
5036         (FlowBranchingLoop): Remove.
5037         * statement.cs (Return.DoResolve): Update to changes.
5038
5039         Fix #76471, #76665
5040         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
5041         (FlowBranching.CreateBranching): Handle it: create a
5042         FlowBranchingContinuable.
5043         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
5044         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
5045         except that it handles the 'continue' command.
5046         (FlowBranching.UsageVector.MergeOrigins): Rename from
5047         MergeBreakOrigins.
5048         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
5049         except that it overrides AddContinueOrigin.
5050         (FlowBranchingException): Override AddContinueOrigin, similar to
5051         AddBreakOrigin.
5052         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
5053         Create a new branching around the embedded statement.
5054         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
5055         control flow after the embedded statement.
5056         (Continue.Resolve): Move all error checking to AddContinueOrigin.
5057
5058         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
5059         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
5060         FlowBranchingBreakable.
5061         (FlowBranchingSwitch): Remove.
5062
5063         Fix test-503.cs
5064         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
5065         error reporting to ...
5066         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
5067         Rename from 'AddBreakVector'.  Add new location argument.  Return
5068         a bool indicating whether the 'break' crosses an unwind-protect.
5069         (FlowBranchingException.AddBreakOrigin): Add.
5070         (FlowBranchingException.Merge): Propagate 'break's to surrounding
5071         flowbranching after updating with the effects of the 'finally'
5072         clause.
5073         (FlowBranchingBreakable): New common base class for
5074         FlowBranchingLoop and FlowBranchingSwitch.
5075
5076         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
5077         embedded statement.
5078         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
5079
5080 2006-05-02  Raja R Harinath  <rharinath@novell.com>
5081
5082         * statement.cs (Do.Resolve): If the loop is infinite, set the
5083         barrier.
5084         (While.Resolve, For.Resolve): Set a barrier after the embedded
5085         statement.  There's no direct control flow that goes from the end
5086         of the embedded statement to the end of the loop.
5087         * flowanalysis.cs (FlowBranching.Infinite): Remove.
5088         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
5089         above ensure that the reachability is correctly computed.
5090
5091         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
5092         (UsageVector.MergeBreakOrigins): If the current path is
5093         unreachable, treat it as if all parameters/locals are initialized.
5094         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
5095         infinite loops before merging-in break origins.
5096
5097         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
5098         (Reachability.Reachable): Split part into ...
5099         (Reachability.Unreachable): ... this.  Simplify.
5100         (Reachability.IsUnreachable): Use 'Unreachable' instead.
5101
5102         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
5103         (Reachability.SetThrowsSometimes): Likewise.
5104         (FlowBranchingBlock.MergeTopBlock): Don't compare against
5105         TriState.Always, use corresponding property.
5106         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
5107         (Block.Resolve): Likewise.  Remove some redundant checks.
5108
5109 2006-05-02  Raja R Harinath  <harinath@gmail.com>
5110
5111         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
5112         (Reachability.Meet): Don't bother checking AlwaysThrows --
5113         barrier is always set.
5114         (FlowBranchingBlock.Merge): Likewise.
5115
5116 2006-05-01  Raja R Harinath  <harinath@gmail.com>
5117
5118         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
5119         checks for unreachable.
5120
5121 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
5122
5123         A fix for #77980
5124         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
5125
5126         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
5127         whether field is really assigned.
5128
5129 2006-04-30  Raja R Harinath  <harinath@gmail.com>
5130
5131         * flowanalysis.cs (Reachability): Make 4-argument constructor
5132         private.
5133         (Reachability.Meet): Rename from 'And'.  Remove static variant.
5134         (Reachability.Always): Rename from the highly misleading
5135         'Reachability.Never'.
5136         (FlowBranching.Merge): Update to changes.  Mark an impossible
5137         situation with a 'throw'.
5138         (*): Update to changes.
5139
5140 2006-04-29  Raja R Harinath  <harinath@gmail.com>
5141
5142         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
5143         Remove 'Undefined'.
5144         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
5145         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
5146         (*): Update to changes.
5147         * statement.cs: Update to changes.
5148
5149 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
5150
5151         A fix for #78049
5152         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
5153
5154 2006-04-28  Raja R Harinath  <harinath@gmail.com>
5155
5156         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
5157         dummy UsageVector.
5158
5159         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
5160         argument to two arguments: an usage-vector and a bool.  Move call
5161         to FlowBranching.Merge () ...
5162         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
5163
5164         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
5165         handling of loop and switch reachability to ...
5166         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
5167
5168 2006-04-27  Raja R Harinath  <harinath@gmail.com>
5169
5170         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
5171         handling to FlowBranchingLoop.InLoop.
5172         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
5173
5174 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
5175
5176         A fix for #78115
5177         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
5178         anonymous method is allowed from AnonymousContainer here.
5179
5180         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
5181
5182 2006-04-24  Raja R Harinath  <rharinath@novell.com>
5183
5184         Fix #78156
5185         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
5186
5187 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
5188
5189         A fix for #49011.
5190         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
5191         (DoubleConstant.Reduce): Ditto.
5192
5193 2006-04-23  Raja R Harinath  <rharinath@novell.com>
5194
5195         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
5196         Remove 'lvalue_right_side' argument.  Move parts to ...
5197         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
5198         (LocalVariable.DoResolveLValue): ... these.
5199
5200 2006-04-21  Raja R Harinath  <rharinath@novell.com>
5201
5202         Fix cs1655.cs
5203         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
5204         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
5205         (LocalVariableReference.DoResolveBase): Use it to implement new
5206         CS1655 check.
5207         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
5208         (Argument.Resolve): Simplify.  Move CS1510 check ...
5209         * ecore.cs (Expression.ResolveLValue): ... here.
5210         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
5211         (PropertyExpr.DoResolveLValue): Likewise.
5212         (FieldExpr.Report_AssignToReadonly): Likewise.
5213         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
5214         LValueMemberAccess or LValueMemberOutAccess on instance depending
5215         on it.
5216         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
5217         DoResolve as appropriate.
5218
5219 2006-04-20  Raja R Harinath  <rharinath@novell.com>
5220
5221         Fix #75800
5222         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
5223         implicit conversions on 'out' and 'ref' arguments.
5224
5225         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
5226         improve clarity.  Remove dead code.
5227
5228         Fix #66031
5229         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
5230         (Catch.Resolve): Resolve VarBlock if it exists.
5231
5232 2006-04-19  Miguel de Icaza  <miguel@novell.com>
5233
5234         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
5235         twice, this was some residual code, the enumerator was emitted
5236         properly in the two branche of if later.
5237
5238 2006-04-19  Raja R Harinath  <rharinath@novell.com>
5239
5240         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
5241         cast is never an lvalue.
5242         (Cast.DoResolve, Cast.ResolveRest): Combine.
5243         (Argument.Emit): Simplify slightly.  Move 'Expr is
5244         IMemoryLocation' check ...
5245         (Argument.Resolve): ... here.
5246         (Argument.Error_LValueRequired): Remove.  Inline into only user.
5247
5248         Simplifications.  Fix cs0191-2.cs
5249         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
5250         CS1649 and CS1651 to ...
5251         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
5252         the actual selection of the error code and message to a lookup
5253         table.  Add a dummy return value to simplify callsites.
5254         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
5255         readonly fields of other instances of the same type.  Move CS0197
5256         warning from ...
5257         * expression.cs (Argument.Resolve): ... here.  Simplify code.
5258         Ensure that ec.InRefOutArgumentResolving is only set during LValue
5259         resolution of an out or ref argument.  The code simplification
5260         above uses this invariant.
5261
5262 2006-04-18  Raja R Harinath  <rharinath@novell.com>
5263
5264         Possibly fix #77752.  Fix cs1690-[4-7].cs.
5265         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
5266         CheckMarshallByRefAccess.  Drop parameter.
5267         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
5268         warning.
5269         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
5270         InstanceExpression.
5271         * report.cs (AllWarnings): Add CS1690.
5272         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
5273         for ref access too.
5274         (LocalVariableReference.DoResolveBase): Update.
5275
5276 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5277
5278         * class.cs (MethodOrOperator): Moved common parts from method class.
5279         detect obsolete attributes.
5280         (Method.Define): Simplified as it reuses code from base.
5281         (Constructor.ValidAttributeTargets): Fixed issue found during
5282         refactoring.
5283         (Destructor.ValidAttributeTargets): Fixed issue found during
5284         refactoring.
5285         (Operator): Finished refactoring set off by #78020. Operator class is now
5286         ordinary method class.
5287
5288         * anonymous.cs: Updated.
5289
5290         * decl.cs (DeclSpace): Add IsGeneric
5291
5292 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5293
5294         * class.cs (Constructor.Emit): Don't emit the attributes twice.
5295
5296 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5297
5298         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
5299         detect obsolete attributes.
5300         (Method.CreateEmitContext): Moved to MethodOrOperator.
5301
5302 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5303
5304         A fix for #78048.
5305         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
5306         customized exception to make crash detection easier.
5307         (MethodOrOperator): Started to work on new base class for methods and
5308         operators.
5309         (Method): Derives from MethodOrOperator.
5310         (Constructor.Emit): Emits its own attributes.
5311         (AbstractPropertyEventMethod.Emit): Ditto.
5312         (Operator): Derives from MethodOrOperator, will refactor fully in extra
5313         patch.
5314         (Operator.Emit): It's temporary more tricky than should be.
5315         
5316         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
5317
5318         * report.cs (InternalErrorException): Add ctor with inner exception.
5319
5320 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
5321
5322         A fix for #76744.
5323         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
5324         only not visible.
5325
5326 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
5327
5328         A fix for #77916.
5329         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
5330         array.
5331
5332 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
5333
5334         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
5335         attribute is present and Guid not.
5336         (Interface.ApplyAttributeBuilder): Ditto.
5337
5338         * attribute.cs: Add error message.
5339
5340 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
5341
5342         A fix for #78020.
5343
5344         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
5345         sources (it's composite) so hold them in extra array as they are used in
5346         Emit phase only. It worked in the previous versions by mistake.
5347         (Attribute.Emit): Emit attribute for more owners when exist.
5348
5349         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
5350         it has now different behaviour.
5351
5352 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
5353
5354         * constant.cs (Constant.IsDefaultInitializer): New method.
5355
5356         * class.cs: Updated.
5357
5358         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
5359         re-initialize default values. It saves KBs almost for every assembly.
5360         Thanks Zoltan for the idea.
5361         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
5362         (ArrayCreation.DoResolve): Resolve only once.
5363         (ArrayCreation.Emit): Emit static initializer only when it is faster.
5364         (ArrayCreation.GetAttributableValue): Cope with optimized values.
5365
5366 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
5367
5368         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
5369         From #77961.
5370
5371 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
5372
5373         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
5374         in an embedded statement too.
5375
5376 2006-04-01  Raja R Harinath  <rharinath@novell.com>
5377
5378         Fix #77958
5379         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
5380
5381 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
5382
5383         A fix for #77966.
5384
5385         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
5386         was not specified.
5387
5388         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
5389
5390 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
5391
5392         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
5393         phase.
5394
5395         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
5396         LocalTemporary change.
5397
5398         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
5399         TypeContainer.
5400         (ClassOrStruct.DefineFieldInitializers): Implemented static field
5401         initializers optimization.
5402         (ClassOrStruct.TypeAttr): Moved from modifiers.
5403         (Constructor.CheckBase): Don't crash when static ctor has parameters.
5404         (FieldBase.ResolveInitializer): Resolves initializer.
5405         (FieldBase.HasDefaultInitializer): New property.
5406
5407         * cs-parser.jay: Removed message.
5408
5409         * expression.cs (CompilerGeneratedThis): New specialization.
5410
5411         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
5412
5413 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
5414
5415         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
5416
5417 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
5418
5419         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
5420         be now EnumConstants only.
5421
5422 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
5423
5424         * attribute.cs, driver.cs: Reset more caches.
5425
5426 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5427
5428         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
5429
5430 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5431
5432         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
5433         for easier reuse. Updated all overrides.
5434         (IntegralConstant): New base class for all integral constants.
5435         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
5436         of the constant range, report custom error.
5437         (UIntConstant.Reduce): Fixed uint conversion.
5438
5439         * ecore.cs, literal.cs: Reduce updates.
5440
5441 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5442
5443         A fix for #75813.
5444
5445         * class.cs (Constructor.Define): Removed extra if for default ctors.
5446         A patch from Atsushi Enomoto.
5447
5448 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5449
5450         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
5451         GetAttributableValue.
5452
5453         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
5454         when required.
5455
5456         * convert.cs (ImplicitConversionRequired): Error message moved to
5457         DoubleLiteral.
5458
5459         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
5460         automatic implicit conversion of an output value.
5461         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
5462
5463         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
5464         conversion.
5465         (TypeOf.GetAttributableValue): Add extra handling for object type.
5466
5467         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
5468         special error message.
5469
5470 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
5471
5472         * class.cs (Constructor.Emit): Don't crash when struct ctor is
5473         InternalCall.
5474         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
5475         compatible with MS runtime.
5476
5477 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
5478
5479         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
5480         attribute arguments here.
5481
5482         * class.cs (Indexer.Define): The check was moved to attribute class.
5483
5484 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
5485
5486         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
5487         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
5488         easier.
5489
5490 2006-03-22  Raja R Harinath  <rharinath@novell.com>
5491
5492         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
5493         mcs to keep code differences small.
5494         * attribute.cs (Attribute.GetParameterDefaultValue): New.
5495         * typemanager.cs (parameter_default_value_attribute_type): New.
5496         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
5497         CS1908 check.
5498
5499 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
5500
5501         * expression.cs (StringConcat.Append): Reverted back to no warning state.
5502
5503 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
5504
5505         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
5506
5507         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
5508         the blocks too.
5509
5510 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
5511
5512         * doc-bootstrap.cs : fix build.
5513
5514 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
5515
5516         * expression.cs (StringConcat.Append): Issue a warning when empty string
5517         is going to append.
5518
5519 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
5520
5521         * assign.cs (CompoundAssign.ResolveSource): Removed.
5522
5523         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
5524         clean up.
5525
5526         * class.cs (TypeContainer.FindMethods): Removed.
5527         (TypeContainer.CheckMemberUsage): Made static.
5528
5529         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
5530
5531         * constant.cs (CheckRange): Removed unused type argument.
5532         (CheckUnsigned): Removed unused type argument.
5533
5534         * cs-parser.jay: Updated after MemberAccess clean up.
5535         Uses Length for empty string test.
5536
5537         * cs-tokenizer.cs: Uses Length for empty string test.
5538         (IsCastToken): Made static.
5539         (is_hex): Made static.
5540         (real_type_suffix): Made static.
5541
5542         * decl.cs (SetupCache): Made static.
5543         (OnGenerateDocComment): Removed unused ds argument.
5544
5545         * delegate.cs (VerifyDelegate): Removed unused argument.
5546
5547         * doc.cs: Uses Length for empty string test.
5548
5549         * driver.cs: Uses Length for empty string test.
5550
5551         * enum.cs (IsValidEnumType): Made static
5552
5553         * expression.cs (EnumLiftUp): Removed unused argument.
5554         (ResolveMethodGroup): Ditto.
5555         (BetterConversion): Ditto.
5556         (GetVarargsTypes): Ditto.
5557         (UpdateIndices): Ditto.
5558         (ValidateInitializers): Ditto.
5559         (MemberAccess.ctor): Ditto.
5560         (GetIndexersForType): Ditto.
5561
5562         * flowanalysis.cs: (MergeFinally): Removed unused argument.
5563
5564         * iterators.cs: Updated after MemberAccess clean up.
5565
5566         * location.cs: Uses Length for empty string test.
5567
5568         * namespace.cs: Uses Length for empty string test.
5569
5570          * report.cs (CheckWarningCode): Made static.
5571
5572         * statement.cs (LabeledStatement): Removed unused argument.
5573
5574         * typemanager.cs (FilterNone): Removed.
5575
5576 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5577
5578         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
5579         obsolete.
5580
5581         * class.cs: Updated.
5582
5583 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5584
5585         * cs-parser.jay.cs: __arglist is not allowed for delegates.
5586
5587 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5588
5589         A fix for #77822.
5590
5591         * expression.cs (VerifyArgumentsCompat): Reverted to double error
5592         reporting, it's more tricky than I thought.
5593
5594 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5595
5596         A fix for #77816.
5597
5598         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
5599         host container.
5600         (AnonymousMethod.ImplicitStandardConversionExists): New method.
5601         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
5602         Add more error reporting; Fixed issue with params.
5603
5604         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
5605
5606         * cs-parser.jay: AnonymousMethod requires host container.
5607
5608         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
5609
5610 2006-03-18  Raja R Harinath  <harinath@gmail.com>
5611
5612         * class.cs: Change 'TypeContainer ds' constructor argument to
5613         'DeclSpace parent'.  Some classes were missed below due to
5614         different naming convention.
5615
5616         * class.cs (MemberCore.Parent): Delete.  This makes the
5617         ParentContainer changes below enforceable by the compiler.
5618
5619         Treat pointers to enclosing declaration space as 'DeclSpace', not
5620         'TypeContainer'.
5621         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
5622         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
5623
5624         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
5625         of TypeContainer.
5626         (Block.AddThisVariable): Likewise.
5627         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
5628         (AbstractPropertyEventMethod.Emit): Likewise.
5629         (AbstractPropertyEventMethod.EmitMethod): Likewise.
5630         (GetMethod.Define, SetMethod.Define): Likewise.
5631         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
5632         (DelegateMethod.EmitMethod): Likewise.
5633
5634         Fix regression test-partial-13.cs.
5635         Rationalize use of PartialContainer.  Ensure that the partial
5636         class semantics can be tied to type-correctness, i.e., any
5637         violation will cause a compile error.
5638         * class.cs, const.cs: Access all fields that belong to class
5639         TypeContainer via ParentContainer.  Arguments of EmitContexts and
5640         Resolve()-like functions still use 'Parent'.
5641
5642         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
5643         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
5644         (PropertyMethod.CheckModifiers): Remove unused argument.
5645         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
5646         DeclSpace.
5647
5648 2006-03-17  Raja R Harinath  <harinath@gmail.com>
5649
5650         Make semantics of PartialContainer simpler.
5651         * decl.cs (DeclSpace.IsPartial): Remove.
5652         * class.cs (TypeContainer.IsPartial): Likewise.
5653         (TypeContainer..ctor): Set PartialContainer to point to self.
5654         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
5655         (TypeContainer.FindNestedType): Likewise.
5656         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
5657
5658 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
5659
5660         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
5661
5662 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
5663
5664         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
5665         classes.
5666
5667 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
5668
5669         * class.cs (Operator.Define): An error for base conversion was not
5670         reported correctly.
5671
5672 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
5673
5674         * iterator.cs : yield break is allowed in try statement which has
5675           catch clauses. Fixed bug #77767.
5676
5677 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
5678
5679         A fix for #77593, #77574.
5680
5681         * class.cs (MethodCore.CheckBase): Another if for operator.
5682
5683 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
5684
5685         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
5686         were not resolved
5687
5688         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
5689         (DelegateCreation.ImplicitStandardConversionExists): New method for just
5690         conversion test.
5691         
5692         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
5693         not needed.
5694
5695         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
5696         Updated after another emitcontext usage was clean up. It should help us to
5697         synchronize with gmcs easier.
5698
5699 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
5700
5701         A fix for #77353.
5702
5703         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
5704         (Event.Define): ditto
5705         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
5706
5707         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
5708         Removed redundant code and set NewSlot for Invoke method too.
5709
5710         * parameter.cs (Parameters.ctor): Add custom, type ctor.
5711         (Parameters.MergeGenerated): New method. Use this method when you merge
5712         compiler generated argument with user arguments.
5713
5714 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
5715
5716         * attribute.cs (ResolveAsTypeTerminal): Removed.
5717
5718         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
5719         specialization for predefined types; 30% speed up.
5720         Finally placed obsolete check to right place.
5721         (Expression.ResolveType): Removed.
5722
5723         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
5724         Updated after ResolveType was removed.
5725
5726         * expression.cs (Cast.ctor): Check void cast.
5727         (Binary.ResolveAsTypeTerminal): Is never type.
5728         (Conditional.ResolveAsTypeTerminal): Is never type.
5729
5730         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
5731
5732 2006-03-01  Raja R Harinath  <rharinath@novell.com>
5733
5734         Fix #77679.
5735         * expression.cs (ParameterReference.DoResolveBase): Change return
5736         type to bool.
5737         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
5738         Update.
5739
5740         Fix #77628.
5741         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
5742
5743         Fix #77642.
5744         * typemanager.cs (GetFullNameSignature): Don't nullref on
5745         protected accessors.
5746
5747 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
5748
5749         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
5750         these two separated members to simplify the code.
5751         (Attribute.Resolve): Refactored to use new fields and methods.
5752         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
5753         implemented obsolete attribute checking.
5754         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
5755         implemented obsolete checking again. It look line never ending quest ;-)
5756         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
5757
5758         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
5759
5760         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
5761
5762         *class.cs (Property.Define): Add RegisterProperty call.
5763
5764         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
5765         argument groups (only 2).
5766
5767         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
5768         encoding expression to arguments.
5769         (Expression.ExprClassToResolveFlags): Just turned to property.
5770
5771         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
5772         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
5773         optimized as well as implemented support for zero-length attributes.
5774
5775         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
5776         Add caching of PropertyInfo's.
5777
5778 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
5779
5780         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
5781         error multiple times.
5782
5783 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
5784
5785         New partial class implementation.
5786         A fix for #77027, #77029, #77403
5787
5788         * attribute.cs (Attributable): Made attributes protected.
5789
5790         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
5791         the replacements of ClassPart and PartialContainer.
5792         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
5793         (TypeContainer.AddInterface): Ditto.
5794         (TypeContainer.AddPartial): The main method for partial classes. It checks
5795         for errors and merges ModFlags and attributes. At the end class is added to
5796         partial_parts list.
5797         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
5798         required here.
5799         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
5800         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
5801         from the rest of partial classes.
5802         (TypeContainer.GetClassBases): Simplified.
5803         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
5804         DefineType.
5805         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
5806         (TypeContainer.HasExplicitLayout): Uses Flags now.
5807         (PartialContainer): Removed.
5808         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
5809         (StaticClass): Was merged with Class.
5810         (Class.GetClassBases): class and static class bases are verified here.
5811         (Class.TypeAttr): Added static attributes when class is static.
5812         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
5813         (MemberBase): In some cases we need to call parent container for partial
5814         class. It should be eliminated but it's not easy now.
5815
5816         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
5817
5818         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
5819         partial classed to accumulate class comments.
5820         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
5821
5822         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
5823
5824         * driver.cs (MainDriver): Tree.GetDecl was removed.
5825
5826         * modifiers.cs (Modifiers): Add partial modifier.
5827
5828         * tree.cs (Tree.decl): Removed.
5829         (RootTypes): Started to use this class more often for root types
5830         specializations.
5831
5832 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
5833
5834         A fix for #77615
5835
5836         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
5837         external interface does not have an attribute.
5838
5839 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
5840
5841         Another prerequisites for new partial classs implementation.
5842         
5843         * attribute.cs (Attribute.Equal): Implemented.
5844         (Attribute.Emit): Changed as attributes can be applied more than twice.
5845         (Attributes.Emit): Check for duplicate attributes here.
5846
5847         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
5848         as a parameter, clean-up.
5849
5850 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
5851
5852         A fix for #77485
5853
5854         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
5855         contains obsolete attribute check which can in some cases look for base
5856         type of current class which is not initialized yet.
5857         (TypeContainer.BaseType): Replacement of ptype.
5858
5859         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
5860
5861 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
5862
5863         First of prerequisites for new partial classs implemention.
5864         
5865         * attribute.cs (Attributable): Extended by ResolveContext;
5866         Attributes finally have correct context for resolving in all cases.
5867         (AttachTo): Attribute owner is assigned here.
5868
5869         * codegen.cs (IResolveContext): Introduce new interface to hold
5870         all information needed in resolving phase.
5871         (EmitContext): Implements IResolveContext; more clean-up needed here.
5872         
5873         * decl.cs (MemberCore): Implemented IResolveContext.
5874
5875         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
5876         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
5877         parameter.cs, statement.cs, tree.cs, typemanager.cs:
5878         Refactored to use new IResolveContext instead of EmitContext; cleanup
5879
5880 2006-02-06  Miguel de Icaza  <miguel@novell.com>
5881
5882         * codegen.cs (EmitScopeInitFromBlock): check here the
5883         capture_context, there is no need to make two calls to the
5884         EmitContext. 
5885
5886         * anonymous.cs: Add some debugging messages that might help me
5887         track other instances of this problem in the future (the
5888         regression of test 467).
5889
5890         * cs-parser.jay: track the variable block, as we need to initalize
5891         any captured variables declared in this block for the "catch"
5892         portion of the "Try" statement.
5893
5894         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
5895         scope initialization for captured variables. 
5896
5897         Also, move the emit for the variables after the block location has
5898         been marked.
5899
5900 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
5901
5902         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
5903
5904 2006-02-02  Miguel de Icaza  <miguel@novell.com>
5905
5906         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
5907         commit yesterday, the initialization for the roots is necessary.
5908         What is not necessary is the scope activation.
5909
5910 2006-02-02  Raja R Harinath  <rharinath@novell.com>
5911
5912         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
5913         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
5914         CS0206 checks.
5915         (Argument.Resolve): Remove CS0206 checks.
5916
5917 2006-02-01  Miguel de Icaza  <miguel@novell.com>
5918
5919         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
5920         scopes for all the roots, the scopes will now be emitted when the
5921         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
5922
5923         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
5924         code.  This reduces a lot of existing cruft.
5925         
5926         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
5927         that the ScopeInfo is generated as we enter the scope, not at the
5928         time of use, which is what we used to do before.
5929
5930         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
5931         every time a Block is about to be emitted if we have a
5932         CaptureContext. 
5933
5934 2006-02-01  Raja R Harinath  <rharinath@novell.com>
5935
5936         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
5937         (Reset): Update.
5938         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
5939
5940         * typemanager.cs (cons_param_array_attribute): Make private.
5941         (Reset): Set it to null.
5942         (InitCoreHelpers): Don't initialize it.
5943         (ConsParamArrayAttribute): New.  Initialize it as needed.
5944         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
5945
5946 2006-01-31  Miguel de Icaza  <miguel@novell.com>
5947
5948         * expression.cs: There might be errors reported during the
5949         selection of applicable methods.  If there are errors, do not
5950         continue execution as it will lead the compiler to crash.
5951
5952 2006-01-30  Miguel de Icaza  <miguel@novell.com>
5953
5954         * expression.cs: Member access is not allowed on anonymous
5955         methods.  Fixes #77402.
5956
5957 2006-01-30  Raja R Harinath  <rharinath@novell.com>
5958
5959         Fix #77401
5960         * cs-parser.jay (VariableDeclaration): Don't set
5961         current_array_type to null.
5962         (field_declaration, event_declaration, declaration_statement):
5963         Set it to null here.
5964
5965 2006-01-28  Raja R Harinath  <harinath@gmail.com>
5966
5967         * typemanager.cs (GenericParameterPosition): New.
5968         * doc.cs: Use it.
5969
5970 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
5971
5972         * doc.cs : To process "include" elements, first we should create
5973           another list than XmlNodeList, because it could result in node
5974           removal, which could result in that the XmlNodeList gives up
5975           yielding next node.
5976
5977           (Also made code identical to gmcs again.)
5978
5979 2006-01-25  Miguel de Icaza  <miguel@novell.com>
5980
5981         * ecore.cs: Introduce an error report that we were not catching
5982         before, if not silent, we must report the error.  Gonzalo ran into
5983         it.
5984
5985 2006-01-23  Miguel de Icaza  <miguel@novell.com>
5986
5987         A fix for bug: #76957
5988         
5989         * iterators.cs (MoveNextMethod.CreateMethodHost): call
5990         ComputeMethodHost before creating the method, this is a new
5991         requirement. 
5992
5993         * anonymous.cs (AnonymousContainer): Now we track all the scopes
5994         that this method references (RegisterScope).  The actual scope
5995         where the method is hosted is computed with the ComputeMethodHost
5996         before we create the method.
5997
5998         Moved the Deepest routine here.
5999
6000         (AnonymousContainer.ComputeMethodHost): New routine used to
6001         compute the proper ScopeInfo that will host the anonymous method.
6002
6003         (ScopeInfo): Deal with multiple roots.  The problem was that we
6004         did not have a unique root where all ScopeInfos could be hanged
6005         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
6006         of roots.  
6007
6008         Remove AdjustMethodScope which is now computed at the end.  Remove
6009         LinkScope which did a partial link, instead link all ScopeInfos
6010         before code generation from the new "LinkScopes" routine. 
6011
6012         Simplify all the Add* routines as they no longer need to maintain
6013         the tree, they just need to record that they are using variables
6014         from a ScopeInfo.
6015
6016         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
6017         routines to produce the forest of ScopeInfo trees.
6018
6019         * class.cs (TypeContainer.AppendMethod): This is just like
6020         AddMethod, but ensures that an interface implementation method
6021         (IEnumerable.XXX) is not inserted at the beginning of the queue of
6022         methods, but at the end.
6023
6024         We use this functionality to ensure that the generated MoveNext
6025         method in the iterator class is resolved/emitted before the
6026         enumerator methods created.   
6027
6028         This is required because the MoveNext method computes the right
6029         ScopeInfo for the method.  And the other methods will eventually
6030         need to resolve and fetch information computed from the anonymous
6031         method. 
6032
6033 2006-01-21  Raja R Harinath  <harinath@gmail.com>
6034             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
6035
6036         Fix rest of #76995.
6037         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
6038         the 'aliases' hash.
6039         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
6040         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
6041
6042 2006-01-18  Raja R Harinath  <rharinath@novell.com>
6043
6044         Fix #76656, cs0231-2.cs.
6045         * cs-parser.jay (formal_parameter_list): Make error case catch
6046         more issues.
6047         (parenthesized_expression_0): Add CS1026 check.
6048         (invocation_expression): Remove unused { $$ = lexer.Location }.
6049
6050 2006-01-17  Raja R Harinath  <rharinath@novell.com>
6051
6052         Fix #76824.
6053         * cs-parser.jay (statement_expression): Don't list out the
6054         individual statement-expressions.  Convert syntax error into
6055         CS0201 check.
6056
6057 2006-01-16  Raja R Harinath  <rharinath@novell.com>
6058
6059         Fix #76874.
6060         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
6061         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
6062         CheckIntermediateModification.
6063         (FieldExpr.DoResolve): Add new two-argument version that
6064         allows us to resolve the InstanceExpression as an lvalue.
6065         The one-argument variant is now just a wrapper.
6066         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
6067         Resolve the lhs as an lvalue if the it has a value type.
6068         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
6069         from Assign.DoResolve.
6070         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
6071         resolved as an lvalue.
6072         (PropertyExpr.DoResolve): Update.
6073         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
6074         has a value type.  Move CS1612 check here from
6075         CheckIntermediateModification.
6076         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
6077         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
6078         'right_side' of a ResolveLValue on an 'out' argument.
6079         (EmptyExpression.LValueMemberAccess): New.  Used as the
6080         'right_side' of a propagated ResolveLValue on a value type.
6081         (LocalVariableReference.DoResolveBase): Recognize
6082         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
6083         Add CS1654 check.
6084         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
6085         EmptyExpression.Null.
6086
6087 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
6088
6089         * typemanager.cs : added IsGenericParameter(). In mcs it always
6090           return false.
6091         * doc.cs : for generic parameters, use GenericParameterPosition,
6092           not FullName.
6093
6094 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
6095
6096         * expression.cs: Fix Console.WriteLine ((this = x).foo);
6097
6098 2006-01-12  Miguel de Icaza  <miguel@novell.com>
6099
6100         This fixes the problem where we used ldfld instead of ldflda to
6101         load the "THIS" pointer on captured parameters, when THIS is a
6102         value type.  See bug #77205.
6103         
6104         * iterators.cs (CapturedThisReference.Emit): Pass false to
6105         EmitThis (we do not need the address).
6106
6107         * codegen.cs (EmitThis): it needs to know whether we need the
6108         address of `this' or not.  This is used by value types.  
6109
6110         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
6111         every other call passes false.
6112
6113 2006-01-12  Raja R Harinath  <rharinath@novell.com>
6114
6115         Fix #77221.
6116         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
6117         GetOverride.
6118         * expression.cs (Invocation.OverloadResolve): Update.
6119         (Invocation.DoResolve): Avoid double resolution of invocation.
6120
6121 2006-01-11  Raja R Harinath  <rharinath@novell.com>
6122
6123         Fix #77180.
6124         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
6125         unary negation of floating point types as 0-expr; negation cannot
6126         overflow in floating point types.
6127
6128         Fix #77204.
6129         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
6130         on operands of 'void' type.
6131
6132         Fix #77200.
6133         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
6134         and ExclusiveOr for boolean constants too.
6135
6136 2006-01-09  Raja R Harinath  <rharinath@novell.com>
6137
6138         Fix #75636.
6139         * expression.cs (Invocation.OverloadResolve): Replace reflected
6140         override methods with their base virtual methods, rather than
6141         skipping over them.
6142         * typemanager.cs (TypeManager.GetOverride): New.
6143
6144 2006-01-05  Jb Evain  <jbevain@gmail.com>
6145
6146         * class.cs (Property.Define, Indexer.Define): do not tag the
6147         properties as SpecialName | RTSpecialName.
6148
6149 2006-01-04  Miguel de Icaza  <miguel@novell.com>
6150
6151         * class.cs (MethodCore.IsDuplicateImplementation): This method was
6152         doing a low-level comparission of parameter types.  It was lacking
6153         a check for __argslist. 
6154
6155 2005-12-30  Miguel de Icaza  <miguel@novell.com>
6156
6157         * expression.cs (ParameterReference.DoResolveBase): Allow
6158         reference parameters if they are local to this block. 
6159
6160         This allows the ref and out parameters of a delegate to be used in
6161         an anonymous method, for example:
6162
6163         delegate void set (out int x);
6164
6165         set s = delegate (out int x){
6166                 x = 0;
6167         };
6168
6169         This is used by functionality introduced late in the C# language.
6170         
6171         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
6172         method that take ref and out parameters. 
6173
6174         Fixes #77119 which was a late change in the spec.
6175
6176 2005-12-23  Miguel de Icaza  <miguel@novell.com>
6177
6178         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
6179         parent if its the same scope.  Fixes #77060.
6180
6181 2005-12-21  Miguel de Icaza  <miguel@novell.com>
6182
6183         * driver.cs: Report the case of no source files and no -out:
6184         argument provided.
6185
6186 2005-12-20  Raja R Harinath  <rharinath@novell.com>
6187
6188         Fix #77035.
6189         * expression.cs (ComposedCast.GetSignatureForError): Define.
6190
6191 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6192
6193         Fix #76995
6194
6195         * namespace.cs (NamespaceEntry): Add extern_aliases as a
6196         ListDictionary, to contain the ExternAliasEntry entries (in
6197         addition to the NamespaceEntry.aliases hashtable). This field is
6198         shared between the original entry and its doppelganger (bodyless 
6199         copy of it).
6200         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
6201         extern_aliases field.
6202         (NamespaceEntry.Lookup): Move the IsImplicit check after the
6203         lookup in extern_aliases.
6204
6205 2005-12-16  Raja R Harinath  <rharinath@novell.com>
6206
6207         Fix #77006.
6208         * class.cs (TypeContainer.Mark_HasEquals): New.
6209         (TypeContainer.Mark_HasGetHashCode): New.
6210         (ClassPart): Override them.
6211         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
6212
6213         Fix #77008.
6214         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
6215         'parent' argument to the base constructor.
6216
6217         Remove all mention of TypeContainer from decl.cs.
6218         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
6219         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
6220         (DeclSpace.DeclSpace): Likewise.
6221         (DeclSpace.DefineMembers): Remove unused argument.
6222         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
6223         debugging check -- we don't care if the debug code throws an
6224         InvalidCastException instead of an InternalErrorException.
6225         * class.cs (TypeContainer.DefineMembers): Update to changes.
6226         (TypeContainer.DoDefineMembers): Likewise.
6227         (TypeContainer.GetMethods): Likewise.
6228         (PropertyMember.Define): Likewise.
6229         (MemberBase.Parent): New property that forwards to
6230         MemberCore.Parent, but ensures that we get a TypeContainer.
6231         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
6232         (RootContext.PopulateTypes): Likewise.  Remove special case code
6233         for !RootContext.StdLib: DefineMembers is idempotent.
6234
6235 2005-12-14  Miguel de Icaza  <miguel@novell.com>
6236
6237         * convert.cs (ExplicitConversionCore): Check the return value from
6238         ExplicitConversionCore which can return null on failure.  Fixes #76914
6239
6240 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
6241
6242         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
6243
6244 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
6245
6246         * doc.cs : The search for referenced namespace was insufficient to
6247           get global one as it used to do. Fixed bug #76965.
6248
6249 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
6250
6251         * doc.cs : check name in cref in the last phase that whether it is
6252           namespace or not.
6253
6254 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
6255
6256         * cs-tokenizer.cs : reverted the latest change: it somehow broke
6257           Mono.C5.
6258
6259 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
6260
6261         * doc.cs : so it turned out that we cannot skip override check for 
6262           interface members. Fixed bug #76954.
6263
6264 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
6265
6266         * cs-tokenizer.cs : fixed bug #75984:
6267           - #warning and #error should not be handled when the source line
6268             is disabled.
6269           - #line is not checked strictly when the source line is disabled.
6270           - #define and #undef is on the other hand checked strictly at any
6271             state.
6272
6273 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
6274
6275         * cs-tokenizer.cs : missing Location (actually, filename) in one of
6276           CS1027 report.
6277
6278 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
6279
6280         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
6281
6282         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
6283         event initializers.
6284         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
6285         (FieldBase.Initializer): Initializer is now optional.
6286         (EventField.Define): Only event field can have initializer.
6287
6288         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
6289
6290         * const.cs (Const): Reuse initializer.
6291
6292         * cs-parser.jay: Updated after FieldBase changes.
6293         Added current_array_type to simplify array initializers.
6294
6295         * ecore.cs (NullCast.IsDefaultValue): Implemented.
6296
6297         * expression.cs, iterators.cs: Updated.
6298
6299         * namespace.cs (NamespaceEntry): Made UsingFound private.
6300
6301 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
6302
6303         * parameterCollection.cs: Obsolete, removed.
6304         * parser.cs: Obsolete, removed.
6305
6306 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
6307
6308         Fix #76849.
6309         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
6310
6311         * enum.cs (Enum.Define): Set obsolete context here.
6312
6313 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
6314
6315         * doc.cs :
6316           - FindDocumentedMember() now expects 1) paramList as null
6317             when "we don't have to check the number of parameters" and
6318             2) Type.EmptyTypes when "there is no arguments".
6319           - Introduced FoundMember struct to hold the exact type which was
6320             used to find the documented member (the above change broke
6321             test-xml-044; it might be better just to use DeclaringType than
6322             what MS does, like this change does, but it depends on usage.)
6323
6324 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
6325
6326         * doc.cs : documented member might be from DeclaringType for nested
6327           types. Fixed bug #76782.
6328
6329 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
6330
6331         * anonymous.cs: Have the param code handle leaving copies on the
6332         stack etc. Allows anonymous params to take part in the assignment
6333         code (++, +=, etc). Fixes bug #76550
6334
6335         * expression.cs: Handle the prepare_for_load/leave_copy by passing
6336         it down to the anon code.
6337
6338         * iterators.cs: Use dummy var here
6339
6340         * codegen.cs: Handle new vars
6341
6342 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
6343
6344         Fix #76849.
6345         * class.cs (MethodData.Define): Set proper Obsolete context.
6346
6347         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
6348         obsolete context.
6349         (FieldExpr.DoResolve): Ditto.
6350
6351 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
6352
6353         Fix #76849.
6354         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
6355         parent is not obsolete.
6356
6357 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
6358
6359         * doc.cs : (FindDocumentedMember) find parameterless members first
6360           and get CS0419 in the early stage. Fixed first case of bug #76727.
6361
6362 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
6363
6364         Fix #76859.
6365         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
6366         no error was reported.
6367
6368         *expression.cs (Binary.DoResolve): left can be null.
6369
6370 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
6371
6372         Fix #76783.
6373         * class.cs (MethodData.Emit): Parameters should be labeled first.
6374
6375 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
6376
6377         Fix #76761.
6378         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
6379
6380 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
6381
6382         * attribute.cs (AreParametersCompliant): Moved to Parameter.
6383
6384         * class.cs (MethodCore): Parameter clean up.
6385         (IMethodData): Added ParameterInfo.
6386         (MethodData): Parameter clean up.
6387         (Indexer.Define): Parameter clean up.
6388
6389         * anonymous.cs,
6390         * codegen.cs,
6391         * cs-parser.jay,
6392         * decl.cs,
6393         * doc.cs,
6394         * ecore.cs,
6395         * flowanalysis.cs,
6396         * iterators.cs,
6397         * pending.cs,
6398         * statement.cs,
6399         * typemanager.cs: Parameter clean up.
6400
6401         * delegate.cs (Define): Get rid of duplicated code.
6402
6403         * expression.cs (ParameterReference): Removed useless parameters
6404         and simplified.
6405         (Invocation): Ditto.
6406
6407         * parameter.cs (ParamsParameter): New class, params specialization.
6408         (ArglistParameter): Attemp to separate arglist.
6409         (Parameter): Refactored to be reusable and faster.
6410         (Parameter.Modifier): Made understandable.
6411         (Parameters): Changed to be used as a class for `this' assembly
6412         parameters. Refactored to use new specialized classes.
6413
6414         * support.cs (ParameterData): Added Types property.
6415         (InternalParameters): Deleted.
6416
6417 2005-08-20  Martin Baulig  <martin@ximian.com>
6418
6419         Merging this patch from GMCS to fix #75867.
6420
6421         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
6422         scope if we don't already have it.
6423
6424 2005-11-17  Martin Baulig  <martin@ximian.com>
6425
6426         * anonymous.cs
6427         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
6428         inherit the scope from our parent.  Fixes #76653.
6429
6430 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
6431
6432         * doc.cs : the previous patch does not actually fix the bug.
6433           PropertyInfo override check is now implemented and really fixed it.
6434         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
6435
6436 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
6437
6438         * doc.cs : apply "override filter" also to properties.
6439           Fixed bug #76730.
6440
6441 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
6442
6443         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
6444           no need to check overrides. For classes, omit those results from 
6445           interfaces since they must exist in the class. Fixed bug #76726.
6446
6447 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
6448
6449         * typemanager.cs : (GetFullNameSignature) differentiate indexers
6450           with different parameters. Fixed the second problem in #76685.
6451
6452 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
6453
6454         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
6455           get expected 'protected' access in CheckValidFamilyAccess()).
6456           Fixed bug #76692.
6457
6458 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
6459
6460         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
6461           Fixed bug #76705.  CS1569 was incorrectly commented out.
6462
6463 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
6464
6465         * doc.cs : use Invocation.IsOverride() to do real override check.
6466         * expression.cs : made Invocation.IsOverride() internal.
6467
6468 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
6469
6470         * doc.cs : use TypeManager.FindMembers() instead of (possible)
6471           TypeBuilder.FindMembers() and filter overriden base members out.
6472           Fixed bug #76990.
6473
6474 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6475
6476         * doc.cs : ref/out parameters are represented as '@' (instead of
6477           '&' in type FullName). Fixed bug #76630 (additionally crefs).
6478
6479 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6480
6481         * doc.cs : when there was no '.' in cref to methods in doc comment,
6482           then parameters were missing in the output. Fixed bug #76691.
6483
6484 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6485
6486         * driver.cs : don't output docs when there is an error.
6487           Fixed bug #76693.
6488
6489 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6490
6491         * doc.cs :
6492           Now it should detect indexers. Fixed primary concern in bug #76685.
6493           Fixed CS0419 message to not show the identical member signature in
6494           the message.
6495
6496 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6497
6498         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
6499           instead of Type.FindMembers() since it does not handle events.
6500           Fixed bug #71604.
6501
6502 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
6503
6504         * codegen.cs: Fixed typo (speficied -> specified).
6505
6506 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
6507
6508         Fix #76369.
6509         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
6510
6511 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
6512
6513         * attribute.cs: Changed error message.
6514
6515         * cs-tokenizer.cs: One more check.
6516
6517 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
6518
6519         * statement.cs (Block.Resolve): Ignore empty statement.
6520
6521 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
6522
6523         * report.cs: Made error/warning methods more strict to avoid
6524         their misuse.
6525
6526         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
6527         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
6528         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
6529         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
6530
6531 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
6532
6533         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
6534         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
6535
6536         * class.cs (TypeContainer.IsComImport): New property.
6537         (Constructor.Define): Create proper ctor for ComImport types.
6538
6539         * expression.cs (New.CheckComImport): Fixed.
6540
6541 2005-11-07  Miguel de Icaza  <miguel@novell.com>
6542
6543         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
6544         that a parameter has been captured does not mean that we do not
6545         have to do the rest of the processing.  This fixes the second part
6546         of #76592.  If there was another anonymous method capturing
6547         values in the past, the Scope would never be set for the second
6548         method that captured the same parameter.
6549
6550         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
6551         properly manipulate the stack.   Second part of fix for #76592.
6552
6553         * expression.cs (New): Add support for invoking "new" on
6554         interfaces that have been flagged with the ComImport attribute and
6555         the CoClass.  Fixes #76637 
6556
6557         * statement.cs (Try.DoEmit): When a variable is captured, do not
6558         try to emit the vi.LocalBuilder variable as it has been captured.
6559         Create a temporary variable and store the results on the
6560         FieldBuilder.  Fixes #76642
6561
6562 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
6563
6564         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
6565
6566         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
6567
6568         * expression.cs (Binary.DoResolve): Added && optimalization.
6569     
6570         * typemanager.cs (AddUserType): Removed useless argument.
6571
6572 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
6573
6574         * statement.cs (Block.variables): Uses ListDictionary.
6575
6576 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
6577
6578         Fix #75969.
6579         * class.cs (PartialContainer.EmitType): Customized to emit
6580         security attributes.
6581         (ClassPart.ApplyAttributeBuilder): Transform security attribute
6582         for partial classes.
6583
6584 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
6585
6586         Fix #76599.
6587         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
6588         access has to be fixed.
6589         
6590         * typemanager.cs (IsUnmanagedType): Wrong common field type.
6591
6592 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
6593
6594         Fix #76590.
6595         * ecore.cs (NullCast.Reduce): Implemented.
6596
6597         * expression.cs (ArrayCreation.CheckIndices): Correcly check
6598         constant type.
6599         
6600         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
6601         properly.
6602         (Foreach.Resolve): Catch null properly.
6603
6604 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
6605  
6606         * cs-tokenizer.cs: Warning text fix.
6607
6608         * driver.cs: AllWarningNumbers exposed on public interface.
6609
6610         * report.cs (): Reviewed warning numbers.
6611         (IsValidWarning): Use binary search.
6612
6613 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
6614  
6615         * driver.cs: Implemeted resource visibility.
6616         (Resources): New class for code sharing between /res: and
6617         /linkres:
6618  
6619 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
6620
6621         Fix #76568.
6622         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
6623         folding.
6624         
6625         * convert (Convert.ImplicitReferenceConversion): NullCast holds
6626         contants only.
6627         
6628         * ecore.cs (NullCast): Child is contant only.
6629         
6630         * literal.cs (NullLiteral.Reduce): null can be converted to any
6631         reference type.
6632
6633 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
6634
6635         * driver.cs: Use Encoding.Default as default code page instead
6636           of ISO-28591.
6637
6638 2005-10-27  Raja R Harinath  <rharinath@novell.com>
6639
6640         Fix #76085.
6641         * expression.cs (Invocation.Error_InvalidArguments): Handle
6642         __arglist parameters.
6643         (Invocation.VerifyArgumentsCompat): Likewise.
6644         * support.cs (ReflectionParameters.GetSignatureForError): Print
6645         __arglist parameters.
6646         (InternalParamters.GetSignatureForError): Likewise.
6647         * parameter.cs (Parameters.GetSignatureForError): Likewise.
6648
6649 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
6650
6651         * attribute.cs (GetPropertyValue): Made public.
6652
6653         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
6654         Resolve.
6655         Add new property WrapNonExceptionThrows to handle 2.0 assembly
6656         attribute.
6657         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
6658         is not defined.
6659         
6660         * driver.cs: Reflect method name change.
6661         
6662         * statement.cs (Try.Resolve): Warn when try has both general
6663         exception handlers.
6664         
6665         * typemanager.cs: runtime_compatibility_attr_type new predefined
6666         type.
6667
6668 2005-10-26  Raja R Harinath  <harinath@gmail.com>
6669
6670         Fix #76419.
6671         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
6672         treat it as an empty parameter list.
6673
6674 2005-10-26  Raja R Harinath  <rharinath@novell.com>
6675
6676         Fix #76271.     
6677         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
6678         ResolveAsTypeStep silent.
6679         * statement.cs (Block.AddConstant): Mark block as used.
6680         (Block.ResolveMeta): Avoid piling on error messages
6681         if a constant initializer resolution fails.
6682
6683 2005-10-25  Raja R Harinath  <rharinath@novell.com>
6684
6685         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
6686         Remove.
6687         (NamespaceEntry.VerifyAllUsing): New.
6688         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
6689         behaviour.  Delegates actual resolution of alias to ...
6690         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
6691         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
6692         Update.
6693         * driver.cs (Driver.MainDriver): Update.
6694         
6695         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
6696         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
6697         property.
6698         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
6699         Remove.
6700         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
6701         RootNamespace.DefineNamespacesForAll.
6702
6703 2005-10-24  Raja R Harinath  <harinath@gmail.com>
6704
6705         * typemanager.cs (assemblies, external_aliases, modules)
6706         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
6707         (ComputeNamespaces, GetRootNamespace): Remove extra staging
6708         overhead.  Move resposibility ...
6709         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
6710         * driver.cs, attribute.cs, codegen.cs: Update to changes.
6711
6712 2005-10-23  Raja R Harinath  <harinath@gmail.com>
6713
6714         * namespace.cs (RootNamespace.all_namespaces): Renamed from
6715         cached_namespaces.  Improve usage.
6716         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
6717         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
6718         Move from GlobalRootNamespace and simplify.
6719         (RootNamespace.Global): Make instance variable.
6720         (RootNamespace.RootNamespace): Add "alias name" parameter.
6721         (GlobalRootNamespace): Simplify drastically.
6722         (Namespace.Lookup): Don't use GetNamespace.
6723         * typemanager.cs (GetRootNamespace): Rename from
6724         ComputeNamespaceForAlias.
6725         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
6726
6727 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
6728
6729         * anonymous.cs (AnonymousContainer): Don't crash when container
6730         doesn't exist.
6731
6732 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
6733
6734         * expression.cs (Binary.DoResolve): Warn when comparing same
6735         values.
6736
6737 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
6738
6739         Fix #76486.
6740         * expression.cs (Binary.DoResolve): It looks like there are no
6741         convetsion rules in enum context.
6742
6743 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6744
6745         Add support for extern alias qualifiers.
6746         * typemanager.cs: Move some LookupTypeReflection code
6747         to namespace.cs, to have cleaner code. Added some methods
6748         to help us keep track of the extern aliased references.
6749         * driver.cs: Add suport for extern alias assemblies on command
6750         line and check for their warnings/errors. Also keep track of the
6751         extern aliased assemblies.
6752         * namespace.cs: Move the global functionality of Namespace
6753         to GlobalRootNamespace/RootNamespace. Now the global namespace
6754         is GlobalRootNamespace.Globa. Also the code moved from 
6755         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
6756         Finally added LocalAliasEntry (AliasEntry before) and
6757         ExternAliasEntry, to handle alias statements.
6758         * cs-parser.jay: Add support in the grammar for extern alias
6759         statement.
6760         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
6761         Update callings to Namespace (now in GlobalRootNamespace).
6762
6763 2005-10-18  Raja R Harinath  <rharinath@novell.com>
6764
6765         Fix #76371.
6766         * class.cs (TypeContainer.DefineType): Move updating of
6767         topological sort earlier in the code.
6768         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
6769
6770 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
6771
6772         Fix #76273.
6773         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
6774         
6775         * constant.cs (Constant.TryReduce): Moved from Cast class.
6776         (Reduce): Made little bit more OO and fixed missing conversions.
6777         
6778         * ecore.cs (Reduce): Implemented.
6779         (Binary.EnumLiftUp): New method to upgrade values to enum values.
6780         
6781         * literal.cs (Reduce): Implemented.
6782         
6783         * class.cs: Reverted Miguel's wrong commit.
6784
6785 2005-10-14  Miguel de Icaza  <miguel@novell.com>
6786
6787         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
6788
6789 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
6790
6791         * cs-parser.jay, expression.cs : CS0214 was missing error location
6792           for constants. Fixed bug #76404.
6793
6794 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
6795
6796         Fix #76370.
6797         * convert.cs (ExplicitConversionCore): Fixed object->enum
6798         conversion.
6799
6800 2005-10-10  Raja R Harinath  <rharinath@novell.com>
6801
6802         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
6803         InstanceExpression.
6804         (PropertyExpr.EmitCall): Likewise.
6805         * expression.cs (Invocation.EmitArguments): Handle case where
6806         arguments == null.
6807         (Invocation.EmitCall): Avoid allocating temporary variable if
6808         there are no arguments.
6809
6810 2005-10-07  Raja R Harinath  <rharinath@novell.com>
6811
6812         Fix #76323.
6813         * convert.cs (ImplicitConversionStandard): Move conversion of
6814         void* to arbitrary pointer types ...
6815         (ExplicitConversionStandard): .. here.
6816         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
6817         error to always print typenames.
6818
6819 2005-10-07  Raja R Harinath  <rharinath@novell.com>
6820
6821         * convert.cs (GetConversionOperator): Rename from
6822         GetConversionOperators.  Move operator selection code from ...
6823         (UserDefinedConversion): ... here.
6824
6825 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
6826
6827         * convert.cs (ExplicitConversionCore): Removed duplicate enum
6828         conversion.
6829
6830 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
6831
6832         * assign.cs (Assign.DoResolve): Error method changed.
6833
6834         * cfold.cs (DoConstantNumericPromotions): Error method changed.
6835         
6836         * const.cs (ResolveValue): Reset in_transit immediately.
6837         
6838         * constant.cs: Error method changed.
6839         
6840         * convert.cs: Removed useless location parameter.
6841         (ExplicitNumericConversion): Don't do double enum check.
6842         (ExplicitConversionCore): Renamed from ExplicitConversion.
6843         (ExplicitUnsafe): Extracted from ExplicitConversion.
6844         (ExplicitConversion): Uses for error reporting.
6845         
6846         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
6847         error messages.
6848         (ResolveBoolean): Uses common error method.
6849         (CastToDecimal): Get rid of ec.
6850         (CastFromDecimal): Optimized.
6851         (ConvCast): Get rid of ec.
6852         
6853         * enum.cs (ResolveValue): Reset in_transit immediately.
6854         (Emit): Return after first error.
6855         
6856         * expression.cs: Convert changes.
6857         
6858         * literal.cs: Error method changed.
6859         
6860         * statement.cs: Error method changed.
6861
6862 2005-10-03  Raja R Harinath  <rharinath@novell.com>
6863
6864         * support.cs (SeekableStreamReader.Position): Don't error out when
6865         the requested position is just beyond the end of the current
6866         buffered data.
6867
6868 2005-09-28  Raja R Harinath  <rharinath@novell.com>
6869
6870         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
6871         try to keep in sync with the byte count of the underlying Stream.
6872         However, this limits us to a window size of 2048 characters: i.e.,
6873         the maximum lookahead of our lexer/parser can be 2048 characters.
6874
6875 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
6876
6877         Fix #76255.
6878         * driver.cs: Fix compilation files with full root path.
6879
6880 2005-09-25  Miguel de Icaza  <miguel@novell.com>
6881
6882         * report.cs (SymbolRelatedToPreviousError): Format the output so
6883         it does not use an open parenthesis that is never closed. 
6884
6885         * driver.cs: Follow coding guidelines
6886
6887 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
6888
6889         Fix #72930.
6890         * const.cs (Const.ResolveValue): Check for assigning non-null
6891         value to reference type.
6892
6893 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
6894
6895         * anonymous.cs: Implemented ExprClassName.
6896         
6897         * assign.cs (Assign.DoResolve): Don't chrash when type is not
6898         delegate.
6899         
6900         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
6901         check.
6902         
6903         * class.cs (StaticClass.DefineContainerMembers): Report protected
6904         members as error.
6905         
6906         * codegen.cs: if(ed) PRODUCTION.
6907         
6908         * convert.cs (Error_CannotImplicitConversion): Better error
6909         distinction.
6910         
6911         * cs-parser.jay: More error checks.
6912         
6913         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
6914         
6915         * driver.cs (CSCParseOption): Enabled wrong option check.
6916         
6917         * ecore.cs (Expression.ExprClassName): Turned to property.
6918         (MemberExpr.CheckIntermediateModification): For checking boxed
6919         value types     modification.
6920         
6921         * statement.cs (Fixed.Resolve): Expression type must be
6922         convertible to fixed type.
6923         (CollectionForeach.GetEnumeratorFilter,TryType):
6924         Small refactoring for easier error checking.
6925
6926 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
6927
6928         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
6929         attributes.
6930         
6931         * class.cs (GeneratedBaseInitializer): New class for customization
6932         compiler generated initializers.
6933         (MemberBase.DoDefine): Check Obsolete attribute here.
6934         (FieldMember.DoDefine): Ditto.
6935         
6936         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
6937         constants.
6938         
6939         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
6940         (MemberCore.GetObsoleteAttribute): Removed argument.
6941         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
6942         (MemberCore.CheckObsoleteType): New helper.
6943         
6944         * delegate.cs,
6945         * enum.cs,
6946         * statement.cs: Updates after MemberCore changes.
6947         
6948         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
6949         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
6950         
6951         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
6952         obsolete attribute for compiler construct.
6953         (As.DoResolve): Cache result.
6954         
6955         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
6956
6957 2005-09-26  Raja R Harinath  <rharinath@novell.com>
6958
6959         Fix #76133.
6960         * expression.cs (This.VerifyFixed): In a value type T, the type of
6961         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
6962         value type R, 'this' is treated as a value parameter.
6963
6964 2005-09-22  Miguel de Icaza  <miguel@novell.com>
6965
6966         * statement.cs (Lock): Use the TemporaryVariable class instead of
6967         manually using local variables as those do not work when variables
6968         are captured.
6969
6970         * ecore.cs: Moved the TemporaryVariable class from being a nested
6971         class inside Foreach to be a public class that can be employed in
6972         other places. 
6973
6974 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
6975
6976         * cs-parser.jay: interface_accessors replaced by
6977         accessor_declarations.
6978
6979         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
6980         location.
6981         
6982         * statement.cs (GotoCase.Resolve): Convert null constant to
6983         null case.
6984         (SwitchLabel.ResolveAndReduce): Ditto.
6985         (SwitchLabel.NullStringCase): Custom null stamp.
6986         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
6987         
6988         typemanager.cs (CSharpSignature): Don't skip first argument
6989         for full names.
6990
6991 2005-09-18  Miguel de Icaza  <miguel@novell.com>
6992
6993         * driver.cs: Set InEmacs based on the environment variable EMACS. 
6994
6995         * location.cs (InEmacs): in this mode, do not report column
6996         location as it confuses Emacs.
6997
6998 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
6999
7000         * cfold.cs, constant.cs, convert.cs, ecore.cs,
7001         expression.cs, iterators.cs, literal.cs: Store constants and
7002         literals location.
7003         
7004         * class.cs (MemberBase.ShortName): Pass location.
7005         
7006         * cs-parser.jay: Some location fixes.
7007         
7008         * ecore.cs (Expression.Location): Made virtual.
7009
7010 2005-09-05  Miguel de Icaza  <miguel@novell.com>
7011
7012         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
7013         if the underlying types are the same, otherwise we need to produce
7014         code that will do the proper cast.
7015
7016         This was exposed by Marek's constant rewrite which produced
7017         invalid code for the call site:
7018
7019         enum X : long { a }
7020         void Method (X v) {}
7021
7022         Method ((X) 5)
7023
7024         This fixes test-49.cs
7025
7026 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
7027
7028         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
7029           Type/Object should be allowed as well. Fixed bug #75968.
7030
7031 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
7032
7033         * expression.cs : (Binary.DoResolve): when one is enum constant and
7034           another is constant 0, then return enum one *as enum type*.
7035           Fixed bug 74846.
7036
7037 2005-09-02  Raja R Harinath  <rharinath@novell.com>
7038
7039         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
7040         internal.
7041
7042         Fix #75941.
7043         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
7044         flow-branching for LocalVariableReferences in case we were invoked
7045         from a MemberAccess.
7046         * expression.cs (LocalVariableReference.VerifyAssigned): New.
7047         Carved out of ...
7048         (LocalVariableReference.DoResolveBase): ... this.
7049         (MemberAccess.Resolve): Do the check that was disabled during
7050         SimpleNameResolve.
7051
7052 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
7053
7054         * class.cs :
7055           (PartialContainer.Create): check abstract/sealed/static strictly
7056           but abstract/sealed can exist only at one side. Fixed bug #75883.
7057
7058 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
7059
7060         Fix #75945.
7061         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
7062         specified, don't default to UnmanagedType.I4.
7063
7064 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
7065
7066         * expression.cs : conditional operator should check possibly
7067           incorrect assign expression. Fixed bug #75946.
7068
7069 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
7070
7071         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
7072           Reverting the change. gmcs is much complex than mcs on this matter.
7073
7074 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
7075
7076         * cs-tokenizer.cs : To read another token ahead of the actual 
7077           consumption, use new SavedToken and cache token instead of moving
7078           back the stream with SeekableStreamReader (it seemed problematic).
7079         * cs-parser.jay,
7080           driver.cs : Thus use StreamReader directly.
7081         * support.cs : Thus removed SeekableStreamReader.
7082
7083 2005-08-30  Raja R Harinath  <rharinath@novell.com>
7084
7085         Fix #75934.
7086         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
7087         (ScopeInfo.EmitScopeType): Use it to construct field names from
7088         names of captured locals.
7089
7090         Fix #75929.
7091         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
7092         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
7093         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
7094         (ExplicitConversion): Remove enum cases already handled by
7095         implicit conversion.  Move implicit conversion check to the beginning.
7096         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
7097         * expression.cs (ArrayCreation.EmitDynamicInitializers):
7098         Don't treat System.Enum as a struct.
7099
7100 2005-08-30  Jb Evain  <jbevain@gmail.com>
7101
7102         * attribute.cs: handles as expression in parameters.
7103
7104 2005-08-30  Raja R Harinath  <rharinath@novell.com>
7105
7106         Fix #75802.
7107         * class.cs (TypeContainer.VerifyClsName): Don't use a
7108         PartialContainer when verifying CLS compliance.
7109         (AbstractPropertyEventMethod): Set Parent here, ...
7110         (PropertyMethod): ... not here.
7111
7112 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
7113
7114         * attribute.cs : escaped attribute name should not be allowed to be
7115           resolved (e.g. @class as classAttribute). Fixed bug #75930.
7116
7117 2005-08-29  Raja R Harinath  <rharinath@novell.com>
7118
7119         Fix #75927.
7120         * convert.cs (ImplicitStandardConversionExists): Allow zero also
7121         when converting a long constant to unsigned long.
7122         * expression.cs (Invocation.OverloadResolve): Add sanity check to
7123         detect where IsApplicable and VerifyArgumentsCompat disagree.
7124
7125 2005-08-29  Raja R Harinath  <rharinath@novell.com>
7126         and Carlos Alberto Cortez  <carlos@unixmexico.org>
7127
7128         Fix #75848.
7129         * class.cs (TypeContainer.CanElideInitializer): New helper.
7130         (TypeContainer.EmitFieldInitializers): Use it to determine if we
7131         can safely emitting the initializer of a field.
7132
7133 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
7134
7135         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
7136           allowed inside a switch (without loop). Fixed bug #75433.
7137
7138 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
7139
7140         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
7141         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
7142
7143 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
7144
7145         * driver.cs : kinda reverting the default encoding changes (not exact 
7146           revert since I noticed that "codepage:reset" might not work fine).
7147
7148 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
7149
7150         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
7151           Location. Now getter and setter store location correctly.
7152           (errors/cs0111-12.cs now reports the expected location.)
7153
7154 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
7155
7156         * driver.cs : Use default encoding on the environment.
7157           Removed (now that) extra parameter for SeekableStreamReader.
7158         * support.cs : (SeekableStreamReader) third .ctor() argument for
7159           StreamReader is not required (always true). preamble size could
7160           be acquired in simpler and safe way.
7161
7162 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
7163
7164         * cs-parser.jay: report CS0642 at warning level 3
7165           and report CS0642 for an if else statement also
7166           fixes bug #74745. Patch by John Luke (and a bit
7167           modified by me).
7168           Removed extra CS0642 warning check for "while",
7169           "for" and "fixed".
7170         * statement.cs: In Block.Resolve(), CS0642 check
7171           is reimplemented to check a sequence of an empty
7172           statement and a block.
7173
7174           Both fix bug #66777.
7175
7176 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
7177
7178         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
7179         detection until I fix it.
7180         
7181         * cs-tokenizer.cs: Changed error message.
7182         
7183         * cs-parser.jay: Fixed 2 error locations.
7184         
7185         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
7186         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
7187         properties.
7188         
7189         * enum.cs (GetSignatureForError): Fixed.
7190         
7191         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
7192         method detection.
7193         
7194         * class.cs,
7195         * typemanager.cs (RegisterProperty): Removed.
7196         
7197         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
7198
7199 2005-08-24  Raja R Harinath  <rharinath@novell.com>
7200
7201         Fix #75874.
7202         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
7203         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
7204
7205 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7206
7207         * expression.cs : tiny fix is required for not warning positive ulong.
7208           See test-441.cs.
7209
7210 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7211
7212         * expression.cs : add CS0652 check for constant and integral
7213           expression. Fixed bug #53974.
7214
7215 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7216
7217         * expression.cs : in DoNumericPromotions(), check if there is implicit
7218           conversion overload for string (to check CS0034). Fixed bug #52492.
7219
7220 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7221
7222         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
7223
7224 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7225
7226         * ecore.cs : report location when it is *not* Null.
7227
7228 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7229
7230         * codegen.cs,
7231           ecore.cs,
7232           flowanalysis.cs,
7233           expression.cs:
7234           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
7235           correctly. Fixed bug #75721.
7236
7237 2005-08-23  Raja R Harinath  <rharinath@novell.com>
7238
7239         * support.cs (SeekableStreamReader.Position): Avoid an expensive
7240         loop that performs 'min (pos, char_count)'.
7241
7242         Fix #75862.
7243         * expression.cs (Unary.ResolveOperator): Don't discard implicit
7244         converted value in Operator.OnesComplement.
7245
7246 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
7247
7248         * anonymous.cs: If the anon method is pulled into a helper class,
7249         it needs to be `internal' not `private'. Fixes runtime behavior on
7250         msft. bug #75704
7251
7252 2005-08-20  Martin Baulig  <martin@ximian.com>
7253
7254         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7255         scope if we don't already have it.
7256
7257         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
7258         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
7259         fixes #75867.
7260
7261 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
7262
7263         Fix #75803
7264         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
7265         is a partial class.
7266
7267 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
7268
7269         The big constants rewrite
7270         Fix #75746, #75685 and more
7271         As a side effect saved 1MB for MWF ;-)
7272         
7273         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
7274         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
7275         enum based for corlib compilation.
7276         
7277         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
7278         subtractions.
7279         
7280         * class.cs (FixedField.Define): Use ResolveAsConstant.
7281         
7282         * const.cs (IConstant): Interface constants and enums.
7283         (Const.ResolveValue): New method for constant resolvning.
7284         (ExternalConstant): Constants from imported assemblies.
7285         
7286         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
7287         conversion; like enums.
7288         (Constant.ToType): Converts this constant to different type.
7289         (Constant.Increment): Adds 1.
7290         
7291         * convert.cs (ImplicitConversionRequired): Simplified.
7292         
7293         * cs-parser.jay: Create EnumMember directly.
7294         
7295         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
7296         
7297         * doc.cs (GenerateEnumDocComment): Removed.
7298         
7299         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
7300         (ConvertIntLiteral): Removed.
7301         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
7302         
7303         * enum.cs (EnumMember): Implement IConstant.
7304         (Enum.IsValidEnumConstant): Removed.
7305         (Enum.GetNextDefaultValue): Removed.
7306         (Enum.FindMembers): Updated.
7307         (Enum.GenerateDocComment): Iterate enum members.
7308         
7309         * expression.cs (Cast.TryReduce): Handle enums correctly.
7310         (New.Constantify): Made public.
7311         (MemberAccess.DoResolve): Removed contant specific if(s).
7312         
7313         * literal.cs (NullLiteral): Implement new abstract methods.
7314         
7315         * statement.cs (GotoCase.Resolve): Use new constant methods.
7316         (SwitchLabel.ResolveAndReduce): Use new constant methods.
7317         
7318         * typemanager.cs (LookupEnum): Removed.
7319         (IsEnumType): Fixed to work with corlib.
7320         (RegisterConstant): Removed.
7321         (LookupConstant): Removed.
7322         (GetConstant): Changed to work with IConstant.
7323
7324 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
7325
7326         * location.cs : Fixed overflown (>255) column number.
7327
7328 2005-08-03  Raja R Harinath  <rharinath@novell.com>
7329
7330         First cut of the qualified-alias-member feature.
7331         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
7332         token.
7333         * cs-parser.jay (DOUBLE_COLON): New token.
7334         (namespace_or_type_name): Add rule for recognizing
7335         qualified-alias-members.
7336         (primary_expression): Likewise.
7337         (element_access): Allow QualifiedAliasMember as a possible
7338         type-bearing expression.
7339         (local_variable_type, local_variable_pointer_type): Likewise.
7340         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
7341         aliases in the current and enclosing namespace declarations.
7342         (NamespaceEntry.UsingAlias): Add CS0440 warning.
7343         * decl.cs (MemberName.is_double_colon): New.
7344         (MemberName.MemberName): Add new constructor for alias-member.
7345         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
7346         * expression.cs (QualifiedAliasMember): New expression type.
7347
7348 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7349
7350         * location.cs : it borked when no argument was specified.
7351
7352 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7353
7354         * location.cs : tiny ToString() format fix.
7355
7356 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7357
7358         * statement.cs : oops, it was missing.
7359
7360 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7361
7362         A set of fixes for precise line/column location.
7363
7364         * location.cs :
7365           "token" field now holds a file/line "delta", a line number offset 
7366           from the segment, and a column number. See also:
7367           http://lists.ximian.com/pipermail/mono-devel-list/2004-
7368           December/009508.html
7369           Removed static IsNull. Use instance IsNull property instead.
7370         * cs-tokenizer.cs :
7371           For some tokens it stores Location. For Identifier it stores
7372           LocatedToken which is a pair of string name and location.
7373           Column numbers are adjusted only at getChar().
7374         * report.cs :
7375           Use Location.ToString() for reporting (it now contains column).
7376         * cs-parser.jay :
7377           Largely modified to use LocatedToken instead of
7378           string (IDENTIFIER), and to acquire Location from some tokens.
7379         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
7380           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
7381           codegen.cs :
7382           Now MemberName holds Location. DeclSpace.ctor() receives Location
7383           as a parameter. Removed extra parameters to all derived classes.
7384           Replaced Location.IsNull() with instance property.
7385         * assign.cs, expression.cs :
7386           Added .ctor() overload that omits Location.
7387         * attribute.cs :
7388           Added "nameEscaped" flag that indicates the identifier was escaped
7389           in the source file. This fixes bug #57047.
7390
7391 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
7392
7393         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
7394         New method, looking for lo-case imported cls type.
7395
7396         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
7397         here.
7398
7399         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
7400
7401         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
7402
7403         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
7404         all_imported_types.
7405         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
7406
7407         Optimized to save 3.5 MB for SWF compilation.
7408
7409 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
7410
7411         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
7412         (PartialContainer.Create): Moved logic AddToContainer.
7413         (PartialContainer.MarkForDuplicationCheck): Shares name.
7414         
7415         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
7416         place.
7417         
7418         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
7419         initialization.
7420         (Namespace.GetSignatureForError): New method.
7421         
7422         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
7423         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
7424
7425 2005-08-01  Raja R Harinath  <rharinath@novell.com>
7426
7427         Fix #75669.
7428         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
7429         member lookup rather than qualifier_type, since qualifier_type can
7430         be null.
7431
7432 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
7433
7434         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
7435         enum member.
7436
7437 2005-07-31  Miguel de Icaza  <miguel@novell.com>
7438
7439         * statement.cs: Copy the local exception into the exception
7440         captured local.  Fixes 75674
7441
7442 2005-07-31  Raja R Harinath  <harinath@gmail.com>
7443
7444         Fix #75658.
7445         * expression.cs (Invocation.OverloadResolve): Don't report error
7446         CS1501 if error CS1502 has been reported.
7447         (New.DoResolve): Delegate CS1501 reporting to
7448         Invocation.OverloadResolve.
7449
7450         Fix #75656.
7451         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
7452         invariant-meaning-in-block property in an enclosing block if
7453         necessary.
7454
7455 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
7456
7457         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
7458         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
7459         (Switch.CheckSwitch): Just save 50kb for SWF.
7460
7461 2005-07-27  Martin Baulig  <martin@ximian.com>
7462
7463         * anonymous.cs (CaptureContext.AddField): Added
7464         `AnonymousContainer am' argument; compute its toplevel scope if
7465         it's not already computed.  Fixes #75649.
7466
7467 2005-07-26  Raja R Harinath  <rharinath@novell.com>
7468
7469         Fix #75628.
7470         * class.cs (Constructor.Emit): Reset block to null if the block
7471         resolve fails.
7472
7473 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
7474
7475         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
7476
7477 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
7478
7479         * class.cs (MethodData.Define): Check whether accessor implementing
7480         interface is public.
7481
7482         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
7483
7484 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
7485
7486         Fix #57245
7487         * namespace.cs (LookupType): Moved same type check to...
7488         
7489         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
7490         with the same name.
7491
7492 2005-07-21  Raja R Harinath  <rharinath@novell.com>
7493
7494         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
7495         already found a typebuilder.
7496         * class.cs (MethodCore.IsDuplicateImplementation): Compare
7497         MemberNames, not strings.
7498
7499         * const.cs (Error_ExpressionMustBeConst): 
7500         Rename from Error_EpressionMustBeConst.
7501         * const.cs, class.cs, statement.cd: Update.
7502
7503 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
7504
7505         Fix #65573
7506
7507         * const.cs (Const.LookupConstantValue): Report missing contant expression
7508         everytime.
7509         (Error_EpressionMustBeConstant): Only one error method.
7510
7511         * class.cs, statement.c: Updated.
7512
7513 2005-07-20  Raja R Harinath  <rharinath@novell.com>
7514
7515         * statement.cs (Block.Flags): Add back HasVarargs.
7516         (Block.flags): Make protected.
7517         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
7518
7519         * typemanager.cs (types, typecontainers, user_types): Remove.
7520         (UserTypes, TypeContainers): Likewise.
7521         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
7522         (CleanUp, Reset): Update.
7523         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
7524         (GetNestedType): Use Type.GetNestedType.
7525         (CoreLookupType): Take two arguments, the namespace and the
7526         basename of the type.  Update to use the Namespace.Lookup
7527         mechanism.
7528         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
7529         (RealMemberLookup): Use IsNestedChildOf instead of playing with
7530         string concatenation and substring matches.
7531         * class.cs, enum.cs, delegate.cs: Update to changes.
7532
7533 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
7534
7535         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
7536         Expression and made virtual.
7537
7538         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
7539         (ImplicitStandardConversionExists): Fixed `byte' typo ?
7540
7541         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
7542
7543         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
7544         error message.
7545
7546         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
7547         change.
7548
7549 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
7550
7551         Fix #57707
7552         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
7553         AssemblyCultureAttribute is not used on executable.
7554
7555         * rootcontext.cs,
7556         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
7557
7558 2005-07-16  Raja R Harinath  <rharinath@novell.com>
7559
7560         Fix #60638.
7561         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
7562         New.  Reports CS0252/CS0253.
7563         Mostly taken from preliminary patch by Duncak Mak.
7564         (Binary.DoResolveOperator): Store results of operator lookup.
7565         Use them to detect if we need to warn about unintended reference
7566         comparisons.
7567
7568 2005-07-15  Raja R Harinath  <rharinath@novell.com>
7569
7570         Fix #72969.
7571         * namespace.cs (Namespace.Lookup): Add back location parameter.
7572         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
7573         * delegate.cs, ecore.cs, expression.cs: Update to changes.
7574
7575         * codegen.cs (EmitContext.DeclSpace): Make readonly.
7576         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
7577         (Namespace.LookupType): ... this.
7578         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
7579         of namespaces.
7580         * typemanager.cs (LookupTypeReflection): Remove buggy code that
7581         purported to handle pointers.
7582         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
7583         CoreLookupType.
7584
7585 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
7586
7587         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
7588         type as namespace.
7589
7590 2005-07-15  Raja R Harinath  <rharinath@novell.com>
7591
7592         * namespace.cs (Namespace.Lookup): Drop location parameter.
7593         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
7594         (NamespaceEntry.Lookup): ... this.
7595         (NamespaceEntry.Error_AmbiguousTypeReference):
7596         Move here from DeclSpace.
7597         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
7598         names ...
7599         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
7600         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
7601         Move to NamespaceEntry.
7602         * delegate.cs, expression.cs: Update to changes.
7603
7604 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
7605
7606         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
7607         CheckAttributeType and refactored.
7608         (Attribute.ResolvePossibleAttributeType): Changed to reuse
7609         ResolveAsTypeTerminal error handling.
7610         (ResolveAsTypeTerminal): Introduced because of global attributes extra
7611         handling.
7612         (GetSignatureForError): Print errors in same way.
7613
7614         * class.cs,
7615         * codegen.cs: Reflect attribute GetSignatureForError change.
7616
7617         * ecore.cs,
7618         * expression.cs: Add silent parameter to ResolveAsTypeStep.
7619
7620         * namespace.cs (UsingEntry): Refactored to make fields private.
7621
7622         * assign.cs,
7623         statement.cs: Error_UnexpectedKind has extra parameter.
7624
7625 2005-07-14  Raja R Harinath  <rharinath@novell.com>
7626
7627         * ecore.cs (IAlias): Remove.
7628         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
7629         that implement the interface.
7630         * namespace.cs (Namespace): Likewise.
7631         (Namespace.declspaces): Renamed from 'defined_names'.
7632         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
7633         DeclSpace instead of an IAlias.
7634         * tree.cs (Tree.AddDecl): Update.
7635
7636 2005-07-12  Raja R Harinath  <rharinath@novell.com>
7637
7638         * statement.cs (Block.Flags); Remove HasVarargs.
7639         (Block.HasVarargs): Move to ToplevelBlock.
7640         (Block.ThisVariable, Block.AddThisVariable): Likewise.
7641         (Block.Variables): Make protected.  Initialize variable hashtable
7642         if necessary.
7643         (Block.AddVariable): Update.
7644         (Block.Resolve): Update to changes.
7645         (ToplevelBlock.HasVarargs): New boolean.
7646         (ToplevelBlock.ThisVariable): Move here from Block.
7647         (ToplevelBlock.AddThisVariable): Likewise.
7648         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
7649         * expression.cs (This.ResolveBase): Update to changes.
7650         (ArglistAccess.DoResolve): Likewise.
7651
7652 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
7653
7654         Fix #75321
7655         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
7656
7657         * class.cs (TypeContainer.VerifyMembers): Distinguish between
7658         not used and not used & assigned.
7659         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
7660
7661 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
7662
7663         Fix #75053
7664         * expression.cs (Is.DoResolve): null is never provided type.
7665
7666 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
7667
7668         Fix #52496
7669         * cs-parser.jay: Less strict event error rule to catch more errors.
7670
7671 2005-07-08  Martin Baulig  <martin@ximian.com>
7672
7673         Fix test-iter-10.cs - distinguish whether we `yield' in a property
7674         gettter (allowed) or setter (not allowed).
7675
7676         * class.cs (Accessor): Implement IIteratorContainer.
7677         (Accessor.Yields): New public field.
7678         (PropertyBase.PropertyMethod.Define): Handle iterators on a
7679         per-accessor basis.
7680
7681         * cs-parser.jay
7682         (get_accessor_declaration, set_accessor_declaration): Set the
7683         `yields' flag on the accessor, not the property.
7684         (property_declaration): Do the iterators check on a per-accessor
7685         basis and not for the whole property.
7686
7687 2005-07-08  Martin Baulig  <martin@ximian.com>
7688
7689         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
7690         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
7691
7692 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
7693
7694         Fix #74975
7695         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
7696         (ExtractSecurityPermissionSet): Cope with self referencing security
7697         attributes properly.
7698
7699         * driver.cs (SetOutputFile): Made public property OutputFile.
7700
7701 2005-07-07  Raja R Harinath  <rharinath@novell.com>
7702
7703         Fix #75486.
7704         * class.cs (TypeContainer.first_nonstatic_field): Rename from
7705         has_nonstatic_fields.  Make into a FieldBase pointer.
7706         (TypeContainer.AddField): Add CS0282 check.
7707         (TypeContainer.EmitType): Update.
7708
7709 2005-07-06  Miguel de Icaza  <miguel@novell.com>
7710
7711         * cs-tokenizer.cs (consume_identifier): Do not create strings to
7712         compare if they start with __.
7713
7714 2005-07-06  Raja R Harinath  <rharinath@novell.com>
7715
7716         * statement.cs (Switch.SwitchGoverningType): Only look at
7717         UserCasts that don't need implicit standard conversions to one of
7718         the allowed switch types (Fixes test-322.cs).
7719         (LocalInfo.Resolve): Re-enable sanity-test.
7720
7721 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
7722
7723         * cs-tokenizer.cs (consume_identifier): Detect double undescores
7724         
7725         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
7726         
7727         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
7728
7729 2005-07-06  Raja R Harinath  <rharinath@novell.com>
7730
7731         Fix #75472.
7732         * ecore.cs (SimpleName.GetSignatureForError): Add.
7733         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
7734         (MemberAccess.GetSignatureForError): Add.
7735
7736 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
7737  
7738         The big error and warning messages review.
7739         
7740         * anonymous.cs,
7741         * assign.cs,
7742         * attribute.cs,
7743         * class.cs,
7744         * codegen.cs,
7745         * convert.cs,
7746         * cs-parser.jay,
7747         * cs-tokenizer.cs,
7748         * decl.cs,
7749         * delegate.cs,
7750         * doc.cs,
7751         * driver.cs,
7752         * ecore.cs,
7753         * enum.cs,
7754         * expression.cs,
7755         * flowanalysis.cs,
7756         * iterators.cs,
7757         * literal.cs,
7758         * location.cs,
7759         * modifiers.cs,
7760         * namespace.cs,
7761         * parameter.cs,
7762         * pending.cs,
7763         * report.cs,
7764         * rootcontext.cs,
7765         * statement.cs,
7766         * support.cs,
7767         * tree.cs,
7768         * typemanager.cs: Updated.
7769         
7770         * class.cs: (MethodCore.SetYields): Moved here to share.
7771         (PropertyMethod.Define): Moved iterator setup here.
7772         
7773         * iterators.cs: Add orig_method to have full access to parent
7774         container.
7775
7776 2005-07-05  Raja R Harinath  <rharinath@novell.com>
7777
7778         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
7779         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
7780         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
7781         variable of struct type.
7782         * expression.cs (Unary.ResolveOperator): Update to change.
7783         (Indirection.VerifyFixed): Likewise.
7784         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
7785         (ParameterReference.VerifyFixed): Value parameters are fixed.
7786         (This.VerifyFixed): Treat 'this' as a value parameter.
7787         * statement.cs (LocalInfo.IsFixed): Remove.
7788
7789 2005-07-01  Martin Baulig  <martin@ximian.com>
7790
7791         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
7792         `ec.EmitThis ()' to get the correct scope.
7793
7794 2005-07-01  Martin Baulig  <martin@ximian.com>
7795
7796         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
7797         instance is a ParameterReference; fixes #75299.
7798
7799 2005-07-01  Martin Baulig  <martin@ximian.com>
7800
7801         Reverted Marek's latest patch (r46725):
7802         - it contains structural changes which are neither mentioned in
7803           the ChangeLog nor explained anywhere; for example the additional
7804           argument of EmitContext's and Iterator's .ctor's and the
7805           TypeContainer.DefineMembers() change.
7806         - structural changes like this should go in in seperate patches
7807           and not be hidden in a huge patch which just seems to affect
7808           warnings and errors.
7809           a big and hard to understand patch.
7810         - it breaks iterators and causes regressions, for instance in
7811           test-iter-03.cs.      
7812
7813 2005-06-30  Raja R Harinath  <rharinath@novell.com>
7814
7815         Fix #75412.
7816         * expression.cs (Indexers.map): Remove.
7817         (Indexers.Append): Filter out inaccessible setters and getters.
7818         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
7819
7820         Fix #75283.
7821         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
7822         Refactored from ...
7823         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
7824         (FieldExpr.Emit, PropertyExpr.Emit): Update.
7825         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
7826         * expression.cs (Invocation.EmitCall): Add CS0120 check.
7827
7828 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
7829
7830         Fix #75322
7831         * class.cs (FieldBase.GetInitializerExpression): One more field
7832         for backup.
7833
7834 2005-06-28  Miguel de Icaza  <miguel@novell.com>
7835
7836         * pending.cs: Do not define a proxy if the base method is virtual,
7837         it will be picked up by the runtime (bug 75270).
7838
7839 2005-06-08  Martin Baulig  <martin@ximian.com>
7840
7841         The big Iterators rewrite :-)
7842
7843         * iterators.cs: Rewrite this to use the anonymous methods framework.
7844
7845         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
7846         before the TypeContainers; see 2test-21.cs.
7847
7848         * class.cs
7849         (TypeContainer.DefineType): Don't create a new EmitContext if we
7850         already have one (this only happens if we're an Iterator).
7851         (TypeContainer.Define): Also call Define() on all our iterators.
7852         (Method.CreateEmitContext): Added support for iterators.
7853
7854         * anonymous.cs
7855         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
7856         (AnonymousContainer.CreateMethodHost): Moved here from
7857         AnonymousMethod and made abstract.
7858         (AnonymousContainer.CreateScopeType): New abstract method.
7859         (AnonymousContainer.IsIterator): New public property.
7860         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
7861         get the ScopeTypeBuilder rather than manually defining it here. 
7862         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
7863         iterators here.
7864
7865         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
7866         before RootContext.DefineTypes().
7867
7868         * codegen.cs (EmitContext.RemapToProxy): Removed.
7869         (EmitContext.CurrentAnonymousMethod): Changed type from
7870         AnonymousMethod -> AnonymousContainer.
7871         (EmitContext.ResolveTopBlock): Protect from being called twice.
7872         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
7873         (EmitContext.EmitThis): Removed the iterators hacks; use the
7874         anonymous methods framework for that.
7875
7876         * statement.cs
7877         (ToplevelBlock.Container): Make this a property, not a field.
7878         (ToplevelBlock.ReParent): New public method; move the
7879         ToplevelBlock into a new container.
7880         (Foreach.TemporaryVariable): Simplify.
7881
7882 2005-06-05  Martin Baulig  <martin@ximian.com>
7883
7884         * statement.cs (LocalInfo.CompilerGenerated): New flag.
7885         (Block.AddTemporaryVariable): New public method; creates a new
7886         `LocalInfo' for a temporary variable.
7887         (Block.EmitMeta): Create the LocalBuilders for all the temporary
7888         variables here.
7889         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
7890         non-iterator variables.
7891
7892 2005-06-05  Martin Baulig  <martin@ximian.com>
7893
7894         * statement.cs (Foreach.TemporaryVariable): Create the
7895         LocalBuilder in the Emit phase and not in Resolve since in some
7896         situations, we don't have an ILGenerator during Resolve; see
7897         2test-19.cs for an example.
7898
7899 2005-06-04  Martin Baulig  <martin@ximian.com>
7900
7901         **** Merged r45395 from GCS ****
7902
7903         The big Foreach rewrite - Part II.
7904
7905         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
7906         with `PropertyInfo ienumerator_getcurrent'.
7907
7908         * codegen.cs (VariableStorage): Removed.
7909
7910         * statement.cs
7911         (Foreach): Derive from Statement, not ExceptionStatement.
7912         (Foreach.CollectionForeach): New nested class.  Moved all the code
7913         dealing with collection foreach here.
7914         (Foreach.ForeachHelperMethods): Removed.
7915         (Foreach.TemporaryVariable): Implement IMemoryLocation.
7916
7917 2005-05-23  Martin Baulig  <martin@ximian.com>
7918
7919         * statement.cs (Try.DoResolve): Don't create a `finally' if we
7920         don't need to.  Fix #75014.
7921
7922 2005-05-20  Martin Baulig  <martin@ximian.com>
7923
7924         Merged r44808 from GMCS.
7925
7926         * class.cs (TypeContainer.CircularDepException): Removed.
7927         (TypeContainer.DefineType): Removed the `InTransit' stuff.
7928         (TypeContainer.CheckRecursiveDefinition): Check for circular class
7929         (CS0146) and interface (CS0529) dependencies here.
7930
7931 2005-06-21  Raja R Harinath  <rharinath@novell.com>
7932
7933         * expression.cs (Invocation.EmitCall): Fix initialization
7934         'this_call' to reflect current behaviour.  Fix indentation.
7935
7936         * convert.cs (FindMostEncompassedType): Add two trivial special
7937         cases (number_of_types == 0 || number_of_types == 1).
7938         (FindMostEncompasingType): Likewise.
7939
7940 2005-06-17  Raja R Harinath  <rharinath@novell.com>
7941
7942         Some cleanups preparing for the fix of #75283.
7943         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
7944         error testing.
7945         (EventExpr.InstanceResolve): Likewise.
7946         (EventExpr.DoResolve): Remove redundant checks.
7947
7948 2005-06-10  Duncan Mak  <duncan@novell.com>
7949
7950         * cs-tokenizer.cs (process_directives): New flag for controlling
7951         the processing of preprocessor directives.
7952         (x_token): After seeing a '#', return Token.NONE instead of going
7953         to handle_preprocessing_directive() when not processing
7954         directives. This avoids unnecessary processing during the token peek in
7955         is_punct().
7956
7957         This fixes #74939.
7958
7959         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
7960         the existing error reporting methods instead of Report.Error.
7961
7962         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
7963         after Raja's rewrite.
7964
7965 2005-06-08  Miguel de Icaza  <miguel@novell.com>
7966
7967         * class.cs: Small fix.
7968
7969 2005-06-08  Raja R Harinath  <rharinath@novell.com>
7970
7971         Fix #75160.
7972         * class.cs (GetPartialBases): Fix return value check of
7973         part.GetClassBases.
7974
7975 2005-06-07  Raja R Harinath  <rharinath@novell.com>
7976
7977         Ensure that partial classes are registered in their enclosing
7978         namespace.  Initial part of fix of #75160.
7979         * tree.cs (Tree.RecordDecl): Add new namespace argument.
7980         Register declspace with namespace here, not in
7981         DeclSpace.RecordDecl.
7982         * cs-parser.jay: Pass namespace to RecordDecl.
7983         * class.cs (PartialContainer.Create): Likewise.
7984         (ClassPart.DefineType): New sanity-check.  Throws an exception if
7985         called.
7986         * decl.cs (Declspace.RecordDecl): Remove.
7987         * namespace.cs (NamespaceEntry.DefineName): Remove.
7988
7989 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
7990
7991         * rootcontext.cs: Reset TargetExt as well.
7992
7993 2005-06-03  Raja R Harinath  <rharinath@novell.com>
7994
7995         * ecore.cs (Expression.Resolve): Emit CS0654 error when
7996         -langversion:ISO-1.
7997
7998 2005-06-02  Raja R Harinath  <rharinath@novell.com>
7999
8000         Fix #75080, cs0119.cs.
8001         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
8002         of ...
8003         (Expression.Resolve): ... this.  Use it.  Remove bogus code
8004         allowing ExprClass.Type and ExprClass.Namespace for
8005         ResolveFlags.VariableOrValue.
8006         (Expression.Resolve) [1-argument variant]: Change default resolve
8007         flags based on language version.
8008         (Expression.Error_UnexpectedKind): Use a simple string array
8009         rather than an ArrayList.
8010         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
8011         not ExprClass.Type.
8012         (TypeOfVoid.DoResolve): Likewise.
8013         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
8014         flags argument -- it always has the same value.
8015
8016 2005-05-31  Raja R Harinath  <rharinath@novell.com>
8017
8018         Fix #75081.
8019         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
8020         Use it in the error message.
8021         * assign.cs, expression.cs, statement.cs: Update.
8022
8023 2005-05-30  Raja R Harinath  <rharinath@novell.com>
8024
8025         Fix #75088.
8026         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
8027         the "almostMatchedMember" case too.
8028         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
8029         that failed the accessibility checks to 'almost_match'.
8030
8031 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
8032
8033         * attribute.cs: Use internal MethodBuilder methods to set
8034         ExactSpelling and SetLastError on PInvoke methods, instead
8035         of passing them via charset.  Fixes #75060.
8036
8037 2005-05-27  Raja R Harinath  <rharinath@novell.com>
8038
8039         * parameter.cs (Parameter): Remove TODO comment.
8040         (Parameter.DefineParameter): Remove Location parameter.
8041         (Parameters.LabelParameters): Likewise.
8042         * class.cs (Constructor.Emit): Update to change.
8043         (MethodData.Emit): Likewise.
8044         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
8045         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
8046
8047 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
8048
8049         * parameter.cs,
8050           Removed Parameters.Location and added Parameter.Location instead.
8051           Removed Location parameter from Emit() and GetSignature().
8052         * anonymous.cs,
8053           class.cs,
8054           cs-parser.jay,
8055           delegate.cs,
8056           iterators.cs,
8057           statement.cs :
8058           Modified all related calls.
8059
8060 2005-05-26  Raja R Harinath  <rharinath@novell.com>
8061
8062         Improve user-defined conversion handling.
8063         * convert.cs (GetConversionOperators): Rewrite.  Return only the
8064         applicable operators.
8065         (AddConversionOperators): New.  Helper for GetConversionOperators.
8066         (FindMostEncompassedType, FindMostEncompassingType): Verify that
8067         there is only one most encompassed/encompassing type.
8068         (FindMostSpecificSource, FindMostSpecificTarget): Remove
8069         "applicable operator" handling.
8070         (UserConversion): Move cache here from GetConversionOperators.
8071         Directly cache the chosen operator, rather than the whole
8072         MethodGroup.
8073         (ExplicitNumericConversion): Fix buggy implementation of Decimal
8074         case.  Allow conversion of decimal to sbyte and byte too.
8075         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
8076         New static methods.  Used to avoid allocating EmptyExpressions in
8077         convert.cs.
8078
8079 2005-05-24  Duncan Mak  <duncan@novell.com>
8080
8081         * ecore.cs (CastFromDecimal): New class for casting a decimal to
8082         another class, used in Convert.ExplicitNumericConversion.
8083         (CastToDecimal): New class, similar to above, but casts to
8084         System.Decimal, used in Convert.ImplicitNumericConversion and also
8085         in explicit convesion from double/float to decimal.
8086
8087         * convert.cs (ImplicitNumericConversion): Handle implicit
8088         conversions to System.Decimal.
8089         (ExplicitNumericConversion): handle explicit conversions to
8090         System.Decimal.
8091
8092         This fixes #68711.
8093         
8094 2005-05-20  Miguel de Icaza  <miguel@novell.com>
8095
8096         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
8097         know the type at this stage, just break through.   Fixes #75008 
8098
8099 2005-05-19  Martin Baulig  <martin@ximian.com>
8100
8101         * delegate.cs
8102         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
8103         to disable error reporting.
8104
8105         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
8106         here since we don't want to report an error; see the new test-336.cs.
8107
8108 2005-05-19  Raja R Harinath  <rharinath@novell.com>
8109
8110         * statement.cs (ToplevelBlock.GetParameterReference)
8111         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
8112         Move here from class Block.
8113         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
8114         * expression.cs (ParameterReference.DoResolveBase): Likewise.
8115
8116 2005-05-18  Martin Baulig  <martin@ximian.com>
8117
8118         Fix #74978.
8119
8120         * flowanalysis.cs
8121         (FlowBranching.Reachability): Add non-static public And() and Or()
8122         methods.
8123         (FlowBranchingSwitch): New class; do the `break_origins' thing
8124         like in FlowBranchingLoop.
8125         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
8126         reachability, not just locals and parameters.
8127         (FlowBranching.MergeChild): Remove some of the hacks for loop and
8128         switch; MergeBreakOrigins() now takes care of that.
8129
8130 2005-05-18  Martin Baulig  <martin@ximian.com>
8131
8132         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8133         a loop and may leave it, reset the barrier; fixes #74974.
8134
8135 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
8136         
8137         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
8138         is back.
8139         
8140         * cs-parser.jay: Catch more lexical errors.
8141         
8142         * report.cs: Add one more Error method.
8143         
8144         * rootcontext.cs,
8145         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
8146
8147 2005-05-17  Martin Baulig  <martin@ximian.com>
8148
8149         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
8150         #70970. 
8151
8152 2005-05-16  Raja R Harinath  <rharinath@novell.com>
8153
8154         Fix test-382.cs.  Emit values of decimal constants.
8155         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
8156         Carved out of ...
8157         (TypeContainer.AddField): ... this.
8158         (TypeContainer.EmitFieldInitializers): Allow the list of fields
8159         with initializers to include 'Const's.
8160         (ClassPart.RegisterFieldForInitialization): Forward to
8161         PartialContainer.
8162         * const.cs (Const.Const): Pass initializer to base class.
8163         (Const.Define): In case of decimal constants, register them for
8164         initialization in a static constructor.
8165
8166 2005-05-14  Martin Baulig  <martin@ximian.com>
8167
8168         * statement.cs (Block.Resolve): Correctly handle unreachable code;
8169         do not call ResolveUnreachable() on unreachable statements in
8170         here, see the comment in the source code.
8171
8172 2005-05-13  Raja R Harinath  <rharinath@novell.com>
8173
8174         Fix #74934.
8175         * expression.cs (BinaryResolveOperator): If one of the operands of
8176         an equality comparison is 'null' and the other is a pointer type,
8177         convert the null to a NullPointer.
8178         * convert.cs (ImplicitReferenceConversion): If the expression is a
8179         NullLiteral and the target type is a pointer type, return a
8180         NullPointer instead.
8181         (ImplicitConversionStandard): Likewise.
8182
8183 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
8184         
8185         * cs-parser.jay: Set readonly context based on special constructs.
8186         
8187         * expression.cs (LocalVariableReference.DoResolveBase): Improved
8188         readonly variable error handling.
8189         
8190         * rootcontext.cs (EmitCode): Don't verify members when error
8191         occurred.
8192         
8193         * statement.cs (LocalInfo): Add reaodnly context information.
8194         (SetReadOnlyContext, GetReadOnlyContext): New methods.
8195
8196 2005-05-13  Raja R Harinath  <rharinath@novell.com>
8197
8198         * statement.cs (Block.Resolve): Revert change below.  Modify fix
8199         for #74041 to initialize 'resolved' to false only for explicit
8200         blocks.  Fixes #74873.
8201
8202 2005-05-12  Raja R Harinath  <harinath@gmail.com>
8203
8204         Fix #74920.
8205         * typemanager.cs (unmanaged_enclosing_types): New.
8206         (IsUnmanagedType): Avoid infloops by using
8207         'unmanaged_enclosing_types' to talk with recursive invocations.
8208
8209 2005-05-13  Martin Baulig  <martin@ximian.com>
8210
8211         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
8212         instance variable, not a local.  Fix #74873.
8213         (Block.ResolveUnreachable): Set it to true here.
8214
8215 2005-05-11  Duncan Mak  <duncan@novell.com>
8216
8217         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
8218         continuing to process for 'arg'.
8219         (handle_preprocessing_directive): Check the argument of the #endif
8220         directive and report error CS1025 if there are any trailing
8221         characters.
8222
8223         According to the C# spec, having even whitespace after the #endif
8224         directive is illegal; however, because we call arg.TrimEnd ()
8225         beforehand, we have the same behavior as csc, allowing whitespace
8226         after the directive.
8227
8228         Fixes #74892.
8229
8230 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
8231
8232         Fix #74863.
8233         
8234         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
8235         (Constructor.GetObsoleteAttribute): Implemented correctly.
8236
8237 2005-05-10  Martin Baulig  <martin@ximian.com>
8238
8239         * support.cs (ReflectionParameters.ParameterModifier): Use
8240         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
8241         and `ParameterAttributes.In'.  Fixes #74884.
8242
8243 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
8244
8245         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
8246         
8247         * expression.cs (Argument.GetParameterModifier): Turned to property.
8248         (Invocation.Error_InvalidArguments): Add more descriptive errors.
8249         
8250         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
8251         its C# equivalent.
8252         
8253 2005-05-09  Raja R Harinath  <rharinath@novell.com>
8254
8255         Fix #74852.
8256         * decl.cs (MemberCache.AddMethods): Register override methods,
8257         rather than non-override methods.
8258         * typemanager.cs (RegisterOverride): New.
8259         (IsOverride): Update.
8260
8261 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
8262
8263         Fix #73105.
8264         
8265         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
8266         recursive declaration.
8267         
8268         * statement.cs (Block.ResolveMeta): Report any error in resolving.
8269         
8270 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
8271
8272         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
8273         
8274         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
8275
8276 2005-05-05  Raja R Harinath  <rharinath@novell.com>
8277
8278         Fix #74797.
8279         * decl.cs (DeclSpace.FamilyAccessible): 
8280         Use TypeManager.IsNestedFamilyAccessible.
8281
8282         Fix reopened #64812.
8283         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
8284         internal'.
8285
8286 2005-05-04  Raja R Harinath  <rharinath@novell.com>
8287             Abin Thomas  <projectmonokochi@rediffmail.com>
8288             Anoob V E  <projectmonokochi@rediffmail.com>
8289             Harilal P R  <projectmonokochi@rediffmail.com>
8290
8291         Fix #64812.
8292         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
8293         allow access to all static members.
8294
8295 2005-05-04  Martin Baulig  <martin@ximian.com>
8296
8297         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
8298
8299 2005-05-04  Martin Baulig  <martin@ximian.com>
8300
8301         Fix #74655.
8302
8303         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
8304         section at the end; make things work if `default' is not the last
8305         section.        
8306
8307 2005-05-04  Martin Baulig  <martin@ximian.com>
8308
8309         Fix #70400.
8310
8311         * statement.cs (Switch): Replaced the `got_default' field with a
8312         `default_section' one.
8313         (Switch.CheckSwitch): Set `default_section' here.
8314         (Switch.Resolve): If we're a constant switch and the constant is
8315         not found, use the default section.
8316
8317 2005-05-03  Martin Baulig  <martin@ximian.com>
8318
8319         * expression.cs (ArrayAccess.EmitGetLength): New public method.
8320
8321         * statement.cs (Foreach.ArrayForeach): New nested class.
8322         (Foreach.TemporaryVariable): New nested class.
8323         (Foreach.EmitArrayForeach): Removed; this is now in the new
8324         ArrayForeach class.
8325
8326 2005-05-03  Raja R Harinath  <rharinath@novell.com>
8327
8328         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
8329         more conservative.
8330         (VerifyPendingMethods): Revert change below.
8331
8332         * typemanager.cs (IsOverride, RegisterNonOverride): New.
8333         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
8334         that used to trigger warning -28.  Remove warning -28.
8335         * expression.cs (Invocation.OverloadResolve): Use
8336         TypeManager.IsOverride to distinguish override methods.
8337
8338         Fix #74773.
8339         * pending.cs (VerifyPendingMethods): If a base type implements the
8340         requested interface, don't bother checking individual methods of
8341         the base type.  As a side-effect, this prevents the creation of
8342         unnecessary proxies.
8343
8344 2005-05-02  Martin Baulig  <martin@ximian.com>
8345
8346         Fix #70182.
8347
8348         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8349         Also `And' the locals if the old vector is null.
8350         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
8351         null; in this case we basically reset all the variables.        
8352
8353 2005-05-02  Martin Baulig  <martin@ximian.com>
8354
8355         Fix #74529.
8356
8357         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
8358         Added `FlowBranching branching' argument; always `and' the
8359         variables instead of `or'ing them unless we're an infinite loop.
8360
8361         * statement.cs (While.Resolve): Create a new sibling unless we're
8362         infinite.       
8363
8364 2005-05-02  Martin Baulig  <martin@ximian.com>
8365
8366         Fix #70140.
8367
8368         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
8369         arguments; use it instead of creating a new TopLevelBlock.
8370         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
8371         our ConstructorInitializer.
8372
8373         * statement.cs
8374         (TopLevelBlock.TopLevelBranching): New public property.
8375         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
8376         and create our `TopLevelBranching'.
8377
8378         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
8379         anonymous method host, use `block.TopLevelBranching' rather than
8380         creating a new branching.
8381
8382 2005-04-20  Miguel de Icaza  <miguel@novell.com>
8383
8384         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
8385         a ScopeInfo, if any of the current children is a child of the new
8386         entry, move those children there.
8387
8388 2005-04-30  Martin Baulig  <martin@ximian.com>
8389
8390         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
8391         at the beginning of a SwitchSection.  Fix #73335.
8392
8393 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
8394
8395         Fix #74378
8396         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
8397         
8398         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
8399         (FieldExpr.DoResolve): Obsolete members are ignored for field
8400         initializers.
8401         
8402 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
8403
8404         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
8405         of arrays detection.
8406
8407         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
8408         verification.
8409         (Field.VerifyClsCompliance): Volatile fields are not compliant.
8410
8411         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
8412         arrays report.
8413
8414 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
8415
8416         * cs-parser.jay: Use the prefered version of -unsafe in error
8417         message.
8418
8419 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
8420
8421         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
8422         circumstances.
8423
8424 2005-04-20  John Luke  <john.luke@gmail.com>
8425
8426         * driver.cs: fix typo in error message, --outout to --output
8427
8428 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
8429
8430         * codegen.cs (InRefOutArgumentResolving): New field.
8431         
8432         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
8433         fields outside contructor.
8434         
8435         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
8436         
8437 2005-04-19  Miguel de Icaza  <miguel@novell.com>
8438
8439         * anonymous.cs (CaptureContext.EmitParameterInstance): The
8440         parameter code was not completed ever, so it was not as up-to-date
8441         as local variables.  Must finish it.
8442
8443         The bug fix was to compare the Toplevel of the block, not the
8444         current block.  Thanks for Ben for pointing this out. 
8445
8446 2005-04-19  Raja R Harinath  <rharinath@novell.com>
8447
8448         * decl.cs (AddMethods): Use the declaring type of the problem
8449         method to determine if we want to squash a warning.
8450
8451 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
8452
8453         * attribute.cs: Removed debug output.
8454
8455         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
8456         
8457         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
8458         Report.Stderr.
8459         
8460 2005-04-18  Raja R Harinath  <rharinath@novell.com>
8461
8462         Fix #74481.
8463         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
8464         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
8465         all null comparisons against reference types.
8466
8467 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
8468
8469         Fix# 74565
8470         * class.cs (TypeContainer.CircularDepException) New nested
8471         exception class.
8472         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
8473         (TypeContainer.DefineType): Removed error, reset InTransit before
8474         exit.
8475         (Class.DefineType): Throw exception when is in Transit.
8476         Catch exception and report error.
8477         (Struct.DefineType): Throw exception when is in Transit.
8478         Catch exception and report error.
8479         (Interface.DefineType): Throw exception when is in Transit.
8480         Catch exception and report error.
8481
8482         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
8483         handle nested exception handlers.
8484
8485         * flowanalysis.cs (InTryWithCatch): New method, search for try with
8486         a catch.
8487
8488         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
8489         InFinally and InCatch storage.
8490
8491         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
8492         (Catch.Resolve): Set and Restore ec.InCatch.
8493         (Try.Resolve): Set and Restore ec.InFinally.
8494         (Try.HasCatch): True when try has catch.
8495
8496 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
8497
8498         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
8499           for the same event member, so exclude such cases from warning 419.
8500           Fixed bug #74633.
8501
8502 2005-04-16  Miguel de Icaza  <miguel@novell.com>
8503
8504         * expression.cs (Binary.ResolveOperator): Apply patch from John
8505         Luke to fix bug 59864: operators &, | and ^ on enumerations
8506         require that the same enum type on both sides.
8507
8508         * driver.cs: Add warnings to old flag usage, this is to assist
8509         people who produce Makefiles and hope that the Makefiles will be
8510         used on Windows.
8511
8512         * class.cs (TypeContainer.EmitType): Moved the definition of the
8513         special $PRIVATE$ field from the resolve phase to the Emit phase.
8514         During resolve we do not know if we are a struct with
8515         HasExplicitLayout, we know this only after the attributes for the
8516         type are emitted.
8517
8518         Set the FieldOffset to zero on the dummy field that we create for
8519         the class.   Fixes 74590.
8520
8521 2005-04-16  Raja R Harinath  <rharinath@novell.com>
8522
8523         Fix #73834.
8524         * ecore.cs (PropertyExpr.resolved): New.
8525         (DoResolve): Use it to handle a case of double resolution here.
8526         Handle a case of identical-name-and-type-name.
8527         * expression.cs (ArrayCreation.CheckIndices): Avoid double
8528         resolution by storing the results of expression resolution back
8529         into the "probes" array.
8530
8531 2005-04-15  Raja R Harinath  <rharinath@novell.com>
8532
8533         Fix cs0208-7.cs and cs0208-8.cs.
8534         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
8535         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
8536         error reporting to point out the reason a struct is not unmanaged.
8537
8538 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
8539
8540         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
8541           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
8542
8543 2005-04-13  Raja R Harinath  <rharinath@novell.com>
8544
8545         Fix #74528.
8546         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
8547         IdenticalNameAndTypeName here.
8548         (EventExpr.InstanceResolve): Likewise.
8549
8550 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
8551
8552         C# 2.0 DefaultCharSetAttribute implementation
8553         
8554         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
8555         which allows us to set GlobalNamespace for every resolve.
8556         (Attribute.ResolveArguments): Cut from Resolve.
8557         (Attribute.GetCharSetValue): Returns CharSet named argument.
8558         (Attribute.DefinePInvokeMethod): Gets default charset from
8559         module settings.
8560         (GlobalAttribute.ResolveAsTypeStep): Override.
8561         (GlobalAttribute.ResolveArguments): Override.
8562         
8563         * class.cs (TypeAttr): Is protected.
8564         
8565         * codegen.cs (ModuleClass.DefaultCharSet): New member.
8566         (ModuleClass.DefaultCharSetType): New memeber.
8567         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
8568         
8569         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
8570         charset from module.
8571         
8572         * delegate.cs (TypeAttr): Override.
8573         (Delegate.DefineType): Use this TypeAttr.
8574         
8575         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
8576         at very early stage (before types are defined) to resolve model
8577         module attributes. It will probably not work with corlib but it
8578         should be ok.
8579         
8580         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
8581         charset from module.
8582         
8583         * typemanager.cs (default_charset_type): New type.
8584
8585 2005-04-13  Raja R Harinath  <rharinath@novell.com>
8586
8587         * decl.cs (MemberCache.AddMethods): Don't warn if
8588         System.Object.Finalize has buggy MethodAttributes.
8589
8590         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
8591         removed below.
8592
8593 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
8594
8595         * doc.cs : detect ambiguous reference to overloaded members.
8596           Fixed bug #71603. MS 1.1 csc does not detect it.
8597
8598 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
8599
8600         * doc.cs : delegates must not be referenced with parameters.
8601           Fixed bug #71605.
8602
8603 2005-04-12  Miguel de Icaza  <miguel@novell.com>
8604
8605         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
8606
8607 2005-04-10  Miguel de Icaza  <miguel@novell.com>
8608
8609         * driver.cs (MainDriver): Stop processing if the CLS stage found
8610         errors. 
8611
8612         (CompilerCallableEntryPoint.InvokeCompiler): Always
8613         reset after execution;   Take a TextWriter argument for the
8614         output.
8615
8616         * report.cs: Use the error stream instead of hardcoding stderr. 
8617
8618 2005-04-09  Miguel de Icaza  <miguel@novell.com>
8619
8620         * class.cs: Reduce code paths to test, too small of an
8621         optimization to make it worth the extra testing.  Always perform
8622         it. 
8623
8624 2005-04-08  Raja R Harinath  <rharinath@novell.com>
8625
8626         Fix #74510.
8627         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
8628         operators that had errors reported on them.
8629
8630 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
8631
8632         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
8633         argument types.
8634         (Attribute.Resolve): Add named argument type checking.
8635         
8636         * class.cs (FixedField.Define): Use IsPrimitiveType
8637         
8638         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
8639         
8640         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
8641         unsafe parameter types.
8642         
8643         * statement.cs (Using.ResolveExpression): Add better error description.
8644         
8645         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
8646         
8647 2005-04-08  Raja R Harinath  <rharinath@novell.com>
8648
8649         Fix #74484.
8650         * attribute.cs (Attribute.GetAttributeUsage): Resolve
8651         AttributeUsageAttribute in the emitcontext of the attribute class,
8652         not in the emitcontext of the attributable entity it was attached to.
8653         * cs-parser.jay: Use 'current_class', not 'current_container',
8654         when creating a GlobalAttribute.
8655
8656 2005-04-08  Alp Toker  <alp@atoker.com>
8657
8658         * pending.cs: The fix to #58413 failed to compile methods implementing
8659         interfaces with/without params modifiers and vice versa, even though
8660         params modifiers aren't part of the signature. Make the modifier check
8661         less strict as in csc.
8662
8663 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
8664             Anoob V E  <projectmonokochi@rediffmail.com>
8665             Harilal P R  <projectmonokochi@rediffmail.com>
8666
8667         Fix #58413.
8668         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
8669         modifiers of pending methods.
8670         (PendingImplementation.PendingImplementation): Initialize it.
8671         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
8672         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
8673         with ParameterData.  Add check for modifiers.
8674         * class.cs (MethodData.Define): Update to changes.
8675
8676 2005-04-07  Raja R Harinath  <rharinath@novell.com>
8677
8678         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
8679
8680 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
8681
8682         * class.cs (PropertyMethod.Define): Check private accessor in abstract
8683         property.
8684         
8685         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
8686         
8687         * rootcontext.cs,
8688         * typemanager.cs: Registered RequiredAttributeAttribute.
8689         
8690 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
8691
8692         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
8693         Warning CS0169 is back at level 3.
8694         (IMethodData.SetMemberIsUsed): New method.
8695         
8696         * decl.cs (IsUsed): New value; moved from FieldBase.Status
8697         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
8698         
8699         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
8700
8701         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
8702         contants.
8703         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
8704         is used.
8705         
8706         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
8707         is used.
8708         
8709         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
8710         to avoid the problems with nested types.
8711
8712 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
8713             Anoob V.E  <projectmonokochi@rediffmail.com>
8714             Harilal P.R  <projectmonokochi@rediffmail.com>
8715             Raja R Harinath  <rharinath@novell.com>
8716
8717         Fix #73820.
8718         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
8719         attribute.
8720         * typemanager (GetConstructor): Make public.
8721
8722 2005-04-05  John Luke  <john.luke@gmail.com>
8723             Raja R Harinath  <rharinath@novell.com>
8724
8725         Fix #62232.
8726         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
8727         struct too.  Return false quicker in a few cases.
8728         (VerifyUnManaged): Use it.
8729
8730 2005-04-05  Raja R Harinath  <rharinath@novell.com>
8731
8732         Fix #74041.
8733         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
8734         not 'unreachable_seen'.
8735
8736 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
8737
8738         * attribute.cs (Attribute.GetValue): Removed unused.
8739         
8740         * codegen.cs (CodeGen.TrimExt): Removed unused.
8741         
8742         * cs-parser.jay (output): Removed unused.
8743         
8744         * cs-tokenizer.cs (hex_digits): Removed unused.
8745         
8746         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
8747         
8748         * expression.cs (Indirection.LoadExprValue): Removed unused.
8749         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
8750         
8751         * iterators.cs (Iterator.param_types): Removed unused.
8752         
8753         * statement.cs (Goto.block): Removed unused.
8754         (ToplevelBlock.did): Removed unused.
8755         (Switch.ResolveConstantSwitch): Removed unused.
8756
8757 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
8758
8759         * rootcontext.cs: Allow mcs to bootstrap with the compilation
8760         resetting thingy.
8761
8762 2005-04-01  Raja R Harinath  <rharinath@novell.com>
8763
8764         Fix #74232 and cs0208-3.cs.
8765         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
8766         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
8767         unmanaged type.  Don't use FieldBuilders when 't' is a
8768         TypeBuilder.  Use ModFlags and MemberType fields.
8769         * class.cs (MemberBase.member_type): Rename from MemberType.
8770         (MemberBase.MemberType): New property.  Determines member_type on
8771         demand.
8772         (MemberBase.DoDefine): Don't initialize MemberType here.
8773         (FieldMember.Define): Likewise.
8774
8775 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
8776
8777         Fix #74241
8778         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
8779         Attributes are emitted there.
8780         
8781 2005-04-01  Raja R Harinath  <rharinath@novell.com>
8782
8783         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
8784         keyword in 'partial enum' too.
8785         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
8786         is not allowed).
8787         Report from Kamil Skalski <nazgul@omega.pl>.
8788
8789         Fix #74309.
8790         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
8791         have partial containers too.
8792
8793         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
8794         in block' checks to Block.CheckInvariantMeaningInBlock.
8795         * statement.cs (Block.GetKnownVariableInfo): Make private.
8796         (Block.IsVariableUsedInChildBlock): Remove.
8797         (Block.IsVariableUsedInBlock): Likewise.
8798         (Block.CheckInvariantMeaningInBlock): New.  Show location of
8799         conflicting declaration.
8800         (Block.AddVariable): Make error messages less long-winded and more
8801         specific.  Show location of conflicting declaration.
8802         * parameter.cs (Parameters.Location): New readonly property.
8803
8804 2005-03-31  Raja R Harinath  <rharinath@novell.com>
8805
8806         Clean up semantics of invoking ResolveMemberAccess.
8807         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
8808         can have an instance, ensure that we pass in a non-TypeExpression
8809         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
8810         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
8811         argument.  Update to changes and simplify.
8812         (FieldExpr.Emitinstance): Remove CS0120 check.
8813         (PropertyExpr.EmitInstance): Likewise.
8814         * expression.cs (Argument.Resolve): Likewise.
8815         (Invocation.DoResolve): Update to changes in semantics of
8816         InstanceExpression.
8817
8818 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
8819
8820         Fix #74241
8821         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
8822         customization.
8823         
8824         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
8825
8826 2005-03-31  Raja R Harinath  <rharinath@novell.com>
8827
8828         Fix difference in behaviour with commandline invocation.
8829         * driver.cs (Driver.Reset): New.
8830         (CompilerCallableEntryPoint): Call it.
8831
8832         * statement.cs (If.Resolve): Avoid spurious "uninitialized
8833         variable" warnings if the boolean expression failed to resolve.
8834
8835 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
8836
8837         * attribute.cs: Fix the union of several permissions when some of them
8838         are unrestricted (so the result isn't an unrestricted permission set).
8839         Fix #74036.
8840
8841 2005-03-30  Raja R Harinath  <rharinath@novell.com>
8842
8843         * ecore.cs (MemberExpr): New class.  Convert from interface
8844         IMemberExpr.
8845         (MemberExpr.ResolveMemberAccess): Refactor and move here from
8846         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
8847         error checks.
8848         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
8849         (MethodGroupExpr.IsExplicitImpl): Remove.
8850         (Expression.GetFieldFromEvent): Remove.
8851         (SimpleName.MemberStaticCheck): Remove.
8852         (SimpleName.DoSimpleNameResolve): Update to changes.
8853         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
8854         (MemberAccess.IdenticalNameAndTypeName): Remove.
8855         (MemberAccess.error176): Move to MemberExpr.
8856         (MemberAccess.DoResolve): Update to changes.
8857         (BaseAccess.DoResolve): Likewise.
8858
8859 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
8860
8861         C# 2.0 Conditional attribute class implementation
8862         
8863         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
8864         Analyzes class whether it has attribute which has ConditionalAttribute
8865         and its condition is not defined.
8866         
8867         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
8868         (Class.IsExcluded): New method. Search for at least one defined
8869         condition in ConditionalAttribute of attribute class.
8870
8871 2005-03-30  Raja R Harinath  <rharinath@novell.com>
8872
8873         * ecore.cs (PropertyExpr): Derive from Expression, not
8874         ExpressionStatement.
8875         (PropertyExpr.EmitStatement): Remove.
8876
8877 2005-03-29  Raja R Harinath  <rharinath@novell.com>
8878
8879         Fix #74060.
8880         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
8881         internal field "value__" of an enum be private.  The examples for
8882         "value__" that I found on MSDN all used FieldAttributes.Private.
8883
8884         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
8885         Don't mention IL method attribute names.
8886
8887         Fix #47991.  Remove a TODO.
8888         * statement.cs (Block.Toplevel): Make into a field.
8889         (Block.Parameters): Move into ToplevelBlock.
8890         (Block.known_variables): Rename from child_variable_names.
8891         (Block.Block): Remove variants that take Parameters.  Initialize
8892         'Toplevel' with the immediately surrounding toplevel block.
8893         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
8894         LocalInfo parameter.
8895         (Block.GetKnownVariableInfo): New.
8896         (Block.IsVariableNameUsedInChildBlock): Update.
8897         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
8898         the block, even though it may not be in scope.
8899         (Block.AddVariable): Remove Parameters parameter.  Use
8900         Toplevel.Parameters instead.
8901         (Block.AddConstant): Remove Parameters parameter.
8902         (Block.GetParameterReference): Update to use Toplevel.Parameters.
8903         (Block.IsParamaterReference): Likewise.
8904         (Block.IsLocalParameter): Likewise.  Simplify a lot.
8905         (ToplevelBlock.Parameters): New.  Moved from Block.
8906         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
8907         initialize Parameters to a non-null value.
8908         * cs-parser.jay: Update to changes.
8909         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
8910         simple names that mean different things in the same block.  Use
8911         Block.IsVariableNameUsedInBlock.
8912
8913 2005-03-28  Raja R Harinath  <rharinath@novell.com>
8914
8915         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
8916         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
8917         GetTypeHandle.  It is possible for a reflected type to derive from
8918         a TypeBuilder (e.g., int[] derives from the TypeBuilder
8919         System.Array during mscorlib compilation).
8920         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
8921         contain a method_hash, don't create one either.  Don't create a
8922         deep copy of the base cache's method_hash.
8923         (MemberCache.SetupCache): Rename back from DeepCopy.
8924         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
8925         already initialized.  If we see an override function, add its
8926         underlying base virtual function to the member_hash too.
8927
8928         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
8929
8930 2005-03-26  Raja R Harinath  <harinath@acm.org>
8931
8932         Fix #73038.
8933         * assign.cs (Assign.DoResolve): When the RHS of an assignment
8934         fails to resolve, ensure that the LHS is still resolved as an
8935         lvalue.
8936
8937 2005-03-25  Raja R Harinath  <harinath@acm.org>
8938
8939         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
8940         ec.ContainerType.
8941         (Enum.current_ec): Remove.
8942         (Enum.LookupEnumValue): Remove EmitContext argument.
8943         Just uses the one created during DefineType.
8944         (Enum.FindMembers): Update.
8945         * expression.cs (MemberAccess.DoResolve): Update.
8946
8947 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
8948
8949         * assign.cs (Assign.DoResolve): Check for CS1717 when
8950         source and target are same (uses Equals).
8951
8952         * expression.cs (LocalVariableReference, ParameterReference,
8953         This): Implemented Equals, GetHashCode.
8954
8955         * statement.cs (Block.GetParameterReference): Removed useless
8956         local variable.
8957
8958 2005-03-22  Raja R Harinath  <rharinath@novell.com>
8959
8960         Fix cs0128.cs
8961         * statement.cs (Block.AddVariable): Ensure that we skip implicit
8962         blocks before deciding whether the error is cs0136 or cs0128.
8963
8964         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
8965         (using_alias_directive, using_namespace_directive): Pass
8966         MemberName, not an expression to Namespace.UsingAlias and
8967         Namespace.Using.
8968         (MakeName): Use the MemberName of the namespace.
8969         * namespace.cs (Namespace.MemberName): New.
8970         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
8971         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
8972         Likewise.
8973         * decl.cs (MemberName.Name): Make readonly.
8974         (MemberName.FromDotted): New "constructor".
8975         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
8976         (MemberCore.Name): Compute from MemberName on demand.
8977         (MemberCore.SetMemberName): Provide a way to change the
8978         MemberName.
8979         (MemberCore.AddToContainer): Don't take a fullname parameter.
8980         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
8981         fully qualified name of the container to the member name.
8982         (TypeContainer.AddToTypeContainer): Use a fully qualified name
8983         only if the type is a member of the root container.
8984         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
8985         MemberName.Left rather than searching for an embedded ".".
8986         (PartialContainer.CreatePart): Update to changes in RootContext.
8987         (MemberBase.ShortName): Turn into a property.  Use
8988         MemberCore.SetMemberName.
8989         (MemberBase.ExplicitInterfaceName): Remove.
8990         (MemberBase.UpdateMemberName): Remove.
8991         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
8992         (PropertyBase.SetMemberName): New override.
8993         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
8994         (Tree.GetDecl): New.
8995         (Tree.AllDecls): Rename from Decls.
8996         * attribute.cs, enum.cs, report.cs: Update to changes.
8997         * driver.cs (MainDriver): Use MemberName.FromDotted on
8998         RootContext.MainClass.
8999
9000 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
9001
9002         * class.cs (FixedField.Define): Check for CS1664 and more sanity
9003         checks.
9004
9005         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
9006
9007 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
9008
9009         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
9010         property accessor modifiers.
9011
9012         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
9013         fixed buffer attribute (CS1716).
9014         (PropertyMethod.HasCustomAccessModifier): When property accessor
9015         has custom modifier.
9016
9017         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
9018         modifiers.
9019         (PropertyExpr.DoResolveLValue): Add CS0272.
9020
9021 2005-03-17  Miguel de Icaza  <miguel@novell.com>
9022
9023         * convert.cs: When converting to a pointer, use the proper Conv.U
9024         or Conv.I depending on the source data type.
9025
9026         * cs-tokenizer.cs: Make the size for large decimal constants,
9027         fixes #72957.
9028
9029 2005-03-17  Martin Baulig  <martin@ximian.com>
9030
9031         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
9032         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
9033
9034 2005-03-17  Martin Baulig  <martin@ximian.com>
9035
9036         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
9037         to bool so we can return an error condition.
9038         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
9039         returned an error.
9040
9041 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
9042
9043         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
9044         attributes.
9045
9046 2005-03-16  Raja R Harinath  <rharinath@novell.com>
9047
9048         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
9049         Refactor to avoid traversing the list of assemblies, and to avoid
9050         string concatenation.
9051         * typemanager.cs (guid_attr_type): Remove.
9052         (negative_hits, pointers, references): Remove hashes.
9053         (type_hash): New.
9054         (GetConstructedType): New.  Uses type_hash to handle constructed
9055         types (arrays, references, pointers).
9056         (GetReferenceType, GetPointerType): Use it.
9057         (GetNestedType): New.  Uses type_hash to handle nested types of
9058         reflected types.
9059         (LookupType, LookupTypeDirect): Remove.
9060         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
9061         'types' hash and LookupTypeReflection directly.
9062         (params_string, params_object): Use GetConstructedType.
9063         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
9064         top-level types.
9065         (Namespace.Lookup): Use cached_types.
9066         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
9067         provided by old TypeManager.LookupType.
9068         * rootcontext.cs (MakeFQN): Remove.
9069         * decl.cs (DeclSpace.MakeFQN): Likewise.
9070         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
9071         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
9072         TypeManager.GetConstructedType.
9073         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
9074
9075 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
9076
9077         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
9078         indexers.
9079
9080         * cs-parser.jay: Reports CS1527 for any namespace element.
9081
9082         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
9083         Added CS0407.
9084
9085         * expression.cs (ParameterReference.IsAssigned): Changed error to
9086         CS0269.
9087         (Error_WrongNumArguments): Moved CS0245 detection here.
9088
9089         * statement.cs (Return.Resolve): Add CS1622 report.
9090
9091 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
9092
9093         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
9094
9095 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
9096
9097         * attribute.cs expression.cs: Get rid of some allocations.
9098
9099 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
9100
9101         * doc.cs : just eliminate the latest change.
9102
9103 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
9104
9105         * doc.cs : commented out the latest change. It breaks xml-030.cs
9106
9107 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
9108
9109         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
9110           fail. So invoke CreateType() in FindDocumentedType().
9111
9112 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
9113
9114         * cs-tokenizer.cs : added IsKeyword().
9115         * doc.cs : Detect keyword incorrectly used as identifier.
9116           Allow identifiers prefixed by @.
9117
9118 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
9119
9120         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
9121         It caused exception in namespace resolving (again!).
9122         
9123         * class.cs (Class.ctor): Removed exit.
9124         (PropertyMethod.ctor): ditto.
9125         
9126         * codegen.cs (Codegen.Reset): Reset static data.
9127         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
9128         
9129         * cs-tokenizer.cs (Cleanup): Removed.
9130         
9131         * driver.cs (GetSystemDir): Rewrote to one line command.
9132         It caused problem with unloaded dynamic modules.
9133         (UnixParseOption): Removed Exit.
9134         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
9135         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
9136         Now can be mcs used as library.
9137         
9138         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
9139         empty location.
9140         
9141         * location.cs (Reset): Reset static data.
9142         
9143         * namespace.cs (Reset): Reset static data.
9144         
9145         * report.cs (Report.Reset): Reset static data.
9146         
9147         * rootcontext.cs (RootContext.Reset): Reset static data.
9148         
9149         * tree.cs (RootTypes.ctor): Use Location.Null
9150         
9151         * typemanager.cs (TypeManager.Reset): Reset static data.
9152         (CoreLookupType): Removed Exit.
9153         (TypeHandle.Reset): Reset static data.
9154         
9155 2005-03-10  Raja R Harinath  <rharinath@novell.com>
9156
9157         Fix #73516.
9158         * typemanager.cs (ComputeNamespaces): Import namespaces from
9159         referenced modules too.
9160
9161 2005-03-09  Raja R Harinath  <rharinath@novell.com>
9162
9163         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
9164         than '.'.
9165
9166 2005-03-09  Raja R Harinath  <rharinath@novell.com>
9167
9168         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
9169         enclosing DeclSpace.  This ensures that a name-lookup populates
9170         more caches and there are fewer 'TypeExpression's.  Carve out
9171         nested type lookup into ...
9172         (LookupNestedTypeInHierarchy): ... this.
9173
9174 2005-03-09  Raja R Harinath  <rharinath@novell.com>
9175
9176         Clean up a few partial-class semantics.  
9177         Fixes test-357.cs and cs1618-2.cs.
9178         * cs-parser.jay (struct_declaration): Use 'current_class' as
9179         parent of newly-created struct.  Remove call to Register ().
9180         Use 'pop_current_class' to complete handing the current struct.
9181         (interface_declaration): Likewise.
9182         (class_declaration): Likewise.
9183         (enum_declaration): Use 'current_class' as parent of newly created
9184         enum.
9185         (delegate_declaration): Likewise.
9186         (pop_current_class): New function.  This is used to handle closing
9187         up the 'current_class' and 'current_container', and pointing them
9188         to the enclosing class/container.
9189         (CSharpParser): Initialize 'current_class' too.
9190         * decl.cs (MemberCore): Add check for invariant: a partial
9191         container is not a parsed entity, and thus does not enclose any
9192         parsed members.
9193         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
9194         (DeclSpace.BaseTypeExpr): Use it.
9195         (DeclSpace.LookupType): Add check for invariant.
9196         * class.cs (TypeContainer): Add check for invariant: a nested
9197         class should have the same NamespaceEntry as its enclosing class.
9198         (TypeContainer.EmitFieldInitializers): Make virtual.
9199         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
9200         MemberCore.
9201         (TypeContainer.Register): Remove.
9202         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
9203         null.  Use TypeResolveEmitContext for resolving base types and
9204         interfaces.  Move initialization of Parts.TypeBuilder here from
9205         ...
9206         (TypeContainer.DefineNestedTypes): ... here.
9207         (PartialContainer): Take a Namespace not a NamespaceEntry.
9208         (PartialContainer.Create): Don't use Register.  Call the
9209         appropriate Add... function directly.
9210         (ClassPart): Take both the PartialContainer and the enclosing
9211         class as constructor arguments.
9212         (ClassPart.EmitFieldInitializers): Override.
9213         (ClassPart.PartFindNestedTypes): Remove.
9214         (FieldBase.GetInitializerExpression): Resolve the initializer
9215         expression in the emit context of the enclosing class.
9216         * tree.cs (RootTypes): Remove Register ().
9217         
9218 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
9219
9220         * cs-parser.jay: Removed CS0134.
9221         
9222         * driver.cs: Removed CS1901.
9223         
9224         * expression.cs (SizeOf.DoResolve): Don't report CS0233
9225         for predefined types.
9226
9227 2005-03-07  Duncan Mak  <duncan@novell.com>
9228
9229         * codegen.cs (Save):  Catch UnauthorizedAccessException as
9230         well. Fixes bug #73454.
9231
9232 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
9233
9234         * cs-tokenizer.cs (xtoken): Add CS1035.
9235         
9236         * class.cs (MethodData.Define): Add CS0683.
9237         (FieldMember.ctor): Add CS0681.
9238
9239 2005-03-07  Raja R Harinath  <rharinath@novell.com>
9240
9241         * ecore.cs (SimpleName.DoResolve): Rename from
9242         SimpleName.DoResolveAllowStatic.
9243         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
9244         Pass 'intermediate' flag to MemberStaticCheck.
9245         (SimpleName.MemberStaticCheck): Skip "static check" only in case
9246         of "intermediate" lookups via MemberAccess.
9247         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
9248         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
9249
9250 2005-03-07  Raja R Harinath  <rharinath@novell.com>
9251
9252         Fix #73394.
9253         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
9254         slipped in because of variable names that are identical to a
9255         builtin type's BCL equivalent ('string String;', 'int Int32;').
9256         (PropertyExpr.EmitInstance): Likewise.
9257
9258 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
9259
9260         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
9261         
9262         * report.cs (warning_ignore_table): Made public.
9263
9264 2005-03-04  Raja R Harinath  <rharinath@novell.com>
9265
9266         Fix #73282.
9267         * class.cs (MethodData.Emit): Pass 'container' to
9268         container.GetObsoleteAttribute instead of 'container.Parent'.
9269
9270 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
9271
9272         * cs-parser.jay: Add 1534 error test.
9273
9274         * iterators.cs (Yield.CheckContext): Add error 1629.
9275         (Iterator.ctor): Save unsafe modifier.
9276         (MoveNextMethod.DoEmit): Restore unsafe context.
9277
9278         * namespace.cs (UsingAlias): Better error message.
9279
9280 2005-03-03  Dan Winship  <danw@novell.com>
9281
9282         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
9283         the warning message [#73219]
9284
9285 2005-03-03  Raja R Harinath  <rharinath@novell.com>
9286
9287         Fix compile with MCS 1.0.0.0.
9288         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
9289         w_restore to not depend on string constant folding.
9290
9291 2005-03-03  Raja R Harinath  <rharinath@novell.com>
9292
9293         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
9294         CS0246 check to users who passed 'silent = false'.
9295         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
9296         check.
9297         (SimpleName.SimpleNameResolve): Update.
9298         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
9299         (MemberAccess.IdenticalNameAndTypeName): Update.
9300         * doc.cs (FindDocumentedTypeNonArray): Update.
9301
9302 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
9303
9304         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
9305         * parameters.cs (ComputeAndDefineParameters): Remove.
9306         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
9307         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
9308         Use GetParameterInfo.
9309
9310 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
9311
9312         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
9313
9314 2005-03-02  Raja R Harinath  <rharinath@novell.com>
9315
9316         Unify DeclSpace.LookupType and DeclSpace.FindType.
9317         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
9318         is in charge of defining nested types on demand.
9319         (DeclSpace.LookupType): Use it when the current_type is a
9320         TypeBuilder.  Use LookupTypeDirect for reflected types.
9321         (DeclSpace.FindType): Remove.
9322         (DeclSpace.LookupInterfaceOrClass): Likewise.
9323         (DeclSpace.DefineTypeAndParents): Likewise.
9324         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
9325         DeclSpace.LookupType.
9326         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
9327         * typemanager.cs (LookupType): Simplify.
9328         (AddUserType): Remove type from negative_hits.
9329         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
9330         * class.cs (TypeContainer.FindMembers): Move handling of nested
9331         types ...
9332         (TypeContainer.FindMembers_NestedTypes): ... here.
9333         (TypeContainer.FindNestedType): Implement override.
9334         (ClassPart.FindNestedType): Delegate to PartialContainer.
9335         (ClassPart.PartFindNestedType): Looks up the nested types of the
9336         part alone.
9337
9338 2005-03-02  Martin Baulig  <martin@ximian.com>
9339
9340         * class.cs (TypeContainer.DoDefineMembers): We also need a default
9341         static constructor in static classes.
9342
9343 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
9344
9345         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
9346         sizeParamIndex is not specified.
9347
9348 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
9349
9350         Fix #73117
9351         * report.cs (WarningMessage.IsEnabled): Missing null check.
9352
9353 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
9354
9355         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
9356         in the fields and not in the properties.
9357
9358 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
9359
9360         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
9361         fields as well.
9362
9363 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
9364
9365         * attribute.cs: Small refactoring (improved robustness).
9366         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
9367         (ValidateGuid): Removed.
9368         (Resolve): Removed referenced to above mentioned.
9369         (GetAttributeUsage): Made private and changed to work without
9370         class assistance.
9371         (GetIndexerAttributeValue): Don't crash.
9372         (GetConditionalAttributeValue): Ditto.
9373         (GetClsCompliantAttributeValue): Ditto.
9374         (ExtractSecurityPermissionSet): All attributes exceptions are
9375         error 648.
9376         (GetPropertyValue): New helper.
9377         (GetMethodImplOptions): New method.
9378         (DefinePInvokeMethod): Reuse common code. Implemented handling of
9379         some missing properties.
9380         
9381         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
9382         (Method.ApplyAttributeBuilder): Updated.
9383         
9384         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
9385         exception.
9386
9387 2005-02-28  Raja R Harinath  <rharinath@novell.com>
9388
9389         Fix #73052.
9390         * report.cs (Report.SymbolRelatedToPreviousError): Handle
9391         non-simple types (array, pointer, reference).
9392
9393 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
9394
9395         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
9396
9397         * class.cs (MethodCore.IsDuplicateImplementation): Special error
9398         for operators.
9399         (Method.CheckBase): Catch wrong destructor here.
9400         (MethodData.Define): Add errors 550, 668.
9401
9402         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
9403
9404         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
9405
9406         * pending.cs (VerifyPendingMethods): Add error 551.
9407
9408         * typemanager.cs (CSharpName): Next error report helper.
9409
9410 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
9411
9412         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
9413         attributes. Removed useless attribute double check.
9414         It saves almost 2MBs for corlib.
9415
9416 2005-02-25  Raja R Harinath  <rharinath@novell.com>
9417
9418         Fix #72924.
9419         * statement.cs (ExpressionStatement.Resolve): Make robust to being
9420         called twice in case of error.
9421
9422 2005-02-23  Chris Toshok  <toshok@ximian.com>
9423
9424         Fix compiler portions of #72827.
9425         * statement.cs (Block.Emit): call Begin/EndScope on the
9426         EmitContext instead of the ILGenerator.
9427
9428         * codegen.cs (EmitContext.BeginScope): new method, call
9429         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
9430         we have one.)
9431         (EmitContext.BeginScope): same, but EndScope and CloseScope
9432
9433         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
9434         offset and call the superclass's OpenScope(int) with it.
9435         (SymbolWriter.CloseScope): get the current il
9436         offset and call superclass's CloseScope(int) with it.
9437
9438 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
9439
9440         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
9441         CS1677 for out and ref as well.
9442
9443         * class.cs (Method.Define): Add error CS1599 detection.
9444         
9445         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
9446         
9447         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
9448         
9449         * delegate.cs (Delegate.Define): Add error CS1599 detection.
9450         
9451         * support.cs.cs (ModifierDesc): New helper method.
9452
9453 2005-02-23  Raja R Harinath  <rharinath@novell.com>
9454             Abin Thomas  <projectmonokochi@rediffmail.com>
9455             Anoob V E  <projectmonokochi@rediffmail.com>
9456             Harilal P R  <projectmonokochi@rediffmail.com>
9457
9458         Fix #57851, #72718.
9459         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
9460         MemberLookup (used for error reporting) actually returns a result.
9461         Fix error report number (122, not 112).
9462
9463 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
9464             Anoob V E  <projectmonokochi@rediffmail.com>
9465             Harilal P R  <projectmonokochi@rediffmail.com>
9466
9467         Fix #71134.
9468         * pending.cs (PendingImplementation.GetAbstractMethods):
9469         Find NonPublic members too.
9470
9471 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
9472
9473         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
9474         Fixed error 217.
9475         
9476         * class.cs (MethodCore.CheckMethodAgainstBase):
9477         Add error 239 report.
9478
9479 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9480
9481         Fix #68955.
9482         * expression.cs (Invocation.IsApplicable): Make public.
9483         (Invocation.IsParamsMethodApplicable): Likewise.
9484         * delegate.cs (Delegate.VerifyApplicability): Don't use
9485         Invocation.VerifyArgumentCompat for parameter applicability
9486         testing.  Use Invocation.IsApplicable and
9487         Invocation.IsParamsMethodApplicable.
9488
9489 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
9490
9491         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
9492         
9493         * class.cs (Operator.Define): Add error 217 report.
9494         
9495 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9496
9497         * namespace.cs (UsingEntry.Resolve): Undo change below.
9498
9499 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9500
9501         Fix #72756.
9502         * ecore.cs (Expression.MemberLookupFailed): Add argument to
9503         disable the error message when the extended MemberLookup also
9504         fails.
9505         (Expression.MemberLookupFinal): Update.
9506         (SimpleName.DoSimpleNameResolve): Update.
9507         * expression.cs (MemberAccess.ResolveNamespaceOrType):
9508         Don't use MemberLookupFinal.
9509         (New.DoResolve): Update.
9510         (BaseAccess.CommonResolve): Update.
9511
9512 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9513
9514         Fix #72732.
9515         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
9516         occured previously, don't resolve again.
9517
9518 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
9519
9520         Fix #69949
9521         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
9522         argument. Call ResolveAttributeUsage for unresolved.
9523         when types doesn't match ctor arguments.
9524         
9525         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
9526         for nested attribute classes.
9527         (Class.attribute_usage): Removed.
9528         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
9529         for attribute class.
9530         
9531         * ecore.cs (IsAttribute): Removed.
9532         
9533         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
9534         
9535         * rootcontext.cs (RegisterAttribute): Removed, attributes are
9536         now normal types.
9537         (attribute_types): Removed.
9538         (EmitCode): Global attributes are emited as the latest.
9539
9540 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
9541
9542         * class.cs (EmitFieldInitializers): Don't emit field initializer
9543         for default values when optimilization is on.
9544         
9545         * constant.cs (Constant.IsDefaultValue): New property.
9546         
9547         * driver.cs: Add /optimize handling.
9548         
9549         * constant.cs,
9550         * ecore.cs,
9551         * literal.cs: Implement new IsDefaultValue property.
9552         
9553         * rootcontext.cs (Optimize): New field, holds /optimize option.
9554
9555 2005-02-18  Raja R Harinath  <rharinath@novell.com>
9556
9557         Fix crasher in re-opened #72347.
9558         * namespace.cs (Namespace.Lookup): Return null if
9559         DeclSpace.DefineType returns null.
9560
9561         Fix #72678.
9562         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
9563
9564 2005-02-18  Raja R Harinath  <rharinath@novell.com>
9565
9566         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
9567         now returns null if it cannot resolve to an lvalue.
9568         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
9569         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
9570         returned null.  Remove check for SimpleName.
9571         (EventExpr.DoResolveLValue): New.
9572         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
9573         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
9574         error from ...
9575         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
9576         avoid CS0131 error.
9577         (Unary.ResolveOperator): Move CS0211 check ...
9578         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
9579         CS0131 error.
9580         (Unary.DoResolveLValue): Simplify.
9581         (AddressOf.DoResolveLValue): New.
9582         (ArrayAccess.DoResolveLValue): New.
9583
9584 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
9585
9586         * attribute.cs (Attribute.Resolve): Add arguments casting for
9587         when types doesn't match ctor arguments.
9588
9589 2005-02-16  Raja R Harinath  <rharinath@novell.com>
9590
9591         Fix parts of #63202.
9592         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
9593         lookup of operator in base type.  Ensure that all checks happen
9594         when the operator resolves to an "op_..." method.
9595
9596 2005-02-15  Raja R Harinath  <rharinath@novell.com>
9597
9598         Fix #71992.
9599         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
9600         'ignore_cs0104' parameter.  Pass it to ...
9601         (NamespaceEntry.Lookup): ... this.
9602         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
9603         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
9604         (TypeLookupExpression.DoResolveAsTypeStep): Update.
9605         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
9606         Update.  Request that cs0104 errors be ignored.
9607         (ComposedCast.ResolveAsTypeStep): Update.
9608
9609 2005-02-14  Raja R Harinath  <rharinath@novell.com>
9610
9611         Fix #59209.
9612         * expression.cs (Invocation.BetterFunction): Remove support for
9613         comparing virtual functions and their overrides.
9614         (Invocation.IsOverride): New.
9615         (Invocation.OverloadResolve): Don't consider 'override' functions
9616         during candidate selection.  Store them in a lookaside list.
9617         If the selected method is a 'virtual' function, use the list to
9618         find any overrides that are closer to the LHS type.
9619
9620 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
9621
9622         * expression.cs (New.DoResolve): Add complex core type reduction.
9623         (New.Constantify): Converts complex core type syntax like 'new int ()'
9624         to simple constant.
9625         
9626 2005-02-14  Raja R Harinath  <rharinath@novell.com>
9627
9628         * decl.cs (EntryType.EntryType): New constructor to create an
9629         updated copy of a cache entry.
9630         (MemberCache.AddMethods): Use it.
9631         (MemberCache.ClearDeclaredOnly): Remove.
9632         (MemberCache.MemberCache): Update.
9633
9634 2005-02-11  Miguel de Icaza  <miguel@novell.com>
9635
9636         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
9637         variable.  This one is represents the actual low-level declaration
9638         of the method, as opposed to the semantic level `IsStatic'.   
9639
9640         An anonymous method which is hosted into a static method might be
9641         actually an instance method.  IsStatic would reflect the
9642         container, while MethodIsStatic represents the actual code
9643         generated.
9644
9645         * expression.cs (ParameterReference): Use the new MethodIsStatic
9646         instead of IsStatic.
9647
9648         * anonymous.cs (AnonymousMethod.Compatible): Pass the
9649         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
9650         set on the current EmitContext. 
9651
9652         * expression.cs (Cast): Overload DoResolveLValue so we can pass
9653         resolve our casted expression as an LValue.  This triggers the
9654         proper LValue processing that is later required by Assign.
9655
9656         This fixes 72347.
9657
9658         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
9659
9660 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
9661
9662         C# 2.0 Fixed buffer implementation
9663
9664         * anonymous.cs: Update after RegisterHelperClass renaming.
9665
9666         * attribute.cs (AttributeTester.fixed_buffer_cache):
9667         Cache of external fixed buffers.
9668         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
9669         implementation if field is fixed buffer else null.
9670
9671         * class.cs
9672         (TypeContainer.AddField): Accept FieldMember instead of Field.
9673         (FieldBase.IsFieldClsCompliant): Extracted code from
9674         VerifyClsCompliance descendant customization.
9675         (FixedField): New class handles fixed buffer fields.
9676         (FixedFieldExternal): Keeps information about imported fixed
9677         buffer.
9678         (IFixedField): Make access to internal or external fixed buffer
9679         same.
9680
9681         * cs-parser.jay: Add fixed buffer parsing.
9682
9683         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
9684         buffer.
9685
9686         * expression.cs (Indirection): Extended implementation to accept
9687         fixed buffer field.
9688         (PointerArithmetic.Emit): Get element from fixed buffer as well.
9689         (ElementAccess.MakePointerAccess): Get type as parameter.
9690         (DoResolve): Add fixed buffer field expression conversion.
9691         (DoResolveLValue): Ditto.
9692         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
9693         (ArrayPtr): Derives from FixedBufferPtr.
9694         (ArrayPtr.Emit): Add extra emit for array elements.
9695
9696         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
9697
9698         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
9699         for compiler generated types.
9700         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
9701
9702         * statement.cs (Fixed): Refactored to be easier add fixed buffer
9703         and consume less memory.
9704         (Fixed.Resolve): Add fixed buffer case.
9705
9706         * typemanager.cs (compiler_generated_attr_ctor,
9707         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
9708         (HasElementType): Add our own implementation to work on every
9709         runtime.
9710
9711 2005-02-11  Miguel de Icaza  <miguel@novell.com>
9712
9713         * anonymous.cs (CaptureContext): Track whether `this' has been
9714         referenced.   
9715
9716         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
9717         only captured `this' if it was implicitly done (instance
9718         methods/variables were used). 
9719
9720         * codegen.cs (EmitContext.CaptureThis): New method to flag that
9721         `this' must be captured.
9722
9723 2005-01-30  Miguel de Icaza  <miguel@novell.com>
9724  
9725         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
9726         is null it means that there has been no need to capture anything,
9727         so we just create a sibling.
9728
9729         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
9730
9731         Just a partial fix.  The other half is fairly elusive.
9732         
9733 2005-02-10  Raja R Harinath  <rharinath@novell.com>
9734
9735         Fix #52586, cs0121-4.cs.
9736         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
9737         and return a hashtable.
9738         (MemberCache.ClearDeclaredOnly): New.
9739         (MemberCache.MemberCache): Update to change.  Make a deep copy of
9740         the method_hash of a base type too.
9741         (MemberCache.AddMethods): Adapt to having a deep copy of the base
9742         type methods.  Overwrite entries with the same MethodHandle so
9743         that the ReflectedType is correct.  The process leaves in base
9744         virtual functions and their overrides as distinct entries.
9745         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
9746         matters since it was boxed in a ArrayList before.
9747         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
9748         modifier.
9749         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
9750         case of a virtual function and its override (choose the overload
9751         as better).
9752         (Invocation.OverloadResolve): Avoid 'override' members during
9753         'applicable_type' calculation.
9754
9755 2005-02-09  Raja R Harinath  <rharinath@novell.com>
9756
9757         Combine two near-redundant caches.
9758         * typemanager.cs (method_params): Rename from method_internal_params.
9759         (TypeManager.GetParameterData): New.  Replace
9760         Invocation.GetParameterData.
9761         (TypeManager.LookupParametersByBuilder): Remove.
9762         * expression.cs (Invocation.method_parameter_cache): Remove.
9763         (Invocation.GetParameterData): Remove.
9764         Update to changes.
9765         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
9766         Update to changes.
9767
9768 2005-02-08  Raja R Harinath  <rharinath@novell.com>
9769
9770         Fix #72015.
9771         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
9772         TypeManager.multicast_delegate_type is null, resolve it by looking
9773         up "System.MulticastDelegate".
9774         * rootcontext.cs (RootContext.ResolveCore): Simplify.
9775
9776 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
9777             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
9778             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
9779
9780         Fix cs0164.cs.
9781         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
9782         (LabeledStatement.AddReference): New.  Set 'referenced'.
9783         (Goto.Resolve): Use it.
9784
9785 2005-02-05  John Luke  <john.luke@gmail.com>
9786
9787         * driver.cs: remove duplicate -doc line in Usage ()
9788
9789 2005-02-04  Raja R Harinath  <rharinath@novell.com>
9790
9791         * location.cs (Location.AddFile): Fix CS2002 error report.
9792
9793 2005-02-02  Martin Baulig  <martin@ximian.com>
9794
9795         * delegate.cs (Delegate.DefineType): Report an internal error if
9796         TypeManager.multicast_delegate_type is null.  See bug #72015 for
9797         details.        
9798
9799 2005-02-02  Raja R Harinath  <rharinath@novell.com>
9800
9801         Fix a crasher in a variant of #31984.
9802         * const.cs (Constant.CheckBase): New override that defers the
9803         new-or-override check in case the base type hasn't been populated
9804         yet.
9805         (Constant.Define): Ensure the new-or-override check is performed.
9806
9807 2005-02-01  Duncan Mak  <duncan@ximian.com>
9808
9809         * const.cs (LookupConstantValue): Check that `ce' is not null
9810         before calling GetValue ().
9811
9812 2005-02-01  Raja R Harinath  <rharinath@novell.com>
9813
9814         Fix test-334.cs (#69519).
9815         * cs-parser.jay (using_alias_directive): Pass in an expression to
9816         NamespaceEntry.UsingAlias.
9817         (using_namespace_directive): Pass in an expression to
9818         NamespaceEntry.Using.
9819         (namespace_name): Don't flatten to a string.
9820         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
9821         (NamespaceEntry.AliasEntry.Resolve): Lookup using
9822         ResolveAsTypeStep.
9823         (NamespaceEntry.UsingEntry): Likewise.
9824         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
9825         changes.
9826         (NamespaceEntry.LookupForUsing): Remove.
9827         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
9828         names.
9829         (NamespaceEntry.Lookup): Remove support for dotted names.
9830
9831 2005-02-01  Raja R Harinath  <rharinath@novell.com>
9832
9833         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
9834         split into two.
9835         (NamespaceEntry.ImplicitParent): Compute on demand.
9836         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
9837         parallels the current.
9838         (NamespaceEntry.LookupForUsing): Use it.
9839         (NamespaceEntry.Lookup): If the current namespace-entry is
9840         implicit, don't search aliases and using tables.
9841
9842 2005-02-01  Raja R Harinath  <rharinath@novell.com>
9843
9844         Fix #31984.
9845         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
9846         BaseCache here.
9847         (TypeContainer.BaseCache): Compute on demand.
9848         (TypeContainer.FindMembers): Define constants and types if they're
9849         not already created.
9850         (FieldMember.Define): Move resetting of ec.InUnsafe before error
9851         check.
9852         * const.cs (Constant.Define): Make idempotent.
9853
9854 2005-01-29  Miguel de Icaza  <miguel@novell.com>
9855
9856         * pending.cs: Produce better code (no nops produced by using Ldarg
9857         + value).
9858         
9859         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
9860         i - 1' it should be arg + 1.
9861
9862         Fixes bug #71819.
9863
9864 2005-01-28  Raja R Harinath  <rharinath@novell.com>
9865
9866         * attribute.cs (Attribute.CheckAttributeType): Make private
9867         non-virtual.
9868         (Attribute.ResolveType): Make virtual.
9869         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
9870         handling of RootContext.Tree.Types.
9871
9872 2005-01-27  Raja R Harinath  <rharinath@novell.com>
9873
9874         Update attribute-handling to use the SimpleName/MemberAccess
9875         mechanisms.
9876         * cs-parser.jay (attribute): Pass in an expression to the
9877         constructors of Attribute and GlobalAttribute.
9878         * attribute.cs (Attribute): Take an expression for the name.
9879         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
9880         passed in attribute name expression.
9881         (Attribute.CheckAttributeType): Use it.
9882         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
9883         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
9884         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
9885         argument to prevent error messages if the lookup fails.
9886
9887 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
9888
9889         * expression.cs (Indirection): Implemented IVariable interface
9890         to support indirection in AddressOf operator.
9891         (PointerArithmetic.Emit): Add optimalization for case where
9892         result can be precomputed.
9893
9894 2005-01-26  Martin Baulig  <martin@ximian.com>
9895
9896         * class.cs (TypeContainer.AttributeTargets): Return the correct
9897         AttributeTargets depending on our `Kind' instead of throwing an
9898         exception; fixes #71632.
9899
9900 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
9901
9902         Fix #71257
9903         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
9904         constant members.
9905
9906 2005-01-25  Raja R Harinath  <rharinath@novell.com>
9907
9908         Fix #71602.
9909         * expression.cs (MemberAccess.DoResolve): Don't complain with
9910         cs0572 when the LHS of a member access has identical name and type
9911         name.
9912
9913 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
9914
9915         Fix #71651, #71675
9916         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
9917         CreatePermission.
9918         Create custom PermissionSet only for PermissionSetAttribute.
9919
9920 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
9921
9922         Fix #71649
9923         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
9924         delegates in static class.
9925
9926 2005-01-24  Martin Baulig  <martin@ximian.com>
9927
9928         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9929         merging an implicit block, just use its reachability.
9930
9931         * statement.cs (Block.Resolve): Make the unreachable code check
9932         work wrt. implicit blocks; see test-337 from #63842.
9933
9934 2005-01-21  Alp Toker  <alp@atoker.com>
9935  
9936         * cs-parser.jay: destructor_declaration's container is PartialContainer
9937         not Class when partial types are used, so use Kind prop instead of
9938         'is'.
9939         
9940 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
9941
9942         * cs-parser.jay: Improve error reporting when an interface
9943         declares new types.
9944
9945 2005-01-20  Dick Porter  <dick@ximian.com>
9946
9947         * support.cs: SeekableStreamReader fix from Sandor Dobos
9948         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
9949         chars are read.  Fixes bug 70369.
9950
9951 2005-01-20  Raja R Harinath  <rharinath@novell.com>
9952
9953         * cs-parser.jay (catch_clause): Simplify current_block handling
9954         somewhat.
9955
9956 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
9957
9958         * convert.cs (ImplicitStandardConversionExists): Synchronize the
9959         code with ImplicitStandardConversion to handle the implicit
9960         conversion of method groups into valid delegate invocations. 
9961
9962         The problem is that in parameter handling we were using this code
9963         path.  Fixes bug #64698
9964
9965 2005-01-19  Raja R Harinath  <rharinath@novell.com>
9966
9967         * cs-parser.jay: Fix several infelicities.
9968         - Avoid assigning to the parser value stack.  Code like 
9969           '$3 = null' is unclean.  Synthesize a value for the code block
9970           instead. 
9971         - Avoid using oob_stack for storing location information.  Use ...
9972         (_mark_): ... this.  New (empty) rule.  Saves the current location
9973         in $$.
9974         (foreach_statement): Avoid using oob_stack for current_block
9975         handling.  Use technique used in for_statement and
9976         using_statement.  Synthesize a value for the code block to store
9977         additional intermediate information.
9978
9979 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
9980
9981         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
9982         of a different type is only allowed to private fields of a
9983         containing type, not on fields of a base class.
9984
9985         See test-174.cs and error cs0122-9.cs
9986
9987 2005-01-13  Raja R Harinath  <rharinath@novell.com>
9988
9989         Fix test-335.cs (bug #58126).
9990         * cs-parser.jay (argument): Split out non-expression parts of the
9991         rule into 'non_simple_argument'.
9992         (invocation_expression): Support parenthesized invocations with
9993         multiple arguments, and with single non-simple arguments.
9994
9995 2005-01-13  Raja R Harinath  <rharinath@novell.com>
9996
9997         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
9998         places.
9999
10000 2005-01-12  Raja R Harinath  <rharinath@novell.com>
10001
10002         Fix cs0038-1.cs, cs1640-6.cs.
10003         * ecore.cs (Expression.Resolve): Remove special-case for
10004         SimpleName in error-handling.
10005         (Expression.almostMatchedMembers): Relax access permission to
10006         protected.
10007         (Expression.MemberLookupFailed): Handle duplicates in
10008         almostMatchedMembers list.
10009         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
10010         * expression.cs (New.DoResolve): Report CS1540 for more cases.
10011         * typemanager.cs (GetFullNameSignature): Use the MethodBase
10012         overload if the passed in MemberInfo is a MethodBase.
10013
10014 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
10015
10016         Fix #70749
10017         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
10018         for non-CAS & merge permission sets properly.
10019
10020 2005-01-11  Raja R Harinath  <rharinath@novell.com>
10021
10022         Improve standard-compliance of simple name and member access 
10023         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
10024         * ecore.cs (FullNamedExpression): New abstract base class 
10025         for Namespaces and TypeExpressions.
10026         (ResolveFlags.SimpleName): Remove.
10027         (SimpleName): Remove support for dotted names.
10028         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
10029         DeclSpace.FindType and DeclSpace.LookupType.
10030         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
10031         (Expression.ExprClassName): Make member function.
10032         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
10033         a namespace.  Remove creation of dotted "SimpleName"s.
10034         (MemberAccess.DoResolve): Likewise.
10035         * decl.cs (DeclSpace.Cache): Make private.
10036         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
10037         (DeclSpace.FindType): Update.
10038         (DeclSpace.LookupType): Move here from RootContext.  Return a 
10039         FullNamedExpression.
10040         * namespace.cs (Namespace): Derive from FullNamedExpression
10041         so that it can be part of expression resolution.
10042         (Namespace.Lookup): Return an FullNamedExpression.
10043         (NamespaceEntry.LookupAlias): Lookup aliases only in current
10044         namespace.
10045         * rootcontext.cs (NamespaceLookup): Remove.
10046         (LookupType): Move to DeclSpace.
10047         * attribute.cs (CheckAttributeType): Update.
10048         * doc.cs (FindDocumentedType): Remove allowAlias argument.
10049         (FindDocumentedTypeNonArray): Likewise.
10050
10051 2005-01-11  Raja R Harinath  <rharinath@novell.com>
10052
10053         Fix cs0509.cs, cs1632.cs.
10054         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
10055         is the same as IsInterface.
10056         (TypeContainer.GetClassBases): Likewise.
10057         * statement.cs (LabeledStatement.ig): New field.
10058         (LabeledStatement.LabelTarget): Save ILGenerator which created the
10059         label.
10060         (LabeledStatement.DoEmit): Check that the label was created with
10061         the same ILGenerator.
10062
10063 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
10064
10065         Fix #71058
10066         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
10067         accessors to its properties.
10068
10069         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
10070         from accessors to property.
10071         
10072 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
10073
10074         Fix #70722
10075         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
10076         only for overrides.
10077         
10078 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
10079
10080         * attribute.cs: Check for null and empty strings.  
10081
10082         I have lost another battle to Paolo.
10083
10084 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
10085
10086         Fix #70942
10087         * class.cs (PropertyMethod): Set Parent field in ctors.
10088         (SetMethod.InternalParameters): Add unsafe switch hack.
10089         Override MarkForDuplicationCheck where it is appropriate.
10090
10091         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
10092         It says whether container allows members with the same name.
10093         Base default is no.
10094         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
10095         Removed is_method parameter.
10096
10097 2005-01-06  Duncan Mak  <duncan@ximian.com>
10098
10099         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
10100         because the previous change led to incorrect reporting of CS1032
10101         ("Cannot define/undefine preprocessor symbols after first token in
10102         file"). Instead of using `tokens_seen' as the only flag that
10103         triggers CS1040, introduce `comments_seen'. This new flag is used
10104         to signify having seen comments on the current line, so it is
10105         unset after a newline.
10106
10107 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
10108
10109         * doc.cs : When searching for a type, find nested type too.
10110           This fixes bug #71040.
10111
10112 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
10113
10114         * doc.cs :
10115           - Warn missing member comment on those classes which also does not
10116             have doc comments. Fixed bug #71041.
10117           - Don't warn missing doc comment on default constructor.
10118             Fixed bug #71042.
10119
10120 2005-01-06  Duncan Mak  <duncan@ximian.com>
10121
10122         * cs-tokenizer.cs (xtoken): After handling traditional C-style
10123         comments, set `tokens_seen' to true. This allows us to detect
10124         misplaced preprocessor directives (i.e. not at the beginning of
10125         the a line, nor after whitespaces). In that case, report error
10126         CS1040. This fixes bug #56460.
10127
10128         * cs-parser.jay (interface_member_declaration): Add checks for
10129         IsExplicitImpl, and report CS0541 error if an interface member is
10130         defined as an explicit interface declaration.
10131
10132 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
10133
10134         Fix #70817
10135         * class.cs (PropertyMethod): Set Parent field in ctors.
10136         (SetMethod.InternalParameters): Add unsafe switch hack.
10137         
10138         * decl.cs (MemberCore.Parent): Cannot be readonly.
10139
10140 2005-01-06  Raja R Harinath  <rharinath@novell.com>
10141
10142         * decl.cs (DeclSpace.ResolveType): Remove.
10143         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
10144         Merge in code from ...
10145         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
10146         * class.cs, enum.cs: Update to changes.
10147
10148 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
10149
10150         * anonymous.cs: Ensure that we init the scope of our parent if it
10151         has not been initialized yet.
10152
10153 2004-12-30  Duncan Mak  <duncan@ximian.com>
10154
10155         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
10156         if field.FieldBuilder is null. Fixes #70758.
10157
10158         * convert.cs: Fixed some typos and updated some of the comments.
10159         (ImplicitStandardConversionExists):
10160         (TryImplicitIntConversion): If `target_type' is an interface and
10161         the type of `ic' implements this interface, return true or a new
10162         BoxedCast instead of null. This fixes #70468.
10163
10164 2004-12-29  Duncan Mak  <duncan@ximian.com>
10165
10166         * expression.cs (Argument.Emit): Check that Expr is
10167         IMemoryLocation before casting to it, and report CS1510 otherwise.
10168
10169         This fixes #70402.
10170
10171 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
10172
10173         * statement.cs (Block.ThisVariable): remove the recursion here, to
10174         make the --profile more sane.
10175
10176 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
10177
10178         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
10179         assembly, by JB Evain.
10180
10181 2004-12-17  Raja R Harinath  <rharinath@novell.com>
10182
10183         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
10184           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
10185         "parent" refers to enclosing type/class.  "base" refers to superclass.
10186
10187 2004-12-17  Raja R Harinath  <rharinath@novell.com>
10188
10189         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10190         Ensure that we only have GlobalAttributes.
10191         * attribute.cs (Attribute.Emit): Make non-virtual.
10192         (GlobalAttribute.Emit): Remove.
10193         (Attribute.Resolve): Make virtual.
10194         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
10195         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
10196         the argument. Don't create one.
10197         (Attribute.GetObsoleteAttribute): Likewise.
10198         (Attribute.GetClsCompliantAttributeValue): Likewise.
10199         * class.cs, decl.cs: Update to changes.
10200
10201 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
10202
10203         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
10204         
10205         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
10206         
10207         * statement.cs (Foreach.Resolve): Add error 186 report.
10208
10209 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
10210
10211         * expression.cs (Conditional.DoResolve): Add warning 429.
10212         
10213         * statement.cs (If.Resolve): Add warning 665.
10214
10215 2004-12-16  Raja R Harinath  <rharinath@novell.com>
10216
10217         New invariant: RootContext.Tree.Types.NamespaceEntry == null
10218         except when in the parser, and in GlobalAttribute.
10219         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
10220         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
10221         RootContext.Tree.Types.NamespaceEntry once work is done.
10222         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
10223         and resets RootContext.Tree.Types.NamespaceEntry.
10224
10225 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
10226
10227         * cs-parser.jay: Don't create a block for every variable.
10228
10229 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
10230
10231         * location.cs: Provide extra information.
10232
10233         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
10234         variables from the captured environment, it is the ldarg_0.
10235
10236 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
10237
10238         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
10239         find a conclusion.
10240         
10241         * class.cs: Changed warning level for 169 to avoid developer
10242         displeasure from warning flooding. It will be changed back when they
10243         fix most of current BCL warnings.
10244         
10245         * RootContext.cs: Pushed default WarningLevel to 3.
10246         
10247         * statement.cs: Removed unused variable.
10248
10249 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
10250
10251         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
10252         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
10253         Add error 502 report.
10254         (StaticClass.DefineType): Add error 441 report.
10255         (Class.AllowedModifiersProp): New virtual property as temporary
10256         extension to AllowedModifiers.
10257         (Class.DefineType): Add error 418 report. Moved ModFlags check here
10258         to share implementation with StaticClass and don't call virtual
10259         methods from ctor.
10260         
10261         * driver.cs (MainDriver): Add error 1558 test.
10262
10263         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
10264         report. Moved error 36 test here.
10265
10266         * statement.cs (Throw.Resolve): Add error 724 report.
10267
10268         * typemanager.cs: Add out_attribute_type core type.
10269         
10270 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
10271
10272         * class.cs (TypeContainer.VerifyClsCompliance): Add error
10273         3018 report.
10274         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
10275
10276         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
10277         3017 report.
10278         
10279         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
10280
10281         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
10282         Add error 3023 report.
10283         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
10284
10285         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
10286         implementation.
10287
10288 2004-12-12  John Luke  <john.luke@gmail.com>
10289
10290         * driver.cs (AddArgs): take -- into account when
10291         adding arguments, fixes bug 65710 
10292
10293 2004-12-12  Martin Baulig  <martin@ximian.com>
10294
10295         * expression.cs (Unary.TryReduceNegative): Added support for
10296         SByteConstant and ByteConstant.
10297         (Unary.Reduce): Check error values from TryReduceNegative().
10298
10299 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
10300
10301         * attributes.cs (Attribute.Resolve): Avoid multiple error report
10302         and report exception as error 182.
10303
10304 2004-12-10  Raja R Harinath  <rharinath@novell.com>
10305
10306         * driver.cs (Main): Fix message when there are warnings.
10307
10308 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
10309
10310         * delegate.cs: Fixed my fix from yesterday, sorry about that.
10311
10312 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
10313
10314         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
10315         Reduced number of warnings.
10316         
10317         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
10318
10319 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
10320
10321         * driver.cs: Removed message.
10322
10323         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
10324
10325 2004-12-08    <vargaz@freemail.hu>
10326
10327         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
10328
10329 2004-12-08  Martin Baulig  <martin@ximian.com>
10330
10331         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
10332         instead of a CS3002 for properties and indexer.
10333
10334 2004-12-08  Martin Baulig  <martin@ximian.com>
10335
10336         * decl.cs (MemberName.ToString): Make this work again.
10337
10338 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
10339
10340         * attribute.cs (Resolve): Add error 591 detection.
10341
10342         * class.cs (FieldMember.Define): Add error 1547 detection.
10343         (Indexer.Define): Add error 620 detection.
10344         (Operator.Define): Add error 590 detection.
10345
10346         * ecore.cs: Missing argument for error 79.
10347
10348         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
10349         detection.
10350
10351 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
10352
10353         Fix #70106
10354         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
10355         only.
10356
10357 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
10358
10359         * cs-parser.jay : handle doc comments on implicit/explicit operators.
10360           Some operator comments were suppressed.
10361         * doc.cs : Implicit/explicit operator name in doc comments are like
10362           "op_Explicit(type)~returnType", so added suffix handling.
10363
10364 2004-12-07  Martin Baulig  <martin@ximian.com>
10365
10366         * decl.cs
10367         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
10368         (MemberCore.GetClsCompliantAttributeValue): Likewise.
10369         (DeclSpace.ec): New protected field; store the EmitContext here.
10370         (DeclSpace.EmitContext): New public property; moved here from
10371         `TypeContainer'.
10372         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
10373         EmitContext.
10374
10375         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
10376         (Enum.Emit): Don't create a new EmitContext.
10377
10378         * delegate.cs (Delegate.DefineType): Always create the
10379         EmitContext.
10380
10381         * iterators.cs (Iterators.DefineIterator): Create a new
10382         EmitContext and store it in `ec'.
10383
10384 2004-08-24  Martin Baulig  <martin@ximian.com>
10385
10386         * typemanager.cs
10387         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
10388         this for accessibility checks.
10389         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
10390         IsNestedFamilyAccessible.
10391         (TypeManager.IsSubclassOf): New method, do what the name actually
10392         says.   
10393
10394 2004-12-06  Raja R Harinath  <rharinath@novell.com>
10395
10396         Fix crash on cs0657-17.cs.
10397         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10398         Use RootContext.Tree.Types, not 'new RootTypes ()'.
10399         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
10400         the case where the NamespaceEntry gets overwritten.
10401
10402 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
10403
10404         Fixed #69195, #56821
10405         * ecore.cs (ResolveBoolean): Tiny refactoring.
10406
10407         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
10408         of right expression resolving when left is false constant and
10409         operator is LogicalAnd OR true constant and operator is LogicalOr.
10410
10411         * statement.cs (ResolveUnreachable): Always reports warning.
10412
10413 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
10414
10415         * class.cs: Distinguish between 1721 and 1722 (just a little help
10416         for the programmer).
10417
10418 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
10419
10420         * delegate.cs: Only allow this on new versions of the language. 
10421
10422 2004-12-02  Duncan Mak  <duncan@ximian.com>
10423
10424         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
10425         Expression class.
10426         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
10427         here as a static method. Take an additional bool out parameter
10428         `must_do_cs1540_check' for signaling to InstanceResolve.
10429         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
10430         member field from PropertyExpr class and made it an argument of
10431         the method instead.
10432         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
10433         check for MarshalByRefObject, and report CS0122 instead of CS1540.
10434         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
10435         and `remove_accessor' as well as InstanceResolve: report CS0122
10436         where applicable.
10437
10438         Fixes #70129.
10439
10440 2004-12-03  Raja R Harinath  <rharinath@novell.com>
10441
10442         Fix test-327.cs, test-328.cs, and put in early infrastructure
10443         for eventually fixing #52697.
10444         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
10445         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
10446         from other methods.
10447         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
10448         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
10449         (VerifyUsing, error246): Update.
10450         * rootcontext.cs (RootContext.NamespaceLookup): Just use
10451         'NamespaceEntry.LookupNamespaceOrType'.
10452
10453 2004-12-03  Martin Baulig  <martin@ximian.com>
10454
10455         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10456         method as our child, call AnonymousMethod.Compatible() on it.
10457
10458 2004-12-03  Raja R Harinath  <rharinath@novell.com>
10459
10460         Disable XML documentation support in 'basic' profile.
10461         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
10462         Redirect XmlElement to System.Object.
10463         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
10464         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
10465         * mcs.exe.sources: Add doc-bootstrap.cs.
10466         * doc-bootstrap.cs: New file.  Contains empty stub implementation
10467         of doc.cs.
10468
10469 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
10470
10471         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
10472           comments are allowed.
10473
10474 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10475
10476         * delegate.cs: Add checks for subtypes in paramaters and return values
10477         in VerifyMethod () to add support for Covariance/Contravariance
10478         in delegates.
10479         
10480 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
10481
10482         * report.cs: Remove extra closing parenthesis.
10483
10484         * convert.cs (Error_CannotImplicitConversion): If the name of the
10485         types are the same, provide some extra information.
10486
10487         * class.cs (FieldBase): Use an unused bit field from the field to
10488         encode the `has_offset' property from the FieldMember.  This saves
10489         a couple of Ks on bootstrap compilation.
10490
10491         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10492         method as our child, return the AnonymousMethod resolved
10493         expression.
10494
10495         * expression.cs (New.DoResolve): Allow return values from
10496         NewDelegate to also include AnonymousMethods.
10497
10498         Fixes #70150.
10499
10500 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
10501
10502         Fix bug #70102
10503         * attribute.cs (Resolve): Improved implementation of params
10504         attribute arguments.
10505
10506         * support.cs (ParameterData): Add HasParams to be faster.
10507
10508 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
10509
10510         all things are for /doc support:
10511
10512         * doc.cs: new file that supports XML documentation generation.
10513         * mcs.exe.sources: added doc.cs.
10514         * driver.cs:
10515           Handle /doc command line option.
10516           Report error 2006 instead of 5 for missing file name for /doc.
10517           Generate XML documentation when required, after type resolution.
10518         * cs-tokenizer.cs:
10519           Added support for picking up documentation (/// and /** ... */),
10520           including a new XmlCommentState enumeration.
10521         * cs-parser.jay:
10522           Added lines to fill Documentation element for field, constant,
10523           property, indexer, method, constructor, destructor, operator, event
10524           and class, struct, interface, delegate, enum.
10525           Added lines to warn incorrect comment.
10526         * rootcontext.cs :
10527           Added Documentation field (passed only when /doc was specified).
10528         * decl.cs:
10529           Added DocComment, DocCommentHeader, GenerateDocComment() and
10530           OnGenerateDocComment() and some supporting private members for
10531           /doc feature to MemberCore.
10532         * class.cs:
10533           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
10534         * delegate.cs:
10535           Added overriden DocCommentHeader.
10536         * enum.cs:
10537           Added overriden DocCommentHeader and GenerateDocComment().
10538
10539 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
10540
10541         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
10542         unwrapping the enumeration values, chain to
10543         DoConstantNumericPromotions again, so we can promote things to the
10544         fundamental types (takes care of enums that are bytes, sbytes).
10545
10546         Fixes bug #62054.
10547
10548 2004-12-01  Raja R Harinath  <rharinath@novell.com>
10549
10550         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
10551         Fix long-standing bug in type-lookup.  Use FindType instead of
10552         LookupType when ec.ResolvingTypeTree.
10553         (Attribute.ResolveType, Attribute.Resolve)
10554         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
10555         Update to changes.
10556         (Attributes.Search): Remove internal version.  Update.
10557         (Attributes.SearchMulti): Update.
10558         (Attributes.GetClsCompliantAttribute): Remove.
10559         (Attributes.GetIndexerNameAttribute): Remove.
10560         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
10561         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
10562         * class.cs (Indexer.Define): Likewise.
10563
10564 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
10565
10566         Fix bug #68790
10567         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
10568         MarshallByReference members access.
10569
10570         * expression.cs: Use CheckMarshallByRefAccess;
10571         Better error CS0197 message.
10572
10573         * report.cs: Print whole related error message.
10574
10575 2004-11-30  Raja R Harinath  <rharinath@novell.com>
10576
10577         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
10578         the current directory to help debugging.
10579
10580 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
10581
10582         * class (GetClassBases): Better error 60 report.
10583         (EventProperty): Disabled warning 67 detection.
10584
10585 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
10586
10587         Fix bug #60324
10588         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
10589
10590         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
10591         precise values.
10592
10593 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
10594
10595         Fix bug #49488
10596         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
10597
10598         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
10599
10600 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
10601
10602         * attribute.cs (Attribute.Resolve): Refine error reporting and
10603         report a cs0117 if the identifier does not exist, to distinguish
10604         from 0617 which is a miss-use of the actual identifier.
10605
10606         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
10607         between cs0070 and cs0079.
10608
10609         * class.cs (MemberBase.DoDefine): When reporting a wrong
10610         accessibility level, we use MethodCore to compare instead of
10611         Method (this was a regression in some refactoring effort).
10612
10613         So now we correctly report cs0056 again.
10614
10615         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
10616         testing the target_type (which was known to be object_type) and
10617         not the source type (which is anonymous_method).
10618
10619         Fixed reporting of error cs1660.
10620
10621         * expression.cs (UserCast.Source): Expose the underlying cast.
10622
10623         * statement.cs (Switch.SwitchGoverningType): Sort the list of
10624         allowed types to find a match to int32 first (most common).
10625
10626         In addition, it ignores any ImplicitUserConversions that did an
10627         internal implicit conversion (as the switch statement allows only
10628         one integral conversion to exist).
10629
10630         * class.cs (PartialContainer.Create): rename `name' to
10631         `member_name' for clarity.  Then replace the string calls with a
10632         call to MemberName.GetPartialName, as now using
10633         MemberName.ToString is an error (this is due to the side effects
10634         it had, that were fixed in the past).
10635
10636         This will restore the error reporting on a number of partial class
10637         errors that were missusing this (and getting an exception as a
10638         results, which is now just a plain textual warning, because
10639         yyparse debug output would crash otherwise).
10640
10641 2004-11-26  Raja R Harinath  <rharinath@novell.com>
10642
10643         * Makefile (PROGRAM_INSTALL_DIR): Remove.
10644
10645 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
10646
10647         * rootcontext.cs (LookupType): Make sure to cache lookups that
10648         don't give us a negative result. This saves about 5% of corlib
10649         compilation time.
10650
10651 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
10652
10653         * report.cs (AbstractMessage.Print): messages are sent to stderr
10654
10655         * class.cs (TypeContainer.GetClassBases): It is an error to have a
10656         non-interface in the list of interfaces (at this point, either
10657         parent was properly set, or a base class is being listed in the
10658         interfaces section).
10659
10660         This flags error 1722, and resolves the crash from bug 69259.
10661
10662 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
10663
10664         * statement.cs (Using.EmitExpressionFinally): make this work right
10665         for valuetypes. Fixes 69926.
10666
10667 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
10668
10669         * const.cs (Const.ChangeType): Cope with the "0 literal can be
10670         converted to an enum" here, before we try to change the underlying
10671         type.  This code exists, but it is a different code path than the
10672         one used while encoding constants.
10673
10674         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
10675         old bug: when converting from the null literal to a pointer,
10676         return an EmptyCast, not the NullLiteral.
10677
10678         This fixes #69921, the recent null_type changes probably made this
10679         bug more prominent.
10680
10681         (ImplicitReferenceConversionExists): In addition, resynchronized
10682         the code here, so it matches the same code in
10683         ImplicitReferenceConversionExists for the `from any class-type S
10684         to any interface-type T'.
10685         
10686
10687 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
10688
10689         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
10690
10691 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
10692
10693         * cs-parser.jay: Use verbosity accordingly. 
10694
10695 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
10696
10697         * expression.cs (Unary.ResolveOperator): Do not report warning;
10698         AddressOf reads from variable.
10699         
10700         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
10701
10702 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
10703
10704         Fix bug #69462
10705
10706         * attribute.cs (Attributable): Removed CheckTargets.
10707         (Attributes.Emit): Explicit attribute targets are tested here.
10708
10709         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
10710         not enabled for interfaces.
10711
10712         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
10713         (GetAssemblyName): Ouch next bug there.
10714
10715 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10716
10717         * expression.cs: Error 275 added.
10718         
10719 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
10720
10721         Fix bug #69177 (Implemented decimal constant support)
10722
10723         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
10724         (BinaryFold): Add DecimalConstant.
10725
10726         * const.cs (Define): Decimal constant 
10727         (is not constant.
10728         (ChangeType): Add decimal type handling.
10729         (LookupConstantValue): Don't set value for decimal type but
10730         emit DecimalConstantAttribute. Needed for constant optimization.
10731
10732         * constant.cs (ToDecimal): New method.
10733         (ConvertToDecimal): New method.
10734         (IntConstant): Implemented ConvertToDecimal.
10735         (DecimalConstant.Emit): Emit optimized version for decimals in
10736         int range.
10737
10738         * expression.cs (ResolveOperator): Changed order of constant
10739         reduction to work correctly with native types which have
10740         overloaded operators.
10741         (ResolveMemberAccess): Extract constant value from attribute
10742         for decimal type.
10743
10744         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
10745
10746         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
10747         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
10748         (ChangeType): Decimal is special.
10749         (TypeToCoreType): Add decimal type.
10750
10751 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
10752
10753         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
10754         decimal types.
10755
10756 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
10757
10758         * class.cs (EventField.ApplyAttributeBuilder): Fix error
10759         test cs1667-5.cs.
10760
10761 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
10762
10763         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
10764
10765         * pending.cs (PendingImplementation): Grab only interfaces.
10766
10767 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
10768
10769         * statement.cs (ForeachHelperMethods): Add location member and
10770         error 202 detection.
10771
10772 2004-11-19  Raja R Harinath  <rharinath@novell.com>
10773
10774         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
10775         automatically handled by executable.make.
10776         (PROGRAM): Make profile-specific.
10777
10778 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
10779
10780         * expression.cs (DoResolveBase): Fixed wrong warning for out
10781         variables.
10782
10783 2004-11-18  Martin Baulig  <martin@ximian.com>
10784
10785         Merged latest changes into gmcs.  Please keep this comment in
10786         here, it makes it easier for me to see what changed in MCS since
10787         the last time I merged.
10788
10789 2004-11-17  Raja R Harinath  <rharinath@novell.com>
10790
10791         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
10792         (TypeHandle.GetMemberCache): New.
10793         (TypeHandle.TypeHandle): Update.
10794         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
10795         (TypeManager.LookupParentInterfacesCache):
10796         Rename from LookupInterfaceCache.  Optimize slightly.
10797         (TypeManager.MemberLookup_FindMembers): Update.
10798         * decl.cs (MemberCache.MemberCache): Set Container to null in the
10799         multi-type variant.
10800         (AddCacheContents): Rename from AddHashtable.
10801         * class.cs (TypeContainer.parent_container): Remove.
10802         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
10803         (TypeContainer.DoDefineMembers): Don't initialize it.
10804         Update to name changes.
10805         
10806 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
10807
10808         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
10809         that factors the code to check access modifiers on override.  
10810
10811         (PropertyBase): Use the code here.
10812
10813         Patch from Lluis S'anchez, fixes bug #69361.
10814
10815 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
10816
10817         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
10818         routine that is used to report the use of a captured variable
10819         whose address has been taken.
10820
10821         There are two checks: one when variables are being captured and
10822         the other check is when the address of a variable is taken. 
10823         
10824         (because an anonymous methods might be resolved before *or* after
10825         the address has been taken) and 
10826
10827         * expression.cs (Conditional.DoResolve): Remove the special
10828         casing that Martin added to trueExpr and falseExpr being both
10829         NullLiteral.  We get the right behavior now just by introducing
10830         the null_type into the compiler. 
10831
10832         * convert.cs (ExplicitConversion): Change the code to use
10833         null_type instead of testing `expr is NullLiteral'.
10834         (ImplicitConversionStandard): use null_type too.
10835         (ImplicitReferenceConversionExists): use null_type too.
10836         (ImplicitReferenceConversion): use null_type too.
10837
10838         * literal.cs: The type of `NullLiteral' is now null_type instead
10839         of object_type. 
10840         (Resolve): Set the type here.
10841
10842         * typemanager.cs: Introduce null_type.
10843
10844 2004-11-17  Martin Baulig  <martin@ximian.com>
10845
10846         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
10847         direction, like FindMembers() does.  Fixes #69546, testcase is in
10848         test-315.cs.    
10849
10850 2004-11-16  Martin Baulig  <martin@ximian.com>
10851
10852         This is based on a patch from Marek Safar, see bug #69082.
10853         Fixes bugs #63705 and #67130.
10854
10855         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
10856         method; create a MemberCache for an interface type and cache the
10857         result.
10858
10859         * decl.cs (IMemberContainer.ParentContainer): Removed.
10860         (IMemberContainer.ParentCache): New property.
10861         (MemberCache.SetupCacheForInterface): Removed.
10862         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
10863         to create a cache for an interface's "parent".
10864
10865         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
10866         interfaces too.
10867
10868 2004-11-16  Martin Baulig  <martin@ximian.com>
10869
10870         Merged back from gmcs; these changes already went into gmcs a
10871         couple of weeks ago.
10872
10873         * typemanager.cs
10874         (TypeManager.AddUserType): Removed the `ifaces' argument.
10875         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
10876         `TypeExpr []'.
10877         (TypeManager.AddUserInterface): Removed.
10878         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
10879         `TypeExpr []'.
10880         (TypeManager.GetInterfaces): Likewise.
10881         (TypeManager.GetExplicitInterfaces): Likewise.
10882
10883         * ecore.cs (TypeExpr.GetInterfaces): Removed.
10884
10885         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
10886         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
10887
10888 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
10889
10890         * statement.cs: Avoid adding bools to a hashtable.
10891
10892 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
10893
10894         * expression.cs (Invocation.OverloadResolve): Flag error if we are
10895         calling an unsafe method from a safe location.
10896
10897 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
10898
10899         Fix #69167
10900         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
10901
10902 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
10903
10904         * namespace.cs (VerifyUsing): use GetPartialName instead of
10905         ToString. 
10906
10907 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
10908
10909         * statement.cs (Return.Resolve): Fix regression in typo: if
10910         `in_exc', we have to request a NeedReturnLabel, this was a typo
10911         introduced in the anonymous method check-in.  Fixes #69131.
10912
10913         * Indexers were using the ShortName when defining themselves,
10914         causing a regression in the compiler bootstrap when applying the
10915         patch from 2004-11-02 (first part), now they use their full name
10916         and the bug is gone.
10917
10918 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
10919
10920         * driver.cs: Strip the path from the names of embedded resources. Fixes
10921         #68519.
10922
10923 2004-11-04  Raja R Harinath  <rharinath@novell.com>
10924
10925         Fix error message regression: cs0104-2.cs.
10926         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
10927         (AliasEntry.Resolve): Update.
10928         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
10929         'silent' flag.
10930         (RootContext.LookupType): Update.
10931
10932 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
10933
10934         * cs-parser.jay: Add support for handling accessor modifiers
10935         * class: Add support port accessor modifiers and error checking,
10936         define PropertyMethod.Define as virtual (not abstract anymore)
10937         * ecore.cs: Add checking for proeprties access with access modifiers
10938         * iterators.cs: Modify Accessor constructor call based in the modified
10939         constructor
10940 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
10941
10942         * expression.cs (StringConcat): Handle being called twice,
10943         as when we have a concat in a field init with more than two
10944         ctors in the class
10945
10946 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
10947
10948         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
10949         special case explicit implementations, we should always produce
10950         the .property or .event declaration.
10951         
10952         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
10953         since it will not return correct data if people use this
10954         unresolved in the presence of using statements (see test-313).
10955
10956         * class.cs (MethodData.Define): If we are an explicit interface
10957         implementation, set the method name to the full name of the
10958         interface plus the name of the method.  
10959
10960         Notice that using the method.MethodName.GetFullName() does not
10961         work, as it will only contain the name as declared on the source
10962         file (it can be a shorthand in the presence of using statements)
10963         and not the fully qualifed type name, for example:
10964
10965         using System;
10966
10967         class D : ICloneable {
10968                 object ICloneable.Clone ()  {
10969                 }
10970         }
10971
10972         Would produce a method called `ICloneable.Clone' instead of
10973         `System.ICloneable.Clone'.
10974
10975         * namespace.cs (Alias.Resolve): Use GetPartialName.
10976         
10977 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
10978
10979         * cs-parser.jay: Add error 1055 report.
10980
10981 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
10982
10983         * assign.cs (Assign.DoResolve): Only do the transform of
10984         assignment into a New if the types are compatible, if not, fall
10985         through and let the implicit code deal with the errors and with
10986         the necessary conversions. 
10987
10988 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
10989
10990         * cs-parser.jay: Add error 1031 report.
10991
10992         * cs-tokenizer.cs: Add location for error 1038.
10993
10994 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
10995
10996         * cs-parser.jay: Add error 1016 report.
10997
10998 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
10999
11000         * cs-parser.jay: Add errors 1575,1611 report.
11001
11002 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11003
11004         * cs-parser.jay: Add error 1001 report.
11005
11006 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11007
11008         Fix #68850
11009         * attribute.cs (GetMarshal): Add method argument for
11010         caller identification.
11011
11012         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
11013         agument for GetMarshal and RuntimeMissingSupport.
11014
11015 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11016
11017         * attribute.cs (ExtractSecurityPermissionSet): Removed
11018         TypeManager.code_access_permission_type.
11019
11020         * typemanager.cs: Removed TypeManager.code_access_permission_type.
11021
11022 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
11023
11024         * expression.cs (LocalVariableReference.DoResolveLValue): Check
11025         for obsolete use of a variable here.   Fixes regression on errors
11026         cs0619-25 and cs0619-26.
11027
11028 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
11029
11030         Fix #62358, implemented security attribute encoding.
11031
11032         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
11033         Tests permitted SecurityAction for assembly or other types.
11034         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
11035         data from SecurityPermissionAttribute to PermisionSet class.
11036
11037         * class.cs (ApplyAttributeBuilder): Added special handling
11038         for System.Security.Permissions.SecurityAttribute based types.
11039
11040         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
11041         special handling for System.Security.Permissions.SecurityAttribute
11042         based types.
11043
11044         * enum.cs (ApplyAttributeBuilder): Added special handling
11045         for System.Security.Permissions.SecurityAttribute based types.
11046
11047         * parameter.cs (ApplyAttributeBuilder): Added special handling
11048         for System.Security.Permissions.SecurityAttribute based types.
11049
11050         * rootcontext.cs: Next 2 core types.
11051
11052         * typemanager.cs (TypeManager.security_permission_attr_type):
11053         Built in type for the SecurityPermission Attribute.
11054         (code_access_permission_type): Build in type.
11055
11056 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
11057
11058         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
11059         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
11060         all of this information into
11061         EmitContext.EmitCapturedVariableInstance.
11062         
11063         * codegen.cs (EmitCapturedVariableInstance): move here the
11064         funcionality of emitting an ldarg.0 in the presence of a
11065         remapping.   This centralizes the instance emit code.
11066
11067         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
11068         then emit a load of this: it means that we have reached the
11069         topmost ScopeInfo: the one that contains the pointer to the
11070         instance of the class hosting the anonymous method.
11071
11072         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
11073         captures to the topmost CaptureContext.
11074
11075 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
11076
11077         * expression.cs (LocalVariableReference): Move the knowledge about
11078         the iterators into codegen's EmitCapturedVariableInstance.
11079
11080 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
11081
11082         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
11083         all code paths return a value from an anonymous method (it is the
11084         same as the 161 error, but for anonymous methods).
11085
11086 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
11087
11088         The introduction of anonymous methods in the compiler changed
11089         various ways of doing things in the compiler.  The most
11090         significant one is the hard split between the resolution phase
11091         and the emission phases of the compiler.
11092
11093         For instance, routines that referenced local variables no
11094         longer can safely create temporary variables during the
11095         resolution phase: they must do so from the emission phase,
11096         since the variable might have been "captured", hence access to
11097         it can not be done with the local-variable operations from the runtime.
11098         
11099         * statement.cs 
11100
11101         (Block.Flags): New flag `IsTopLevel' to indicate that this block
11102         is a toplevel block.
11103
11104         (ToplevelBlock): A new kind of Block, these are the blocks that
11105         are created by the parser for all toplevel method bodies.  These
11106         include methods, accessors and anonymous methods.
11107
11108         These contain some extra information not found in regular blocks:
11109         A pointer to an optional CaptureContext (for tracking captured
11110         local variables and parameters).  A pointer to the parent
11111         ToplevelBlock.
11112         
11113         (Return.Resolve): Catch missmatches when returning a value from an
11114         anonymous method (error 1662).
11115         Invoke NeedReturnLabel from the Resolve phase instead of the emit
11116         phase.
11117
11118         (Break.Resolve): ditto.
11119
11120         (SwitchLabel): instead of defining the labels during the
11121         resolution phase, we now turned the public ILLabel and ILLabelCode
11122         labels into methods called GetILLabelCode() and GetILLabel() that
11123         only define the label during the Emit phase.
11124
11125         (GotoCase): Track the SwitchLabel instead of the computed label
11126         (its contained therein).  Emit the code by using
11127         SwitchLabel.GetILLabelCode ().
11128
11129         (LocalInfo.Flags.Captured): A new flag has been introduce to track
11130         whether the Local has been captured or not.
11131
11132         (LocalInfo.IsCaptured): New property, used to tell whether the
11133         local has been captured.
11134         
11135         * anonymous.cs: Vastly updated to contain the anonymous method
11136         support.
11137
11138         The main classes here are: CaptureContext which tracks any
11139         captured information for a toplevel block and ScopeInfo used to
11140         track the activation frames for various local variables.   
11141
11142         Each toplevel block has an optional capture context associated
11143         with it.  When a method contains an anonymous method both the
11144         toplevel method and the anonymous method will create a capture
11145         context.   When variables or parameters are captured, they are
11146         recorded on the CaptureContext that owns them, for example:
11147
11148         void Demo () {
11149              int a;
11150              MyDelegate d = delegate {
11151                  a = 1;
11152              }
11153         }
11154
11155         Here `a' will be recorded as captured on the toplevel
11156         CapturedContext, the inner captured context will not have anything
11157         (it will only have data if local variables or parameters from it
11158         are captured in a nested anonymous method.
11159
11160         The ScopeInfo is used to track the activation frames for local
11161         variables, for example:
11162
11163         for (int i = 0; i < 10; i++)
11164                 for (int j = 0; j < 10; j++){
11165                    MyDelegate d = delegate {
11166                         call (i, j);
11167                    }
11168                 }
11169
11170         At runtime this captures a single captured variable `i', but it
11171         captures 10 different versions of the variable `j'.  The variable
11172         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
11173         recorded on a child.  
11174
11175         The toplevel ScopeInfo will also track information like the `this'
11176         pointer if instance variables were referenced (this is necessary
11177         as the anonymous method lives inside a nested class in the host
11178         type of the method). 
11179
11180         (AnonymousMethod): Expanded to track the Toplevel, implement
11181         `AnonymousMethod.Compatible' to tell whether an anonymous method
11182         can be converted to a target delegate type. 
11183
11184         The routine now also produces the anonymous method content
11185
11186         (AnonymousDelegate): A helper class that derives from
11187         DelegateCreation, this is used to generate the code necessary to
11188         produce the delegate for the anonymous method that was created. 
11189
11190         * assign.cs: API adjustments for new changes in
11191         Convert.ImplicitStandardConversionExists.
11192
11193         * class.cs: Adjustments to cope with the fact that now toplevel
11194         blocks are of type `ToplevelBlock'. 
11195
11196         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
11197         insteda of standard blocks.
11198
11199         Flag errors if params arguments are passed to anonymous methods.
11200
11201         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
11202         `CurrentAnonymousMethod' which points to the current Anonymous
11203         Method.  The variable points to the AnonymousMethod class that
11204         holds the code being compiled.  It is set in the new EmitContext
11205         created for the anonymous method.
11206
11207         (EmitContext.Phase): Introduce a variable and an enumeration to
11208         assist in enforcing some rules about when and where we are allowed
11209         to invoke certain methods (EmitContext.NeedsReturnLabel is the
11210         only one that enfonces this right now).
11211
11212         (EmitContext.HaveCaptureInfo): new helper method that returns
11213         whether we have a CapturedContext initialized.
11214
11215         (EmitContext.CaptureVariable): New method used to register that a
11216         LocalInfo must be flagged for capturing. 
11217
11218         (EmitContext.CapturedParameter): New method used to register that a
11219         parameters must be flagged for capturing. 
11220         
11221         (EmitContext.CapturedField): New method used to register that a
11222         field must be flagged for capturing. 
11223
11224         (EmitContext.HaveCapturedVariables,
11225         EmitContext.HaveCapturedFields): Return whether there are captured
11226         variables or fields. 
11227
11228         (EmitContext.EmitMethodHostInstance): This is used to emit the
11229         instance for the anonymous method.  The instance might be null
11230         (static methods), this (for anonymous methods that capture nothing
11231         and happen to live side-by-side with the current method body) or a
11232         more complicated expression if the method has a CaptureContext.
11233
11234         (EmitContext.EmitTopBlock): Routine that drives the emission of
11235         code: it will first resolve the top block, then emit any metadata
11236         and then emit the code.  The split is done so that we can extract
11237         any anonymous methods and flag any captured variables/parameters.
11238         
11239         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
11240         during this phase, the ILGenerator should not be used as labels
11241         and local variables declared here might not be accessible to any
11242         code that is part of an anonymous method.  
11243
11244         Exceptions to this include the temporary variables that are
11245         created by some statements internally for holding temporary
11246         variables. 
11247         
11248         (EmitContext.EmitMeta): New routine, in charge of emitting all the
11249         metadata for a cb
11250
11251         (EmitContext.TemporaryReturn): This method is typically called
11252         from the Emit phase, and its the only place where we allow the
11253         ReturnLabel to be defined other than the EmitMeta.  The reason is
11254         that otherwise we would have to duplicate a lot of logic in the
11255         Resolve phases of various methods that today is on the Emit
11256         phase. 
11257
11258         (EmitContext.NeedReturnLabel): This no longer creates the label,
11259         as the ILGenerator is not valid during the resolve phase.
11260
11261         (EmitContext.EmitThis): Extended the knowledge in this class to
11262         work in anonymous methods in addition to iterators. 
11263
11264         (EmitContext.EmitCapturedVariableInstance): This emits whatever
11265         code is necessary on the stack to access the instance to a local
11266         variable (the variable will be accessed as a field).
11267
11268         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
11269         EmitContext.EmitAddressOfParameter): Routines to support
11270         parameters (not completed at this point). 
11271         
11272         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
11273         will also remove the parameters.
11274
11275         * convert.cs (Convert): Define a `ConstantEC' which points to a
11276         null.  This is just to prefity some code that uses
11277         ImplicitStandardConversion code and do not have an EmitContext
11278         handy.
11279
11280         The idea is to flag explicitly that at that point in time, it is
11281         known that the conversion will not trigger the delegate checking
11282         code in implicit conversions (which requires a valid
11283         EmitContext). 
11284
11285         Everywhere: pass new EmitContext parameter since
11286         ImplicitStandardConversionExists now requires it to check for
11287         anonymous method conversions. 
11288
11289         (Convert.ImplicitStandardConversionExists): If the type of an
11290         expression is the anonymous_method_type, and the type is a
11291         delegate, we invoke the AnonymousMethod.Compatible method to check
11292         whether an implicit conversion is possible. 
11293
11294         (Convert.ImplicitConversionStandard): Only do implicit method
11295         group conversions if the language level is not ISO_1.
11296
11297         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
11298         MethodInfo for the Invoke method.  used by Delegate and
11299         AnonymousDelegate.
11300
11301         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
11302         method conversions if the target type is a delegate.
11303
11304         Removed extra debugging nops.
11305
11306         (LocalVariableReference): Turn the `local_info' into a public
11307         field. 
11308
11309         Add `prepared' field, the same hack used for FieldExprs to cope
11310         with composed assignments, as Local variables do not necessarily
11311         operate purely on the stack as they used to: they can be captured
11312         fields. 
11313
11314         Add `temp' for a temporary result, like fields.
11315
11316         Refactor DoResolve and DoResolveLValue into DoResolveBase.
11317
11318         It now copes with Local variables that are captured and emits the
11319         proper instance variable to load it from a field in the captured
11320         case. 
11321
11322         (ParameterReference.DoResolveBase): During the resolve phase,
11323         capture parameters if we are in an anonymous method.
11324
11325         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
11326         anonymous method, use the EmitContext helper routines to emit the
11327         parameter reference.
11328
11329         * iterators.cs: Set RemapToProxy to true/false during the
11330         EmitDispose class.
11331
11332         * parameters.cs (GetParameterByName): New helper method. 
11333
11334         * typemanager.cs (anonymous_method_type) a new type that
11335         represents an anonyous method.  This is always an internal type,
11336         used as a fencepost to test against the anonymous-methodness of an
11337         expression. 
11338         
11339 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
11340
11341         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
11342         561 report.
11343         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
11344
11345 2004-10-18  Martin Baulig  <martin@ximian.com>
11346
11347         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
11348         `Type' directly, but call ResolveType() on it.
11349         (Catch.Resolve): Likewise.
11350         (Foreach.Resolve): Likewise.
11351
11352 2004-10-18  Martin Baulig  <martin@ximian.com>
11353
11354         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
11355         `Type' directly, but call ResolveType() on it.
11356         (Probe.DoResolve): Likewise.
11357         (ArrayCreation.LookupType): Likewise.
11358         (TypeOf.DoResolve): Likewise.
11359         (SizeOf.DoResolve): Likewise.
11360
11361 2004-10-18  Martin Baulig  <martin@ximian.com>
11362
11363         * expression.cs (Invocation.BetterFunction): Put back
11364         TypeManager.TypeToCoreType().
11365
11366 2004-10-18  Raja R Harinath  <rharinath@novell.com>
11367
11368         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
11369         the ResolveType.
11370
11371 2004-10-18  Martin Baulig  <martin@ximian.com>
11372
11373         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
11374         `Type' directly, but call ResolveType() on it.
11375
11376 2004-10-18  Martin Baulig  <martin@ximian.com>
11377
11378         * class.cs (FieldMember.Define): Don't access the TypeExpr's
11379         `Type' directly, but call ResolveType() on it.
11380         (MemberBase.DoDefine): Likewise.
11381
11382         * expression.cs (New.DoResolve): Don't access the TypeExpr's
11383         `Type' directly, but call ResolveType() on it.
11384         (ComposedCast.DoResolveAsTypeStep): Likewise.
11385
11386         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
11387         `Type' directly, but call ResolveType() on it.
11388
11389 2004-10-17  John Luke  <john.luke@gmail.com>
11390
11391         * class.cs (Operator.GetSignatureForError): use CSharpName
11392
11393         * parameter.cs (Parameter.GetSignatureForError): Returns
11394         correct name even if was not defined.
11395
11396 2004-10-13  Raja R Harinath  <rharinath@novell.com>
11397
11398         Fix #65816.
11399         * class.cs (TypeContainer.EmitContext): New property.
11400         (DefineNestedTypes): Create an emitcontext for each part.
11401         (MethodCore.DoDefineParameters): Use container's emitcontext.
11402         Pass type array to InternalParameters.
11403         (MemberBase.DoDefine): Use container's emitcontext.
11404         (FieldMember.Define): Likewise.
11405         (Event.Define): Likewise.
11406         (SetMethod.GetParameterInfo): Change argument to EmitContext.
11407         Pass type array to InternalParameters.
11408         (SetIndexerMethod.GetParameterInfo): Likewise.
11409         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
11410         * delegate.cs (Define): Pass emitcontext to
11411         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
11412         array to InternalParameters.
11413         * expression.cs (ParameterReference.DoResolveBase): Pass
11414         emitcontext to GetParameterInfo.
11415         (ComposedCast.DoResolveAsTypeStep): Remove check on
11416         ec.ResolvingTypeTree.
11417         * parameter.cs (Parameter.Resolve): Change argument to
11418         EmitContext.  Use ResolveAsTypeTerminal.
11419         (Parameter.GetSignature): Change argument to EmitContext.
11420         (Parameters.ComputeSignature): Likewise.
11421         (Parameters.ComputeParameterTypes): Likewise.
11422         (Parameters.GetParameterInfo): Likewise.
11423         (Parameters.ComputeAndDefineParameterTypes): Likewise.
11424         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
11425         * support.cs (InternalParameters..ctor): Remove variant that takes
11426         a DeclSpace.
11427         * typemanager.cs (system_intptr_expr): New.
11428         (InitExpressionTypes): Initialize it.
11429
11430 2004-10-12  Chris Toshok  <toshok@ximian.com>
11431
11432         * cs-parser.jay: fix location for try_statement and catch_clause.
11433
11434 2004-10-11  Martin Baulig  <martin@ximian.com>
11435
11436         * report.cs: Don't make --fatal abort on warnings, we have
11437         -warnaserror for that.
11438
11439 2004-10-07  Raja R Harinath  <rharinath@novell.com>
11440
11441         More DeclSpace.ResolveType avoidance.
11442         * decl.cs (MemberCore.InUnsafe): New property.
11443         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
11444         with newly created EmitContext.
11445         (FieldMember.Define): Likewise.
11446         * delegate.cs (Delegate.Define): Likewise.
11447         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
11448         only if normal name-lookup fails.
11449         (TypeExpr.DoResolve): Enable error-checking.
11450         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
11451         (SizeOf.DoResolve): Likewise.
11452         (ComposedCast.DoResolveAsTypeStep): Likewise.
11453         (StackAlloc.DoResolve): Likewise.
11454         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
11455         (Block.Unsafe): New property.
11456         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
11457         (Unsafe): Set 'unsafe' flag of contained block.
11458         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
11459         (Fixed.Resolve): Likewise.
11460         (Catch.Resolve): Likewise.
11461         (Using.ResolveLocalVariableDecls): Likewise.
11462         (Foreach.Resolve): Likewise.
11463
11464 2004-10-05  John Luke <john.luke@gmail.com>
11465
11466         * cs-parser.jay: add location to error CS0175
11467
11468 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
11469
11470         * ecore.cs (Expression.Constantity): Add support for turning null
11471         into a constant.
11472
11473         * const.cs (Const.Define): Allow constants to be reference types
11474         as long as the value is Null.
11475
11476 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
11477
11478         * namespace.cs (NamespaceEntry.Using): No matter which warning
11479         level is set, check if this namespace name has already been added.
11480
11481 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
11482
11483         * expression.cs: reftype [!=]= null should always use br[true,false].
11484         # 67410
11485
11486 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
11487
11488         Fix #67108
11489         * attribute.cs: Enum conversion moved to 
11490         GetAttributeArgumentExpression to be applied to the all
11491         expressions.
11492
11493 2004-10-01  Raja R Harinath  <rharinath@novell.com>
11494
11495         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
11496         * class.c (TypeContainer.DefineType): Flag error if
11497         base types aren't accessible due to access permissions.
11498         * decl.cs (DeclSpace.ResolveType): Move logic to
11499         Expression.ResolveAsTypeTerminal.
11500         (DeclSpace.ResolveTypeExpr): Thin layer over
11501         Expression.ResolveAsTypeTerminal.
11502         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
11503         Refactor code into NestedAccess.  Use it.
11504         (DeclSpace.NestedAccess): New.
11505         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
11506         argument to silence errors.  Check access permissions.
11507         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
11508         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
11509         (Cast.DoResolve): Likewise.
11510         (New.DoResolve): Likewise.
11511         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
11512         (TypeOf.DoResolve): Likewise.
11513
11514         * expression.cs (Invocation.BetterConversion): Return the Type of
11515         the better conversion.  Implement section 14.4.2.3 more faithfully.
11516         (Invocation.BetterFunction): Make boolean.  Make correspondence to
11517         section 14.4.2.2 explicit.
11518         (Invocation.OverloadResolve): Update.
11519         (Invocation): Remove is_base field.
11520         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
11521         (Invocation.Emit): Likewise.
11522
11523 2004-09-27  Raja R Harinath  <rharinath@novell.com>
11524
11525         * README: Update to changes.
11526
11527 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
11528
11529         * cs-parser.jay: Reverted 642 warning fix.
11530
11531 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11532
11533         Fix bug #66615
11534         * decl.cs (FindMemberWithSameName): Indexer can have more than
11535         1 argument.
11536
11537 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11538
11539         * expression.cs (LocalVariableReference.DoResolveLValue):
11540         Do not report warning 219 for out values.
11541         (EmptyExpression.Null): New member to avoid extra allocations.
11542
11543 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11544
11545         * cs-parser.jay: Fix wrong warning 642 report.
11546
11547         * cs-tokenizer.cs (CheckNextToken): New helper;
11548         Inspect next character if is same as expected.
11549
11550 2004-09-23  Martin Baulig  <martin@ximian.com>
11551
11552         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
11553         (Convert.ImplicitReferenceConversionExists): Likewise.
11554
11555 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11556
11557         * class.cs (Operator.Define): Add error 448 and 559 report.
11558
11559 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
11560
11561         * class.cs (MemberBase.IsTypePermitted): New protected
11562         method for checking error CS0610.
11563
11564 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
11565
11566         * class.cs (TypeContainer.HasExplicitLayout): New property
11567         Returns whether container has StructLayout attribute set Explicit.
11568         (FieldMember): New abstract class for consts and fields.
11569         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
11570         (Field): Reuse FieldMember.
11571
11572         * const.cs (Const): Reuse FieldMember.
11573
11574         * rootcontext.cs: EmitConstants call moved to class.
11575
11576 2004-09-22  Martin Baulig  <martin@ximian.com>
11577
11578         Thanks to Peter Sestoft for this bug report.
11579
11580         * expression.cs (Conditional): If both the `trueExpr' and the
11581         `falseExpr' is a NullLiteral, return a NullLiteral.
11582
11583 2004-09-22  Martin Baulig  <martin@ximian.com>
11584
11585         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
11586         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
11587         for the "get_Current" call.
11588
11589 2004-09-22  Martin Baulig  <martin@ximian.com>
11590
11591         Marek and me just fixed one of our oldest bugs: #28562 :-)
11592
11593         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
11594
11595         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
11596         we're an EnumConstant, just return that.
11597         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
11598         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
11599         to get the value which'll actually be written into the attribute.
11600         However, we have to use GetValue() to access the attribute's value
11601         in the compiler.        
11602
11603 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
11604
11605         * constant.cs (Constant.IsNegative): New abstract property
11606         IsNegative.
11607
11608         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
11609         (StackAlloc.DoResolve): Reused IsNegative.
11610
11611 2004-09-21  Martin Baulig  <martin@ximian.com>
11612
11613         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
11614         if we're used in an iterator, we may be called from different
11615         methods.
11616
11617         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
11618         we actually have an exception block.
11619
11620 2004-09-20  John Luke <jluke@cfl.rr.com>
11621
11622         * class.cs, cs-parser.jay: Improve the error report for 1520:
11623         report the actual line where the error happens, not where the
11624         class was declared.
11625
11626         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
11627         Pass location information that was available elsewhere.
11628
11629 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
11630
11631         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
11632         runtime to delay sign assemblies.
11633
11634 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
11635
11636         * cs-parser.jay: Do not report the stack trace, this is barely
11637         used nowadays.
11638
11639 2004-08-22  John Luke  <john.luke@gmail.com>
11640  
11641         * driver.cs : check that a resource id is not already used
11642         before adding it, report CS1508 if it is, bug #63637
11643
11644 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
11645
11646         * ecore.cs: Removed dead code.
11647
11648 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
11649
11650         * class.cs: Do not report warning CS0067 on the interfaces.
11651
11652 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
11653
11654         * cs-parser.jay: Add error 504 report.
11655
11656 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
11657
11658         * rootcontext.cs: WarningLevel is 4 by default now.
11659
11660         * statement.cs (Fixed.Resolve): Do not null
11661         VariableInfo.
11662
11663 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
11664
11665         Fixed bug #55780
11666         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
11667         deep search when property is not virtual.
11668         (PropertyExpr.ResolveAccessors): Make one call for both
11669         accessors.
11670
11671 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11672
11673         Fixed bug #65766
11674         * statement.cs: Error 152 report constains also location.
11675
11676 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11677
11678         Fixed bug #65766
11679         * const.cs: Explicitly set constant as static.
11680
11681 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11682
11683         Fixed bug #64226
11684         * cs-parser.jay: Add error 1017 report.
11685
11686 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11687
11688         Fixed bug #59980, #64224
11689         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
11690
11691         * typemanager.cs (IsSpecialMethod): Simplified
11692
11693 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
11694
11695         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
11696         condition with better params.
11697
11698 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
11699
11700         Fixed bug #65238
11701         * attribute.cs (Resolve): Property has to have both
11702         accessors.
11703
11704 2004-09-14  Martin Baulig  <martin@ximian.com>
11705
11706         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
11707
11708 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
11709
11710         Fixed bug #61902
11711         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
11712         called and is obsolete then this member suppress message
11713         when call is inside next [Obsolete] method or type.
11714
11715         * expression.cs: Use TestObsoleteMethodUsage member.
11716
11717 2004-09-14  Martin Baulig  <martin@ximian.com>
11718
11719         * cs-parser.jay: Sync a bit with the GMCS version.
11720
11721 2004-09-14  Martin Baulig  <martin@ximian.com>
11722
11723         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
11724         (CSharpParser.yacc_verbose_flag): New public field.
11725
11726         * genericparser.cs: Removed.
11727
11728 2004-09-14  Raja R Harinath  <rharinath@novell.com>
11729
11730         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
11731
11732 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
11733
11734         * class.cs (MethodCore.CheckBase): Fix bug #65757.
11735
11736 2004-09-10  Martin Baulig  <martin@ximian.com>
11737
11738         Backported my MemberName changes from GMCS into MCS.
11739
11740         - we are now using a special `MemberName' class instead of using
11741         strings; in GMCS, the `MemberName' also contains the type
11742         arguments.
11743
11744         - changed the grammar rules a bit:
11745           * the old `member_name' is now a `namespace_or_type_name':
11746             The rule is that we use `namespace_or_type_name' everywhere
11747             where we expect either a "member name" (GetEnumerator) or a
11748             "member name" with an explicit interface name
11749             (IEnumerable.GetEnumerator).
11750             In GMCS, the explicit interface name may include type arguments
11751             (IEnumerable<T>.GetEnumerator).
11752           * we use `member_name' instead of just `IDENTIFIER' for
11753             "member names":
11754             The rule is that we use `member_name' wherever a member may
11755             have type parameters in GMCS.       
11756
11757         * decl.cs (MemberName): New public class.
11758         (MemberCore.MemberName): New public readonly field.
11759         (MemberCore.ctor): Take a `MemberName' argument, not a string.
11760         (DeclSpace): Likewise.
11761
11762         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
11763         * enum.cs (Enum.ctor): Likewise.
11764
11765         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
11766         MemberName.     
11767         (AliasEntry.ctor): Take a MemberName, not an Expression.
11768         (AliasEntry.UsingAlias): Likewise.
11769
11770         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
11771         (IMethodData.MemberName): Changed type from string to MemberName.
11772         (MemberBase.ExplicitInterfaceName): Likewise.
11773         (AbstractPropertyEventMethod.SetupName): Make this private.
11774         (AbstractPropertyEventMethod.ctor): Added `string prefix'
11775         argument; compute the member name here.
11776         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
11777         on the `member.MemberName' and the `prefix'.
11778
11779         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
11780         not `type_name'.
11781         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
11782         thus, we get a `MemberName' instead of a `string'.  These
11783         declarations may have type parameters in GMCS.
11784         (interface_method_declaration, delegate_declaration): Likewise.
11785         (class_declaration, interface_declaration): Likewise.
11786         (method_header): Use `namespace_or_type_name' instead of
11787         `member_name'.  We may be an explicit interface implementation.
11788         (property_declaration, event_declaration): Likewise.
11789         (member_name): This is now just an `IDENTIFIER', not a
11790         `namespace_or_type_name'.
11791         (type_name, interface_type): Removed.
11792         (namespace_or_type_name): Return a MemberName, not an Expression.
11793         (primary_expression): Use `member_name' instead of `IDENTIFIER';
11794         call GetTypeExpression() on the MemberName to get an expression.
11795         (IndexerDeclaration.interface_type): Changed type from string to
11796         MemberName.
11797         (MakeName): Operate on MemberName's instead of string's.
11798
11799 2004-09-13  Raja R Harinath  <rharinath@novell.com>
11800
11801         Fix bug #55770.
11802         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
11803         (NamespaceEntry.Lookup): Add new argument to flag if we want the
11804         lookup to avoid symbols introduced by 'using'.
11805         * rootcontext.cs (NamespaceLookup): Update.
11806
11807 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
11808
11809         * class.cs (TypeContainer.DoDefineMembers): Do not call
11810         DefineDefaultConstructor for static classes.
11811
11812 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
11813
11814         * attribute.cs (Attribute.Resolve): Add error 653 report.
11815
11816         * class.cs (Class.ApplyAttributeBuilder): Add error 641
11817         report.
11818         (Method.ApplyAttributeBuilder): Add error 685 report.
11819         (Operator.Define): Add error 564 report.
11820
11821         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
11822
11823         * expression.cs (Invocation.DoResolve): Add error
11824         245 and 250 report.
11825
11826         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
11827         error 674 report.
11828
11829 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
11830
11831         * class.cs (ConstructorInitializer.Resolve):
11832         Wrong error number (515->516).
11833
11834 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
11835
11836         * class.cs (Indexer.Define): Add error 631 report.
11837
11838 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
11839
11840         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
11841
11842 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
11843
11844         * expression.cs (Probe.DoResolve): Add error CS0241 report.
11845
11846 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
11847
11848         * cs-parser.jay: Added error CS0241 report.
11849
11850 2004-09-10  Raja R Harinath  <rharinath@novell.com>
11851
11852         * cs-parser.jay (fixed_statement): Introduce a scope for the
11853         declaration in the 'fixed' statement.
11854
11855 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
11856
11857         * cs-parser.jay: Added CS0230 error report.
11858
11859 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
11860
11861         * cs-parser.jay: Added errors CS0231 and CS0257 report.
11862
11863 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
11864
11865         * expression.cs (Argument.Resolve): Added error CS0192 and
11866         CS0199 report.
11867
11868 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
11869
11870         C# 2.0 #pragma warning feature
11871
11872         * cs-tokenizer.cs (PreProcessPragma): New method; 
11873         Handles #pragma directive.
11874
11875         * report.cs (WarningRegions): New class; Support
11876         class for #pragma warning directive. It tests whether
11877         warning is enabled for a given line.
11878
11879 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
11880
11881         * const.cs: Add more descriptive error report, tahnks to
11882         Sebastien. 
11883
11884 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
11885
11886         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
11887
11888 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
11889
11890         * expression.cs: Apply patch from Ben: Remove dead code from
11891         ArrayCreation, and remove the TurnintoConstant call in const.cs,
11892         as that code just threw an exception anwyays.
11893
11894         * const.cs: Remove the call to the turnintoconstant, for details
11895         see bug: #63144
11896         
11897         * literal.cs: The type of the null-literal is the null type;  So
11898         we use a placeholder type (literal.cs:System.Null, defined here)
11899         for it.
11900
11901         * expression.cs (Conditional.DoResolve): Remove some old code that
11902         is no longer needed, conversions have been fixed.
11903
11904         (ArrayCreationExpression.DoResolve): Return false if we fail to
11905         resolve the inner expression.
11906
11907 2004-09-07  Raja R Harinath  <rharinath@novell.com>
11908
11909         Fix test-290.cs.
11910         * cs-parser.jay (delegate_declaration): Record a delegate
11911         declaration as a type declaration.
11912         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
11913
11914 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
11915
11916         * parameter.cs: Do not crash if the type can not be resolved. 
11917
11918         * expression.cs: Report errors with unsafe pointers, fixes #64896
11919
11920 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
11921
11922         * expression.cs: Pointer arith always needs to do a conv.i
11923         if the operand is a long. fix 65320
11924
11925 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
11926
11927         Fixed cs0619-37.cs, cs0619-38.cs
11928
11929         * enum.cs (GetObsoleteAttribute): Removed.
11930
11931         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
11932         on Enum member is double staged. The first is tested member
11933         and then enum.
11934
11935 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
11936
11937         Fixed #56986, #63631, #65231
11938
11939         * class.cs: (TypeContainer.AddToMemberContainer): New method,
11940         adds member to name container.
11941         (TypeContainer.AddToTypeContainer): New method, adds type to
11942         name container.
11943         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
11944         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
11945         AddOperator): Simplified by reusing AddToMemberContainer.
11946         (TypeContainer.UserDefinedStaticConstructor): Changed to property
11947         instead of field.
11948         (Method.CheckForDuplications): Fixed implementation to test all
11949         possibilities.
11950         (MemberBase): Detection whether member is explicit interface
11951         implementation is now in constructor.
11952         (MemberBase.UpdateMemberName): Handles IndexerName.
11953         (Accessor): Changed to keep also location information.
11954         (AbstractPropertyEventMethod): Is derived from MemberCore.
11955         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
11956         will be emited or not.
11957         (PropertyBase.AreAccessorsDuplicateImplementation):
11958         Tests whether accessors are not in collision with some method.
11959         (Operator): Is derived from MethodCore to simplify common
11960         operations.
11961
11962         * decl.cs (Flags.TestMethodDuplication): Test for duplication
11963         must be performed.
11964         (DeclSpace.AddToContainer): Adds the member to defined_names
11965         table. It tests for duplications and enclosing name conflicts.
11966
11967         * enum.cs (EnumMember): Clean up to reuse the base structures
11968
11969 2004-09-03  Martin Baulig  <martin@ximian.com>
11970
11971         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
11972         into TypeContainer, to make partial classes work again.
11973
11974 2004-09-03  Martin Baulig  <martin@ximian.com>
11975
11976         * rootcontext.cs (RootContext.V2): Removed.
11977
11978 2004-03-23  Martin Baulig  <martin@ximian.com>
11979
11980         * expression.cs (Invocation.OverloadResolve): Added `bool
11981         may_fail' argument and use it instead of the Location.IsNull() hack.
11982
11983 2004-09-03  Martin Baulig  <martin@ximian.com>
11984
11985         Merged latest changes into gmcs.  Please keep this comment in
11986         here, it makes it easier for me to see what changed in MCS since
11987         the last time I merged.
11988
11989 2004-09-03  Raja R Harinath  <rharinath@novell.com>
11990
11991         Fix #61128.
11992         * expression.cs (BetterConversion): Don't allow either conversion 
11993         to be null.  Remove redundant implicit conversion test when 'q ==
11994         null' -- when this function is invoked, we already know that the
11995         implicit conversion exists.
11996         (BetterFunction): Assume that 'best' is non-null.  Remove
11997         redundant reimplementation of IsApplicable when 'best' is null.
11998         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
11999         number of arguments.
12000         (IsAncestralType): Extract from OverloadResolve.
12001         (OverloadResolve): Make robust to the MethodGroupExpr being
12002         unsorted.  Implement all the logic of Section 14.5.5.1, and
12003         support overloading of methods from multiple applicable types.
12004         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
12005
12006         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
12007         (RealError, Warning): Append type of report to related symbol.
12008
12009 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
12010
12011         * enum.cs: Fixed CLS-Compliance checks for enum members.
12012         Error tests cs3008-8.cs, cs3014-8.cs
12013
12014 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
12015
12016         Fixed bug #62342, #63102
12017         * class.cs: ImplementIndexer uses member.IsExplicitImpl
12018         like ImplementMethod.
12019
12020 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
12021
12022         * attribute.cs (Attribute.GetAttributeArgumentExpression):
12023         Fixed bug #65170.
12024
12025 2004-09-02  Martin Baulig  <martin@ximian.com>
12026
12027         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
12028         TypeManager.GetArgumentTypes() rather than calling GetParameters()
12029         on the MethodBase.
12030
12031 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
12032
12033         C# 2.0 Static classes implemented
12034
12035         * class.cs (TypeContainer): instance_constructors,
12036         initialized_fields, initialized_static_fields,
12037         default_constructor, base_inteface_types are protected to be
12038         accessible from StaticClass.
12039         (TypeContainer.DefineDefaultConstructor): New virtual method
12040         for custom default constructor generating
12041         (StaticClass): New class to handle "Static classes" feature.
12042
12043         * cs-parser.jay: Handle static keyword on class like instance
12044         of StaticClass.
12045
12046         * driver.cs: Added "/langversion" command line switch with two
12047         options (iso-1, default).
12048
12049 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
12050
12051         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
12052
12053 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
12054
12055         * delegate.cs: Style.
12056
12057 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12058
12059         * delegate.cs: Add seperate instance expr field for miguel.
12060
12061 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12062
12063         * PointerArithmetic (Resolve): make sure we are not doing
12064         pointer arith on void*. Also, make sure we are resolved
12065         by not setting eclass until resolve.
12066
12067         All callers: Make sure that PointerArithmetic gets resolved.
12068
12069 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12070
12071         * ArrayCreation (LookupType): If the type does not resolve 
12072         to an array, give an error.
12073
12074 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
12075
12076         * statement.cs (Try.Resolve): Fixed bug #64222
12077
12078 2004-08-27  Martin Baulig  <martin@ximian.com>
12079
12080         * class.cs
12081         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
12082         crash here.     
12083
12084 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
12085
12086         * ecore.cs (Constantify): Get underlying type via
12087         System.Enum.GetUnderlyingType to avoid StackOverflow on the
12088         Windows in special cases.
12089
12090 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
12091
12092         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
12093         for obtaining also private methods.
12094         (GetRemoveMethod): Used GetRemoveMethod (true)
12095         for obtaining also private methods.
12096
12097 2004-08-24  Martin Baulig  <martin@ximian.com>
12098
12099         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
12100         MethodAttributes.HideBySig for operators.
12101
12102 2004-08-23  Martin Baulig  <martin@ximian.com>
12103
12104         Back to the old error reporting system :-)
12105
12106         * report.cs (Message): Removed.
12107         (Report.MessageData, ErrorData, WarningData): Removed.
12108         (Report.Error, Warning): Back to the old system.
12109
12110 2004-08-23  Martin Baulig  <martin@ximian.com>
12111
12112         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
12113
12114         * class.cs (TypeContainer.ParentContainer): New public virtual
12115         method; replaces the explicit interface implementation.
12116         (ClassPart.ParentContainer): Override.
12117
12118 2004-08-23  Martin Baulig  <martin@ximian.com>
12119
12120         * statement.cs (Switch): Added support for constant switches; see
12121         #59428 or test-285.cs.
12122
12123 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
12124
12125         Fixed bug #62740.
12126         * statement.cs (GetEnumeratorFilter): Removed useless
12127         logic because C# specs is strict. GetEnumerator must be
12128         public.
12129
12130 2004-08-22  Martin Baulig  <martin@ximian.com>
12131
12132         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12133         a switch and may break, reset the barrier.  Fixes #59867.
12134
12135 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
12136
12137         CLS-Compliance speed up (~5% for corlib)
12138
12139         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
12140         New method. Tests container for CLS-Compliant names
12141
12142         * class.cs (TypeContainer.VerifyClsName): New method.
12143         Checks whether container name is CLS Compliant.
12144         (Constructor): Implements IMethodData.
12145
12146         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
12147         low-case table for CLS Compliance test.
12148         (MemberCache.VerifyClsParameterConflict): New method.
12149         Checks method parameters for CS3006 error.
12150
12151         * enum.cs (EnumMember): Is derived from MemberCore.
12152         (Enum.VerifyClsName): Optimized for better performance.
12153
12154 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
12155
12156         * report.cs: Renamed Error_T to Error and changed all
12157         references.
12158
12159 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
12160
12161         * class.cs (TypeContainer.IndexerArrayList): New inner class
12162         container for indexers.
12163         (TypeContainer.DefaultIndexerName): New constant for default
12164         indexer name. Replaced all "Item" with this constant.
12165         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
12166
12167         * typemanager.cs (TypeManager.default_member_ctor): Cache here
12168         DefaultMemberAttribute constructor.
12169
12170 2004-08-05  Martin Baulig  <martin@ximian.com>
12171
12172         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
12173         Fix bug #59429.
12174
12175 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
12176
12177         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
12178         multi platforms problem.
12179
12180         * compiler.csproj: Included shared files.
12181
12182 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
12183
12184         Fix bug 60333, 55971 in the more general way
12185         * attribute.cs (Attribute.GetAttributeArgumentExpression):
12186         Added arg_type argument for constant conversion.
12187         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
12188
12189 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
12190
12191         Fix bug #59760
12192         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
12193         OperatorArrayList, MethodCoreArrayList for typecontainer
12194         containers. Changed class member types to these new types.
12195         (MethodArrayList.DefineMembers): Added test for CS0659.
12196
12197 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
12198
12199         * cfold.cs: Synchronize the folding with the code in expression.cs
12200         Binary.DoNumericPromotions for uint operands.
12201
12202         * attribute.cs: Revert patch from Raja, it introduced a regression
12203         while building Blam-1.2.1 (hard to isolate a test case).
12204
12205 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
12206
12207         Fix for #55382
12208         * class.cs:
12209         (TypeContainer.Define): Renamed to DefineContainerMembers because of
12210         name collision.
12211         (MethodCore.parent_method): New member. The method we're overriding
12212         if this is an override method.
12213         (MethodCore.CheckBase): Moved from Method class and made common.
12214         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
12215         private.
12216         (MethodCore.CheckForDuplications): New abstract method. For custom
12217         member duplication search in a container
12218         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
12219         method and its return type.
12220         (Event.conflict_symbol): New member. Symbol with same name in the
12221         parent class.
12222
12223         * decl.cs:
12224         (MemberCache.FindMemberWithSameName): New method. The method
12225         is looking for conflict with inherited symbols.
12226
12227 2004-08-04  Martin Baulig  <martin@ximian.com>
12228
12229         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
12230
12231         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
12232
12233 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
12234
12235         * report.cs (Message): New enum for better error, warning reference in
12236         the code.
12237         (MessageData): New inner abstract class. It generally handles printing of
12238         error and warning messages.
12239         Removed unused Error, Warning, Message methods.
12240
12241 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
12242
12243         Fix for cs0592-8.cs test
12244         * attribute.cs
12245         (Attributable.ValidAttributeTargets): Made public.
12246         (Attribute.ExplicitTarget): New member for explicit target value.
12247         (Attribute.CheckTargets): Now we translate explicit attribute
12248         target to Target here.
12249
12250 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
12251
12252         * ecore.cs (MethodGroupExpr): new IsBase property.
12253
12254         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
12255
12256         * delegate.cs (DelegateCreation): store a MethodGroupExpr
12257         rather than an instance expr.
12258
12259         (DelegateCreation.Emit): Use the method group rather than
12260         the instance expression. Also, if you have base.Foo as the
12261         method for a delegate, make sure to emit ldftn, not ldftnvirt.
12262
12263         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
12264
12265         (NewDelegate.DoResolve): Only check for the existance of Invoke
12266         if the method is going to be needed. Use MethodGroupExpr.
12267
12268         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
12269
12270         * expression.cs: For pointer arith., make sure to use
12271         the size of the type, not the size of the pointer to
12272         the type.
12273
12274 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
12275
12276         Fix for #60722
12277         * class.cs (Class): Added error CS0502 test.
12278
12279 2004-08-03  John Luke  <jluke@cfl.rr.com>
12280             Raja R Harinath  <rharinath@novell.com>
12281
12282         Fix for #60997.
12283         * attribute.cs (Attribute.complained_before): New flag.
12284         (Attribute.ResolveType, Attribute.Resolve),
12285         (Attribute.DefinePInvokeMethod): Set it.
12286         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
12287         
12288 2004-08-03  Martin Baulig  <martin@ximian.com>
12289
12290         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
12291         use a user-defined operator; we still need to do numeric
12292         promotions in case one argument is a builtin type and the other
12293         one has an implicit conversion to that type.  Fixes #62322.
12294
12295 2004-08-02  Martin Baulig  <martin@ximian.com>
12296
12297         * statement.cs (LocalInfo.Flags): Added `IsThis'.
12298         (LocalInfo.IsThis): New public property.
12299         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
12300
12301 2004-08-01  Martin Baulig  <martin@ximian.com>
12302
12303         * class.cs (TypeContainer.GetClassBases): Don't set the default
12304         here since we may get called from GetPartialBases().
12305         (TypeContainer.DefineType): If GetClassBases() didn't return a
12306         parent, use the default one.
12307
12308 2004-07-30  Duncan Mak  <duncan@ximian.com>
12309
12310         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
12311
12312 2004-07-30  Martin Baulig  <martin@ximian.com>
12313
12314         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
12315
12316         * class.cs (SourceMethod): New public class, derive from the
12317         symbol writer's ISourceMethod.
12318         (Method): Use the new symbol writer API.
12319
12320         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
12321         as argument and use the new symbol writer.
12322
12323         * location.cs
12324         (SourceFile): Implement the symbol writer's ISourceFile.
12325         (Location.SymbolDocument): Removed.
12326         (Location.SourceFile): New public property.
12327
12328         * symbolwriter.cs: Use the new symbol writer API.
12329
12330 2004-07-30  Raja R Harinath  <rharinath@novell.com>
12331
12332         * Makefile (install-local): Remove.  Functionality moved to
12333         executable.make.
12334
12335 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
12336
12337         * Makefile: Install mcs.exe.config file together with mcs.exe.
12338         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
12339         correct runtime version.
12340         
12341 2004-07-25  Martin Baulig  <martin@ximian.com>
12342
12343         * class.cs
12344         (TypeContainer.RegisterOrder): Removed, this was unused.
12345         (TypeContainer, interface_order): Removed.
12346         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
12347         TypeContainer as argument since we can also be called with a
12348         `PartialContainer' for a partial class/struct/interface.
12349         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
12350         of checking whether we're an `Interface' - we could be a
12351         `PartialContainer'.
12352         (PartialContainer.Register): Override; call
12353         AddClass()/AddStruct()/AddInterface() on our parent.
12354
12355         * cs-parser.jay (interface_member_declaration): Add things to the
12356         `current_container', not the `current_class'.
12357
12358         * rootcontext.cs (RegisterOrder): The overloaded version which
12359         takes an `Interface' was unused, removed.
12360
12361         * typemanager.cs (TypeManager.LookupInterface): Return a
12362         `TypeContainer', not an `Interface'.
12363         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
12364         contain a `PartialContainer' for an interface, so check it's
12365         `Kind' to figure out what it is.
12366
12367 2004-07-25  Martin Baulig  <martin@ximian.com>
12368
12369         * class.cs (Class.DefaultTypeAttributes): New public constant.
12370         (Struct.DefaultTypeAttributes): Likewise.
12371         (Interface.DefaultTypeAttributes): Likewise.
12372         (PartialContainer.TypeAttr): Override this and add the
12373         DefaultTypeAttributes.
12374
12375 2004-07-25  Martin Baulig  <martin@ximian.com>
12376
12377         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
12378         we can just use the `Parent' field instead.
12379
12380 2004-07-25  Martin Baulig  <martin@ximian.com>
12381
12382         * class.cs (TypeContainer.Emit): Renamed to EmitType().
12383
12384 2004-07-25  Martin Baulig  <martin@ximian.com>
12385
12386         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
12387         our parts before defining any methods.
12388         (TypeContainer.VerifyImplements): Make this virtual.
12389         (ClassPart.VerifyImplements): Override and call VerifyImplements()
12390         on our PartialContainer.
12391
12392 2004-07-25  Martin Baulig  <martin@ximian.com>
12393
12394         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
12395
12396         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
12397         argument, we can just use the `Parent' field instead.
12398
12399         * class.cs
12400         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
12401         (MemberBase.DoDefine): Likewise.
12402
12403 2004-07-24  Martin Baulig  <martin@ximian.com>
12404
12405         * decl.cs (MemberCore.Parent): New public field.
12406         (DeclSpace.Parent): Moved to MemberCore.
12407
12408         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
12409         (MemberBase.ctor): Added TypeContainer argument, pass it to our
12410         parent's .ctor.
12411         (FieldBase, Field, Operator): Likewise.
12412         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
12413         (EventField, Event): Likewise.
12414
12415 2004-07-23  Martin Baulig  <martin@ximian.com>
12416
12417         * class.cs (PartialContainer): New public class.
12418         (ClassPart): New public class.
12419         (TypeContainer): Added support for partial classes.
12420         (TypeContainer.GetClassBases): Splitted some of the functionality
12421         out into GetNormalBases() and GetPartialBases().
12422
12423         * cs-tokenizer.cs (Token.PARTIAL): New token.
12424         (Tokenizer.consume_identifier): Added some hacks to recognize
12425         `partial', but only if it's immediately followed by `class',
12426         `struct' or `interface'.
12427
12428         * cs-parser.jay: Added support for partial clases.
12429
12430 2004-07-23  Martin Baulig  <martin@ximian.com>
12431
12432         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
12433         a `DeclSpace' and also made it readonly.
12434         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
12435         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
12436         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
12437
12438         * cs-parser.jay: Pass the `current_class', not the
12439         `current_container' (at the moment, this is still the same thing)
12440         to a new Method, Property, Event, Indexer or Constructor.
12441
12442 2004-07-23  Martin Baulig  <martin@ximian.com>
12443
12444         * cs-parser.jay (CSharpParser): Added a new `current_class' field
12445         and removed the `current_interface' one.
12446         (struct_declaration, class_declaration, interface_declaration):
12447         Set `current_class' to the newly created class/struct/interface;
12448         set their `Bases' and call Register() before parsing their body.
12449
12450 2004-07-23  Martin Baulig  <martin@ximian.com>
12451
12452         * class.cs (Kind): New public enum.
12453         (TypeContainer): Made this class abstract.
12454         (TypeContainer.Kind): New public readonly field.
12455         (TypeContainer.CheckDef): New public method; moved here from
12456         cs-parser.jay.
12457         (TypeContainer.Register): New public abstract method.
12458         (TypeContainer.GetPendingImplementations): New public abstract
12459         method.
12460         (TypeContainer.GetClassBases): Removed the `is_class' and
12461         `is_iface' parameters.
12462         (TypeContainer.DefineNestedTypes): Formerly known as
12463         DoDefineType().
12464         (ClassOrStruct): Made this class abstract.
12465
12466         * tree.cs (RootTypes): New public type. 
12467
12468 2004-07-20  Martin Baulig  <martin@ximian.com>
12469
12470         * tree.cs (Tree.RecordNamespace): Removed.
12471         (Tree.Namespaces): Removed.
12472
12473         * rootcontext.cs (RootContext.IsNamespace): Removed.
12474
12475         * cs-parser.jay (namespace_declaration): Just create a new
12476         NamespaceEntry here.
12477
12478 2004-07-20  Martin Baulig  <martin@ximian.com>
12479
12480         * statement.cs (ExceptionStatement): New abstract class.  This is
12481         now used as a base class for everyone who's using `finally'.
12482         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
12483         our local variables before using them.
12484
12485         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
12486         virtual method.  This is used by Yield.Resolve() to "steal" an
12487         outer block's `finally' clauses.
12488         (FlowBranchingException): The .ctor now takes an ExceptionStatement
12489         argument.
12490
12491         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
12492         version which takes an ExceptionStatement.  This version must be
12493         used to create exception branchings.
12494
12495         * iterator.cs
12496         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
12497         (Iterator.EmitMoveNext): Added exception support; protect the
12498         block with a `fault' clause, properly handle 'finally' clauses.
12499         (Iterator.EmitDispose): Run all the `finally' clauses here.
12500
12501 2004-07-20  Martin Baulig  <martin@ximian.com>
12502
12503         * iterator.cs: This is the first of a set of changes in the
12504         iterator code.  Match the spec more closely: if we're an
12505         IEnumerable, then GetEnumerator() must be called.  The first time
12506         GetEnumerator() is called, it returns the current instance; all
12507         subsequent invocations (if any) must create a copy.
12508
12509 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
12510
12511         * expression.cs: Resolve the constant expression before returning
12512         it. 
12513
12514 2004-07-19  Martin Baulig  <martin@ximian.com>
12515
12516         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
12517         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
12518         the return type of the new EmitContext.
12519
12520 2004-07-18  Martin Baulig  <martin@ximian.com>
12521
12522         * class.cs (Property.Define): Fix iterators.
12523
12524         * iterators.cs (Iterator.Define): Moved the
12525         `container.AddInterator (this)' call here from the .ctor; only do
12526         it if we resolved successfully.
12527
12528 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
12529
12530         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
12531         `true' for preprocessing directives that we parse.  The return
12532         value indicates whether we should return to regular tokenizing or
12533         not, not whether it was parsed successfully.
12534
12535         In the past if we were in: #if false ... #line #endif, we would
12536         resume parsing after `#line'.  See bug 61604.
12537
12538         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
12539         building: IsEnumType should return true only for enums, not for
12540         enums or System.Enum itself.  This fixes #61593.
12541
12542         Likely what happened is that corlib was wrong: mcs depended on
12543         this bug in some places.  The bug got fixed, we had to add the
12544         hack, which caused bug 61593.
12545
12546         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
12547         that was a workaround for the older conditions.
12548
12549 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
12550
12551         * assign.cs: IAssignMethod has a new interface, as documented
12552         inline. All assignment code now uses this new api.
12553
12554         * ecore.cs, expression.cs: All classes which implement
12555         IAssignMethod now use the new interface.
12556
12557         * expression.cs (Invocation): add a hack to EmitCall so that
12558         IndexerAccess can be the target of a compound assignment without
12559         evaluating its arguments twice.
12560
12561         * statement.cs: Handle changes in Invocation api.
12562
12563 2004-07-16  Martin Baulig  <martin@ximian.com>
12564
12565         * iterators.cs: Rewrote this.  We're now using one single Proxy
12566         class for both the IEnumerable and the IEnumerator interface and
12567         `Iterator' derives from Class so we can use the high-level API.
12568
12569         * class.cs (TypeContainer.AddIterator): New method.
12570         (TypeContainer.DoDefineType): New protected virtual method, which
12571         is called from DefineType().
12572         (TypeContainer.DoDefineMembers): Call DefineType() and
12573         DefineMembers() on all our iterators.
12574         (TypeContainer.Emit): Call Emit() on all our iterators.
12575         (TypeContainer.CloseType): Call CloseType() on all our iterators.
12576
12577         * codegen.cs (EmitContext.CurrentIterator): New public field.
12578
12579 2004-07-15  Martin Baulig  <martin@ximian.com>
12580
12581         * typemanager.cs
12582         (TypeManager.not_supported_exception_type): New type.   
12583
12584 2004-07-14  Martin Baulig  <martin@ximian.com>
12585
12586         * iterators.cs: Use real error numbers.
12587
12588 2004-07-14  Martin Baulig  <martin@ximian.com>
12589
12590         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
12591         requires this to be a System.Collection.IEnumerable and not a
12592         class implementing that interface.
12593         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
12594
12595 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
12596
12597         * class.cs: Fixed previous fix, it broke some error tests.
12598
12599 2004-07-12  Martin Baulig  <martin@ximian.com>
12600
12601         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
12602         Fixes #61293.
12603
12604 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
12605
12606         * assign.cs (LocalTemporary): Add new argument: is_address,If
12607         `is_address' is true, then the value that we store is the address
12608         to the real value, and not the value itself.
12609         
12610         * ecore.cs (PropertyExpr): use the new local temporary
12611         stuff to allow us to handle X.Y += z (where X is a struct)
12612
12613 2004-07-08  Martin Baulig  <martin@ximian.com>
12614
12615         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
12616         not always return, just like we're doing in Using.Resolve().
12617
12618 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
12619
12620         * cs-parser.jay (fixed_statement): flag this as Pinned.
12621
12622 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
12623
12624         * typemanager.cs (TypeManager): Removed MakePinned method, this
12625         mechanism is replaced with the .NET 2.x compatible mechanism of
12626         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
12627
12628         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
12629         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
12630         `IsFixed' property which has a different meaning.
12631
12632 2004-07-02  Raja R Harinath  <rharinath@novell.com>
12633
12634         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
12635         visible from inside a nested class, not just the names of the
12636         immediately enclosing class.
12637         Fix for bug #60730.
12638
12639 2004-06-24  Raja R Harinath  <rharinath@novell.com>
12640
12641         * expression.cs (BetterConversion): Remove buggy special-case
12642         handling of "implicit constant expression conversions".  At this
12643         point, we already know that the conversion is possible -- we're
12644         only checking to see which is better.
12645
12646 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12647
12648         * cs-parser.jay: Added error CS0210 test.
12649
12650 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12651
12652         * cs-parser.jay: Added error CS0134 test.
12653
12654 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12655
12656         Fix bug #52507
12657         * cs-parser.jay: Added error CS0145 test.
12658
12659 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12660
12661         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
12662
12663 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
12664         
12665         * expression.cs (StackAlloc.Resolve): The argument may not
12666         be a constant; deal with this case.
12667         
12668 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
12669
12670         * attribute.cs (IndexerName_GetIndexerName): Renamed to
12671         GetIndexerAttributeValue.
12672         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
12673
12674         * class.cs (Indexer.Define): Added error tests for CS0415,
12675         CS0609.
12676
12677 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
12678
12679         * attribute.cs (Attribute.Resolve): Keep field code in sync with
12680         property code.
12681
12682 2004-06-23  Martin Baulig  <martin@ximian.com>
12683
12684         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
12685         neither return nor throw, reset the barrier as well.  Fixes #60457.
12686
12687 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
12688
12689         * class.cs : EventAttributes is now set to None by default.
12690           This fixes bug #60459.
12691
12692 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
12693
12694         Fix bug #60219
12695         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
12696         Don't throw exception but return null (it's sufficient now).
12697
12698 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
12699
12700         * typemanager.cs (GetArgumentTypes): Faster implementation.
12701
12702 2004-06-18  Martin Baulig  <martin@ximian.com>
12703
12704         * attribute.cs (Attribute.Resolve): Check whether we're an
12705         EmptyCast which a Constant child.  Fixes #60333.
12706
12707 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
12708
12709         * statement.cs (EmitCollectionForeach): Account for the fact that
12710         not all valuetypes are in areas which we can take the address of.
12711         For these variables, we store to a temporary variable. Also, make
12712         sure that we dont emit a `callvirt' on a valuetype method.
12713
12714 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
12715
12716         * expression.cs (StackAlloc.DoReSolve): Added test for
12717         negative parameter (CS0247).
12718
12719 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
12720
12721         Fix bug #59792
12722         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
12723
12724 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
12725
12726         Fix bug #59781
12727         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
12728         ulong.
12729
12730 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
12731
12732         Fix bug #58254 & cs1555.cs, cs1556.cs
12733         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
12734
12735 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
12736
12737         * cs-parser.jay: Added error CS1669 test for indexers.
12738
12739 2004-06-11  Martin Baulig  <martin@ximian.com>
12740
12741         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
12742         call this twice: for params and varargs methods.
12743
12744 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12745
12746         * class.cs:
12747         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
12748
12749 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12750
12751         * attribute.cs (Attribute.GetValidTargets): Made public.
12752
12753         * class.cs: 
12754         (AbstractPropertyEventMethod): New class for better code sharing.
12755         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
12756         CS1667 report.
12757         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
12758
12759 2004-06-11  Raja R Harinath  <rharinath@novell.com>
12760
12761         Fix bug #59477.
12762         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
12763         that the call to Resolve is part of a MemberAccess.
12764         (Expression.Resolve): Use it for SimpleName resolution.
12765         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
12766         Add 'intermediate' boolean argument.
12767         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
12768         error message when the SimpleName can be resolved ambiguously
12769         between an expression and a type.
12770         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
12771         public.
12772         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
12773         call on the left-side.
12774
12775 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12776
12777         * class.cs:
12778         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
12779
12780 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12781
12782         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
12783
12784 2004-06-11  Martin Baulig  <martin@ximian.com>
12785
12786         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
12787         varargs methods if applicable.
12788
12789 2004-06-11  Martin Baulig  <martin@ximian.com>
12790
12791         * expression.cs (Invocation.EmitCall): Don't use
12792         `method.CallingConvention == CallingConventions.VarArgs' since the
12793         method could also have `CallingConventions.HasThis'.
12794
12795 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12796
12797         * class.cs (Event.GetSignatureForError): Implemented.
12798         Fixed crash in error test cs3010.cs
12799
12800 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
12801
12802         * cs-tokenizer.cs: Change the way we track __arglist to be
12803         consistent with the other keywords.
12804
12805 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
12806
12807         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
12808         tomorrow.
12809
12810 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
12811
12812         * codegen.cs: Check that all referenced assemblies have a strongname
12813         before strongnaming the compiled assembly. If not report error CS1577.
12814         Fix bug #56563. Patch by Jackson Harper.
12815         * typemanager.cs: Added a method to return all referenced assemblies.
12816         Fix bug #56563. Patch by Jackson Harper.
12817
12818 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
12819
12820         * class.cs:
12821         (Method.ApplyAttributeBuilder): Moved and added conditional
12822         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
12823
12824         * delegate.cs:
12825         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
12826
12827 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
12828
12829         Fixed #59640
12830         * class.cs: (EventField.attribute_targets): Changed default target.
12831
12832 2004-06-08  Martin Baulig  <martin@ximian.com>
12833
12834         * expression.cs (Invocation.EmitCall): Enable varargs methods.
12835
12836 2004-06-08  Martin Baulig  <martin@ximian.com>
12837
12838         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
12839
12840 2004-06-07  Martin Baulig  <martin@ximian.com>
12841
12842         Added support for varargs methods.
12843
12844         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
12845         keyword.
12846
12847         * cs-parser.jay: Added support for `__arglist'.
12848
12849         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
12850
12851         * expression.cs (Argument.AType): Added `ArgList'.
12852         (Invocation): Added support for varargs methods.
12853         (ArglistAccess): New public class.
12854         (Arglist): New public class.
12855
12856         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
12857
12858         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
12859         a method's top-level block if the method has varargs.
12860
12861         * support.cs (ReflectionParameters, InternalParameters): Added
12862         support for varargs methods.    
12863
12864 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
12865
12866         * class.cs: Provide location in indexer error report.
12867
12868         * driver.cs: Use standard names.
12869
12870         * namespace.cs: Catch the use of using after a namespace has been
12871         declared also on using aliases.
12872
12873 2004-06-03  Raja R Harinath  <rharinath@novell.com>
12874
12875         Bug #50820.
12876         * typemanager.cs (closure_private_ok, closure_invocation_type)
12877         (closure_qualifier_type, closure_invocation_assembly)
12878         (FilterWithClosure): Move to ...
12879         (Closure): New internal nested class.
12880         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
12881         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
12882         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
12883         (MemberLookup, MemberLookupFailed): Use it.
12884         * expression.cs (New.DoResolve): Treat the lookup for the
12885         constructor as being qualified by the 'new'ed type.
12886         (Indexers.GetIndexersForTypeOrInterface): Update.
12887
12888 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
12889
12890         * attribute.cs
12891         (GetConditionalAttributeValue): New method. Returns
12892         condition of ConditionalAttribute.
12893         (SearchMulti): New method.  Returns all attributes of type 't'.
12894         Use it when attribute is AllowMultiple = true.
12895         (IsConditionalMethodExcluded): New method.
12896
12897         * class.cs
12898         (Method.IsExcluded): Implemented. Returns true if method has conditional
12899         attribute and the conditions is not defined (method is excluded).
12900         (IMethodData): Extended interface for ConditionalAttribute support.
12901         (PropertyMethod.IsExcluded): Implemented.
12902
12903         * decl.cs
12904         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
12905
12906         * expression.cs
12907         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
12908         on the method.
12909
12910 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12911
12912         * expression.cs (ArrayCreationExpression): Make this just an
12913         `expression'. It can't be a statement, so the code here was
12914         dead.
12915
12916 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
12917
12918         Fixed #59072
12919         * typemanager.cs (GetFullNameSignature): New method for
12920         MethodBase types.
12921
12922 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
12923
12924         Fixed #56452
12925         * class.cs (MemberBase.GetSignatureForError): New virtual method.
12926         Use this method when MethodBuilder is null.
12927         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
12928         Added test for error CS0626 (MONO reports error for this situation).
12929         (IMethodData.GetSignatureForError): Extended interface.
12930
12931 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
12932
12933         * attribute.cs
12934         (AttributeTester.GetObsoleteAttribute): Returns instance of
12935         ObsoleteAttribute when type is obsolete.
12936
12937         * class.cs
12938         (TypeContainer.VerifyObsoleteAttribute): Override.
12939         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
12940         (MethodCode.VerifyObsoleteAttribute): Override.
12941         (MemberBase.VerifyObsoleteAttribute): Override.
12942
12943         * decl.cs
12944         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
12945         and report proper error.
12946
12947         *delegate.cs
12948         Delegate.VerifyObsoleteAttribute): Override.
12949
12950         * ecore.cs
12951         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
12952         and report proper error.
12953         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
12954
12955         * enum.cs
12956         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
12957         and enum member.
12958
12959         * expression.cs
12960         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
12961         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
12962         Added test for ObsoleteAttribute.
12963
12964         * statement.cs
12965         (Catch): Derived from Statement.
12966
12967 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
12968  
12969         Fixed bug #59071 & cs0160.cs
12970  
12971         * statement.cs (Try.Resolve): Check here whether order of catch
12972         clauses matches their dependencies.
12973
12974 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
12975
12976         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
12977         caused a regression: #59343.  Referencing nested classes from an
12978         assembly stopped working.
12979
12980 2004-05-31  Martin Baulig  <martin@ximian.com>
12981
12982         MCS is now frozen for beta 2.
12983
12984 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12985
12986         * convert.cs: add a trivial cache for overload operator resolution.
12987
12988 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12989
12990         * decl.cs: If possible, use lookuptypedirect here. We can only do
12991         this if there is no `.' after the namespace. Avoids using
12992         LookupType, which does lots of slow processing.
12993         (FindNestedType) New method, does what it says :-).
12994         * namespace.cs: use LookupTypeDirect.
12995         * rootcontext.cs: use membercache, if possible.
12996         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
12997
12998 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12999
13000         * expression.cs:
13001         According to the spec, 
13002
13003         In a member access of the form E.I, if E is a single identifier,
13004         and if the meaning of E as a simple-name (§7.5.2) is a constant,
13005         field, property, localvariable, or parameter with the same type as
13006         the meaning of E as a type-name (§3.8), then both possible
13007         meanings of E are permitted.
13008
13009         We did not check that E as a simple-name had the same type as E as
13010         a type name.
13011
13012         This trivial check gives us 5-7% on bootstrap time.
13013
13014 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13015
13016         * expression.cs (Invocation.OverloadResolve): Avoid the
13017         use of hashtables and boxing here by allocating on demand.
13018
13019 2004-05-30  Martin Baulig  <martin@ximian.com>
13020
13021         * rootcontext.cs (RootContext.LookupType): Don't cache things if
13022         we're doing a silent lookup.  Don't try to lookup nested types in
13023         TypeManager.object_type (thanks to Ben Maurer).
13024
13025 2004-05-30  Martin Baulig  <martin@ximian.com>
13026
13027         Committing a patch from Ben Maurer.
13028
13029         * rootcontext.cs (RootContext.LookupType): Cache negative results.
13030
13031 2004-05-29  Martin Baulig  <martin@ximian.com>
13032
13033         * class.cs (IMethodData.ShouldIgnore): New method.
13034
13035         * typemanager.cs (TypeManager.MethodFlags): Don't take a
13036         `Location' argument, we don't need it anywhere.  Use
13037         `IMethodData.ShouldIgnore ()' instead of
13038         `MethodData.GetMethodFlags ()'.
13039         (TypeManager.AddMethod): Removed.
13040         (TypeManager.AddMethod2): Renamed to AddMethod.
13041
13042 2004-05-29  Martin Baulig  <martin@ximian.com>
13043
13044         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
13045
13046         * convert.cs (Convert.ImplicitReferenceConversion): If we're
13047         converting from a class type S to an interface type and we already
13048         have an object on the stack, don't box it again.  Fixes #52578.
13049
13050 2004-05-29  Martin Baulig  <martin@ximian.com>
13051
13052         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
13053         Added support for `params' parameters.  Fixes #59267.
13054
13055 2004-05-29  Martin Baulig  <martin@ximian.com>
13056
13057         * literal.cs (NullPointer): Provide a private .ctor which sets
13058         `type' to TypeManager.object_type.  Fixes #59048.
13059
13060 2004-05-29  Martin Baulig  <martin@ximian.com>
13061
13062         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
13063         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
13064
13065         * ecore.cs (EventExpr.instance_expr): Make the field private.
13066
13067 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
13068
13069         Fixed bug #50080 & cs0214-2.cs
13070         * expression.cs (Cast.DoResolve): Check unsafe context here.
13071         
13072         * statement.cs (Resolve.DoResolve): Likewise.
13073
13074 2004-05-26  Martin Baulig  <martin@ximian.com>
13075
13076         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
13077
13078         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
13079         (RootContext.LookupType): Pass down the `silent' flag.
13080
13081 2004-05-25  Martin Baulig  <martin@ximian.com>
13082
13083         * expression.cs
13084         (MethodGroupExpr.IdenticalTypeName): New public property.
13085         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
13086         expression actually refers to a type.
13087
13088 2004-05-25  Martin Baulig  <martin@ximian.com>
13089
13090         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
13091         for #56176 and made it actually work.
13092
13093 2004-05-25  Martin Baulig  <martin@ximian.com>
13094
13095         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
13096         (FieldExpr, PropertyExpr): Override and implement
13097         CacheTemporaries.  Fixes #52279.
13098
13099 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
13100
13101         * location.cs: In the new compiler listing a file twice is a
13102         warning, not an error.
13103
13104 2004-05-24  Martin Baulig  <martin@ximian.com>
13105
13106         * enum.cs (Enum.DefineType): For the `BaseType' to be a
13107         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
13108
13109 2004-05-24  Martin Baulig  <martin@ximian.com>
13110
13111         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
13112         walking the `using' list.  Fixes #53921.
13113
13114 2004-05-24  Martin Baulig  <martin@ximian.com>
13115
13116         * const.cs (Const.LookupConstantValue): Added support for
13117         EmptyCast's; fixes #55251.
13118
13119 2004-05-24  Martin Baulig  <martin@ximian.com>
13120
13121         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
13122         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
13123         which does the CS0135 check.  The reason is that we first need to
13124         check whether the variable actually exists.
13125
13126 2004-05-24  Martin Baulig  <martin@ximian.com>
13127
13128         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
13129         than RootContext.LookupType() to find the explicit interface
13130         type.  Fixes #58584.
13131
13132 2004-05-24  Raja R Harinath  <rharinath@novell.com>
13133
13134         * Makefile: Simplify.  Use executable.make.
13135         * mcs.exe.sources: New file.  List of sources of mcs.exe.
13136
13137 2004-05-24  Anders Carlsson  <andersca@gnome.org>
13138
13139         * decl.cs:
13140         * enum.cs:
13141         Use the invariant culture when doing String.Compare for CLS case
13142         sensitivity.
13143         
13144 2004-05-23  Martin Baulig  <martin@ximian.com>
13145
13146         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
13147         don't have any dots.  Fixes #52622, added cs0246-8.cs.
13148
13149         * namespace.cs (NamespaceEntry.Lookup): Likewise.
13150         
13151 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
13152
13153         * class.cs (MemberBase.Define): Reuse MemberType member for 
13154         resolved type. Other methods can use it too.
13155
13156 2004-05-23  Martin Baulig  <martin@ximian.com>
13157
13158         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
13159         the variable also exists in the current block (otherwise, we need
13160         to report a CS0103).  Fixes #58670.
13161
13162 2004-05-23  Martin Baulig  <martin@ximian.com>
13163
13164         * flowanalysis.cs (Reachability.Reachable): Compute this
13165         on-the-fly rather than storing it as a field.
13166
13167 2004-05-23  Martin Baulig  <martin@ximian.com>
13168
13169         * flowanalysis.cs (Reachability.And): Manually compute the
13170         resulting `barrier' from the reachability.      
13171        
13172 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
13173
13174         Fix bug #57835
13175         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
13176         instance of ObsoleteAttribute when symbol is obsolete.
13177
13178         * class.cs
13179         (IMethodData): Extended interface for ObsoleteAttribute support.
13180
13181 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
13182
13183         * attribute.cs: Fix bug #55970
13184
13185 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
13186
13187         Fix bug #52705
13188         * attribute.cs
13189         (GetObsoleteAttribute): New method. Creates the instance of
13190         ObsoleteAttribute.
13191         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
13192         ObsoleteAttribute when member is obsolete.
13193         (AttributeTester.Report_ObsoleteMessage): Common method for
13194         Obsolete error/warning reporting.
13195
13196         * class.cs
13197         (TypeContainer.base_classs_type): New member for storing parent type.
13198
13199         * decl.cs
13200         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
13201         for this MemberCore.
13202
13203 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
13204
13205         * attribute.cs, const.cs: Fix bug #58590
13206
13207 2004-05-21  Martin Baulig  <martin@ximian.com>
13208
13209         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
13210         out parameters if the end of the method is unreachable.  Fixes
13211         #58098. 
13212
13213 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
13214
13215         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
13216         Hari was right, why extra method.
13217
13218 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
13219
13220         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
13221
13222 2004-05-20  Martin Baulig  <martin@ximian.com>
13223
13224         Merged this back from gmcs to keep the differences to a minumum.
13225
13226         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
13227         instead of a Declspace.
13228         (Attribute.ResolveType): Likewise.
13229         (Attributes.Search): Likewise.
13230         (Attributes.Contains): Likewise.
13231         (Attributes.GetClsCompliantAttribute): Likewise.
13232
13233         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
13234         argument.
13235         (MethodData.ApplyAttributes): Take an EmitContext instead of a
13236         DeclSpace.
13237
13238 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
13239
13240         Fix bug #58688 (MCS does not report error when the same attribute
13241         is assigned twice)
13242
13243         * attribute.cs (Attribute.Emit): Distinction between null and default.
13244
13245 2004-05-19  Raja R Harinath  <rharinath@novell.com>
13246
13247         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
13248         of a top-level attribute without an attribute target.
13249         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
13250         Make non-static.
13251         (Attribute.Conditional_GetConditionName), 
13252         (Attribute.Obsolete_GetObsoleteMessage): Update.
13253         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
13254         part of ScanForIndexerName.
13255         (Attribute.CanIgnoreInvalidAttribute): New function.
13256         (Attribute.ScanForIndexerName): Move to ...
13257         (Attributes.ScanForIndexerName): ... here.
13258         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
13259         (Attributes.Search): New internal variant that can choose not to
13260         complain if types aren't resolved.  The original signature now
13261         complains.
13262         (Attributes.GetClsCompliantAttribute): Use internal variant, with
13263         complaints suppressed.
13264         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
13265         only if it not useful.
13266         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
13267         top-level for attributes that are shared between the assembly
13268         and a top-level class.
13269         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
13270         * class.cs: Update to reflect changes.
13271         (DefineIndexers): Fuse loops.
13272         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
13273         a couple more variants of attribute names.
13274
13275 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
13276
13277         Fix bug #52585 (Implemented explicit attribute declaration)
13278
13279         * attribute.cs:
13280         (Attributable.ValidAttributeTargets): New abstract method. It gets
13281         list of valid attribute targets for explicit target declaration.
13282         (Attribute.Target): It holds target itself.
13283         (AttributeSection): Removed.
13284         (Attribute.CheckTargets): New method. It checks whether attribute
13285         target is valid for the current element.
13286
13287         * class.cs:
13288         (EventProperty): New class. For events that are declared like
13289         property (with add and remove accessors).
13290         (EventField): New class. For events that are declared like field.
13291         class.cs
13292
13293         * cs-parser.jay: Implemented explicit attribute target declaration.
13294
13295         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
13296         Override ValidAttributeTargets.
13297
13298         * parameter.cs:
13299         (ReturnParameter): Class for applying custom attributes on 
13300         the return type.
13301         (ParameterAtribute): New class. Class for applying custom
13302         attributes on the parameter type.
13303
13304 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
13305
13306         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
13307         definitions. 
13308
13309         (Method): Allow UNSAFE here.
13310
13311         * modifiers.cs: Support unsafe reporting.
13312
13313 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
13314
13315         * decl.cs: Fix bug #58478.
13316
13317 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13318
13319         * statement.cs: When checking for unreachable code on an EmptyStatement,
13320         set the location. Fixes bug #58488.
13321
13322 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
13323
13324         * driver.cs: Add -pkg handling.
13325
13326         From Gonzalo: UseShelLExecute=false
13327
13328 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
13329
13330         * attribute.cs:
13331         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
13332         for attribute.
13333         (Attribute.IsClsCompliaceRequired): Moved to base for better
13334         accesibility.
13335         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
13336         when attribute is AttributeUsageAttribute.
13337         (Attribute.GetValidTargets): Simplified.
13338         (Attribute.GetAttributeUsage): New method returns AttributeUsage
13339         attribute for this type.
13340         (Attribute.ApplyAttributes): Method renamed to Emit and make
13341         non-static.
13342         (GlobalAttributeSection): New class for special handling of global
13343         attributes (assembly, module).
13344         (AttributeSection.Emit): New method.
13345
13346         * class.cs: Implemented Attributable abstract methods.
13347         (MethodCore.LabelParameters): Moved to Parameter class.
13348         (Accessor): Is back simple class.
13349         (PropertyMethod): Implemented Attributable abstract class.
13350         (DelegateMethod): Implemented Attributable abstract class.
13351         (Event): New constructor for disctintion between normal Event
13352         and Event with accessors.
13353
13354         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
13355
13356         * codegen.cs, const.cs, decl.cs, delegate.cs:
13357         (CommonAssemblyModulClass): Implemented Attributable abstract class
13358         and simplified.
13359
13360         * enum.cs: Implement IAttributeSupport interface.
13361         (EnumMember): New class for emum members. Implemented Attributable
13362         abstract class
13363
13364         * parameter.cs:
13365         (ParameterBase): Is abstract.
13366         (ReturnParameter): New class for easier [return:] attribute handling.
13367
13368         * typemanager.cs: Removed builder_to_attr.
13369
13370 2004-05-11  Raja R Harinath  <rharinath@novell.com>
13371
13372         Fix bug #57151.
13373         * attribute.cs (Attribute.GetPositionalValue): New function.
13374         * class.cs (TypeContainer.VerifyMembers): New function.
13375         (TypeContainer.Emit): Use it.
13376         (ClassOrStruct): New base class for Class and Struct.
13377         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
13378         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
13379         class.
13380         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
13381         then each non-static field should have a FieldOffset attribute.
13382         Otherwise, none of the fields should have a FieldOffset attribute.
13383         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
13384         and FieldOffset attributes.
13385         * typemanager.cs (TypeManager.struct_layout_attribute_type)
13386         (TypeManager.field_offset_attribute_type): New core types.
13387         (TypeManager.InitCoreTypes): Initialize them.
13388
13389 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
13390
13391         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
13392         Return correct type.
13393         From bug #58270.
13394
13395 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
13396
13397         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
13398         be implicitly converted to ulong.
13399         
13400         * expression.cs: The logic for allowing operator &, | and ^ worked
13401         was wrong, it worked before because we did not report an error in
13402         an else branch.  Fixes 57895.
13403
13404         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
13405         allow volatile fields to be reference types.
13406
13407 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
13408
13409         * driver.cs: Add support for /debug-
13410
13411 2004-05-07  Raja R Harinath  <rharinath@novell.com>
13412
13413         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
13414         Add a 'complain' parameter to silence errors.
13415         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
13416         silently overlooked type-resolutions.
13417         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
13418         to reflect changes.
13419         (Attributes.Search): New function.
13420         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
13421         (Attributes.GetAttributeFullName): Remove hack.
13422         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
13423         Update to reflect changes.
13424         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13425         Use Attributes.Search instead of nested loops.
13426
13427 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
13428
13429         * decl.cs:
13430         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
13431         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
13432         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
13433
13434         * report.cs: (Report.Warning): Renamed to Warning_T because of
13435         parameter collision.
13436
13437 2004-05-05  Raja R Harinath  <rharinath@novell.com>
13438
13439         * expression.cs (MemberAccess.ResolveMemberAccess):
13440         Exit with non-zero status after Report.Error.
13441         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
13442         Likewise.
13443         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
13444
13445 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
13446
13447         * support.cs: Don't hang when the file is empty.
13448
13449 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
13450
13451         * support.cs: In SeekableStreamReader, compute the preamble size of the
13452           underlying stream. Position changes should take into account that initial
13453           count of bytes.
13454
13455 2004-05-03  Todd Berman  <tberman@sevenl.net>
13456
13457         * driver.cs: remove unused GetSysVersion function.
13458
13459 2004-05-03  Todd Berman  <tberman@sevenl.net>
13460
13461         * driver.cs: Remove the hack from saturday, as well as the hack
13462         from jackson (LoadAssemblyFromGac), also adds the CWD to the
13463         link_paths to get that bit proper.
13464
13465 2004-05-01  Todd Berman  <tberman@sevenl.net>
13466
13467         * driver.cs: Try a LoadFrom before a Load, this checks the current
13468         path. This is currently a bug in mono that is be fixed, however, this
13469         provides a workaround for now. This will be removed when the bug
13470         is fixed.
13471
13472 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
13473
13474         * CryptoConvert.cs: Updated to latest version. Fix issue with 
13475         incomplete key pairs (#57941).
13476
13477 2004-05-01  Todd Berman  <tberman@sevenl.net>
13478
13479         * driver.cs: Remove '.' from path_chars, now System.* loads properly
13480         from the GAC
13481
13482 2004-04-30  Jackson Harper  <jackson@ximian.com>
13483
13484         * codegen.cs: Open keys readonly.
13485         
13486 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13487
13488         * typemanager.cs: don't report cyclic struct layout when a struct
13489         contains 2 or more fields of the same type. Failed for Pango.AttrShape
13490         which has 2 Pango.Rectangle fields.
13491
13492 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13493
13494         * expression.cs: Handle IntPtr comparisons with IL code
13495         rather than a method call.
13496
13497 2004-04-29  Martin Baulig  <martin@ximian.com>
13498
13499         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
13500         the list of PropertyInfo's in class hierarchy and find the
13501         accessor.  Fixes #56013.
13502
13503 2004-04-29  Martin Baulig  <martin@ximian.com>
13504
13505         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
13506
13507 2004-04-29  Martin Baulig  <martin@ximian.com>
13508
13509         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13510
13511         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
13512
13513 2004-04-29  Martin Baulig  <martin@ximian.com>
13514
13515         * class.cs (ConstructorInitializer.Resolve): Check whether the
13516         parent .ctor is accessible.  Fixes #52146.
13517
13518 2004-04-29  Martin Baulig  <martin@ximian.com>
13519
13520         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13521
13522         * statement.cs (Using.EmitLocalVariableDecls): Use
13523         TypeManager.idisposable_type, not typeof (IDisposable).
13524         (Foreach.EmitCollectionForeach): Added support for valuetypes.
13525
13526 2004-04-29  Martin Baulig  <martin@ximian.com>
13527
13528         * class.cs (Event.Define): Don't emit the field and don't set
13529         RTSpecialName and SpecialName for events on interfaces.  Fixes
13530         #57703. 
13531
13532 2004-04-29  Raja R Harinath  <rharinath@novell.com>
13533
13534         Refactor Attribute.ApplyAttributes.
13535         * attribute.cs (Attributable): New base class for objects that can
13536         have Attributes applied on them.
13537         (Attribute): Make AttributeUsage fields public.
13538         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
13539         (Attribute.IsInternalCall): New property.
13540         (Attribute.UsageAttr): Convert to a public read-only property.
13541         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
13542         (Attribute.ResolveType, Attribute.Resolve)
13543         (Attribute.ScanForIndexerName): Update to reflect changes.
13544         (Attribute.CheckAttributeTarget): Re-format.
13545         (Attribute.ApplyAttributes): Refactor, to various
13546         Attributable.ApplyAttributeBuilder methods.
13547         * decl.cs (MemberCore): Make Attributable.
13548         * class.cs (Accessor): Make Attributable.
13549         (MethodData.ApplyAttributes): Use proper attribute types, not
13550         attribute names.
13551         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
13552         (TypeContainer.ApplyAttributeBuilder)
13553         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
13554         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
13555         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
13556         (Operator.ApplyAttributeBuilder): New factored-out methods.
13557         * const.cs (Const.ApplyAttributeBuilder): Likewise.
13558         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
13559         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
13560         * parameter.cs (ParameterBase): New Attributable base class
13561         that can also represent Return types.
13562         (Parameter): Update to the changes.
13563
13564 2004-04-29  Jackson Harper  <jackson@ximian.com>
13565
13566         * driver.cs: Prefer the corlib system version when looking for
13567         assemblies in the GAC. This is still a hack, but its a better hack
13568         now.
13569         
13570 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
13571
13572         * decl.cs, enum.cs: Improved error 3005 reporting.
13573   
13574         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
13575         (related_symbols): New private member for list of symbols
13576         related to reported error/warning.
13577         
13578         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
13579
13580 2004-04-29  Martin Baulig  <martin@ximian.com>
13581
13582         * ecore.cs (Expression.Constantify): If we're an enum and
13583         TypeManager.TypeToCoreType() doesn't give us another type, use
13584         t.UnderlyingSystemType.  Fixes #56178.  
13585
13586 2004-04-29  Martin Baulig  <martin@ximian.com>
13587
13588         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
13589         interfaces and for each interface, only add members directly
13590         declared in that interface.  Fixes #53255.
13591
13592 2004-04-28  Martin Baulig  <martin@ximian.com>
13593
13594         * expression.cs (ConditionalLogicalOperator): Use a temporary
13595         variable for `left' to avoid that we evaluate it more than once;
13596         bug #52588.
13597
13598 2004-04-28  Martin Baulig  <martin@ximian.com>
13599
13600         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
13601         `void[]' (CS1547).
13602
13603 2004-04-28  Martin Baulig  <martin@ximian.com>
13604
13605         * statement.cs (LocalInfo.Resolve): Check whether the type is not
13606         void (CS1547).
13607
13608         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
13609         whether the type is not void (CS1547).
13610
13611 2004-04-28  Martin Baulig  <martin@ximian.com>
13612
13613         * expression.cs (Unary.DoResolveLValue): Override this and report
13614         CS0131 for anything but Operator.Indirection.
13615
13616 2004-04-28  Martin Baulig  <martin@ximian.com>
13617
13618         Committing a patch from Ben Maurer; see bug #50820.
13619
13620         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13621         check for classes.
13622
13623         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13624         classes.        
13625
13626 2004-04-28  Martin Baulig  <martin@ximian.com>
13627
13628         Committing a patch from Ben Maurer; see bug #50820.
13629
13630         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13631         check for classes.
13632
13633         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13634         classes.        
13635
13636 2004-04-28  Martin Baulig  <martin@ximian.com>
13637
13638         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
13639         (Block.AddLabel): Call DoLookupLabel() to only search in the
13640         current block.
13641
13642 2004-04-28  Martin Baulig  <martin@ximian.com>
13643
13644         * cfold.cs (ConstantFold.BinaryFold): Added special support for
13645         comparing StringConstants and NullLiterals in Equality and Inequality.
13646
13647 2004-04-28  Jackson Harper  <jackson@ximian.com>
13648
13649         * driver.cs: Attempt to load referenced assemblies from the
13650         GAC. This is the quick and dirty version of this method that
13651         doesnt take into account versions and just takes the first
13652         canidate found. Will be good enough for now as we will not have more
13653         then one version installed into the GAC until I update this method.
13654
13655 2004-04-28  Martin Baulig  <martin@ximian.com>
13656
13657         * typemanager.cs (TypeManager.CheckStructCycles): New public
13658         static method to check for cycles in the struct layout.
13659
13660         * rootcontext.cs (RootContext.PopulateTypes): Call
13661         TypeManager.CheckStructCycles() for each TypeContainer.
13662         [Note: We only need to visit each type once.]
13663
13664 2004-04-28  Martin Baulig  <martin@ximian.com>
13665
13666         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
13667
13668         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
13669         success and added `out object value'.  Use a `bool resolved' field
13670         to check whether we've already been called rather than
13671         `ConstantValue != null' since this breaks for NullLiterals.
13672
13673 2004-04-28  Raja R Harinath  <rharinath@novell.com>
13674
13675         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
13676         setting of this flag, since the 'set' method may be non-public.
13677
13678 2004-04-28  Raja R Harinath  <rharinath@novell.com>
13679
13680         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
13681         check on current_vector.Block.
13682
13683 2004-04-27  Martin Baulig  <martin@ximian.com>
13684
13685         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
13686         a field initializer.  Fixes #56459.
13687
13688 2004-04-27  Martin Baulig  <martin@ximian.com>
13689
13690         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
13691         we're not attempting to use an indexer.  Fixes #52154.
13692
13693 2004-04-27  Martin Baulig  <martin@ximian.com>
13694
13695         * statement.cs (Return): Don't create a return label if we don't
13696         need it; reverts my change from January 20th.  Thanks to Ben
13697         Maurer for this.
13698
13699 2004-04-27  Martin Baulig  <martin@ximian.com>
13700
13701         According to the spec, `goto' can only leave a nested scope, but
13702         never enter it.
13703
13704         * statement.cs (Block.LookupLabel): Only lookup in the current
13705         block, don't recurse into parent or child blocks.
13706         (Block.AddLabel): Check in parent and child blocks, report
13707         CS0140/CS0158 if we find a duplicate.
13708         (Block): Removed this indexer for label lookups.
13709         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
13710         this already does the error reporting for us.
13711
13712         * flowanalysis.cs
13713         (FlowBranching.UsageVector.Block): New public variable; may be null.
13714         (FlowBranching.CreateSibling): Added `Block' argument.
13715         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
13716         label for the target of a `goto' and check whether we're not
13717         leaving a `finally'.
13718
13719 2004-04-27  Martin Baulig  <martin@ximian.com>
13720
13721         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13722         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
13723         just for returns).
13724
13725 2004-04-27  Martin Baulig  <martin@ximian.com>
13726
13727         * statement.cs (Block.AddLabel): Also check for implicit blocks
13728         and added a CS0158 check.
13729
13730 2004-04-27  Martin Baulig  <martin@ximian.com>
13731
13732         * flowanalysis.cs (FlowBranchingLoop): New class.
13733         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
13734         UsageVector's instead of an ArrayList.
13735         (FlowBranching.Label): Likewise.
13736         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
13737         (FlowBranching.AddBreakVector): New method.
13738
13739 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
13740
13741         * attribute.cs: Small regression fix: only convert the type if we
13742         the type is different, fixes System.Drawing build.
13743
13744 2004-04-27  Martin Baulig  <martin@ximian.com>
13745
13746         * attribute.cs (Attribute.Resolve): If we have a constant value
13747         for a named field or property, implicity convert it to the correct
13748         type.
13749
13750 2004-04-27  Raja R Harinath  <rharinath@novell.com>
13751
13752         * statement.cs (Block.Block): Implicit blocks share
13753         'child_variable_names' fields with parent blocks.
13754         (Block.AddChildVariableNames): Remove.
13755         (Block.AddVariable): Mark variable as "used by a child block" in
13756         every surrounding block.
13757         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
13758         been used in a child block, complain about violation of "Invariant
13759         meaning in blocks" rule.
13760         * cs-parser.jay (declare_local_variables): Don't use
13761         AddChildVariableNames.
13762         (foreach_statement): Don't create an implicit block: 'foreach'
13763         introduces a scope.
13764
13765 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
13766
13767         * convert.cs (ImplicitNumericConversion): 0 is also positive when
13768         converting from 0L to ulong.  Fixes 57522.
13769
13770 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
13771
13772         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
13773         derived class hides via 'new' keyword field from base class (test-242.cs).
13774         TODO: Handle this in the more general way.
13775         
13776         * class.cs (CheckBase): Ditto.
13777
13778 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
13779
13780         * decl.cs (caching_flags): New member for storing cached values
13781         as bit flags.
13782         (MemberCore.Flags): New enum where bit flags for caching_flags
13783         are defined.
13784         (MemberCore.cls_compliance): Moved to caching_flags.
13785         (DeclSpace.Created): Moved to caching_flags.
13786
13787         * class.cs: Use caching_flags instead of DeclSpace.Created
13788         
13789 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
13790
13791         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
13792         if we are only a derived class, not a nested class.
13793
13794         * typemanager.cs: Same as above, but do this at the MemberLookup
13795         level (used by field and methods, properties are handled in
13796         PropertyExpr).   Allow for the qualified access if we are a nested
13797         method. 
13798
13799 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
13800
13801         * class.cs: Refactoring.
13802         (IMethodData): New inteface; Holds links to parent members
13803         to avoid member duplication (reduced memory allocation).
13804         (Method): Implemented IMethodData interface.
13805         (PropertyBase): New inner classes for get/set methods.
13806         (PropertyBase.PropertyMethod): Implemented IMethodData interface
13807         (Event): New inner classes for add/remove methods.
13808         (Event.DelegateMethod): Implemented IMethodData interface.
13809
13810         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
13811         EmitContext (related to class.cs refactoring).
13812
13813 2004-04-21  Raja R Harinath  <rharinath@novell.com>
13814
13815         * delegate.cs (Delegate.VerifyApplicability): If the number of
13816         arguments are the same as the number of parameters, first try to
13817         verify applicability ignoring  any 'params' modifier on the last
13818         parameter.
13819         Fixes #56442.
13820
13821 2004-04-16  Raja R Harinath  <rharinath@novell.com>
13822
13823         * class.cs (TypeContainer.AddIndexer): Use
13824         'ExplicitInterfaceName' to determine if interface name was
13825         explicitly specified.  'InterfaceType' is not initialized at this time.
13826         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
13827         Indexers array is already in the required order.  Initialize
13828         'IndexerName' only if there are normal indexers.
13829         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
13830         (TypeContainer.Emit): Emit DefaultMember attribute only if
13831         IndexerName is initialized.
13832         Fixes #56300.
13833
13834 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
13835
13836         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
13837         Fixes #57007
13838
13839 2004-04-15  Raja R Harinath  <rharinath@novell.com>
13840
13841         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
13842         attributes.
13843         Fix for #56456.
13844
13845         * attribute.cs (Attribute.Resolve): Check for duplicate named
13846         attributes.
13847         Fix for #56463.
13848
13849 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
13850
13851         * iterators.cs (MarkYield): track whether we are in an exception,
13852         and generate code accordingly.  Use a temporary value to store the
13853         result for our state.
13854
13855         I had ignored a bit the interaction of try/catch with iterators
13856         since their behavior was not entirely obvious, but now it is
13857         possible to verify that our behavior is the same as MS .NET 2.0
13858
13859         Fixes 54814
13860
13861 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
13862
13863         * iterators.cs: Avoid creating temporaries if there is no work to
13864         do. 
13865
13866         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
13867         Enumerations, use TypeManager.EnumToUnderlying and call
13868         recursively. 
13869
13870         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
13871         bug #57013
13872
13873         (This.Emit): Use EmitContext.EmitThis to emit our
13874         instance variable.
13875
13876         (This.EmitAssign): Ditto.
13877
13878         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
13879         codepaths, we will move all the functionality into
13880         Mono.CSharp.This 
13881
13882         (FieldExpr.EmitAssign): Ditto.
13883
13884         This fixes several hidden bugs that I uncovered while doing a code
13885         review of this today.
13886
13887         * codegen.cs (EmitThis): reworked so the semantics are more clear
13888         and also support value types "this" instances.
13889
13890         * iterators.cs: Changed so that for iterators in value types, we
13891         do not pass the value type as a parameter.  
13892
13893         Initialization of the enumerator helpers is now done in the caller
13894         instead of passing the parameters to the constructors and having
13895         the constructor set the fields.
13896
13897         The fields have now `assembly' visibility instead of private.
13898
13899 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
13900
13901         * expression.cs (Argument.Resolve): Check if fields passed as ref
13902         or out are contained in a MarshalByRefObject.
13903
13904         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
13905         another compiler type.
13906
13907 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
13908
13909         * class.cs (Indexer.Define): use the new name checking method.
13910         Also, return false on an error.
13911         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
13912         (is_identifier_[start/part]_character): make static.
13913
13914 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
13915
13916         * expression.cs (Binary.ResolveOperator): Do no append strings
13917         twice: since we can be invoked more than once (array evaluation)
13918         on the same concatenation, take care of this here.  Based on a fix
13919         from Ben (bug #56454)
13920
13921 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
13922
13923         * codegen.cs: Fix another case where CS1548 must be reported (when 
13924         delay-sign isn't specified and no private is available #56564). Fix
13925         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
13926         error when MCS is used on the MS runtime and we need to delay-sign 
13927         (which seems unsupported by AssemblyBuilder - see #56621).
13928
13929 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
13930
13931         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
13932         (TypeManager.ComputeNamespaces): Faster implementation for
13933         Microsoft runtime.
13934
13935         * compiler.csproj: Updated AssemblyName to mcs.
13936
13937 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
13938
13939         * rootcontext.cs: Add new types to the boot resolution.
13940
13941         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
13942         MulticastDelegate is not allowed.
13943
13944         * typemanager.cs: Add new types to lookup: System.TypedReference
13945         and ArgIterator.
13946
13947         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
13948         check for TypedReference or ArgIterator, they are not allowed. 
13949
13950         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
13951         makes us properly catch 1510 in some conditions (see bug 56016 for
13952         details). 
13953
13954 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
13955
13956         * CryptoConvert.cs: update from corlib version
13957         with endian fixes.
13958
13959 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
13960
13961         * class.cs (Indexer.Define): Check indexername declaration
13962
13963 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
13964
13965         * attribute.cs (IsClsCompliant): Fixed problem with handling
13966         all three states (compliant, not-compliant, undetected).
13967
13968 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
13969
13970         * attribute.cs (Attribute): Location is now public.
13971         (Resolve): Store resolved arguments (pos_values) in attribute class.
13972         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
13973         (GetClsCompliantAttributeValue): New method that gets
13974         CLSCompliantAttribute value.
13975         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
13976         if exists else null.
13977         (AttributeTester): New class for CLS-Compliant verification routines.
13978
13979         * class.cs (Emit): Add CLS-Compliant verification.
13980         (Method.GetSignatureForError): Implemented.
13981         (Constructor.GetSignatureForError): Implemented
13982         (Constructor.HasCompliantArgs): Returns if constructor has
13983         CLS-Compliant arguments.
13984         (Constructor.Emit): Override.
13985         (Construcor.IsIdentifierClsCompliant): New method; For constructors
13986         is needed to test only parameters.
13987         (FieldBase.GetSignatureForError): Implemented.
13988         (TypeContainer): New member for storing base interfaces.
13989         (TypeContainer.FindMembers): Search in base interfaces too.
13990
13991         * codegen.cs (GetClsComplianceAttribute): New method that gets
13992         assembly or module CLSCompliantAttribute value.
13993         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
13994         for assembly.
13995         (ModuleClass.Emit): Add error 3012 test.
13996
13997         * const.cs (Emit): Override and call base for CLS-Compliant tests.
13998
13999         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
14000         state for all decl types.
14001         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
14002         if CLS-Compliant tests are required.
14003         (IsClsCompliaceRequired): New method. Analyze whether code
14004         must be CLS-Compliant.
14005         (IsExposedFromAssembly): New method. Returns true when MemberCore
14006         is exposed from assembly.
14007         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
14008         value or gets cached value.
14009         (HasClsCompliantAttribute): New method. Returns true if MemberCore
14010         is explicitly marked with CLSCompliantAttribute.
14011         (IsIdentifierClsCompliant): New abstract method. This method is
14012         used to testing error 3005.
14013         (IsIdentifierAndParamClsCompliant): New method. Common helper method
14014         for identifier and parameters CLS-Compliant testing.
14015         (VerifyClsCompliance): New method. The main virtual method for
14016         CLS-Compliant verifications.
14017         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
14018         null. I don't know why is null (too many public members !).
14019         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
14020         and get value of first CLSCompliantAttribute that found.
14021
14022         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
14023         (VerifyClsCompliance): Override and add extra tests.
14024
14025         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
14026         clscheck- disable CLS-Compliant verification event if assembly is has
14027         CLSCompliantAttribute(true).
14028
14029         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
14030         ApllyAttribute is now called in emit section as in the other cases.
14031         Possible future Emit integration.
14032         (IsIdentifierClsCompliant): New override.
14033         (VerifyClsCompliance): New override.
14034         (GetEnumeratorName): Returns full enum name.
14035
14036         * parameter.cs (GetSignatureForError): Implemented.
14037
14038         * report.cs (WarningData): New struct for Warning message information.
14039         (LocationOfPreviousError): New method.
14040         (Warning): New method. Reports warning based on the warning table.
14041         (Error_T): New method. Reports error based on the error table.
14042
14043         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
14044         verifications are done here.
14045
14046         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
14047
14048         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
14049         CLSCompliantAttribute.
14050         (all_imported_types): New member holds all imported types from other
14051         assemblies.
14052         (LoadAllImportedTypes): New method fills static table with exported types
14053         from all referenced assemblies.
14054         (Modules): New property returns all assembly modules.
14055
14056 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
14057
14058         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
14059         throwing a parser error.
14060
14061         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
14062         which removes the hardcoded get_/set_ prefixes for properties, as
14063         IL allows for the properties to be named something else.  
14064
14065         Bug #56013
14066
14067         * expression.cs: Do not override operand before we know if it is
14068         non-null.  Fix 56207
14069
14070 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14071
14072         * typemanager.cs: support for pinned variables.
14073
14074 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14075
14076         * decl.cs, typemanager.cs: Avoid using an arraylist
14077         as a buffer if there is only one result set.
14078
14079 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14080
14081         * expression.cs: Make sure you cant call a static method
14082         with an instance expression, bug #56174.
14083
14084 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
14085
14086         * class.cs (IsDuplicateImplementation): Improve error reporting to
14087         flag 663 (method only differs in parameter modifier).
14088
14089         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
14090         in preprocessor directives.
14091
14092         * location.cs (LookupFile): Allow for the empty path.
14093
14094         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
14095         better approach for some of that patch, but its failing with the
14096         CharSet enumeration.  For now try/catch will do.
14097
14098         * typemanager.cs: Do not crash if a struct does not have fields.
14099         Fixes 56150.
14100
14101 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
14102
14103         * expression.cs: cs0213, cant fix a fixed expression.
14104         fixes 50231.
14105
14106 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
14107
14108         * cs-parser.jay: detect invalid embeded statements gracefully.
14109         bug #51113.
14110
14111 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
14112
14113         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
14114         As a regex:
14115         s/
14116         the invocation type may not be a subclass of the tye of the item/
14117         The type of the item must be a subclass of the invocation item.
14118         /g
14119
14120         Fixes bug #50820.
14121
14122 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
14123
14124         * attribute.cs: Added methods to get a string and a bool from an
14125         attribute. Required to information from AssemblyKeyFileAttribute,
14126         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
14127         * codegen.cs: Modified AssemblyName creation to include support for
14128         strongnames. Catch additional exceptions to report them as CS1548.
14129         * compiler.csproj: Updated include CryptoConvert.cs.
14130         * compiler.csproj.user: Removed file - user specific configuration.
14131         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
14132         Mono.Security assembly. The original class is maintained and tested in
14133         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
14134         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
14135         like CSC 8.0 (C# v2) supports.
14136         * Makefile: Added CryptoConvert.cs to mcs sources.
14137         * rootcontext.cs: Added new options for strongnames.
14138
14139 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
14140
14141         * driver.cs: For --expect-error, report error code `2'
14142         if the program compiled with no errors, error code `1' if
14143         it compiled with an error other than the one expected.
14144
14145 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
14146
14147         * compiler.csproj: Updated for Visual Studio .NET 2003.
14148         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
14149         * compiler.sln: Updated for Visual Studio .NET 2003.
14150
14151 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
14152
14153         * expression.cs: Fix bug #47234. We basically need to apply the
14154         rule that we prefer the conversion of null to a reference type
14155         when faced with a conversion to 'object' (csc behaviour).
14156
14157 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14158
14159         * statement.cs: Shorter form for foreach, eliminates
14160         a local variable. r=Martin.
14161
14162 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14163
14164         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
14165         checks if we can use brtrue/brfalse to test for 0.
14166         * expression.cs: use the above in the test for using brtrue/brfalse.
14167         cleanup code a bit.
14168
14169 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14170
14171         * expression.cs: Rewrite string concat stuff. Benefits:
14172
14173         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
14174         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
14175         rather than a concat chain.
14176
14177         * typemanager.cs: Add lookups for more concat overloads.
14178
14179 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14180
14181         * expression.cs: Emit shorter il code for array init.
14182
14183         newarr
14184         dup
14185         // set 1
14186
14187         // set 2
14188
14189         newarr
14190         stloc.x
14191
14192         ldloc.x
14193         // set 1
14194
14195         ldloc.x
14196         // set 2
14197
14198 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
14199
14200         * statement.cs: Before, two switch blocks would be merged if the
14201         total size of the blocks (end_item - begin_item + 1) was less than
14202         two times the combined sizes of the blocks.
14203
14204         Now, it will only merge if after the merge at least half of the
14205         slots are filled.
14206
14207         fixes 55885.
14208
14209 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
14210
14211         * class.cs : csc build fix for GetMethods(). See bug #52503.
14212
14213 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
14214
14215         * expression.cs: Make sure fp comparisons work with NaN.
14216         This fixes bug #54303. Mig approved this patch a long
14217         time ago, but we were not able to test b/c the runtime
14218         had a related bug.
14219
14220 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
14221
14222         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
14223
14224 2004-03-19  Martin Baulig  <martin@ximian.com>
14225
14226         * class.cs (MemberCore.IsDuplicateImplementation): Report the
14227         error here and not in our caller.
14228
14229 2004-03-19  Martin Baulig  <martin@ximian.com>
14230
14231         * interface.cs: Completely killed this file.
14232         (Interface): We're now a TypeContainer and live in class.cs.
14233
14234         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
14235         argument; we're now also called for interfaces.
14236         (TypeContainer.DefineMembers): Allow this method being called
14237         multiple times.
14238         (TypeContainer.GetMethods): New public method; formerly known as
14239         Interface.GetMethod().  This is used by PendingImplementation.
14240         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
14241         it's now private and non-static.
14242         (Interface): Moved this here; it's now implemented similar to
14243         Class and Struct.
14244         (Method, Property, Event, Indexer): Added `bool is_interface'
14245         argument to their .ctor's.
14246         (MemberBase.IsInterface): New public field.
14247
14248         * cs-parser.jay: Create normal Method, Property, Event, Indexer
14249         instances instead of InterfaceMethod, InterfaceProperty, etc.
14250         (opt_interface_base): Removed; we now use `opt_class_base' instead.
14251         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
14252
14253 2004-03-19  Martin Baulig  <martin@ximian.com>
14254
14255         * class.cs (MethodCore.IsDuplicateImplementation): New private
14256         method which does the CS0111 checking.
14257         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
14258         Use IsDuplicateImplementation().
14259
14260 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
14261
14262         * decl.cs (FindMemberToOverride): New method to find the correct
14263         method or property to override in the base class.
14264         * class.cs
14265             - Make Method/Property use the above method to find the
14266               version in the base class.
14267             - Remove the InheritableMemberSignatureCompare as it is now
14268               dead code.
14269
14270         This patch makes large code bases much faster to compile, as it is
14271         O(n) rather than O(n^2) to do this validation.
14272
14273         Also, it fixes bug 52458 which is that nested classes are not
14274         taken into account when finding the base class member.
14275
14276         Reviewed/Approved by Martin.
14277
14278 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
14279
14280         * interface.cs: In all interface classes removed redundant
14281         member initialization.
14282
14283 2004-03-16  Martin Baulig  <martin@ximian.com>
14284
14285         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
14286
14287 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
14288
14289         * decl.cs (DefineTypeAndParents): New helper method to define a
14290         type's containers before the type itself is defined;  This is a
14291         bug exposed by the recent changes to Windows.Forms when an
14292         implemented interface was defined inside a class that had not been
14293         built yet.   
14294
14295         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
14296
14297         (Check): Loop correctly to report errors modifiers
14298         (UNSAFE was not in the loop, since it was the same as TOP).
14299
14300         * interface.cs: Every interface member now takes a ModFlags,
14301         instead of a "is_new" bool, which we set on the base MemberCore. 
14302
14303         Every place where we called "UnsafeOk" in the interface, now we
14304         call the proper member (InterfaceMethod.UnsafeOK) instead to get
14305         the unsafe settings from the member declaration instead of the
14306         container interface. 
14307
14308         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
14309
14310         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
14311         `set_indexer_name' to the pending bits (one per type).
14312
14313         We fixed a bug today that was picking the wrong method to
14314         override, since for properties the existing InterfaceMethod code
14315         basically ignored the method name.  Now we make sure that the
14316         method name is one of the valid indexer names.
14317
14318 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
14319  
14320         * support.cs (SeekableStreamReader): Keep track of stream byte
14321         positions and don't mix them with character offsets to the buffer.
14322
14323         Patch from Gustavo Giráldez
14324
14325 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
14326
14327         * interface.cs (InterfaceSetGetBase): Removed double member
14328         initialization, base class does it as well.
14329
14330 2004-03-13  Martin Baulig  <martin@ximian.com>
14331
14332         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
14333         when compiling corlib.
14334
14335 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
14336
14337         * convert.cs (ExplicitConversion): We were reporting an error on
14338         certain conversions (object_type source to a value type, when the
14339         expression was `null') before we had a chance to pass it through
14340         the user defined conversions.
14341
14342         * driver.cs: Replace / and \ in resource specifications to dots.
14343         Fixes 50752
14344
14345         * class.cs: Add check for duplicate operators.  Fixes 52477
14346
14347 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
14348
14349         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
14350         that are in the middle of the statements, not only at the end.
14351         Fixes #54987
14352
14353         * class.cs (TypeContainer.AddField): No longer set the
14354         `HaveStaticConstructor' flag, now we call it
14355         `UserDefineStaticConstructor' to diferentiate the slightly
14356         semantic difference.
14357
14358         The situation is that we were not adding BeforeFieldInit (from
14359         Modifiers.TypeAttr) to classes that could have it.
14360         BeforeFieldInit should be set to classes that have no static
14361         constructor. 
14362
14363         See:
14364
14365         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
14366
14367         And most importantly Zoltan's comment:
14368
14369         http://bugzilla.ximian.com/show_bug.cgi?id=44229
14370
14371         "I think beforefieldinit means 'it's ok to initialize the type sometime 
14372          before its static fields are used', i.e. initialization does not need
14373          to be triggered by the first access to the type. Setting this flag
14374          helps the JIT to compile better code, since it can run the static
14375          constructor at JIT time, and does not need to generate code to call it
14376          (possibly lots of times) at runtime. Unfortunately, mcs does not set
14377          this flag for lots of classes like String. 
14378          
14379          csc sets this flag if the type does not have an explicit static 
14380          constructor. The reasoning seems to be that if there are only static
14381          initalizers for a type, and no static constructor, then the programmer
14382          does not care when this initialization happens, so beforefieldinit
14383          can be used.
14384          
14385          This bug prevents the AOT compiler from being usable, since it 
14386          generates so many calls to mono_runtime_class_init that the AOT code
14387          is much slower than the JITted code. The JITted code is faster, 
14388          because it does not generate these calls if the vtable is type is
14389          already initialized, which is true in the majority of cases. But the
14390          AOT compiler can't do this."
14391
14392 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
14393
14394         * class.cs (MethodData.Emit): Refactor the code so symbolic
14395         information is generated for destructors;  For some reasons we
14396         were taking a code path that did not generate symbolic information
14397         before. 
14398
14399 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
14400
14401         * class.cs: Create a Constructor.CheckBase method that
14402         takes care of all validation type code. The method
14403         contains some code that was moved from Define.
14404
14405         It also includes new code that checks for duplicate ctors.
14406         This fixes bug #55148.
14407
14408 2004-03-09  Joshua Tauberer <tauberer@for.net>
14409
14410         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
14411         a { ... }-style array creation invokes EmitStaticInitializers
14412         which is not good for reference-type arrays.  String, decimal
14413         and now null constants (NullCast) are not counted toward
14414         static initializers.
14415
14416 2004-03-05  Martin Baulig  <martin@ximian.com>
14417
14418         * location.cs (SourceFile.HasLineDirective): New public field;
14419         specifies whether the file contains or is referenced by a "#line"
14420         directive.
14421         (Location.DefineSymbolDocuments): Ignore source files which
14422         either contain or are referenced by a "#line" directive.        
14423
14424 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
14425
14426         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
14427         direct access to our parent, so check the method inline there.
14428
14429 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
14430
14431         * expression.cs (Invocation.EmitCall): Miguel's last commit
14432         caused a regression. If you had:
14433
14434             T t = null;
14435             t.Foo ();
14436
14437         In Foo the implict this would be null.
14438
14439 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
14440
14441         * expression.cs (Invocation.EmitCall): If the method is not
14442         virtual, do not emit a CallVirt to it, use Call.
14443
14444         * typemanager.cs (GetFullNameSignature): Improve the method to
14445         cope with ".ctor" and replace it with the type name.
14446
14447         * class.cs (ConstructorInitializer.Resolve): Now the method takes
14448         as an argument the ConstructorBuilder where it is being defined,
14449         to catch the recursive constructor invocations.
14450
14451 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
14452
14453         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
14454         routines to check if a type is an enumerable/enumerator allow
14455         classes that implement the IEnumerable or IEnumerator interfaces.
14456
14457         * class.cs (Property, Operator): Implement IIteratorContainer, and
14458         implement SetYields.
14459
14460         (Property.Define): Do the block swapping for get_methods in the
14461         context of iterators.   We need to check if Properties also
14462         include indexers or not.
14463
14464         (Operator): Assign the Block before invoking the
14465         OperatorMethod.Define, so we can trigger the Iterator code
14466         replacement. 
14467
14468         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
14469         Property and Operator classes are not created when we parse the
14470         declarator but until we have the block completed, so we use a
14471         singleton SimpleIteratorContainer.Simple to flag whether the
14472         SetYields has been invoked.
14473
14474         We propagate this setting then to the Property or the Operator to
14475         allow the `yield' to function.
14476
14477 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
14478
14479         * codegen.cs: Implemented attribute support for modules.
14480         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
14481         Assembly/Module functionality.
14482
14483         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
14484         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
14485         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
14486
14487 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
14488
14489         * interface.cs (FindMembers): The operation is performed on all base
14490         interfaces and not only on the first. It is required for future CLS Compliance patch.
14491
14492 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
14493
14494         * statement.cs, codegen.cs:
14495         This patch deals with patterns such as:
14496
14497         public class List : IEnumerable {
14498
14499                 public MyEnumerator GetEnumerator () {
14500                         return new MyEnumerator(this);
14501                 }
14502
14503                 IEnumerator IEnumerable.GetEnumerator () {
14504                         ...
14505                 }
14506                 
14507                 public struct MyEnumerator : IEnumerator {
14508                         ...
14509                 }
14510         }
14511
14512         Before, there were a few things we did wrong:
14513         1) we would emit callvirt on a struct, which is illegal
14514         2) we emited ldarg when we needed to emit ldarga
14515         3) we would mistakenly call the interface methods on an enumerator
14516         type that derived from IEnumerator and was in another assembly. For example:
14517
14518         public class MyEnumerator : IEnumerator
14519
14520         Would have the interface methods called, even if there were public impls of the
14521         method. In a struct, this lead to invalid IL code.
14522
14523 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
14524
14525         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
14526           renamed to Emit.
14527
14528         * delegate.cs (Define): Fixed crash when delegate type is undefined.
14529
14530 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
14531
14532         * cs-parser.jay: Fix small regression: we were not testing V2
14533         compiler features correctly.
14534
14535         * interface.cs: If the emit context is null, then create one
14536
14537 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
14538
14539         * decl.cs (GetSignatureForError): New virtual method to get full name
14540           for error messages.
14541
14542         * attribute.cs (IAttributeSupport): New interface for attribute setting.
14543           Now it is possible to rewrite ApplyAttributes method to be less if/else.
14544
14545         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
14546           Duplicated members and code in these classes has been removed.
14547           Better encapsulation in these classes.
14548
14549 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
14550
14551         * assign.cs (Assign.DoResolve): When dealing with compound
14552         assignments, there is a new rule in ECMA C# 2.4 (might have been
14553         there before, but it is documented here) that states that in:
14554
14555         a op= b;
14556
14557         If b is of type int, and the `op' is a shift-operator, then the
14558         above is evaluated as:
14559
14560         a = (int) a op b 
14561
14562         * expression.cs (Binary.ResolveOperator): Instead of testing for
14563         int/uint/long/ulong, try to implicitly convert to any of those
14564         types and use that in pointer arithmetic.
14565
14566         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
14567         method to print information for from the type, not from the
14568         null-method we were given.
14569
14570 2004-02-01  Duncan Mak  <duncan@ximian.com>
14571
14572         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
14573         parsing for cmd, fixes bug #53694.
14574
14575 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
14576
14577         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
14578         in the member name duplication tests. Property and operator name duplication
14579         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
14580
14581 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
14582
14583         * interface.cs (PopulateMethod): Fixed crash when interface method
14584         returns not existing type (error test cs0246-3.cs).
14585
14586 2004-02-02  Ravi Pratap M <ravi@ximian.com>
14587
14588         * cs-parser.jay (interface_accessors): Re-write actions to also
14589         store attributes attached to get and set methods. Fix spelling
14590         while at it.
14591
14592         (inteface_property_declaration): Modify accordingly.
14593
14594         (InterfaceAccessorInfo): New helper class to store information to pass
14595         around between rules that use interface_accessors.
14596
14597         * interface.cs (Emit): Apply attributes on the get and set
14598         accessors of properties and indexers too.
14599
14600         * attribute.cs (ApplyAttributes): Modify accordingly to use the
14601         right MethodBuilder when applying attributes to the get and set accessors.
14602
14603 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
14604
14605         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
14606
14607 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
14608
14609         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
14610
14611 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
14612
14613         * cs-parser.jay: Remove YIELD token, instead use the new grammar
14614         changes that treat `yield' specially when present before `break'
14615         or `return' tokens.
14616
14617         * cs-tokenizer.cs: yield is no longer a keyword.
14618
14619 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
14620
14621         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
14622         setting for default constructors.
14623         For default constructors are almost every time set wrong Modifier. The
14624         generated IL code has been alright. But inside mcs this values was
14625         wrong and this was reason why several of my CLS Compliance tests
14626         failed.
14627
14628 2004-01-22  Martin Baulig  <martin@ximian.com>
14629
14630         * cs-parser.jay (namespace_or_type_name): Return an Expression,
14631         not a QualifiedIdentifier.  This is what `type_name_expression'
14632         was previously doing.
14633         (type_name_expression): Removed; the code is now in
14634         `namespace_or_type_name'.
14635         (qualified_identifier): Removed, use `namespace_or_type_name'
14636         instead.
14637         (QualifiedIdentifier): Removed this class.      
14638
14639 2004-01-22  Martin Baulig  <martin@ximian.com>
14640
14641         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
14642         not a string as alias name.
14643
14644 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
14645
14646         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
14647         #52730 bug, and instead compute correctly the need to use a
14648         temporary variable when requesting an address based on the
14649         static/instace modified of the field and the constructor.
14650  
14651 2004-01-21  Martin Baulig  <martin@ximian.com>
14652
14653         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
14654         class and namespace before looking up aliases.  Fixes #52517.
14655
14656 2004-01-21  Martin Baulig  <martin@ximian.com>
14657
14658         * flowanalysis.cs (UsageVector.Merge): Allow variables being
14659         assinged in a 'try'; fixes exception4.cs.
14660
14661 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14662         * class.cs : Implemented parameter-less constructor for TypeContainer
14663
14664         * decl.cs: Attributes are now stored here. New property OptAttributes
14665
14666         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
14667
14668         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
14669
14670 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14671
14672         * typemanager.cs (CSharpSignature): Now reports also inner class name.
14673           (CSharpSignature): New method for indexer and property signature.
14674
14675 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14676
14677         * pending.cs (IsVirtualFilter): Faster implementation.
14678
14679 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14680
14681         * typemanager.cs: Avoid inclusion of same assembly more than once.
14682
14683 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14684
14685         * cs-parser.jay: Fixed problem where the last assembly attribute
14686           has been applied also to following declaration (class, struct, etc.)
14687           
14688 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14689
14690         * class.cs: Added error CS0538, CS0539 reporting.
14691         Fixed crash on Microsoft runtime when field type is void.
14692
14693         * cs-parser.jay: Added error CS0537 reporting.
14694
14695         * pending.cs: Added error CS0535 reporting.
14696         Improved error report for errors CS0536, CS0534.
14697
14698 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
14699
14700         Merge a few bits from the Anonymous Method MCS tree.
14701
14702         * statement.cs (ToplevelBlock): New class for toplevel methods,
14703         will hold anonymous methods, lifted variables.
14704
14705         * cs-parser.jay: Create toplevel blocks for delegates and for
14706         regular blocks of code. 
14707
14708 2004-01-20  Martin Baulig  <martin@ximian.com>
14709
14710         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
14711         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
14712         and `NeedExplicitReturn'; added `IsLastStatement'.
14713         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
14714         have a `ReturnLabel' or we're not unreachable.
14715
14716         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
14717         child's reachability; don't just override ours with it.  Fixes
14718         #58058 (lluis's example).
14719         (FlowBranching): Added public InTryOrCatch(), InCatch(),
14720         InFinally(), InLoop(), InSwitch() and
14721         BreakCrossesTryCatchBoundary() methods.
14722
14723         * statement.cs (Return): Do all error checking in Resolve().
14724         Unless we are the last statement in a top-level block, always
14725         create a return label and jump to it.
14726         (Break, Continue): Do all error checking in Resolve(); also make
14727         sure we aren't leaving a `finally'.
14728         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
14729         statement in a top-level block.
14730         (Block.Flags): Added `IsDestructor'.
14731         (Block.IsDestructor): New public property.
14732
14733 2004-01-20  Martin Baulig  <martin@ximian.com>
14734
14735         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
14736
14737 2004-01-20  Martin Baulig  <martin@ximian.com>
14738
14739         * statement.cs (Statement.ResolveUnreachable): New public method.
14740         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
14741         (Block.Resolve): Resolve unreachable statements.
14742
14743 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
14744
14745         * expression.cs: We need to fix the case where we do
14746         not have a temp variable here.
14747
14748         * assign.cs: Only expression compound assignments need
14749         temporary variables.
14750
14751 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
14752
14753         * flowanalysis.cs: Reduce memory allocation in a few ways:
14754           - A block with no variables should not allocate a bit
14755             vector for itself.
14756           - A method with no out parameters does not need any tracking
14757             for assignment of the parameters, so we need not allocate
14758             any data for it.
14759           - The arrays:
14760                 public readonly Type[] VariableTypes;
14761                 public readonly string[] VariableNames;
14762             Are redundant. The data is already stored in the variable
14763             map, so we need not allocate another array for it.
14764           - We need to add alot of checks for if (params | locals) == null
14765             due to the first two changes.
14766
14767 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
14768
14769         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
14770         implement IMemoryLocation, we store a copy on a local variable and
14771         take the address of it.  Patch from Benjamin Jemlich
14772
14773         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
14774         to use a special "type_name_expression" rule which reduces the
14775         number of "QualifiedIdentifier" classes created, and instead
14776         directly creates MemberAccess expressions.
14777
14778 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
14779
14780         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
14781         that fixes #52853.  Null literal assignment to ValueType
14782
14783         * class.cs (MethodData.Emit): Instead of checking the name of the
14784         method to determine if its a destructor, create a new derived
14785         class from Method called Destructor, and test for that.  
14786
14787         * cs-parser.jay: Create a Destructor object instead of a Method.  
14788
14789         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
14790
14791         Fixes: 52933
14792
14793 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
14794
14795         * expression.cs (Binary.ResolveOperator): Perform an implicit
14796         conversion from MethodGroups to their delegate types on the
14797         Addition operation.
14798
14799         * delegate.cs: Introduce a new class DelegateCreation that is the
14800         base class for `NewDelegate' and `ImplicitDelegateCreation',
14801         factor some code in here.
14802
14803         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
14804         conversion from MethodGroups to compatible delegate types. 
14805
14806         * ecore.cs (Expression.Resolve): Do not flag error 654
14807         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
14808         we allow conversions from MethodGroups to delegate types now.
14809
14810         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
14811         assignments in v2 either.
14812
14813 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
14814
14815         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
14816         static read-only fields in ctors.
14817
14818         Applied patch from Benjamin Jemlich 
14819
14820         * expression.cs (UnaryMutator): Avoid leaking local variables. 
14821
14822 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
14823
14824         * cs-tokenizer.cs (IsCastToken): Allow the various native types
14825         here to return true, as they can be used like this:
14826
14827                 (XXX) int.MEMBER ()
14828
14829         Fixed 49836 and all the other dups
14830
14831 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
14832
14833         * driver.cs: Implement /win32res and /win32icon.
14834
14835 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
14836
14837         * cs-parser.jay: Add a rule to improve error handling for the
14838         common mistake of placing modifiers after the type.
14839
14840 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
14841
14842         * cs-parser.jay (interface_event_declaration): Catch
14843         initialization of events on interfaces, and report cs0068
14844
14845         * cs-parser.jay (interface_event_declaration): Catch
14846         initialization of events. 
14847
14848         * ecore.cs: Better report missing constructors.
14849
14850         * expression.cs (Binary.ResolveOperator): My previous bug fix had
14851         the error reporting done in the wrong place.  Fix.
14852
14853         * expression.cs (Binary.ResolveOperator): Catch the 
14854         operator + (E x, E y) error earlier, and later allow for implicit
14855         conversions in operator +/- (E e, U x) from U to the underlying
14856         type of E.
14857
14858         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
14859         52596, if the container class is abstract, the default constructor
14860         is protected otherwise its public (before, we were always public).
14861
14862         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
14863         fixed statement.
14864
14865         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
14866         Jemlich that fixes bug #52597, MCS was generating invalid code for
14867         idisposable structs.   Thanks to Ben for following up with this
14868         bug as well.
14869
14870 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
14871
14872         * driver.cs: Allow assemblies without code to be generated, fixes
14873         52230.
14874
14875 2004-01-07  Nick Drochak <ndrochak@gol.com>
14876
14877         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
14878
14879 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
14880
14881         * cs-parser.jay: Add rules to improve error reporting if fields or
14882         methods are declared at the namespace level (error 116)
14883
14884         * Add rules to catch event add/remove
14885
14886 2004-01-04  David Sheldon <dave-mono@earth.li>
14887
14888   * expression.cs: Added matching ")" to error message for 
14889   CS0077
14890
14891 2004-01-03 Todd Berman <tberman@gentoo.org>
14892
14893         * ecore.cs, attribute.cs:
14894         Applying fix from #52429.
14895
14896 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
14897
14898         * ecore.cs, expression.cs, statement.cs:
14899         Total rewrite of how we handle branching. We
14900         now handle complex boolean expressions with fewer
14901         jumps. As well if (x == 0) no longer emits a ceq.
14902
14903         if (x is Foo) is much faster now, because we generate
14904         better code.
14905
14906         Overall, we get a pretty big improvement on our benchmark
14907         tests. The code we generate is smaller and more readable.
14908
14909         I did a full two-stage bootstrap. The patch was reviewed
14910         by Martin and Miguel.
14911
14912 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
14913
14914         * cs-parser.jay: Make primary_expression not take a QI.
14915         we dont need this because the member_access rule covers
14916         us here. So we replace the rule with just IDENTIFIER.
14917
14918         This has two good effects. First, we remove a s/r conflict.
14919         Second, we allocate many fewer QualifiedIdentifier objects.
14920
14921 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
14922
14923         * attribute.cs: Handle MarshalAs attributes as pseudo, and
14924         set the correct information via SRE. This prevents
14925         hanging on the MS runtime. Fixes #29374.
14926
14927 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
14928
14929         * convert.cs: correctly handle conversions to value types
14930         from Enum and ValueType as unboxing conversions.
14931
14932         Fixes bug #52569. Patch by Benjamin Jemlich.
14933
14934 2004-01-02  Ravi Pratap  <ravi@ximian.com>
14935
14936         * expression.cs (BetterConversion): Prefer int -> uint
14937         over int -> ulong (csc's behaviour). This fixed bug #52046.
14938
14939 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
14940
14941         * decl.cs (MemberCache.FindMembers): now returns a
14942         MemberInfo [].
14943
14944         * typemanager.cs: In general, go with with ^^.
14945         (CopyNewMethods): take an IList.
14946         (RealMemberLookup): Only allocate an arraylist
14947         if we copy from two sets of methods.
14948
14949         This change basically does two things:
14950         1) Fewer array lists allocated due to CopyNewMethods.
14951         2) the explicit cast in MemberList costed ALOT.
14952
14953 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
14954
14955         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
14956         a hashtable to avoid needless string allocations when an identifier is
14957         used more than once (the common case).
14958
14959 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
14960
14961         * pending.cs: MS's TypeBuilder.GetInterfaces ()
14962         is broken, it will not return anything. So, we
14963         have to use the information we have in mcs to
14964         do the task.
14965
14966         * typemanager.cs: Add a cache for GetInterfaces,
14967         since this will now be used more often (due to ^^)
14968
14969         (GetExplicitInterfaces) New method that gets the
14970         declared, not effective, interfaces on a type
14971         builder (eg, if you have interface IFoo, interface
14972         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
14973         { IBar }.
14974
14975         This patch makes MCS able to bootstrap itself on
14976         Windows again.
14977
14978 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
14979
14980         * expression.cs: Remove the Nop's that Miguel put
14981         in by mistake.
14982
14983 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
14984
14985         * report.cs, codegen.cs: Give the real stack trace to
14986         the error when an exception is thrown.
14987
14988 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
14989
14990         * decl.cs: only allocate hashtables for ifaces if 
14991         it is an iface!
14992
14993 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
14994
14995         * expression.cs: fix the error from cs0121-2.cs
14996         (a parent interface has two child interfaces that
14997         have a function with the same name and 0 params
14998         and the function is called through the parent).
14999
15000 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
15001
15002         * class.cs, rootcontext.cs, typmanager.cs: do not
15003         leak pointers.
15004
15005 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
15006
15007         * codegen.cs: remove stack for the ec flow branching.
15008         It is already a linked list, so no need.
15009
15010 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
15011
15012         * Makefile: Allow custom profiler here.
15013
15014 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
15015
15016         * typemanager.cs (LookupType):
15017           - Use a static char [], because split takes
15018             a param array for args, so it was allocating
15019             every time.
15020           - Do not store true in a hashtable, it boxes.
15021
15022 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
15023
15024         * flowanalysis.cs: bytify common enums.
15025
15026 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
15027
15028         * modifiers.cs: Add a new set of flags for the
15029         flags allowed on explicit interface impls.
15030         * cs-parser.jay: catch the use of modifiers in
15031         interfaces correctly.
15032         * class.cs: catch private void IFoo.Blah ().
15033
15034         All related to bug #50572.
15035
15036 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
15037
15038         * decl.cs: Rewrite the consistant accessability checking.
15039         Accessability is not linear, it must be implemented in
15040         a tableish way. Fixes #49704.
15041
15042 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
15043
15044         * expression.cs: Handle negation in a checked context.
15045         We must use subtraction from zero. Fixes #38674.
15046
15047 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15048
15049         * class.cs: Ignore static void main in DLLs.
15050         * rootcontext.cs: Handle the target type here,
15051         since we are have to access it from class.cs
15052         * driver.cs: account for the above.
15053
15054 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15055
15056         * report.cs: Give line numbers and files if available.
15057
15058 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
15059
15060         * driver.cs: Implement /addmodule.
15061
15062         * typemanager.cs:  Change 'modules' field so it now contains Modules not
15063         ModuleBuilders.
15064
15065 2003-12-20  Martin Baulig  <martin@ximian.com>
15066
15067         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
15068         (FieldBase.IsAssigned): Removed this field.
15069         (FieldBase.SetAssigned): New public method.
15070         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
15071
15072 2003-12-20  Martin Baulig  <martin@ximian.com>
15073
15074         * expression.cs (LocalVariableReference.DoResolve): Don't set
15075         `vi.Used' if we're called from DoResolveLValue().
15076
15077         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
15078         returns the usage vector it just merged into the current one -
15079         pass this one to UsageWarning().
15080         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
15081         of the `EmitContext', don't call this recursively on our children.
15082
15083 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
15084
15085         * driver.cs: Implement /target:module.
15086
15087 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
15088
15089         * support.cs (CharArrayHashtable): New helper class.
15090
15091         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
15092         char arrays, not strings, so we can avoid creating a string in
15093         consume_identifier if the identifier is a keyword.
15094
15095 2003-12-16  Martin Baulig  <martin@ximian.com>
15096
15097         * statement.cs (LocalInfo.Assigned): Removed this property.
15098         (LocalInfo.Flags): Removed `Assigned'.
15099         (LocalInfo.IsAssigned): New public method; takes the EmitContext
15100         and uses flow analysis.
15101         (Block.UsageWarning): Made this method private.
15102         (Block.Resolve): Call UsageWarning() if appropriate.
15103
15104         * expression.cs (LocalVariableReference.DoResolve): Always set
15105         LocalInfo.Used here.
15106
15107 2003-12-13  Martin Baulig  <martin@ximian.com>
15108
15109         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
15110         any value here; we're now using flow analysis to figure out
15111         whether a statement/block returns a value.
15112
15113 2003-12-13  Martin Baulig  <martin@ximian.com>
15114
15115         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
15116         working again.
15117         (FlowBranching.MergeFinally): Don't call
15118         `branching.CheckOutParameters()' here, this is called in
15119         MergeTopBlock().
15120         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
15121         when adding the `finally' vector.       
15122
15123 2003-12-13  Martin Baulig  <martin@ximian.com>
15124
15125         * flowanalysis.cs
15126         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
15127         actually work and also fix #48962.
15128
15129 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
15130
15131         * decl.cs: Do not check System.Object for nested types,
15132         since we know it does not have any. Big bang for buck:
15133
15134         BEFORE:
15135            Run 1:   8.35 seconds
15136            Run 2:   8.32 seconds
15137            corlib:  17.99 seconds
15138         AFTER:
15139            Run 1:   8.17 seconds
15140            Run 2:   8.17 seconds
15141            corlib:  17.39 seconds
15142
15143 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
15144
15145         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
15146         time we are returning 0 members, so we save alot here.
15147
15148 2003-12-11  Martin Baulig  <martin@ximian.com>
15149
15150         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
15151         `MergeChild()', also just take the `FlowBranching' as argument;
15152         call Merge() on it and return the result.
15153         (FlowBranching.Merge): We don't need to do anything if we just
15154         have one sibling.
15155
15156 2003-12-11  Martin Baulig  <martin@ximian.com>
15157
15158         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
15159         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
15160         Maurer for this idea.
15161
15162 2003-12-11  Martin Baulig  <martin@ximian.com>
15163
15164         * flowanalysis.cs (MergeResult): This class is now gone; we now
15165         use the `UsageVector' for this.  The reason for this is that if a
15166         branching just has one sibling, we don't need to "merge" them at
15167         all - that's the next step to do.
15168         (FlowBranching.Merge): We now return a `UsageVector' instead of a
15169         `MergeResult'.
15170
15171 2003-12-11  Martin Baulig  <martin@ximian.com>
15172
15173         Reworked flow analyis and made it more precise and bug-free.  The
15174         most important change is that we're now using a special `Reachability'
15175         class instead of having "magic" meanings of `FlowReturns'.  I'll
15176         do some more cleanups and optimizations and also add some more
15177         documentation this week.
15178
15179         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
15180         largely reworked this class.
15181         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
15182         the new `Reachability' class instead of having "magic" values here.
15183         (FlowBranching): We're now using an instance of `Reachability'
15184         instead of having separate `Returns', `Breaks' etc. fields.
15185
15186         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
15187         based on flow analysis; ignore the return value of block.Emit ().
15188
15189 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
15190
15191         * driver.cs typemanager.cs: Find the mono extensions to corlib even
15192         if they are private.
15193
15194 2003-12-09  Martin Baulig  <martin@ximian.com>
15195
15196         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
15197         call them directly on the UsageVector.
15198
15199 2003-12-09  Martin Baulig  <martin@ximian.com>
15200
15201         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
15202         Changed return type from `FlowReturns' to `Reachability'.
15203
15204 2003-12-09  Martin Baulig  <martin@ximian.com>
15205
15206         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
15207         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
15208         `Reachable' fields with a single `Reachability' one.
15209
15210 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15211
15212         * class.cs (FindMembers): Remove foreach's.
15213
15214         Bootstrap times:
15215
15216         BEFORE
15217                 Run 1:   8.74 seconds
15218                 Run 2:   8.71 seconds
15219
15220         AFTER
15221                 Run 1:   8.64 seconds
15222                 Run 2:   8.58 seconds
15223
15224
15225 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15226
15227         * cs-parser.jay:
15228         * gen-treedump.cs:
15229         * statement.cs:
15230         This patch does a few things:
15231                 1. EmptyStatement is now a singleton, so it is never reallocated.
15232                 2. All blah is EmptyStatement constructs have been changed to
15233                    blah == EmptyStatement.Value, which is much faster and valid
15234                    now that EmptyStatement is a singleton.
15235                 3. When resolving a block, rather than allocating a new array for
15236                    the non-empty statements, empty statements are replaced with
15237                    EmptyStatement.Value
15238                 4. Some recursive functions have been made non-recursive.
15239         Mainly the performance impact is from (3), however (1) and (2) are needed for
15240         this to work. (4) does not make a big difference in normal situations, however
15241         it makes the profile look saner.
15242
15243         Bootstrap times:
15244
15245         BEFORE
15246         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15247         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15248         Total memory allocated: 56397 KB
15249
15250         AFTER
15251         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
15252         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
15253         Total memory allocated: 55666 KB
15254
15255 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15256
15257         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
15258         than the hashtable in a hashtable version
15259
15260         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
15261         we always end up concating a string. This results in a huge perf
15262         loss, because many strings have to be tracked by the GC. In this
15263         patch, we first use a hashtable that works with two keys, so that
15264         the strings do not need to be concat'ed.
15265
15266         Bootstrap times:
15267         BEFORE
15268                 Run 1:   8.74 seconds
15269                 Run 2:   8.71 seconds
15270
15271         AFTER
15272                 Run 1:   8.65 seconds
15273                 Run 2:   8.56 seconds
15274
15275 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15276
15277         * Makefile: Add a new target `do-time' that does a quick and simple
15278         profile, leaving easy to parse output.
15279
15280 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
15281
15282         * codegen.cs (Init): Create the dynamic assembly with 
15283         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
15284
15285 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
15286
15287         * support.cs: Make the PtrHashtable use only one
15288         instance of its comparer.
15289
15290 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
15291
15292         * typemanager.cs: Fix lookup of GetNamespaces.
15293
15294 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
15295
15296         * expression.cs: Removed redundant line.
15297
15298         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
15299         ArrayLists, use for loops with bounds.  
15300
15301         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
15302         arraylist.
15303
15304         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
15305         arraylists, use for loop with bounds.
15306
15307         The above three changes give us a 0.071 second performance
15308         improvement out of 3.294 seconds down to 3.223.  On my machine
15309         the above changes reduced the memory usage by 1,387 KB during
15310         compiler bootstrap.
15311
15312         * cs-parser.jay (QualifiedIdentifier): New class used to represent
15313         QualifiedIdentifiers.  Before we created a new string through
15314         concatenation, and mostly later on, the result would be
15315         manipulated by DecomposeQI through string manipulation.
15316
15317         This reduced the compiler memory usage for bootstrapping from
15318         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
15319         compile times in 0.05 seconds.
15320
15321 2003-11-28  Dick Porter  <dick@ximian.com>
15322
15323         * support.cs: Do string compares with the Invariant culture.
15324
15325         * rootcontext.cs: 
15326         * gen-treedump.cs: 
15327         * expression.cs: 
15328         * driver.cs: 
15329         * decl.cs: 
15330         * codegen.cs: 
15331         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
15332         the comparison is done with the Invariant culture.
15333
15334 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
15335
15336         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
15337         GetEnumerator method.
15338
15339         (ProbeCollectionType): Iterate starting at the most specific type
15340         upwards looking for a GetEnumerator
15341
15342         * expression.cs: Shift count can be up to 31 for int/uint and 63
15343         for long/ulong.
15344
15345 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
15346
15347         * statement.cs (Block.LookupLabel): Also look for the label on the
15348         children blocks.  Use a hash table to keep track of visited
15349         nodes. 
15350
15351         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
15352         we actually did transform the other operand, otherwise fall back
15353         to the common codepath that casts to long.
15354
15355         * cs-tokenizer.cs: Use the same code pattern as the int case.
15356         Maybe I should do the parsing myself, and avoid depending on the
15357         Parse routines to get this done.
15358
15359 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
15360
15361         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
15362         which fixes bug 51347.  This time test it.
15363
15364         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
15365         attributes for example can not tell the difference between these.
15366         The difference was only a syntax feature of the language. 
15367
15368         * attribute.cs: Apply attributes to delegates.
15369
15370         * delegate.cs: Call the apply attributes method.
15371
15372 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
15373
15374         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
15375         comparing 0 vs Byte.MinValue, not the value
15376
15377         (ImplicitConversionRequired): When reporting a conversion error,
15378         use error 31 to print out the constant error instead of the
15379         simpler 29.
15380
15381         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
15382         which fixes bug 51347.
15383
15384 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
15385
15386         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
15387         which fixes the -warnaserror command line option.
15388
15389 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
15390
15391         * cfold.cs (DoNumericPromotions): During constant folding of
15392         additions on UIntConstant, special case intconstants with
15393         IntConstants like we do on the expression binary operator. 
15394
15395 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
15396
15397         * convert.cs (ImplicitReferenceConversion): We were missing a case
15398         (System.Enum are not value types or class types, so we need to
15399         classify them separatedly).
15400
15401         * driver.cs: We do not support error 2007.
15402
15403 2003-11-12 Jackson Harper <jackson@ximian.com>
15404
15405         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
15406         system directory. Also use the full file name so users can
15407         libraries names mscorlib-o-tron.dll in a non system dir.
15408
15409 2003-11-10  Martin Baulig  <martin@ximian.com>
15410
15411         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
15412         (TypeManager.InitCoreTypes): Initialize them here, but instead of
15413         calling `ResolveType()' on them, directly assign their `Type'.
15414
15415 2003-11-08  Martin Baulig  <martin@ximian.com>
15416
15417         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
15418         return value and the `out parent' parameter.
15419         (TypeContainer.DefineType): Moved the CS0644 check into
15420         GetClassBases().  Don't pass the interface types to the
15421         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
15422         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
15423
15424         * ecore.cs (TypeExpr.IsAttribute): New property.
15425         (TypeExpr.GetInterfaces): New method.
15426
15427         * interface.cs (Interface.GetInterfaceTypeByName): Return a
15428         TypeExpr instead of a Type.
15429         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
15430         (Interface.DefineType): Don't pass the interface types to the
15431         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
15432         them later and then call `TypeBulider.AddInterfaceImplementation()'.
15433
15434         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
15435         instead of a `Type[]'.
15436         (TypeManager.RegisterBuilder): Likewise.
15437         (TypeManager.AddUserInterface): Likewise.
15438         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
15439         `Type[]' and also return a `TypeExpr[]'.
15440         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
15441
15442 2003-11-08  Martin Baulig  <martin@ximian.com>
15443
15444         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
15445         Expression.     
15446
15447 2003-11-08  Martin Baulig  <martin@ximian.com>
15448
15449         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
15450         TypeManager.ResolveExpressionTypes().
15451
15452         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
15453         instead of an Expression.
15454         (TypeExpr): This is now an abstract base class for `TypeExpression'.
15455         (TypeExpression): New public class; formerly known as `TypeExpr'.
15456
15457         * expression.cs (ComposedCast): Derive from TypeExpr.
15458
15459         * typemanager.cs (TypeManager.system_*_expr): These are now
15460         TypExpr's instead of Expression's.
15461         (TypeManager.ResolveExpressionTypes): New public static function;
15462         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
15463         of them.        
15464
15465 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
15466
15467         * expression.cs (New.DoResolve): Do not dereference value that
15468         might be a null return.
15469
15470         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
15471         sure that the constant value has the right type.  Fixes an
15472         unreported bug, similar to 50425.
15473
15474         * const.cs (Const.LookupConstantValue): Call
15475         ImplicitStandardConversionExists before doing a conversion to
15476         avoid havng the TypeManager.ChangeType do conversions.
15477
15478         Reduced the number of casts used
15479
15480         (Const.ChangeType): New routine to enable reuse of the constant
15481         type changing code from statement.
15482
15483         * typemanager.cs (ChangeType): Move common initialization to
15484         static global variables.
15485
15486         Fixes #50425.
15487
15488         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
15489         every value type to go through, even if it was void.  Fix that. 
15490
15491         * cs-tokenizer.cs: Use is_identifier_start_character on the start
15492         character of the define, and the is_identifier_part_character for
15493         the rest of the string.
15494
15495 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
15496
15497         * expression.cs (UnaryMutator.EmitCode): When I updated
15498         LocalVariableReference.DoResolve, I overdid it, and dropped an
15499         optimization done on local variable references.
15500
15501 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
15502
15503         * ecore.cs: Convert the return from Ldlen into an int.
15504
15505 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
15506
15507         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
15508         the accessibility, this is a special case for toplevel non-public
15509         classes (internal for instance).
15510
15511 2003-10-20  Nick Drochak <ndrochak@gol.com>
15512
15513         * ecore.cs: Fix typo and build.  Needed another right paren.
15514
15515 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
15516
15517         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
15518         `internal' case regular and protected, but not allowing protected
15519         to be evaluated later.  Bug 49840
15520
15521 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
15522
15523         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
15524         to kb.Nlast, and not the kb.nFirst to isolate the switch
15525         statement.
15526
15527         Extract the underlying type, so enumerations of long/ulong are
15528         treated like long/ulong.
15529
15530 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
15531
15532         * expression.cs (New): Overload the meaning of RequestedType to
15533         track the possible creation of the NewDelegate type, since
15534         DoResolve is invoked more than once for new constructors on field
15535         initialization.
15536
15537         See bugs: #48800 and #37014
15538
15539         * cs-parser.jay (declare_local_constants): Take an arraylist
15540         instead of a single constant.
15541
15542         (local_constant_declaration): It should take a
15543         constant_declarators, not a constant_declarator.  Fixes 49487
15544
15545         * convert.cs: Fix error report.
15546
15547 2003-10-13 Jackson Harper <jackson@ximian.com>
15548
15549         * typemanager.cs (TypeToCoreType): Add float and double this fixes
15550         bug #49611
15551
15552 2003-10-09  Martin Baulig  <martin@ximian.com>
15553
15554         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
15555         to the .ctor.
15556         (MethodCore.DoDefineParameters): Removed the TypeContainer
15557         argument; use the DeclSpace which was passed to the .ctor instead.
15558         (MethodCore.CheckParameter): Take a DeclSpace instead of a
15559         TypeContainer; we only need a DeclSpace here.
15560
15561 2003-10-09  Martin Baulig  <martin@ximian.com>
15562
15563         * class.cs (MethodData): Added additional `DeclSpace ds' argument
15564         to the .ctor.
15565         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
15566         EmitContext's .ctor.    
15567
15568 2003-10-09  Martin Baulig  <martin@ximian.com>
15569
15570         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
15571         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
15572         AsAccessible(), moved them as well.
15573
15574         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
15575
15576 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
15577
15578         * cs-parser.jay : Renamed yyName to yyNames related to jay.
15579
15580 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
15581
15582         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
15583         generation for >=, as spotted by Paolo, bug 48679.  
15584         Patch from David Waite.
15585
15586         * cs-tokenizer.cs: Add handling for #pragma.
15587
15588         * cs-parser.jay: Allow for both yield and yield return in the
15589         syntax.  The anti-cobolization of C# fight will go on!
15590
15591         * class.cs (TypeBuilder.DefineType): Catch error condition here
15592         (Parent.DefineType erroring out and returning null).
15593
15594         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15595         coping with enumerations variables, we were mistakenly processing
15596         them as a regular value type instead of built-in types.  Fixes the
15597         bug #48063
15598
15599         * typemanager.cs (IsBuiltinOrEnum): New method.
15600
15601 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
15602
15603         * cs-parser.jay: Upgrade: yield now needs the return clause.
15604
15605 2003-09-19  Martin Baulig  <martin@ximian.com>
15606
15607         * decl.cs (MemberCache.SetupCacheForInterface): Take a
15608         `MemberCache parent' argument.  Normally, an interface doesn't
15609         have a parent type except System.Object, but we use this in gmcs
15610         for generic type parameters.
15611
15612 2003-09-18  Martin Baulig  <martin@ximian.com>
15613
15614         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
15615         on `type.IsInterface'; don't check whether the type has a parent
15616         to determine whether it's an interface.
15617
15618 2003-09-15  Martin Baulig  <martin@ximian.com>
15619
15620         * class.cs (TypeContainer.DefineType): Added an error flag to
15621         avoid reporting duplicate CS0146's ("class definition is
15622         circular.").
15623
15624         * driver.cs (Driver.MainDriver): Abort if
15625         RootContext.ResolveTree() reported any errors.
15626
15627 2003-09-07  Martin Baulig  <martin@ximian.com>
15628
15629         * report.cs (Error, Warning): Added overloaded versions which take
15630         a `params object[] args' and call String.Format().
15631
15632 2003-09-07  Martin Baulig  <martin@ximian.com>
15633
15634         * decl.cs (DeclSpace..ctor): Don't call
15635         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
15636         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
15637         (DeclSpace.RecordDecl): New method.
15638
15639         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
15640
15641 2003-09-02  Ravi Pratap  <ravi@ximian.com>
15642
15643         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
15644         value attributes to be applied to ParameterBuilders.
15645
15646         * class.cs (MethodCore.LabelParameters): Make static and more
15647         generic so that it can be used from other places - like interface
15648         methods, for instance.
15649
15650         * interface.cs (Interface.Emit): Call LabelParameters before
15651         emitting attributes on the InterfaceMethod.
15652
15653 2003-08-26  Martin Baulig  <martin@ximian.com>
15654
15655         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
15656         resolving aliases; fixes #47927.
15657
15658 2003-08-26  Martin Baulig  <martin@ximian.com>
15659
15660         * statement.cs (Using.DoResolve): This is internally emitting a
15661         try/finally clause, so we need to set ec.NeedExplicitReturn if we
15662         do not always return.  Fixes #47681.
15663
15664 2003-08-26  Martin Baulig  <martin@ximian.com>
15665
15666         * decl.cs (MemberCore): Moved WarningNotHiding(),
15667         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
15668         into MemberBase.
15669         (AdditionResult): Make this nested in DeclSpace.
15670         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
15671         argument; call NamespaceEntry.Define() unless we're nested in a
15672         class or struct.
15673
15674         * namespace.cs (Namespace.DefineName): New public function.  This
15675         is called from DeclSpace's .ctor to add 
15676         (Namespace.Lookup): Include DeclSpaces in the lookup.
15677
15678         * class.cs (Operator): Derive from MemberBase, not MemberCore.
15679
15680         * const.cs (Const): Derive from MemberBase, not MemberCore.     
15681
15682 2003-08-25  Martin Baulig  <martin@ximian.com>
15683
15684         * convert.cs (Convert.ExplicitReferenceConversion): When
15685         converting from an interface type to a class, unbox if the target
15686         type is a struct type.  Fixes #47822.
15687
15688 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15689
15690         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
15691         #47854.
15692
15693 2003-08-22  Martin Baulig  <martin@ximian.com>
15694
15695         * class.cs (TypeManager.DefineType): When defining a nested type,
15696         call DefineType() on our parent; fixes #47801.
15697
15698 2003-08-22  Martin Baulig  <martin@ximian.com>
15699
15700         * class.cs (MethodData.Define): While checking if a method is an
15701         interface implementation, improve the test a bit more to fix #47654.
15702
15703 2003-08-22  Martin Baulig  <martin@ximian.com>
15704
15705         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
15706         correctly; fixes #47722.
15707
15708 2003-08-22  Martin Baulig  <martin@ximian.com>
15709
15710         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
15711         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
15712
15713         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
15714
15715 2003-08-22  Martin Baulig  <martin@ximian.com>
15716
15717         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
15718         can only be assigned in static constructors.  Fixes #47161.
15719
15720 2003-08-22  Martin Baulig  <martin@ximian.com>
15721
15722         Rewrote and improved the flow analysis code.
15723
15724         * flowbranching.cs (FlowBranching): Make this class abstract.
15725         (FlowBranching.CreateBranching): New static function to create a
15726         new flow branching.
15727         (FlowBranchingBlock, FlowBranchingException): New classes.
15728         (FlowBranching.UsageVector.Type): New public readonly field.
15729         (FlowBranching.UsageVector.Breaks): Removed the setter.
15730         (FlowBranching.UsageVector.Returns): Removed the setter.
15731         (FlowBranching.UsageVector): Added Break(), Return(),
15732         NeverReachable() and Throw() methods to modify the reachability.
15733         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
15734         done by FlowBranching.Merge().
15735         (FlowBranching.UsageVector.MergeChild): New method; merges the
15736         merge result into the current vector.
15737         (FlowBranching.Merge): New abstract method to merge a branching.
15738
15739 2003-08-12  Martin Baulig  <martin@ximian.com>
15740
15741         * expression.cs (Indirection.CacheTemporaries): Create the
15742         LocalTemporary with the pointer type, not its element type.
15743
15744 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
15745
15746         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
15747         token was a keyword or not.
15748
15749         Add `error' options where an IDENTIFIER was expected;  Provide
15750         CheckToken and CheckIdentifierToken convenience error reporting
15751         functions. 
15752
15753         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
15754
15755         * decl.cs: Rename `NamespaceEntry Namespace' public field into
15756         NameSpaceEntry NameSpaceEntry.
15757
15758         (LookupInterfaceOrClass): Avoid creating a full qualified name
15759         from namespace and name: avoid doing lookups when we know the
15760         namespace is non-existant.   Use new Tree.LookupByNamespace which
15761         looks up DeclSpaces based on their namespace, name pair.
15762
15763         * driver.cs: Provide a new `parser verbose' to display the
15764         exception thrown during parsing.  This is turned off by default
15765         now, so the output of a failure from mcs is more graceful.
15766
15767         * namespace.cs: Track all the namespaces defined in a hashtable
15768         for quick lookup.
15769
15770         (IsNamespace): New method
15771
15772 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
15773
15774         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
15775         we know that we need to concatenate (full typename can never be
15776         null). 
15777
15778         * class.cs: ditto.
15779
15780         * statement.cs: Use a bitfield;  Do not initialize to null things
15781         which are done by the constructor by default.
15782
15783         * cs-parser.jay: bug fix, parameter was 4, not 3.
15784
15785         * expression.cs: Just use the property;
15786
15787         * statement.cs: No need for GetVariableInfo method.
15788
15789 2003-08-08  Martin Baulig  <martin@ximian.com>
15790
15791         * flowanalysis.cs (FlowReturns): This is now nested in the
15792         `FlowBranching' class.
15793         (MyBitVector): Moved this here from statement.cs.
15794         (FlowBranching.SiblingType): New enum type.
15795         (FlowBranching.CreateSibling): Added `SiblingType' argument.
15796
15797 2003-08-07  Martin Baulig  <martin@ximian.com>
15798
15799         * flowanalysis.cs (FlowBranchingType): This is now nested in the
15800         `FlowBranching' class and called `BranchingType'.
15801
15802 2003-08-07  Martin Baulig  <martin@ximian.com>
15803
15804         * flowanalysis.cs: Moved all the control flow analysis code into
15805         its own file.
15806
15807 2003-08-07  Martin Baulig  <martin@ximian.com>
15808
15809         * assign.cs (Assign.DoResolve): `target' must either be an
15810         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
15811         #37319.
15812
15813 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
15814
15815         * expression.cs (BinaryMethod): This kind of expression is created by the
15816         Binary class if it determines that the operator has to be handled
15817         by a method.
15818
15819         (BinaryDelegate): This kind of expression is created if we are
15820         dealing with a + or - operator on delegates.
15821
15822         (Binary): remove method, argumetns, and DelegateOperator: when
15823         dealing with methods, 
15824
15825         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
15826
15827         * statement.cs (Block): use bitfields for the three extra booleans
15828         we had in use.   Remove unused topblock parameter.
15829
15830         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
15831
15832         * assign.cs: Drop extra unneeded tests.
15833
15834 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
15835
15836         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
15837
15838         * statement.cs (Foreach): Use VariableStorage instead of
15839         LocalBuilders.   
15840
15841         * codegen.cs (VariableStorage): New class used by clients that
15842         require a variable stored: locals or fields for variables that
15843         need to live across yield.
15844
15845         Maybe provide a convenience api for EmitThis+EmitLoad?
15846
15847         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
15848         these bad boys.
15849
15850 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
15851
15852         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
15853         RemapParameterLValue): New methods that are used to turn a
15854         precomputed FieldInfo into an expression like this:
15855
15856                 instance.FieldInfo
15857
15858         The idea is to use this instead of making LocalVariableReference
15859         have more than one meaning.
15860
15861         * cs-parser.jay: Add error production to BASE.
15862
15863         * ecore.cs: Deal with TypeManager.GetField returning null, which
15864         is now a valid return value.
15865
15866         (FieldExprNoAddress): New expression for Fields whose address can
15867         not be taken.
15868
15869         * expression.cs (LocalVariableReference): During the resolve
15870         phases, create new expressions if we are in a remapping context.
15871         Remove code that dealt with remapping here.
15872
15873         (ParameterReference): same.
15874
15875         (ProxyInstance): New expression, like the `This' expression, but
15876         it is born fully resolved.  We know what we are doing, so remove
15877         the errors that are targeted to user-provided uses of `this'.
15878
15879         * statement.cs (Foreach): our variable is now stored as an
15880         Expression;  During resolution, follow the protocol, dont just
15881         assume it will return this.
15882
15883 2003-08-06  Martin Baulig  <martin@ximian.com>
15884
15885         * support.cs (SeekableStreamReader.cs): New public class.
15886
15887         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
15888         SeekableStreamReader instead of the normal StreamReader.
15889
15890 2003-08-04  Martin Baulig  <martin@ximian.com>
15891
15892         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
15893         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
15894         deambiguate casts and delegate invocations.
15895         (parenthesized_expression): Use the new tokens to ensure this is
15896         not a cast of method invocation.
15897
15898         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
15899         when reading a `)' and Deambiguate_CloseParens () was previously
15900         called.
15901
15902         * expression.cs (ParenthesizedExpression): New class.  This is
15903         just used for the CS0075 test.
15904         (Binary.DoResolve): Check for CS0075.   
15905
15906 2003-07-29  Ravi Pratap  <ravi@ximian.com>
15907
15908         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
15909         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
15910         reference comparison.
15911
15912         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
15913         examine the ReturnType for equality - this is necessary in the
15914         cases of implicit and explicit operators whose signature also
15915         includes the return type.
15916
15917 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
15918
15919         * namespace.cs: Cache the result of the namespace computation,
15920         instead of computing it every time.
15921
15922 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
15923
15924         * decl.cs: Use a global arraylist that we reuse over invocations
15925         to avoid excesive memory consumption.  Reduces memory usage on an
15926         mcs compile by one meg (45 average).
15927
15928         * typemanager.cs (LookupTypeReflection): In .NET pointers are
15929         private, work around that.
15930
15931 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
15932
15933         * literal.cs (IntLiteral): Define Zero and One static literals. 
15934
15935         * cs-parser.jay (integer_literal): use static literals to reduce
15936         memory usage for the most used literals (0, 1 and -1).  211kb
15937         reduced in memory usage.
15938
15939         Replace all calls to `new ArrayList' with `new
15940         ArrayList(4)' which is a good average number for most allocations,
15941         and also requires only 16 bytes of memory for its buffer by
15942         default. 
15943
15944         This reduced MCS memory usage in seven megabytes for the RSS after
15945         bootstrapping.
15946
15947 2003-07-28  Ravi Pratap  <ravi@ximian.com>
15948
15949         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
15950         handle params methods the correct way by forming only one
15951         applicable set with params and normal methods in them. Earlier we
15952         were looking at params methods only if we found no normal methods
15953         which was not the correct thing to do.
15954
15955         (Invocation.BetterFunction): Take separate arguments indicating
15956         when candidate and the best method are params methods in their
15957         expanded form.
15958
15959         This fixes bugs #43367 and #46199.
15960
15961         * attribute.cs: Documentation updates.
15962
15963         (CheckAttribute): Rename to CheckAttributeTarget.
15964         (GetValidPlaces): Rename to GetValidTargets.
15965
15966         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
15967         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
15968
15969         Fixes bug #44468.
15970
15971 2003-07-28  Martin Baulig  <martin@ximian.com>
15972
15973         * class.cs (TypeContainer.DefineMembers): Use the base type's full
15974         name when looking up the base class of a nested class.  Fixes #46977.
15975
15976 2003-07-26  Martin Baulig  <martin@ximian.com>
15977
15978         * expression.cs (Indexers.Indexer): New nested struct; contains
15979         getter, setter and the indexer's type.
15980         (Indexers.Properties): This is now an ArrayList of
15981         Indexers.Indexer's.
15982         (IndexerAccess.DoResolveLValue): Correctly set the type if the
15983         indexer doesn't have any getters.
15984
15985         * assign.cs (Assign.DoResolve): Also do the implicit conversions
15986         for embedded property and indexer assignments.
15987
15988 2003-07-26  Martin Baulig  <martin@ximian.com>
15989
15990         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
15991         preprocessor directive is not the first non-whitespace character
15992         on a line.
15993
15994 2003-07-26  Martin Baulig  <martin@ximian.com>
15995
15996         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
15997         namespace parsing, follow the spec more closely.
15998
15999         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
16000         NamespaceEntry.Lookup().
16001
16002 2003-07-25  Martin Baulig  <martin@ximian.com>
16003
16004         * MethodCore.cs (OverridesSomething): New public field; it's set
16005         from TypeContainer.DefineMembers if this method overrides
16006         something (which doesn't need to be a method).  Fix #39462.
16007
16008 2003-07-25  Ravi Pratap  <ravi@ximian.com>
16009
16010         * typemanager.cs (GetMembers): Ensure that the list of members is
16011         reversed. This keeps things in sync.
16012
16013         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
16014         find an AttributeUsage attribute.
16015
16016         * expression.cs (Invocation.OverloadResolve): Perform the check
16017         which disallows Invoke to be directly called on a Delegate.
16018
16019         (Error_InvokeOnDelegate): Report error cs1533.
16020
16021 2003-07-25  Martin Baulig  <martin@ximian.com>
16022
16023         * expression.cs (Indexers.GetIndexersForType): Only look in the
16024         interface hierarchy if the requested type is already an
16025         interface.  Fixes #46788 while keeping #46502 fixed.
16026
16027 2003-07-25  Martin Baulig  <martin@ximian.com>
16028
16029         * class.cs (TypeContainer.DefineMembers): Check whether all
16030         readonly fields have been assigned and report warning CS0649 if
16031         not.
16032
16033         * statement.cs (LocalInfo.IsFixed): Always return true if this is
16034         a valuetype.
16035
16036 2003-07-24  Ravi Pratap  <ravi@ximian.com>
16037
16038         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
16039         returned from GetMethods to make things consistent with the
16040         assumptions MCS makes about ordering of methods.
16041
16042         This should comprehensively fix bug #45127 and it does :-)
16043
16044         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
16045         ordering is actually reverse.
16046
16047         * Clean up some debug messages I left lying around.
16048
16049         * interface.cs (Populate*): Get rid of code which emits attributes
16050         since the stage in which we emit attributes is the 'Emit' stage,
16051         not the define stage.
16052
16053         (Emit): Move attribute emission for interface members here.
16054
16055 2003-07-22  Ravi Pratap  <ravi@ximian.com>
16056
16057         * expression.cs (Invocation.OverloadResolve): Follow the spec more
16058         closely: we eliminate methods in base types when we have an
16059         applicable method in a top-level type.
16060
16061         Please see section 14.5.5.1 for an exact description of what goes
16062         on. 
16063
16064         This fixes bug #45127 and a host of other related to corlib compilation.
16065
16066         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
16067         array is the method corresponding to the top-level type (this is
16068         because of the changes made to icall.c) so we change this
16069         accordingly.
16070
16071         (MethodGroupExpr.Name): This too.
16072
16073         * typemanager.cs (GetElementType): New method which does the right
16074         thing when compiling corlib. 
16075
16076         * everywhere: Make use of the above in the relevant places.
16077
16078 2003-07-22  Martin Baulig  <martin@ximian.com>
16079
16080         * cs-parser.jay (invocation_expression): Moved
16081         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
16082         `cast_expression', but create a InvocationOrCast which later
16083         resolves to either an Invocation or a Cast.
16084
16085         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
16086         method; call this before EmitStatement() to make sure that this
16087         expression can be used as a statement.
16088
16089         * expression.cs (InvocationOrCast): New class; resolves to either
16090         an Invocation or a Cast.
16091
16092         * statement.cs (StatementExpression): Call ResolveStatement() on
16093         the ExpressionStatement before emitting it.
16094
16095 2003-07-21  Martin Baulig  <martin@ximian.com>
16096
16097         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
16098         `ref' and `out' attributes match; fixes #46220.
16099         (MemberAccess.ResolveMemberAccess): You can't reference a type
16100         through an expression; fixes #33180.
16101         (Indexers.GetIndexersForType): Don't return the indexers from
16102         interfaces the class implements; fixes #46502.
16103
16104 2003-07-21  Martin Baulig  <martin@ximian.com>
16105
16106         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
16107         CS0661 checks; fixes bug #30442.
16108
16109 2003-07-21  Martin Baulig  <martin@ximian.com>
16110
16111         * decl.cs (AdditionResult): Added `Error'.
16112
16113         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
16114
16115         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
16116         makes cs0031.cs actually work.
16117
16118 2003-07-20  Martin Baulig  <martin@ximian.com>
16119
16120         * namespace.cs: Fixed that bug which caused a crash when compiling
16121         the debugger's GUI.
16122
16123 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
16124
16125         * typemanager.cs (LookupTypeReflection): Never expose types which
16126         are NotPublic, NestedPrivate, NestedAssembly, or
16127         NestedFamANDAssem.  We used to return these, and later do a check
16128         that would report a meaningful error, but the problem is that we
16129         would not get the real match, if there was a name override.
16130
16131 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
16132
16133         * namespace.cs (Namespace, Name): Do not compute the namespace
16134         name dynamically, compute it in the constructor.  This reduced
16135         memory usage by 1697 KB.
16136
16137         * driver.cs: Use --pause to pause at the end.
16138
16139 2003-07-17  Peter Williams  <peter@newton.cx>
16140
16141         * Makefile: Change the name of the test target so that it doesn't
16142         conflict with the recursive test target.
16143
16144 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
16145
16146         * expression.cs (LocalVariableReference.Emit, EmitAssign,
16147         AddressOf): Do not use EmitThis, that was wrong, use the actual
16148         this pointer.
16149
16150 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
16151
16152         * class.cs (MethodData.Define): While checking if a method is an
16153         interface implementation, improve the test: If we are not public
16154         (use new test here: use the computed MethodAttributes directly,
16155         instead of the parsed modifier flags) check if the `implementing'
16156         method comes from an interface or not.
16157
16158         * pending.cs (VerifyPendingMethods): Slightly better error
16159         message.
16160
16161         * makefile: add test target that does the mcs bootstrap.
16162
16163 2003-07-16  Ravi Pratap  <ravi@ximian.com>
16164
16165         * interface.cs (Define): Do nothing here since there are no
16166         members to populate etc. Move the attribute emission out of here
16167         since this was just totally the wrong place to put it. Attribute
16168         application happens during the 'Emit' phase, not in the 'Define'
16169         phase.
16170
16171         (Emit): Add this method and move the attribute emission here
16172
16173         * rootcontext.cs (EmitCode): Call the Emit method on interface
16174         types too.
16175
16176 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
16177
16178         * expression.cs (OverloadResolve): Report error only if Location
16179         is not 'Null' which means that there was a probe going on.
16180
16181 2003-07-14  Martin Baulig  <martin@ximian.com>
16182
16183         * expression.cs (ConditionalLogicalOperator): New public class to
16184         implement user defined conditional logical operators.
16185         This is section 14.11.2 in the spec and bug #40505.
16186
16187 2003-07-14  Martin Baulig  <martin@ximian.com>
16188
16189         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
16190
16191 2003-07-14  Martin Baulig  <martin@ximian.com>
16192
16193         * codegen.cs (EmitContext.InFixedInitializer): New public field.
16194
16195         * ecore.cs (IVariable.VerifyFixed): New interface method.
16196
16197         * expression.cs (Unary.ResolveOperator): When resolving the `&'
16198         operator, check whether the variable is actually fixed.  Fixes bug
16199         #36055.  Set a variable definitely assigned when taking its
16200         address as required by the spec.
16201
16202         * statement.cs (LocalInfo.IsFixed): New field.
16203         (LocalInfo.MakePinned): Set `IsFixed' to true.
16204
16205 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
16206
16207         * attribute.cs (Attribute.Resolve): While doing a Member lookup
16208         for .ctors, ensure that we only ask for members declared in the
16209         attribute type (BindingFlags.DeclaredOnly).
16210
16211         Fixes bug #43632.
16212
16213         * expression.cs (Error_WrongNumArguments): Report error 1501
16214         correctly the way CSC does.
16215
16216 2003-07-13  Martin Baulig  <martin@ximian.com>
16217
16218         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
16219         lookup on the fully qualified name, to make things like "X.X" work
16220         where "X.X" is a fully qualified type name, but we also have a
16221         namespace "X" in the using list.  Fixes #41975.
16222
16223 2003-07-13  Martin Baulig  <martin@ximian.com>
16224
16225         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
16226         function. If we're a CompoundAssign, we need to create an embedded
16227         CompoundAssign, not an embedded Assign.
16228         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
16229         Fixes #45854.
16230
16231 2003-07-13  Martin Baulig  <martin@ximian.com>
16232
16233         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
16234         work to fix bug #46088.
16235
16236 2003-07-13  Ravi Pratap <ravi@ximian.com>
16237
16238         * class.cs (Operator.Emit): Do not emit attributes here - it is
16239         taken care of by the Method class that we delegate too. This takes
16240         care of bug #45876.
16241
16242 2003-07-10  Martin Baulig  <martin@ximian.com>
16243
16244         * expression.cs (TypeOfVoid): New class.
16245         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
16246
16247 2003-07-10  Martin Baulig  <martin@ximian.com>
16248
16249         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
16250         bug #35957.
16251
16252 2003-07-10  Martin Baulig  <martin@ximian.com>
16253
16254         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
16255         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
16256
16257         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
16258
16259         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
16260
16261 2003-07-10  Martin Baulig  <martin@ximian.com>
16262
16263         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
16264         of decimal.  Fixes #42850.
16265
16266         NOTE: I also fixed the created byte blob, but this doesn't work on
16267         the MS runtime and csc never produces any byte blobs for decimal
16268         arrays.
16269
16270 2003-07-10  Martin Baulig  <martin@ximian.com>
16271
16272         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
16273         structs; fixes #32068.
16274         (Block.AddChildVariableNames): Fixed #44302.
16275
16276 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16277
16278         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
16279
16280 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
16281
16282         * attribute.cs: And this test is onger needed.
16283
16284 2003-07-08  Martin Baulig  <martin@ximian.com>
16285
16286         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
16287         inaccessible types.  Fixes #36313.
16288
16289         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
16290
16291         * namespace.cs (NamespaceEntry): Create implicit entries for all
16292         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
16293         implicit entries for N1.N2 and N1.
16294
16295 2003-07-08  Martin Baulig  <martin@ximian.com>
16296
16297         Rewrote the handling of namespaces to fix a lot of the issues
16298         wrt. `using' aliases etc.
16299
16300         * namespace.cs (Namespace): Splitted this class into a
16301         per-assembly `Namespace' and a per-file `NamespaceEntry'.
16302
16303         * typemanager.cs (TypeManager.IsNamespace): Removed.
16304         (TypeManager.ComputeNamespaces): Only compute namespaces from
16305         loaded assemblies here, not the namespaces from the assembly we're
16306         currently compiling.
16307
16308 2003-07-08  Martin Baulig  <martin@ximian.com>
16309
16310         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
16311
16312 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
16313
16314         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
16315         already fixed it.  
16316
16317         I thought about the memory savings here, but LookupTypeReflection
16318         is used under already very constrained scenarios.  Compiling
16319         corlib or mcs only exposes one hit, so it would not really reduce
16320         any memory consumption.
16321
16322 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16323
16324         * typemanager.cs: fixes bug #45889 by only adding public types from
16325         other assemblies to the list of known types.
16326
16327 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
16328
16329         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
16330         on the type we resolved.
16331
16332 2003-07-05  Martin Baulig  <martin@ximian.com>
16333
16334         * pending.cs (PendingImplementation.ParentImplements): Don't
16335         create the proxy if the parent is abstract.
16336
16337         * class.cs (TypeContainer.DefineIndexers): Process explicit
16338         interface implementations first.  Fixes #37714.
16339
16340 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
16341
16342         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
16343         defined recursively;  but since we modify the input parameters
16344         (left is set to `this' temporarily), we reset this value if the
16345         left_is_explicit is false, which gives the original semantics to
16346         the code.  
16347
16348         * literal.cs (NullPointer): new class used to represent a null
16349         literal in a pointer context.
16350
16351         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
16352         type is a pointer, use a NullPointer object instead of a
16353         NullLiteral.   Closes 43687
16354
16355         (ExplicitConversion): Convert pointer values using
16356         the conv opcode to the proper type.
16357
16358         * ecore.cs (New): change ValueTypeVariable property into a method,
16359         that returns whether the valuetype is suitable for being used.
16360
16361         * expression.cs (Binary.DoNumericPromotions): Only return if we
16362         the int constant was a valid uint, and we can return both left and
16363         right as uints.  If not, we continue processing, to trigger the
16364         type conversion.  This fixes 39018.
16365
16366         * statement.cs (Block.EmitMeta): During constant resolution, set
16367         the CurrentBlock property on the emitcontext, so that we resolve
16368         constants propertly.
16369
16370 2003-07-02  Martin Baulig  <martin@ximian.com>
16371
16372         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
16373         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
16374
16375         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
16376         than emitting it here.
16377
16378         * statement.cs: Fixed some more flow analysis bugs.
16379
16380 2003-07-02  Martin Baulig  <martin@ximian.com>
16381
16382         * class.cs (MethodData.Define): When implementing interface
16383         methods, set Final unless we're Virtual.
16384
16385         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
16386         check work for interface methods.
16387
16388 2003-07-01  Martin Baulig  <martin@ximian.com>
16389
16390         * ecore.cs (EmitContext.This): Replaced this property with a
16391         GetThis() method which takes a Location argument.  This ensures
16392         that we get the correct error location for a CS0188.
16393
16394 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
16395
16396         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
16397         ImplicitStandardConversion.
16398
16399         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
16400
16401 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
16402
16403         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
16404         optimization.
16405
16406 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
16407
16408         * class.cs (Constructor.Define): Turn off initlocals for unsafe
16409         constructors.
16410
16411         (MethodData.Define): Turn off initlocals for unsafe methods.
16412
16413 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
16414
16415         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
16416         complete;  Fixes #37521.
16417
16418         * delegate.cs: Use Modifiers.TypeAttr to compute the
16419         TypeAttributes, instead of rolling our own.  This makes the flags
16420         correct for the delegates.
16421
16422 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
16423
16424         * class.cs (Constructor.Define): Set the private flag for static
16425         constructors as well.
16426
16427         * cs-parser.jay (statement_expression): Set the return value to
16428         null, to avoid a crash when we catch an error.
16429
16430 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
16431
16432         * cs-parser.jay: Applied patch from Jackson that adds support for
16433         extern and unsafe modifiers to destructor declarations.
16434
16435         * expression.cs: Report error 21 if the user is trying to index a
16436         System.Array.
16437
16438         * driver.cs: Add an error message, suggested by the bug report.
16439
16440         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
16441         if we do not have a ": this ()" constructor initializer.  Fixes 45149
16442
16443 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
16444
16445         * namespace.cs: Add some information to reduce FAQs.
16446
16447 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
16448
16449         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
16450         underlying enumeration types.  Fixes #43915.
16451
16452         * expression.cs: Treat ushort/short as legal values to be used in
16453         bitwise operations.
16454
16455 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
16456
16457         * delegate.cs: transfer custom attributes for paramenters from
16458         the delegate declaration to Invoke and BeginInvoke.
16459
16460 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
16461
16462         * attribute.cs: handle custom marshalers and emit marshal info
16463         for fields, too.
16464
16465 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
16466
16467         * makefile.gnu: Added anonymous.cs to the compiler sources.
16468
16469 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
16470
16471         * iterators.cs: Change the name of the proxy class to include two
16472         underscores.
16473
16474         * cs-parser.jay: Update grammar to include anonymous methods.
16475
16476         * anonymous.cs: new file.
16477
16478 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
16479
16480         * class.cs (Field.Define): Add missing test for pointers and
16481         safety. 
16482
16483 2003-05-27  Ravi Pratap  <ravi@ximian.com>
16484
16485         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
16486         we use the stobj opcode.
16487
16488         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
16489         since it wasn't the correct fix. 
16490
16491         It still is puzzling that we are required to use stobj for IntPtr
16492         which seems to be a ValueType.
16493
16494 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
16495
16496         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
16497         during regular simple name resolution.   Now, the trick is that
16498         instead of returning for processing the simplename, we do a
16499         TypeManager.LookupType (ie, a rooted lookup as opposed to a
16500         contextual lookup type).   If a match is found, return that, if
16501         not, return for further composition.
16502
16503         This fixes long-standing 30485.
16504
16505         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
16506         using the address to initialize an object, do an Stobj instead of
16507         using the regular Stelem.
16508
16509         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
16510         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
16511         Because if we are a BaseIndexerAccess that value will be true.
16512         Fixes 43643.
16513
16514         * statement.cs (GotoCase.Resolve): Return after reporting an
16515         error, do not attempt to continue. 
16516
16517         * expression.cs (PointerArithmetic.Emit): If our operand is a
16518         long, convert our constants to match the operand before
16519         multiplying.  Convert to I type before adding.   Fixes 43670.
16520
16521 2003-05-14  Ravi Pratap  <ravi@ximian.com>
16522
16523         * enum.cs (ImplicitConversionExists) : Rename to
16524         ImplicitEnumConversionExists to remove ambiguity. 
16525
16526         * ecore.cs (NullCast): New type of cast expression class which
16527         basically is very similar to EmptyCast with the difference being
16528         it still is a constant since it is used only to cast a null to
16529         something else
16530         (eg. (string) null)
16531
16532         * convert.cs (ImplicitReferenceConversion): When casting a null
16533         literal, we return a NullCast.
16534
16535         * literal.cs (NullLiteralTyped): Remove - I don't see why this
16536         should be around anymore.
16537
16538         The renaming (reported was slightly wrong). Corrections:
16539
16540         ConvertImplicitStandard -> ImplicitConversionStandard
16541         ConvertExplicitStandard -> ExplicitConversionStandard
16542
16543         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
16544         before passing them in !
16545
16546         * convert.cs (ImplicitConversionStandard): When comparing for
16547         equal expr and target types, ensure that expr is not a
16548         NullLiteral.
16549
16550         In general, we must not be checking (expr_type ==
16551         target_type) in the top level conversion methods
16552         (ImplicitConversion, ExplicitConversion etc). This checking is
16553         done in the methods that they delegate to.
16554
16555 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
16556
16557         * convert.cs: Move Error_CannotConvertType,
16558         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
16559         ImplicitNumericConversion, ImplicitConversionExists,
16560         ImplicitUserConversionExists, StandardConversionExists,
16561         FindMostEncompassedType, FindMostSpecificSource,
16562         FindMostSpecificTarget, ImplicitUserConversion,
16563         ExplicitUserConversion, GetConversionOperators,
16564         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
16565         TryImplicitIntConversion, Error_CannotConvertImplicit,
16566         ConvertImplicitRequired, ConvertNumericExplicit,
16567         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
16568         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
16569         its own file.
16570
16571         Perform the following renames:
16572
16573         StandardConversionExists -> ImplicitStandardConversionExists
16574         ConvertImplicit -> ImplicitConversion
16575         ConvertImplicitStandard -> ImplicitStandardConversion
16576         TryImplicitIntConversion -> ImplicitIntConversion
16577         ConvertImplicitRequired -> ImplicitConversionRequired
16578         ConvertNumericExplicit -> ExplicitNumericConversion
16579         ConvertReferenceExplicit -> ExplicitReferenceConversion
16580         ConvertExplicit -> ExplicitConversion
16581         ConvertExplicitStandard -> ExplicitStandardConversion
16582
16583 2003-05-19  Martin Baulig  <martin@ximian.com>
16584
16585         * statement.cs (TypeInfo.StructInfo): Made this type protected.
16586         (TypeInfo): Added support for structs having structs as fields.
16587
16588         * ecore.cs (FieldExpr): Implement IVariable.
16589         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
16590         VariableInfo for the field.
16591
16592 2003-05-18  Martin Baulig  <martin@ximian.com>
16593
16594         * expression.cs (This.DoResolve): Report a CS0027 if we're
16595         emitting a field initializer.
16596
16597 2003-05-18  Martin Baulig  <martin@ximian.com>
16598
16599         * expression.cs (This.ResolveBase): New public function.
16600         (This.DoResolve): Check for CS0188.
16601
16602         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
16603         This.Resolve().
16604
16605         * ecore.cs (MethodGroupExpr.DoResolve): Set the
16606         `instance_expression' to null if we don't have any non-static
16607         methods.
16608
16609 2003-05-18  Martin Baulig  <martin@ximian.com>
16610
16611         Reworked the way how local variables and parameters are handled by
16612         the flow analysis code.
16613
16614         * statement.cs (TypeInfo, VariableMap): New public classes.
16615         (VariableInfo): New public class.  This is now responsible for
16616         checking whether a variable has been assigned.  It is used for
16617         parameters and local variables.
16618         (Block.EmitMeta): Take the InternalParameters as argument; compute
16619         the layout of the flow vectors here.
16620         (Block.LocalMap, Block.ParameterMap): New public properties.
16621         (FlowBranching): The .ctor doesn't get the InternalParameters
16622         anymore since Block.EmitMeta() now computes the layout of the flow
16623         vector.
16624         (MyStructInfo): This class is now known as `StructInfo' and nested
16625         in `TypeInfo'; we don't access this directly anymore.
16626
16627         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
16628         property and removed IsAssigned(), IsFieldAssigned(),
16629         SetAssigned() and SetFieldAssigned(); we now call them on the
16630         VariableInfo so we don't need to duplicate this code everywhere.
16631
16632         * expression.cs (ParameterReference): Added `Block block' argument
16633         to the .ctor.
16634         (LocalVariableReference, ParameterReference, This): The new
16635         VariableInfo class is now responsible for all the definite
16636         assignment stuff.
16637
16638         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
16639         IsParameterAssigned, SetParameterAssigned): Removed.
16640
16641 2003-05-18  Martin Baulig  <martin@ximian.com>
16642
16643         * typemanager.cs (InitCoreTypes): Try calling
16644         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
16645         the 3-args-version.  Corlib now also needs our `void_type'.
16646         (GetMethod): Added overloaded version which takes an optional
16647         `bool report_errors' to allow lookups of optional methods.
16648
16649 2003-05-12  Martin Baulig  <martin@ximian.com>
16650
16651         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
16652         only used for locals and not for parameters.
16653
16654 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
16655
16656         * support.cs (InternalParameters.ParameterType): Return the
16657         ExternalType of the parameter.
16658
16659         * parameter.cs (Parameter.ExternalType): drop the two arguments,
16660         they were unused.
16661
16662 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
16663
16664         * class.cs (MethodData.Define): Do not set the `newslot' on
16665         interface members, if they are also flagged as "override".
16666
16667         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
16668         better code for ++i and i++.  This only works for static fields
16669         and local variables.
16670
16671         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
16672         want to pull the DeclSpace out of the builder_to_declspace instead
16673         of the TypeBuilder (like in TypeContainer.FindMembers).
16674
16675         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
16676         instead of LookupTypeContainer.  Fixes the crash on .NET for
16677         looking up interface members.
16678
16679         * const.cs: Create our own emit context during the Definition
16680         stage, so that constants are evaluated in the proper context, when
16681         a recursive definition happens.
16682
16683 2003-05-11  Martin Baulig  <martin@ximian.com>
16684
16685         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
16686         new block for a switch section.
16687         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
16688         the adding/lookup in the switch block.  Fixes #39828.
16689
16690 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
16691
16692         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
16693         functionality: I needed to convert the data after I had performed
16694         the add/sub operation into the operands type size.
16695
16696         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
16697         pass the type for the box operation, otherwise the resulting
16698         object would have been of type object.
16699
16700         (BoxedCast): Add constructor to specify the type to box as.
16701
16702 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
16703
16704         * iterators.cs: I was reusing the `count' variable inadvertently,
16705         take steps to not allow this to happen.
16706
16707 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
16708
16709         * attribute.cs (Attribute.Resolve): Params attributes are encoded
16710         by creating an array at the point where the params starts and
16711         putting all those arguments there, then adjusting the size of the
16712         array.
16713
16714 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
16715
16716         * expression.cs (New.AddressOf): Implement interface
16717         IMemoryLocation.  This is used when the `new' operator is used in
16718         the context of an invocation to a method on a value type.
16719
16720         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
16721         example. 
16722
16723         * namespace.cs: Also check the using aliases here.
16724
16725         * driver.cs: Move the test for using validity after the types have
16726         been entered, so we do a single pass that also includes the using
16727         aliases. 
16728
16729         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
16730         in the regular case.   CreateSiblingForFinally is doing extra
16731         error checking.
16732
16733         * attribute.cs (GetAttributeArgumentExpression): Store the result
16734         on an out value, and use the return value to indicate failure
16735         instead of using null (which is a valid return for Constant.GetValue).
16736
16737         * statement.cs: Perform the analysis flow for the increment
16738         portion after the statement, because this will be the real flow of
16739         execution.  Fixes #42385
16740
16741         * codegen.cs (EmitContext.EmitArgument,
16742         EmitContext.EmitStoreArgument): New helper functions when the
16743         RemapToProxy flag is set.
16744
16745         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
16746         function.
16747
16748         Add support for remapping parameters. 
16749
16750         * iterators.cs: Propagate parameter values;  Store parameter
16751         values in the proxy classes.
16752
16753 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
16754
16755         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
16756         need a proxy reference;  I do not know what I was thinking
16757
16758         * cs-parser.jay (constructor_initializer): catch another error,
16759         and display nice message.
16760
16761         (field_declaration): catch void field declaration
16762         to flag a better error. 
16763
16764         * class.cs (MemberBase.CheckBase): Report an error instead of a
16765         warning if a new protected member is declared in a struct. 
16766         (Field.Define): catch the error of readonly/volatile.
16767
16768         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
16769
16770         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
16771         volatile variable is taken
16772
16773 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
16774
16775         * statement.cs (Fixed.Resolve): Report an error if we are not in
16776         an unsafe context.
16777
16778 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
16779
16780         * typemanager.cs: reuse the code that handles type clashes for
16781         delegates and enumerations.
16782
16783         * class.cs (Report28): Always report.
16784
16785         * expression.cs (EncodeAsAttribute): Allow nulls here.
16786
16787 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
16788
16789         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
16790         the functionality for testing whether an expression is valid for
16791         an attribute here.  Also handle the case of arrays of elements
16792         being stored. 
16793
16794         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
16795         encoding a linear array into an array of objects that are suitable
16796         to be passed to an CustomAttributeBuilder.
16797
16798         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
16799
16800         * ecore.cs: (FieldExpr): Handle field remapping here.
16801
16802         * iteratators.cs: Pass the instance variable (if the method is an
16803         instance method) to the constructors, so we can access the field
16804         variables on the class.
16805
16806         TODO: Test this with structs.  I think the THIS variable on
16807         structs might have to be a pointer, and not a refenrece
16808
16809 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
16810
16811         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
16812         local variables to fields in a proxy class.
16813
16814         * iterators.cs (PopulateProxy): Rename our internal fields to
16815         <XXX>.  
16816         Create a <THIS> field if we are an instance method, so we can
16817         reference our parent container variables.
16818         (MapVariable): Called back from the EmitContext code to enter a
16819         new variable to field mapping into the proxy class (we just create
16820         a FieldBuilder).
16821
16822         * expression.cs
16823         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
16824         for using the remapped locals to fields.
16825
16826         I placed the code here, because that gives the same semantics to
16827         local variables, and only changes the Emit code.
16828
16829         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
16830         statements inside iterators.
16831         (VariableInfo): Add a FieldBuilder for the cases when we are
16832         remapping local variables to fields in a proxy class
16833
16834         * ecore.cs (SimpleNameResolve): Avoid testing two times for
16835         current_block != null.
16836
16837         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
16838         not cope with strings, as it has been moved to the
16839         TableSwitchEmit.  Fixed bug in switch generation.
16840
16841         * expression.cs (New.DoResolve): Provide more context for the user
16842         when reporting an error.
16843
16844         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
16845         pointers. 
16846
16847         * expression.cs (MemberAccess.DoResolve): When we get a type back,
16848         check the permissions for it.  Note than in a type-resolution
16849         context the check was already present in DeclSpace.ResolveType,
16850         but was missing from the MemberAccess.
16851
16852         (ArrayCreation.CheckIndices): warn if the user has
16853         more nested levels of expressions, but there are no more
16854         dimensions specified.  Avoids crash on bug 41906.
16855
16856 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
16857
16858         * statement.cs (Block): replace Implicit bool, for a generic
16859         flags.   
16860         New flag: `Unchecked'.  This is used during the EmitMeta phase
16861         (which is out-of-line with the regular Resolve/Emit process for a
16862         statement, as this is done ahead of time, but still gets a chance
16863         to call constant resolve).
16864
16865         (Block.Flags): new enum for adding a new flag.
16866
16867         (Block.EmitMeta): track the state of unchecked.
16868
16869         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
16870         to enable constant resolution to work there as well.
16871
16872 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
16873
16874         * typemanager.cs (ienumerable_type): Also look up
16875         System.Collections.IEnumerable. 
16876
16877 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
16878
16879         TODO: Test more than one conditional per method.
16880
16881         * class.cs (Indexer.Define): Report the location where the user is
16882         referencing the unsupported feature.
16883
16884         (MethodData): Overload the use of `conditionals' to
16885         minimize the creation of needless ArrayLists.   This saves roughly
16886         212kb on my machine.
16887
16888         (Method): Implement the new IIteratorContainer interface.
16889         (Method.SetYields): Implement the method by setting the ModFlags
16890         to contain METHOD_YIELDS.
16891
16892         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
16893         which just got set to null.
16894
16895         * iterators.cs: New file.
16896
16897         (Yield, YieldBreak): New statements.
16898
16899         * statement.cs (Return.Resolve): Flag an error if we are used in
16900         an iterator method.
16901
16902         * codegen.cs (InIterator): New flag set if the code is being
16903         compiled in an iterator method.
16904
16905         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
16906         internal modifier, and we just use it to avoid adding extra
16907         fields, as this is seldom used.  
16908
16909         * cs-parser.jay: Add yield_statement (yield and yield break).
16910
16911         * driver.cs: New flag -v2 to turn on version 2 features. 
16912
16913         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
16914         hashtable when v2 is enabled.
16915
16916 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
16917
16918         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
16919         there is already a namespace defined with this name.
16920
16921         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
16922         people upgraded their corlibs.
16923
16924         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
16925         always use fully qualified types, no need to use the compiler
16926         front end.
16927
16928         (TypeManager.IsNamespace): Use binarysearch.
16929
16930         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
16931         AddDelegate): I did not quite use the new IsValid API properly: I
16932         have to pass the short-name and the fullname.  I was passing only
16933         the basename instead of the fullname sometimes. 
16934
16935         (TypeContainer.DefineType): call NamespaceClash.
16936
16937         * interface.cs (Interface.DefineType): use NamespaceClash before
16938         defining the type.
16939
16940         * delegate.cs (Delegate.DefineType): use NamespaceClash before
16941         defining the type.
16942
16943         * enum.cs: (Enum.DefineType): use NamespaceClash before
16944         defining the type.
16945
16946         * typemanager.cs (: 3-line patch that gives us some tasty 11%
16947         speed increase.  First, use the negative_hits cache when we get a
16948         negative.  Second, add the type with its full original name
16949         instead of the new . and + encoded name (reflection uses + to
16950         separate type from a nested type).  Use LookupTypeReflection
16951         directly which bypasses the type->name hashtable (that we already
16952         know does not contain the type.
16953
16954         * decl.cs (DeclSpace.ResolveTypeExpr): track the
16955         location/container type. 
16956
16957         * driver.cs: When passing utf8, use directly the UTF8Encoding.
16958
16959 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
16960
16961         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
16962
16963         * delegate.cs (NewDelegate.Resolve): Test whether an instance
16964         method is being referenced in the method group from a static
16965         context, and report error 120 if so.
16966
16967         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
16968         Error118. 
16969
16970         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
16971         is created, we create the A namespace).
16972
16973         * cs-parser.jay: A namespace also introduces a DeclarationFound.
16974         Fixes #41591
16975
16976 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
16977
16978         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
16979         invocation to ModuleBuilder.GetType with the same values will
16980         return a new type instance, so we need to cache its return
16981         values. 
16982
16983         * expression.cs (Binary.ResolveOperator): Only allow the compare
16984         operators on enums if they are of the same type.
16985
16986         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
16987         types of ValueType on their own case.  Before we were giving them
16988         the same treatment as objects.
16989
16990         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
16991         fullname.  Short name is used to compare against container name.
16992         Fullname is used to check against defined namespace names.
16993
16994         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
16995         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
16996
16997         (Method.CheckBase): Call parent.
16998         (MemberBase.CheckBase): Check for protected members on sealed
16999         classes.
17000         (PropertyBase.CheckBase): Call parent.
17001         (Field.Define): Call parent.
17002
17003         * report.cs: Negative error codes are now mapped to 8000 - code,
17004         so that the display is render more nicely.
17005
17006         * typemanager.cs: Do not use try/catch, instead report a regular
17007         error. 
17008
17009         (GetPointerType, GetReferenceType): These methods provide
17010         mechanisms to obtain the T* and T& from a T.  We had the code
17011         previously scattered around the code base, and it also used
17012         TypeManager.LookupType that would go through plenty of caches.
17013         This one goes directly to the type source.
17014
17015         In some places we did the Type.GetType followed by
17016         ModuleBuilder.GetType, but not in others, so this unifies the
17017         processing as well.
17018
17019         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
17020         statements now that we have namespace information.
17021
17022         * typemanager.cs (IsNamespace): New method, returns whether the
17023         string presented is a namespace or not.
17024
17025         (ComputeNamespaces): New public entry point, computes the list of
17026         available namespaces, using the GetNamespaces API call in Mono, or
17027         the slower version in MS.NET.   
17028
17029         Now before we start the semantic analysis phase, we have a
17030         complete list of namespaces including everything that the user has
17031         provided.
17032
17033         Deleted old code to cache namespaces in .nsc files.
17034
17035 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
17036
17037         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
17038         class/struct location definition Location for the implicit
17039         constructor location.
17040
17041         (Operator.Define): Use the location of the operator for the
17042         implicit Method definition.
17043
17044         (Constructor.Emit): use the constructor location for the implicit
17045         base initializer constructor.
17046
17047         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
17048         and the Expression class now contains two new methods:
17049
17050         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
17051         isolate type lookup from the rest of the resolution process.
17052
17053         Since we use Expressions to hold type definitions due to the way
17054         we parse the input we have historically overloaded Resolve to
17055         perform the Type lookups if a special flag is passed.  Now this is
17056         eliminated and two methods take their place. 
17057
17058         The differences in the two methods between xStep and xTerminal is
17059         that xStep is involved in our current lookup system that uses
17060         SimpleNames to compose a name, while xTerminal is used just to
17061         catch the case where the simplename lookup failed.
17062
17063 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
17064
17065         * expression.cs (ResolveMemberAccess): Remove redundant code.
17066         TypeExpr expressions are always born fully resolved.
17067
17068         * interface.cs (PopulateMethod): Do not lookup the types twice.
17069         We were doing it once during SemanticAnalysis and once during
17070         PopulateMethod.
17071
17072         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
17073         in local variable type definitions, were being returned as a
17074         SimpleName (we decomposed everything into a string), that is
17075         because primary_expression was being used instead of a type in the
17076         grammar (reduce/reduce conflicts).
17077
17078         The part that was wrong is that we converted the expression into a
17079         string (an oversimplification in one hand, compounded with primary
17080         expressions doing string concatenation).
17081
17082         So things like:
17083
17084         A.B.C [] x;
17085
17086         Would return "A.B.C[]" as a SimpleName.  This stopped things like
17087         using clauses from working on this particular context.  And a type
17088         was being matched directly against "A.B.C[]".
17089
17090         We now use the correct approach, and allow for ComposedCast to be
17091         part of the unary expression.  So the "A.B.C []" become a composed
17092         cast of "A.B.C" (as a nested group of MemberAccess with a
17093         SimpleName at the end) plus the rank composition "[]". 
17094
17095         Also fixes 35567
17096
17097 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
17098
17099         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
17100         for the access level checking.
17101
17102         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
17103         `TypeContainer container', because I kept getting confused when I
17104         was debugging this code.
17105
17106         * expression.cs (Indexers): Instead of tracking getters/setters,
17107         we now track them in parallel.  We create one arraylist less, but
17108         most importantly it is possible now for the LValue code to find a
17109         matching get for a set.
17110
17111         (IndexerAccess.DoResolveLValue): Update the code.
17112         GetIndexersForType has been modified already to extract all the
17113         indexers from a type.  The code assumed it did not.
17114
17115         Also make the code set the correct return type for the indexer.
17116         This was fixed a long time ago for properties, but was missing for
17117         indexers.  It used to be void_type.
17118
17119         (Binary.Emit): Test first for doubles instead of
17120         floats, as they are more common.
17121
17122         (Binary.EmitBranchable): Use the .un version of the branch opcodes
17123         when dealing with floats and the <=, >= operators.  This fixes bug
17124         #39314 
17125
17126         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
17127         to load the array value by emitting a load on the foreach variable
17128         type.  This was incorrect.  
17129
17130         We now emit the code to load an element using the the array
17131         variable type, and then we emit the conversion operator.
17132
17133         Fixed #40176
17134
17135 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
17136
17137         * attribute.cs: Avoid allocation of ArrayLists in the common case.
17138
17139 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
17140
17141         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
17142         test for protection before we test for signatures. 
17143
17144         (MethodSignature.ToString): implement.
17145
17146         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
17147         to the case where we reduced into a LongConstant.
17148
17149         * decl.cs (CheckAccessLevel): If the type is an array, we can not
17150         depend on whether the information is acurrate, because the
17151         Microsoft runtime will always claim that the array type is public,
17152         regardless of the real state.
17153
17154         If the type is a pointer, another problem happens: the type is
17155         reported as non-public in Microsoft.  
17156
17157         In both cases we have to call CheckAccessLevel recursively with
17158         the underlying type as the argument to be tested.
17159
17160 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
17161
17162         * assign.cs (Assign.Emit): If we are dealing with a compound
17163         assignment expression, we should use the code path that stores the
17164         intermediate result in a temporary value.  This fixes #40903.
17165
17166         *expression.cs (Indirection.ToString): Provide ToString method for
17167         debugging. 
17168
17169 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
17170
17171         * class.cs: Null out fields holding references to Block objects so
17172         they can be garbage collected.
17173
17174         * expression.cs (OverloadResolve): Remove unused local.
17175
17176 2003-04-07  Martin Baulig  <martin@ximian.com>
17177
17178         * codegen.cs (EmitContext.CurrentFile): New public field.
17179         (EmitContext.Mark): Use the CurrentFile to check whether the
17180         location is in the correct file.
17181         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
17182
17183 2003-04-07  Martin Baulig  <martin@ximian.com>
17184
17185         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
17186
17187         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
17188         location.  [FIXME: The location argument which gets passed to this
17189         method is sometimes wrong!]
17190
17191 2003-04-07  Nick Drochak <ndrochak@gol.com>
17192
17193         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
17194
17195 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
17196
17197         * expression.cs (Indirection.EmitAssign): We were using the
17198         temporary, but returning immediately instead of continuing the
17199         EmitAssing flow.
17200
17201 2003-04-06  Martin Baulig  <martin@ximian.com>
17202
17203         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
17204         if it's a nested child, but also deriving from the outer class.
17205         See test 190.cs.
17206
17207         * typemanager.cs (IsNestedChildOf): Make this work if it's a
17208         nested child, but also deriving from the outer class.  See
17209         test-190.cs.
17210         (FilterWithClosure): We may access private members of the outer
17211         class if we're a nested child and deriving from the outer class.
17212         (RealMemberLookup): Only set `closure_private_ok' if the
17213         `original_bf' contained BindingFlags.NonPublic.
17214
17215 2003-04-05  Martin Baulig  <martin@ximian.com>
17216
17217         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
17218
17219 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
17220
17221         * class.cs (Event.Define): Do not allow abstract events to have
17222         initializers. 
17223
17224 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
17225
17226         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
17227         block in event declarations.
17228
17229         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
17230         value type, get its address.
17231
17232         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
17233         leaving a class on the stack instead of a boolean value (int
17234         0/1).  Change the code so we compare against null, and then the
17235         result against zero.
17236
17237         * class.cs (TypeContainer.GetClassBases): We were checking for the
17238         parent class being sealed too late.
17239
17240         * expression.cs (Binary.Emit): For <= and >= when dealing with
17241         floating point values, use cgt.un and clt.un instead of cgt and
17242         clt alone.
17243
17244 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
17245
17246         * statement.cs: Apply the same optimization as MS: skip the 
17247         GetEnumerator returning an IEnumerator, and use the one returning a 
17248         CharEnumerator instead. This allows us to avoid the try-finally block 
17249         and the boxing.
17250
17251 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
17252
17253         * cs-parser.jay: Attributes cannot be applied to
17254                          namespaces. Fixes #40473
17255
17256 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17257
17258         * class.cs:
17259         (Add*): check if the name is valid using the full name for constants,
17260         fields, properties and events.
17261
17262 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
17263
17264         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
17265         char constants to be part of the enumeration.
17266
17267         * expression.cs (Conditional.DoResolve): Add support for operator
17268         true. Implements the missing functionality from 14.12
17269
17270         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
17271         operator true/false as required by the spec.
17272
17273         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
17274         implicit conversion to boolean.
17275
17276         * statement.cs (Statement.ResolveBoolean): A boolean expression is
17277         also one where the type implements `operator true'. 
17278
17279         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
17280         get an expression that will invoke operator true based on an
17281         expression.  
17282
17283         (GetConversionOperators): Removed the hack that called op_True
17284         here.  
17285
17286         (Expression.ResolveBoolean): Move this from Statement.
17287
17288 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
17289
17290         * ecore.cs (FieldExpr): do not allow initialization of initonly
17291         fields on derived classes
17292
17293 2003-03-13  Martin Baulig  <martin@ximian.com>
17294
17295         * statement.cs (Block.Emit): Call ig.BeginScope() and
17296         ig.EndScope() when compiling with debugging info; call
17297         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
17298
17299 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
17300
17301         * expression.cs (Indexers): Do not construct immediately, allow
17302         for new members to be appended as we go.  Fixes 38143
17303
17304 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17305
17306         * expression.cs: save/restore context when resolving an unchecked
17307         expression.
17308
17309 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
17310
17311         * cfold.cs: Catch division by zero in modulus operator during
17312         constant folding.
17313
17314 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
17315
17316         * interface.cs (Interface.DefineMembers): Avoid defining members
17317         twice. 
17318
17319 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
17320
17321         * driver.cs: handle the +/- options for -noconfig
17322
17323         * statement.cs (Unckeched.Resolve): Also track the state of
17324         unchecked in the Resolve phase.
17325
17326 2003-02-27  Martin Baulig  <martin@ximian.com>
17327
17328         * ecore.cs (Expression.MemberLookup): Don't create a
17329         MethodGroupExpr for something which is not a method.  Fixes #38291.
17330
17331 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
17332
17333         * class.cs (MemberBase.CheckParameters): Also check that the type
17334         is unmanaged if it is a pointer.
17335
17336         * expression.cs (SizeOf.Resolve): Add location information.
17337
17338         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
17339         a managed type is declared.
17340
17341         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
17342         parameter modifiers as well.  Fixes bug 38606
17343
17344         * class.cs: Very sad.  Am backing out the speed up changes
17345         introduced by the ArrayList -> Array in the TypeContainer, as they
17346         were not actually that much faster, and introduced a bug (no error
17347         reports on duplicated methods).
17348
17349         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
17350         source first, this will guarantee that we have a valid expression
17351         before calling in lower levels functions that will require a
17352         resolved object.  Then use this original_source in the
17353         target.ResolveLValue instead of the original source that was
17354         passed to us.
17355
17356         Another change.  Use target.Resolve instead of LValueResolve.
17357         Although we are resolving for LValues, we will let the Assign code
17358         take care of that (it will be called again from Resolve).  This
17359         basically allows code like this:
17360
17361         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
17362         class Y { void A (X x) { x [0] += o; }
17363
17364         The problem was that the indexer was trying to resolve for
17365         set_Item (idx, object o) and never finding one.  The real set_Item
17366         was set_Item (idx, X).  By delaying the process we get the right
17367         semantics. 
17368
17369         Fixes bug 36505
17370
17371 2003-02-23  Martin Baulig  <martin@ximian.com>
17372
17373         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
17374         while calling DoEmit ().
17375
17376         * codegen.cs (EmitContext.Mark): Don't mark locations in other
17377         source files; if you use the #line directive inside a method, the
17378         compiler stops emitting line numbers for the debugger until it
17379         reaches the end of the method or another #line directive which
17380         restores the original file.
17381
17382 2003-02-23  Martin Baulig  <martin@ximian.com>
17383
17384         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
17385
17386 2003-02-23  Martin Baulig  <martin@ximian.com>
17387
17388         * statement.cs (Block.AddChildVariableNames): We need to call this
17389         recursively, not just for our immediate children.
17390
17391 2003-02-23  Martin Baulig  <martin@ximian.com>
17392
17393         * class.cs (Event.Define): Always make the field private, like csc does.
17394
17395         * typemanager.cs (TypeManager.RealMemberLookup): Make events
17396         actually work, fixes bug #37521.
17397
17398 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
17399
17400         * delegate.cs: When creating the various temporary "Parameters"
17401         classes, make sure that we call the ComputeAndDefineParameterTypes
17402         on those new parameters (just like we do with the formal ones), to
17403         allow them to be resolved in the context of the DeclSpace.
17404
17405         This fixes the bug that Dick observed in Bugzilla #38530.
17406
17407 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
17408
17409         * expression.cs (ResolveMemberAccess): When resolving a constant,
17410         do not attempt to pull a constant if the value was not able to
17411         generate a valid constant.
17412
17413         * const.cs (LookupConstantValue): Do not report more errors than required.
17414
17415 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17416
17417         * expression.cs: fixes bug #38328.
17418
17419 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
17420
17421         * class.cs: Changed all the various members that can be part of a
17422         class from being an ArrayList to be an Array of the right type.
17423         During the DefineType type_list, interface_list, delegate_list and
17424         enum_list are turned into types, interfaces, delegates and enums
17425         arrays.  
17426
17427         And during the member population, indexer_list, event_list,
17428         constant_list, field_list, instance_constructor_list, method_list,
17429         operator_list and property_list are turned into their real arrays.
17430
17431         Although we could probably perform this operation earlier, for
17432         good error reporting we need to keep the lists and remove the
17433         lists for longer than required.
17434
17435         This optimization was triggered by Paolo profiling the compiler
17436         speed on the output of `gen-sample-program.pl' perl script. 
17437
17438         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
17439         not crash in methods like MemberLookupFailed that use this field.  
17440
17441         This problem arises when the compiler fails to resolve a type
17442         during interface type definition for example.
17443
17444 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
17445
17446         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
17447         inherit from System.Object, so we have to stop at null, not only
17448         when reaching System.Object.
17449
17450 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
17451
17452         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
17453         DeclaredOnly because the parent indexer might have had a different
17454         name, but did not loop until the top of the hierarchy was reached.
17455
17456         The problem this one fixes is 35492: when a class implemented an
17457         indexer from an interface, we were getting the interface method
17458         (which was abstract) and we were flagging an error (can not invoke
17459         abstract method).
17460
17461         This also keeps bug 33089 functioning, and test-148 functioning.
17462
17463         * typemanager.cs (IsSpecialMethod): The correct way of figuring
17464         out if a method is special is to see if it is declared in a
17465         property or event, or whether it is one of the predefined operator
17466         names.   This should fix correctly #36804.
17467
17468 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
17469
17470         The goal here is to remove the dependency on EmptyCast.Peel ().
17471         Killing it completely.
17472
17473         The problem is that currently in a number of places where
17474         constants are expected, we have to "probe" for an EmptyCast, and
17475         Peel, which is not the correct thing to do, as this will be
17476         repetitive and will likely lead to errors. 
17477
17478         The idea is to remove any EmptyCasts that are used in casts that
17479         can be reduced to constants, so we only have to cope with
17480         constants. 
17481
17482         This bug hunt was triggered by Bug 37363 and the desire to remove
17483         the duplicate pattern where we were "peeling" emptycasts to check
17484         whether they were constants.  Now constants will always be
17485         constants.
17486
17487         * ecore.cs: Use an enumconstant here instead of wrapping with
17488         EmptyCast.  
17489
17490         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
17491         throwing me off.  By handling this we can get rid of a few hacks.
17492
17493         * statement.cs (Switch): Removed Peel() code.
17494
17495 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
17496
17497         * class.cs: Location information for error 508
17498
17499         * expression.cs (New.DoResolve): Add a guard against double
17500         resolution of an expression.  
17501
17502         The New DoResolve might be called twice when initializing field
17503         expressions (see EmitFieldInitializers, the call to
17504         GetInitializerExpression will perform a resolve on the expression,
17505         and later the assign will trigger another resolution
17506
17507         This leads to bugs (#37014)
17508
17509         * delegate.cs: The signature for EndInvoke should contain any ref
17510         or out parameters as well.  We were not doing this in the past. 
17511
17512         * class.cs (Field.Define): Do not overwrite the type definition
17513         inside the `volatile' group.  Turns out that volatile enumerations
17514         were changing the type here to perform a validity test, which
17515         broke conversions. 
17516
17517 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
17518
17519         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
17520         and structs, we do not want to load the instance variable
17521
17522         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
17523         enum_type has to be handled like an object reference (implicit
17524         conversions exists from this to object), but the regular IsClass
17525         and IsValueType tests will never return true for this one.
17526
17527         Also we use TypeManager.IsValueType instead of type.IsValueType,
17528         just for consistency with the rest of the code (this is only
17529         needed if we ever use the construct exposed by test-180.cs inside
17530         corlib, which we dont today).
17531
17532 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
17533
17534         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
17535         just InternalCall.
17536
17537 2003-02-09  Martin Baulig  <martin@ximian.com>
17538
17539         * namespace.cs (Namespace..ctor): Added SourceFile argument.
17540         (Namespace.DefineNamespaces): New static public method; this is
17541         called when we're compiling with debugging to add all namespaces
17542         to the symbol file.
17543
17544         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
17545         pass it to the Namespace's .ctor.
17546
17547         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
17548         and MethodBase arguments; pass the namespace ID to the symwriter;
17549         pass the MethodBase instead of the token to the symwriter.
17550         (SymbolWriter.DefineNamespace): New method to add a namespace to
17551         the symbol file.
17552
17553 2003-02-09  Martin Baulig  <martin@ximian.com>
17554
17555         * symbolwriter.cs: New file.  This is a wrapper around
17556         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
17557         methods here in near future.
17558
17559 2003-02-09  Martin Baulig  <martin@ximian.com>
17560
17561         * codegen.cs (EmitContext.Mark): Just pass the arguments to
17562         ILGenerator.MarkSequencePoint() which are actually used by the
17563         symbol writer.
17564
17565 2003-02-09  Martin Baulig  <martin@ximian.com>
17566
17567         * location.cs (SourceFile): New public sealed class.  This
17568         contains the name and an index which is used in the location's token.
17569         (Location): Reserve an appropriate number of bits in the token for
17570         the source file instead of walking over that list, this gives us a
17571         really huge performance improvement when compiling with debugging.
17572
17573         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
17574         `SourceFile' argument instead of a string.
17575         (Driver.ProcessFile): Add all the files via Location.AddFile(),
17576         but don't parse/tokenize here, we need to generate the list of all
17577         source files before we do that.
17578         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
17579         the files.
17580
17581         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
17582         instead of a string.
17583
17584         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
17585         of a string.
17586
17587 2003-02-09  Martin Baulig  <martin@ximian.com>
17588
17589         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
17590         filename on `#line default'.
17591
17592 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
17593
17594         * statement.cs: don't clear the pinned var when the fixed statement
17595         returns from the method (fixes bug#37752).
17596
17597 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
17598
17599         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
17600         to IsValueType.
17601
17602 2003-02-07  Martin Baulig  <martin@ximian.com>
17603
17604         * driver.cs: Removed the `--debug-args' command line argument.
17605
17606         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
17607         automatically by the AsssemblyBuilder.
17608         (CodeGen.InitializeSymbolWriter): We don't need to call any
17609         initialization function on the symbol writer anymore.  This method
17610         doesn't take any arguments.
17611
17612 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
17613
17614         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
17615         from referenced assemblies as well.
17616
17617 2003-02-02  Martin Baulig  <martin@ximian.com>
17618
17619         * class.cs (MethodData.Emit): Generate debugging info for external methods.
17620
17621 2003-02-02  Martin Baulig  <martin@ximian.com>
17622
17623         * class.cs (Constructor.Emit): Open the symbol writer before
17624         emitting the constructor initializer.
17625         (ConstructorInitializer.Emit): Call ec.Mark() to allow
17626         single-stepping through constructor initializers.
17627
17628 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
17629
17630         * class.cs: Handle error 549: do not allow virtual methods in
17631         sealed classes. 
17632
17633 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
17634
17635         * decl.cs: Check access levels when resolving types
17636
17637 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
17638
17639         * statement.cs: Add parameters and locals set in catch blocks that might 
17640         return to set vector
17641
17642 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
17643
17644         * class.cs (Operator): Set the SpecialName flags for operators.
17645
17646         * expression.cs (Invocation.DoResolve): Only block calls to
17647         accessors and operators on SpecialName methods.
17648
17649         (Cast.TryReduce): Handle conversions from char constants.
17650
17651
17652 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
17653
17654         * statement.cs: small memory and time optimization in FlowBranching.
17655
17656 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
17657
17658         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
17659         problem that the last fix but in the other sid (Set).
17660
17661         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
17662         access when there is no indexer in the hierarchy.
17663
17664 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
17665
17666         * class.cs: Combine some if statements.
17667
17668 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17669
17670         * driver.cs: fixed bug #37187.
17671
17672 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
17673
17674         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
17675         any indexer, it's needed to build a list with all the indexers in the
17676         hierarchy (AllGetters), else we have problems. Fixes #35653.
17677
17678 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
17679
17680         * class.cs (MethodData.Define): It is wrong for an interface
17681         implementation to be static in both cases: explicit and implicit.
17682         We were only handling this in one case.
17683
17684         Improve the if situation there to not have negations.
17685
17686         * class.cs (Field.Define): Turns out that we do not need to check
17687         the unsafe bit on field definition, only on usage.  Remove the test.
17688
17689 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17690
17691         * driver.cs: use assembly.Location instead of Codebase (the latest
17692         patch made mcs fail when using MS assemblies).
17693
17694 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
17695
17696         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
17697         get the path to *corlib.dll.
17698
17699 2003-01-21  Nick Drochak <ndrochak@gol.com>
17700
17701         * cs-tokenizer.cs:
17702         * pending.cs:
17703         * typemanager.cs: Remove compiler warnings
17704
17705 2003-01-20  Duncan Mak  <duncan@ximian.com>
17706
17707         * AssemblyInfo.cs: Bump the version number to 0.19.
17708
17709 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17710
17711         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
17712
17713 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
17714
17715         * class.cs (Constructor::Emit): Emit debugging info for constructors.
17716
17717 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
17718
17719         * cs-parser.jay: Small fix: we were not comparing the constructor
17720         name correctly.   Thanks to Zoltan for the initial pointer.
17721
17722 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
17723
17724         * cs-tokenizer.cs: Set file name when specified with #line
17725
17726 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
17727
17728         * cs-parser.jay: Only perform the constructor checks here if we
17729         are named like the class;  This will help provider a better
17730         error.  The constructor path is taken when a type definition is
17731         not found, but most likely the user forgot to add the type, so
17732         report that rather than the constructor error.
17733
17734 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
17735
17736         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
17737         allocations.
17738
17739 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17740
17741         * cs-parser.jay: Add cleanup call.
17742
17743 2003-01-13  Duncan Mak  <duncan@ximian.com>
17744
17745         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
17746         consistent with other methods.
17747
17748 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17749
17750         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
17751
17752 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
17753
17754         * attribute.cs: only set GuidAttr to true when we have a
17755         GuidAttribute.
17756
17757 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17758
17759         * ecore.cs:
17760         * expression.cs:
17761         * typemanager.cs: fixes to allow mcs compile corlib with the new
17762         Type.IsSubclassOf fix.
17763
17764 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
17765
17766         * expression.cs (LocalVariableReference.DoResolve): Classify a
17767         constant as a value, not as a variable.   Also, set the type for
17768         the variable.
17769
17770         * cs-parser.jay (fixed_statement): take a type instead of a
17771         pointer_type, so we can produce a better error message later.
17772
17773         * statement.cs (Fixed.Resolve): Flag types that are not pointers
17774         as an error.  
17775
17776         (For.DoEmit): Make inifinite loops have a
17777         non-conditional branch back.
17778
17779         (Fixed.DoEmit): First populate the pinned variables, then emit the
17780         statement, then clear the variables.  Before I was emitting the
17781         code once for each fixed piece.
17782
17783
17784 2003-01-08  Martin Baulig  <martin@ximian.com>
17785
17786         * statement.cs (FlowBranching.MergeChild): A break in a
17787         SWITCH_SECTION does not leave a loop.  Fixes #36155.
17788
17789 2003-01-08  Martin Baulig  <martin@ximian.com>
17790
17791         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
17792         lives in the same number space than `param_map'.  Fixes #36154.
17793
17794 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
17795
17796         * cs-parser.jay (constructor_declaration): Set the
17797         Constructor.ModFlags before probing for it.  This makes the
17798         compiler report 514, 515 and 132 (the code was there, but got
17799         broken). 
17800
17801         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
17802         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
17803         (GotoCase.Resolve): Set `Returns' to ALWAYS.
17804
17805 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
17806
17807         * enum.cs: create the enum static fields using the enum type.
17808
17809 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
17810
17811         * class.cs: don't try to create the ParamBuilder for the return
17812         type if it's not needed (and handle it breaking for the ms runtime
17813         anyway).
17814
17815 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
17816
17817         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
17818
17819 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
17820
17821         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
17822         the command.   This showed up while compiling the JANET source
17823         code, which used \r as its only newline separator.
17824
17825 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
17826
17827         * class.cs (Method.Define): If we are an operator (because it
17828         reuses our code), then set the SpecialName and HideBySig.  #36128
17829
17830 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
17831
17832         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
17833         exception, report error 120 `object reference required'.
17834
17835         * driver.cs: Add --pause option, used during to measure the size
17836         of the process as it goes with --timestamp.
17837
17838         * expression.cs (Invocation.DoResolve): Do not allow methods with
17839         SpecialName to be invoked.
17840
17841 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
17842
17843         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
17844         number before adding it.
17845
17846 2002-12-21  Ravi Pratap  <ravi@ximian.com>
17847
17848         * ecore.cs (StandardImplicitConversion): When in an unsafe
17849         context, we allow conversion between void * to any other pointer
17850         type. This fixes bug #35973.
17851
17852 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
17853
17854         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
17855         is not thrown when extensionless outputs are used 
17856
17857 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17858
17859         * rootcontext.cs: fixed compilation of corlib.
17860
17861 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
17862
17863         * attribute.cs (Attributes.Contains): Add new method.
17864
17865         * class.cs (MethodCore.LabelParameters): if the parameter is an
17866         `out' parameter, check that no attribute `[In]' has been passed.
17867
17868         * enum.cs: Handle the `value__' name in an enumeration.
17869
17870 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
17871
17872         * decl.cs: Added special case to allow overrides on "protected
17873         internal" methods
17874
17875 2002-12-18  Ravi Pratap  <ravi@ximian.com>
17876
17877         * attribute.cs (Attributes.AddAttributeSection): Rename to this
17878         since it makes much more sense.
17879
17880         (Attributes.ctor): Don't require a Location parameter.
17881
17882         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
17883
17884         * attribute.cs (ApplyAttributes): Remove extra Location parameters
17885         since we already have that information per attribute.
17886
17887         * everywhere : make appropriate changes.
17888
17889         * class.cs (LabelParameters): Write the code which actually
17890         applies attributes to the return type. We can't do this on the MS
17891         .NET runtime so we flag a warning in the case an exception is
17892         thrown.
17893
17894 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
17895
17896         * const.cs: Handle implicit null conversions here too.
17897
17898 2002-12-17  Ravi Pratap  <ravi@ximian.com>
17899
17900         * class.cs (MethodCore.LabelParameters): Remove the extra
17901         Type [] parameter since it is completely unnecessary. Instead
17902         pass in the method's attributes so that we can extract
17903         the "return" attribute.
17904
17905 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
17906
17907         * cs-parser.jay (parse): Use Report.Error to flag errors instead
17908         of ignoring it and letting the compile continue.
17909
17910         * typemanager.cs (ChangeType): use an extra argument to return an
17911         error condition instead of throwing an exception.
17912
17913 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
17914
17915         * expression.cs (Unary.TryReduce): mimic the code for the regular
17916         code path.  Perform an implicit cast in the cases where we can
17917         implicitly convert to one of the integral types, and then reduce
17918         based on that constant.   This fixes bug #35483.
17919
17920 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17921
17922         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
17923
17924 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17925
17926         * namespace.cs: fixed bug #35489.
17927
17928 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
17929
17930         * class.cs: Remove some dead code.
17931
17932         * cs-parser.jay: Estimate the number of methods needed
17933         (RootContext.MethodCount);
17934
17935         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
17936         numbers instead of StringBuilders.
17937
17938         * support.cs (PtrHashtable): Add constructor with initial size;
17939         We can now reduce reallocations of the method table.
17940
17941 2002-12-10  Ravi Pratap  <ravi@ximian.com>
17942
17943         * attribute.cs (ApplyAttributes): Keep track of the emitted
17944         attributes on a per-target basis. This fixes bug #35413.
17945
17946 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
17947
17948         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
17949         default to the Windows 1252 encoding.
17950
17951         (UnixParseOption): Support version, thanks to Alp for the missing
17952         pointer. 
17953
17954         * AssemblyInfo.cs: Add nice assembly information.
17955
17956         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
17957         (bug 35169).
17958
17959         * cs-parser.jay: Allow a trailing comma before the close bracked
17960         in the attribute_section production.
17961
17962         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
17963         address of the instance was being taken, I will take this out,
17964         because we take the address of the object immediately here.
17965
17966 2002-12-09  Ravi Pratap  <ravi@ximian.com>
17967
17968         * typemanager.cs (AreMultipleAllowed): Take care of the most
17969         obvious case where attribute type is not in the current assembly -
17970         stupid me ;-)
17971
17972 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
17973
17974         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
17975         definitions, instead of doing that afterwards.  
17976
17977         Also we use a nice little hack, depending on the constructor, we
17978         know if we are a "composed" name or a simple name.  Hence, we
17979         avoid the IndexOf test, and we avoid 
17980
17981         * codegen.cs: Add code to assist in a bug reporter to track down
17982         the source of a compiler crash. 
17983
17984 2002-12-07  Ravi Pratap  <ravi@ximian.com>
17985
17986         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
17987         types have been emitted for a given element and flag an error
17988         if something which does not have AllowMultiple set is used more
17989         than once.
17990
17991         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
17992         attribute types and their corresponding AllowMultiple properties
17993
17994         (AreMultipleAllowed): Check the property for a given type.
17995
17996         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
17997         property in the case we have a TypeContainer.
17998
17999         (Attributes.AddAttribute): Detect duplicates and just skip on
18000         adding them. This trivial fix catches a pretty gross error in our
18001         attribute emission - global attributes were being emitted twice!
18002
18003         Bugzilla bug #33187 is now fixed.
18004
18005 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
18006
18007         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
18008         instead of pp_and).
18009
18010         * expression.cs (Binary.ResolveOperator): I can only use the
18011         Concat (string, string, string) and Concat (string, string,
18012         string, string) if the child is actually a concatenation of
18013         strings. 
18014
18015 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
18016
18017         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
18018         context where we need a 2-character lookahead.
18019
18020         * pending.cs (PendingImplementation): Rework so we can keep track
18021         of interface types all the time, and flag those which were
18022         implemented by parents as optional.
18023
18024 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
18025
18026         * expression.cs (Binary.ResolveOperator): Use
18027         String.Concat(string,string,string) or
18028         String.Concat(string,string,string,string) when possible. 
18029
18030         * typemanager: More helper methods.
18031
18032
18033 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
18034
18035         * pending.cs: remove the bogus return from GetMissingInterfaces()
18036         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
18037
18038 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18039
18040         * namespace.cs: avoid duplicated 'using xxx' being added to
18041         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
18042         when we get more than one 'using' statement for the same namespace.
18043         Report a CS0105 warning for it.
18044
18045 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
18046
18047         * cs-tokenizer.cs (consume_identifier): use read directly, instead
18048         of calling getChar/putback, uses internal knowledge of it.    
18049
18050         (xtoken): Reorder tokenizer so most common patterns are checked
18051         first.  This reduces the compilation time in another 5% (from 8.11s
18052         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
18053
18054         The parsing time is 22% of the compilation in mcs, and from that
18055         64% is spent on the tokenization process.  
18056
18057         I tried using a binary search for keywords, but this is slower
18058         than the hashtable.  Another option would be to do a couple of
18059         things:
18060
18061                 * Not use a StringBuilder, instead use an array of chars,
18062                   with a set value.  Notice that this way we could catch
18063                   the 645 error without having to do it *afterwards*.
18064
18065                 * We could write a hand-parser to avoid the hashtable
18066                   compares altogether.
18067
18068         The identifier consumption process takes 37% of the tokenization
18069         time.  Another 15% is spent on is_number.  56% of the time spent
18070         on is_number is spent on Int64.Parse:
18071
18072                 * We could probably choose based on the string length to
18073                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
18074                   computations. 
18075
18076         Another 3% is spend on wrapping `xtoken' in the `token' function.
18077
18078         Handle 0xa0 as whitespace (#34752)
18079
18080 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
18081
18082         * typemanager.cs (IsCLRType): New routine to tell whether a type
18083         is one of the builtin types.  
18084
18085         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
18086         typecode in more places instead of doing pointer comparissions.
18087         We could leverage some knowledge about the way the typecodes are
18088         laid out.
18089
18090         New code to cache namespaces in assemblies, it is currently not
18091         invoked, to be used soon.
18092
18093         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
18094
18095         * expression.cs (Binary.ResolveOperator): specially handle
18096         strings, and do not perform user-defined operator overloading for
18097         built-in types.
18098
18099 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
18100
18101         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
18102         internalcall as it is a pretty simple operation;  Avoid whenever
18103         possible to call Char.IsLetter.
18104
18105         (consume_identifier): Cut by half the number of
18106         hashtable calls by merging the is_keyword and GetKeyword behavior.
18107
18108         Do not short-circuit, because if we do, we
18109         report errors (ie, #if false && true would produce an invalid
18110         directive error);
18111
18112
18113 2002-11-24  Martin Baulig  <martin@ximian.com>
18114
18115         * expression.cs (Cast.TryReduce): If we're in checked syntax,
18116         check constant ranges and report a CS0221.  Fixes #33186.
18117
18118 2002-11-24  Martin Baulig  <martin@ximian.com>
18119
18120         * cs-parser.jay: Make this work for uninitialized variable
18121         declarations in the `for' initializer.  Fixes #32416.
18122
18123 2002-11-24  Martin Baulig  <martin@ximian.com>
18124
18125         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
18126         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
18127
18128 2002-11-24  Martin Baulig  <martin@ximian.com>
18129
18130         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
18131         argument; if true, we also check for user-defined conversions.
18132         This is only needed if both arguments are of a user-defined type.
18133         Fixes #30443, added test-175.cs.
18134         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
18135
18136         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
18137
18138 2002-11-24  Martin Baulig  <martin@ximian.com>
18139
18140         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
18141         function to get the store opcode.
18142         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
18143         only emit the Ldelema if the store opcode is Stobj.  You must run
18144         both test-34 and test-167 to test this.  Fixes #34529.
18145
18146 2002-11-23  Martin Baulig  <martin@ximian.com>
18147
18148         * ecore.cs (Expression.MemberLookup): Added additional
18149         `qualifier_type' argument which is used when we're being called
18150         from MemberAccess.DoResolve() and null if we're called from a
18151         SimpleName lookup.
18152         (Expression.MemberLookupFailed): New method to report errors; this
18153         does the CS1540 check and reports the correct error message.
18154
18155         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
18156         argument for the CS1540 check and redone the way how we're dealing
18157         with private members.  See the comment in the source code for details.
18158         (FilterWithClosure): Reverted this back to revision 1.197; renamed
18159         `closure_start_type' to `closure_qualifier_type' and check whether
18160         it's not null.  It was not this filter being broken, it was just
18161         being called with the wrong arguments.
18162
18163         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
18164         and pass it the correct `qualifier_type'; this also does the error
18165         handling for us.
18166
18167 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
18168
18169         * expression.cs (Invocation.EmitParams): If the we are dealing
18170         with a non-built-in value type, load its address as well.
18171
18172         (ArrayCreation): Use a a pretty constant instead
18173         of the hardcoded value 2.   Use 6 instead of 2 for the number of
18174         static initializers.  
18175
18176         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
18177         because they are not really value types, just glorified integers. 
18178
18179         * driver.cs: Do not append .exe, the CSC compiler does not do it.
18180
18181         * ecore.cs: Remove redundant code for enumerations, make them use
18182         the same code path as everything else, fixes the casting issue
18183         with enumerations in Windows.Forms.
18184
18185         * attribute.cs: Do only cast to string if it is a string, the
18186         validation happens later.
18187
18188         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
18189         people upgrade their corlibs.
18190
18191         * ecore.cs: Oops, enumerations were not following the entire code path
18192
18193 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
18194
18195         * typemanager.cs (FilterWithClosure): Commented out the test for
18196         1540 in typemanager.cs, as it has problems when accessing
18197         protected methods from a parent class (see test-174.cs). 
18198
18199         * attribute.cs (Attribute.ValidateGuid): new method.
18200         (Attribute.Resolve): Use above.
18201
18202 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
18203
18204         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
18205
18206         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
18207         handling for enumerations, as we only needed the TypeContainer
18208         functionality to begin with (this is required for the fix below to
18209         work for enums that reference constants in a container class for
18210         example). 
18211
18212         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
18213
18214         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
18215         a valid TypeBuilder to perform lookups on.o
18216
18217         * class.cs (InheritableMemberSignatureCompare): Use true in the
18218         call to GetGetMethod and GetSetMethod, because we are comparing
18219         the signature, and we need to get the methods *even* if they are
18220         private. 
18221
18222         (PropertyBase.CheckBase): ditto.
18223
18224         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
18225         GotoCase.Resolve): Use Peel on EmpytCasts.
18226
18227         * ecore.cs (EmptyCast): drop child, add Peel method.
18228
18229 2002-11-17  Martin Baulig  <martin@ximian.com>
18230
18231         * ecore.cs (EmptyCast.Child): New public property.
18232
18233         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
18234         label resolved to an EmptyCast.  Fixes #34162.
18235         (GotoCase.Resolve): Likewise.
18236         (Block.EmitMeta): Likewise.
18237
18238 2002-11-17  Martin Baulig  <martin@ximian.com>
18239
18240         * expression.cs (Invocation.BetterConversion): Prefer int over
18241         uint; short over ushort; long over ulong for integer literals.
18242         Use ImplicitConversionExists instead of StandardConversionExists
18243         since we also need to check for user-defined implicit conversions.
18244         Fixes #34165.  Added test-173.cs.
18245
18246 2002-11-16  Martin Baulig  <martin@ximian.com>
18247
18248         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
18249         with the `true' and `false' literals.  Fixes #33151.
18250
18251 2002-11-16  Martin Baulig  <martin@ximian.com>
18252
18253         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
18254         October 22nd; don't do the cs1540 check for static members.
18255
18256         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
18257         now using our own filter here and doing the cs1540 check again.
18258
18259 2002-11-16  Martin Baulig  <martin@ximian.com>
18260
18261         * support.cs (InternalParameters): Don't crash if we don't have
18262         any fixed parameters.  Fixes #33532.
18263
18264 2002-11-16  Martin Baulig  <martin@ximian.com>
18265
18266         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
18267         when looking up static methods to make this work on Windows.
18268         Fixes #33773.
18269
18270 2002-11-16  Martin Baulig  <martin@ximian.com>
18271
18272         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
18273         a setter rather than using PropertyInfo.CanWrite.
18274
18275 2002-11-15  Nick Drochak  <ndrochak@gol.com>
18276
18277         * class.cs: Allow acces to block member by subclasses. Fixes build
18278         breaker.
18279
18280 2002-11-14  Martin Baulig  <martin@ximian.com>
18281
18282         * class.cs (Constructor.Emit): Added the extern/block check.
18283         Fixes bug #33678.
18284
18285 2002-11-14  Martin Baulig  <martin@ximian.com>
18286
18287         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
18288         iteration while looking for indexers, this is needed because the
18289         indexer may have a different name in our base classes.  Fixed the
18290         error reporting (no indexers at all, not get accessor, no
18291         overloaded match).  Fixes bug #33089.
18292         (IndexerAccess.DoResolveLValue): Likewise.
18293
18294 2002-11-14  Martin Baulig  <martin@ximian.com>
18295
18296         * class.cs (PropertyBase.CheckBase): Make this work for multiple
18297         indexers.  Fixes the first part of bug #33089.
18298         (MethodSignature.InheritableMemberSignatureCompare): Added support
18299         for properties.
18300
18301 2002-11-13  Ravi Pratap  <ravi@ximian.com>
18302
18303         * attribute.cs (Attribute.Resolve): Catch the
18304         NullReferenceException and report it since it isn't supposed to
18305         happen. 
18306
18307 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
18308
18309         * expression.cs (Binary.EmitBranchable): Also handle the cases for
18310         LogicalOr and LogicalAnd that can benefit from recursively
18311         handling EmitBranchable.  The code now should be nice for Paolo.
18312
18313 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
18314
18315         * typemanager.cs (LookupType): Added a negative-hit hashtable for
18316         the Type lookups, as we perform quite a number of lookups on
18317         non-Types.  This can be removed once we can deterministically tell
18318         whether we have a type or a namespace in advance.
18319
18320         But this might require special hacks from our corlib.
18321
18322         * TODO: updated.
18323
18324         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
18325         and double which avoids a conversion from an integer to a double.
18326
18327         * expression.cs: tiny optimization, avoid calling IsConstant,
18328         because it effectively performs the lookup twice.
18329
18330 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
18331
18332         But a bogus return here to keep the semantics of the old code
18333         until the Mono runtime is fixed.
18334
18335         * pending.cs (GetMissingInterfaces): New method used to remove all
18336         the interfaces that are already implemented by our parent
18337         classes from the list of pending methods. 
18338
18339         * interface.cs: Add checks for calls after ResolveTypeExpr.
18340
18341 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
18342
18343         * class.cs (Class.Emit): Report warning 67: event not used if the
18344         warning level is beyond 3.
18345
18346         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
18347         being a NullLiteral.
18348
18349         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
18350         specifiers. 
18351
18352         * class.cs (TypeContainer.GetClassBases): Cover a missing code
18353         path that might fail if a type can not be resolved.
18354
18355         * expression.cs (Binary.Emit): Emit unsigned versions of the
18356         operators. 
18357
18358         * driver.cs: use error 5.
18359
18360 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
18361
18362         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
18363
18364 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
18365
18366         * cs-parser.jay (switch_section): A beautiful patch from Martin
18367         Baulig that fixed 33094.
18368
18369 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
18370
18371         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
18372         Check whether the base is abstract and report an error if so.
18373
18374         * expression.cs (IndexerAccess.DoResolveLValue,
18375         IndexerAccess.DoResolve): ditto. 
18376
18377         (Invocation.DoResolve): ditto.
18378
18379         (Invocation.FullMethodDesc): Improve the report string.
18380
18381         * statement.cs (Block): Eliminate IsVariableDefined as it is
18382         basically just a wrapper for GetVariableInfo.
18383
18384         * ecore.cs (SimpleName): Use new 
18385
18386         * support.cs (ReflectionParamter.ParameterType): We unwrap the
18387         type, as we return the actual parameter ref/unref state on a
18388         different call.
18389
18390 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
18391
18392         * support.cs: Return proper flags REF/OUT fixing the previous
18393         commit.  
18394
18395         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
18396         not used to mean `ref' but `ref or out' in ParameterReference
18397
18398         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
18399         full type signature instead of calling TypeManger.CSharpName
18400         ourselves. 
18401
18402         * support.cs (InternalParameters.ParameterDesc): Do not compare
18403         directly to the modflags, because REF/OUT will actually be bitsets
18404         if set. 
18405
18406         * delegate.cs (VerifyMethod): Check also the modifiers.
18407
18408         * cs-tokenizer.cs: Fix bug where floating point values with an
18409         exponent where a sign was missing was ignored.
18410
18411         * driver.cs: Allow multiple assemblies to be specified in a single
18412         /r: argument
18413
18414 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
18415
18416         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
18417         because identifiers after a parenthesis would end up in this kind
18418         of production, and we needed to desamiguate it for having casts
18419         like:
18420
18421                 (UserDefinedType *) xxx
18422
18423 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
18424
18425         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
18426         we should set on the Bindingflags.NonPublic, but not turn on
18427         private_ok.  private_ok controls whether a Private member is
18428         returned (this is chekced on the filter routine), while the
18429         BindingFlags.NonPublic just controls whether private/protected
18430         will be allowed.   This fixes the problem part of the problem of
18431         private properties being allowed to be used in derived classes.
18432
18433         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
18434         so we can call the children DoResolveLValue method (this will
18435         properly signal errors on lvalue assignments to base properties)
18436
18437         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
18438         getter are null, and we have a property info, we know that this
18439         happened because the lookup failed, so we report an error 122 for
18440         protection level violation.
18441
18442         We also silently return if setter and getter are null in the
18443         resolve functions, this condition only happens if we have flagged
18444         the error before.  This is the other half of the problem. 
18445
18446         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
18447         not have accessibility information, that is why we were returning
18448         true in the filter function in typemanager.cs.
18449
18450         To properly report 122 (property is inaccessible because of its
18451         protection level) correctly, we report this error in ResolveAccess
18452         by failing if both the setter and the getter are lacking (ie, the
18453         lookup failed). 
18454
18455         DoResolve and DoLResolve have been modified to check for both
18456         setter/getter being null and returning silently, the reason being
18457         that I did not want to put the knowledge about this error in upper
18458         layers, like:
18459
18460         int old = Report.Errors;
18461         x = new PropertyExpr (...);
18462         if (old != Report.Errors)
18463                 return null;
18464         else
18465                 return x;
18466
18467         So the property expr is returned, but it is invalid, so the error
18468         will be flagged during the resolve process. 
18469
18470         * class.cs: Remove InheritablePropertySignatureCompare from the
18471         class, as we no longer depend on the property signature to compute
18472         whether it is possible to implement a method or not.
18473
18474         The reason is that calling PropertyInfo.GetGetMethod will return
18475         null (in .NET, in Mono it works, and we should change this), in
18476         cases where the Get Method does not exist in that particular
18477         class.
18478
18479         So this code:
18480
18481         class X { public virtual int A { get { return 1; } } }
18482         class Y : X { }
18483         class Z : Y { public override int A { get { return 2; } } }
18484
18485         Would fail in Z because the parent (Y) would not have the property
18486         defined.  So we avoid this completely now (because the alternative
18487         fix was ugly and slow), and we now depend exclusively on the
18488         method names.
18489
18490         (PropertyBase.CheckBase): Use a method-base mechanism to find our
18491         reference method, instead of using the property.
18492
18493         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
18494         routines are gone now.
18495
18496         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
18497         names, they were incorrectly named.
18498
18499         * cs-tokenizer.cs: Return are more gentle token on failure. 
18500
18501         * pending.cs (PendingImplementation.InterfaceMethod): This routine
18502         had an out-of-sync index variable, which caused it to remove from
18503         the list of pending methods the wrong method sometimes.
18504
18505 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
18506
18507         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
18508         CanWrite, because those refer to this particular instance of the
18509         property, and do not take into account the fact that we can
18510         override single members of a property.
18511
18512         Constructor requires an EmitContext.  The resolution process does
18513         not happen here, but we need to compute the accessors before,
18514         because the resolution does not always happen for properties.
18515
18516         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
18517         subclass, before we did not update this flag, but we did update
18518         bindingflags. 
18519
18520         (GetAccessors): Drop this routine, as it did not work in the
18521         presence of partially overwritten set/get methods. 
18522
18523         Notice that this broke the cs1540 detection, but that will require
18524         more thinking. 
18525
18526 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18527
18528         * class.cs:
18529         * codegen.cs:
18530         * driver.cs: issue a warning instead of an error if we don't support
18531         debugging for the platform. Also ignore a couple of errors that may
18532         arise when trying to write the symbols. Undo my previous patch.
18533
18534 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18535
18536         * driver.cs: ignore /debug switch except for Unix platforms.
18537
18538 2002-10-23  Nick Drochak  <ndrochak@gol.com>
18539
18540         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
18541
18542 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
18543
18544         * driver.cs: Do not make mcs-debug conditional, so we do not break
18545         builds that use it.
18546
18547         * statement.cs (UsageVector.MergeChildren): I would like Martin to
18548         review this patch.  But basically after all the children variables
18549         have been merged, the value of "Breaks" was not being set to
18550         new_breaks for Switch blocks.  I think that it should be set after
18551         it has executed.  Currently I set this to the value of new_breaks,
18552         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
18553         conservative, but I do not understand this code very well.
18554
18555         I did not break anything in the build, so that is good ;-)
18556
18557         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
18558
18559 2002-10-20  Mark Crichton  <crichton@gimp.org>
18560
18561         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
18562
18563 2002-10-20  Nick Drochak  <ndrochak@gol.com>
18564
18565         * cfold.cs: Fixed compile blocker.
18566
18567 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
18568
18569         * driver.cs: I was chekcing the key, not the file.
18570
18571 2002-10-19  Ravi Pratap  <ravi@ximian.com>
18572
18573         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
18574         message that we were generating - we just need to silently return
18575         a null.
18576
18577 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
18578
18579         * class.cs (Event.Define): Change my previous commit, as this
18580         breaks the debugger.  This is a temporary hack, as it seems like
18581         the compiler is generating events incorrectly to begin with.
18582
18583         * expression.cs (Binary.ResolveOperator): Added support for 
18584         "U operator - (E x, E y)"
18585
18586         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
18587         y)".
18588
18589         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
18590         init-only variables, but this path did not take into account that
18591         there might be also instance readonly variables.  Correct this
18592         problem. 
18593
18594         This fixes bug 32253
18595
18596         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
18597         delegates as well.
18598
18599         * driver.cs: Change the extension for modules to `netmodule'
18600
18601         * cs-parser.jay: Improved slightly the location tracking for
18602         the debugger symbols.
18603
18604         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
18605         modifiers that were specified instead of the hardcoded value
18606         (FamAndAssem).  This was basically ignoring the static modifier,
18607         and others.  Fixes 32429.
18608
18609         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
18610         fixed a bug in the process (32476)
18611
18612         * expression.cs (ArrayAccess.EmitAssign): Patch from
18613         hwang_rob@yahoo.ca that fixes bug 31834.3
18614
18615 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
18616
18617         * driver.cs: Make the module extension .netmodule.
18618
18619 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
18620
18621         * driver.cs: Report an error if the resource file is not found
18622         instead of crashing.
18623
18624         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
18625         false, like Emit does.
18626
18627 2002-10-16  Nick Drochak  <ndrochak@gol.com>
18628
18629         * typemanager.cs: Remove unused private member.  Also reported mcs
18630         bug to report this as a warning like csc.
18631
18632 2002-10-15  Martin Baulig  <martin@gnome.org>
18633
18634         * statement.cs (Statement.Emit): Made this a virtual method; emits
18635         the line number info and calls DoEmit().
18636         (Statement.DoEmit): New protected abstract method, formerly knows
18637         as Statement.Emit().
18638
18639         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
18640
18641 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
18642
18643         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
18644         have fixed a remaining problem: not every AddXXXX was adding a
18645         fully qualified name.  
18646
18647         Now everyone registers a fully qualified name in the DeclSpace as
18648         being defined instead of the partial name.  
18649
18650         Downsides: we are slower than we need to be due to the excess
18651         copies and the names being registered this way.  
18652
18653         The reason for this is that we currently depend (on the corlib
18654         bootstrap for instance) that types are fully qualified, because
18655         we dump all the types in the namespace, and we should really have
18656         types inserted into the proper namespace, so we can only store the
18657         basenames in the defined_names array.
18658
18659 2002-10-10  Martin Baulig  <martin@gnome.org>
18660
18661         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
18662         from bug #31834, see the bug report for a testcase which is
18663         miscompiled.
18664
18665 2002-10-10  Martin Baulig  <martin@gnome.org>
18666
18667         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
18668         flow analysis code for this.
18669
18670         * statement.cs (Do, While, For): Tell the flow analysis code about
18671         infinite loops.
18672         (FlowBranching.UsageVector): Added support for infinite loops.
18673         (Block.Resolve): Moved the dead code elimination here and use flow
18674         analysis to do it.
18675
18676 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
18677
18678         * class.cs (Field.Define): Catch cycles on struct type
18679         definitions. 
18680
18681         * typemanager.cs (IsUnmanagedtype): Do not recursively check
18682         fields if the fields are static.  We only need to check instance
18683         fields. 
18684
18685         * expression.cs (As.DoResolve): Test for reference type.
18686
18687         * statement.cs (Using.ResolveExpression): Use
18688         ConvertImplicitRequired, not ConvertImplicit which reports an
18689         error on failture
18690         (Using.ResolveLocalVariableDecls): ditto.
18691
18692         * expression.cs (Binary.ResolveOperator): Report errors in a few
18693         places where we had to.
18694
18695         * typemanager.cs (IsUnmanagedtype): Finish implementation.
18696
18697 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
18698
18699         * expression.cs: Use StoreFromPtr instead of extracting the type
18700         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
18701
18702         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
18703         an enumeration value to a System.Enum, but System.Enum is not a
18704         value type, but an class type, so we need to box.
18705
18706         (Expression.ConvertExplicit): One codepath could return
18707         errors but not flag them.  Fix this.  Fixes #31853
18708
18709         * parameter.cs (Resolve): Do not allow void as a parameter type.
18710
18711 2002-10-06  Martin Baulig  <martin@gnome.org>
18712
18713         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
18714         if it's a class type and not a struct.  Fixes #31815.
18715
18716 2002-10-06  Martin Baulig  <martin@gnome.org>
18717
18718         * statement.cs: Reworked the flow analysis code a bit to make it
18719         usable for dead code elimination.
18720
18721 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18722
18723         * cs-parser.jay: allow empty source files. Fixes bug #31781.
18724
18725 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
18726
18727         * expression.cs (ComposedCast.DoResolveType): A quick workaround
18728         to fix the test 165, will investigate deeper.
18729
18730 2002-10-04  Martin Baulig  <martin@gnome.org>
18731
18732         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
18733         finally blocks actually work.
18734         (Try.Resolve): We don't need to create a sibling for `finally' if
18735         there is no finally block.
18736
18737 2002-10-04  Martin Baulig  <martin@gnome.org>
18738
18739         * class.cs (Constructor.Define): The default accessibility for a
18740         non-default constructor is private, not public.
18741
18742 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
18743
18744         * class.cs (Constructor): Make AllowedModifiers public, add
18745         EXTERN.
18746
18747         * cs-parser.jay: Perform the modifiers test here, as the
18748         constructor for the Constructor class usually receives a zero
18749         because of the way we create it (first we create, later we
18750         customize, and we were never checking the modifiers).
18751
18752         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
18753         is a version of LookupTypeReflection that includes the type-name
18754         cache.  This can be used as a fast path for functions that know
18755         the fully qualified name and are only calling into *.GetType() to
18756         obtain a composed type.
18757
18758         This is also used by TypeManager.LookupType during its type
18759         composition.
18760
18761         (LookupType): We now also track the real type name, as sometimes
18762         we can get a quey for the real type name from things like
18763         ComposedCast.  This fixes bug 31422.
18764
18765         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
18766         complete type fullname, it does not have to go through the type
18767         resolution system to obtain the composed version of the type (for
18768         obtaining arrays or pointers).
18769
18770         (Conditional.Emit): Use the EmitBoolExpression to
18771         generate nicer code, as requested by Paolo.
18772
18773         (ArrayCreation.CheckIndices): Use the patch from
18774         hwang_rob@yahoo.ca to validate the array initializers. 
18775
18776 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
18777
18778         * class.cs (ConstructorInitializer.Emit): simplify code by using
18779         Invocation.EmitCall, and at the same time, fix the bugs in calling
18780         parent constructors that took variable arguments. 
18781
18782         * ecore.cs (Expression.ConvertNumericExplicit,
18783         Expression.ImplicitNumericConversion): Remove the code that
18784         manually wrapped decimal (InternalTypeConstructor call is now gone
18785         as well).
18786
18787         * expression.cs (Cast.TryReduce): Also handle decimal types when
18788         trying to perform a constant fold on the type.
18789
18790         * typemanager.cs (IsUnmanagedtype): Partially implemented.
18791
18792         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
18793         that only turned off an error report, and did nothing else. 
18794
18795 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
18796
18797         * driver.cs: Handle and ignore /fullpaths
18798
18799 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
18800
18801         * expression.cs (Binary.ResolveOperator): Catch the case where
18802         DoNumericPromotions returns true, 
18803
18804         (Binary.DoNumericPromotions): Simplify the code, and the tests.
18805
18806 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
18807
18808         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
18809         report error 70.
18810
18811 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
18812
18813         * ecore.cs (ConvertNumericExplicit): It is not enough that the
18814         conversion exists, but it is also required that the conversion be
18815         performed.  This manifested in "(Type64Enum) 2".  
18816
18817         * class.cs (TypeManager.AddMethod): The fix is not to change
18818         AddEnum, because that one was using a fully qualified name (every
18819         DeclSpace derivative does), but to change the AddMethod routine
18820         that was using an un-namespaced name.  This now correctly reports
18821         the duplicated name.
18822
18823         Revert patch until I can properly fix it.  The issue
18824         is that we have a shared Type space across all namespaces
18825         currently, which is wrong.
18826
18827         Options include making the Namespace a DeclSpace, and merge
18828         current_namespace/current_container in the parser.
18829
18830 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
18831
18832         * cs-parser.jay: Improve error reporting when we get a different
18833         kind of expression in local_variable_type and
18834         local_variable_pointer_type. 
18835
18836         Propagate this to avoid missleading errors being reported.
18837
18838         * ecore.cs (ImplicitReferenceConversion): treat
18839         TypeManager.value_type as a target just like object_type.   As
18840         code like this:
18841
18842         ValueType v = 1;
18843
18844         Is valid, and needs to result in the int 1 being boxed before it
18845         is assigned to the value type v.
18846
18847         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
18848         to validate the enumeration name.
18849
18850         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
18851         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
18852         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
18853
18854         * ecore.cs (TryImplicitIntConversion): When doing an
18855         implicit-enumeration-conversion, check if the type is 64-bits and
18856         perform a conversion before passing to EnumConstant.
18857
18858 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
18859
18860         * decl.cs (Error_AmbiguousTypeReference); New routine used to
18861         report ambiguous type references.  Unlike the MS version, we
18862         report what the ambiguity is.   Innovation at work ;-)
18863
18864         (DeclSpace.FindType): Require a location argument to
18865         display when we display an ambiguous error.
18866
18867         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
18868
18869         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
18870
18871         * expression.cs (EmitDynamicInitializers): Apply patch from
18872         hwang_rob@yahoo.ca that fixes the order in which we emit our
18873         initializers. 
18874
18875 2002-09-21  Martin Baulig  <martin@gnome.org>
18876
18877         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
18878         delegate takes no arguments.
18879
18880 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
18881
18882         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
18883         from integers.
18884
18885         * expression.cs: Extract the underlying type.
18886
18887         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
18888
18889         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
18890
18891 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
18892
18893         * class.cs (TypeContainer.DefineType): We can not use the nice
18894         PackingSize with the size set to 1 DefineType method, because it
18895         will not allow us to define the interfaces that the struct
18896         implements.
18897
18898         This completes the fixing of bug 27287
18899
18900         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
18901         means also structs.  This fixes part of the problem. 
18902         (Expresion.ImplicitReferenceConversionExists): ditto.
18903
18904         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
18905         error if there were no errors reported during the type lookup
18906         process, to avoid duplicates or redundant errors.  Without this
18907         you would get an ambiguous errors plus a type not found.  We have
18908         beaten the user enough with the first error.  
18909
18910         (DeclSparce.FindType): Emit a warning if we have an ambiguous
18911         reference. 
18912
18913         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
18914         during the resolution process, stop the lookup, this avoids
18915         repeated error reports (same error twice).
18916
18917         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
18918
18919         * typemanager.cs (LookupType): Redo the type lookup code to match
18920         the needs of System.Reflection.  
18921
18922         The issue is that System.Reflection requires references to nested
18923         types to begin with a "+" sign instead of a dot.  So toplevel
18924         types look like: "NameSpace.TopLevelClass", and nested ones look
18925         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
18926         levels. 
18927
18928 2002-09-19  Martin Baulig  <martin@gnome.org>
18929
18930         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
18931         says that a method always returns or always throws an exception,
18932         don't report the CS0161.
18933
18934         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
18935         set `Returns = new_returns'.
18936
18937 2002-09-19  Martin Baulig  <martin@gnome.org>
18938
18939         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
18940         to an enum constant, check for a CS0176.
18941
18942 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
18943
18944         * class.cs (TypeContainer.CheckPairedOperators): Now we check
18945         for operators that must be in pairs and report errors.
18946
18947         * ecore.cs (SimpleName.DoResolveType): During the initial type
18948         resolution process, when we define types recursively, we must
18949         check first for types in our current scope before we perform
18950         lookups in the enclosing scopes.
18951
18952         * expression.cs (MakeByteBlob): Handle Decimal blobs.
18953
18954         (Invocation.VerifyArgumentsCompat): Call
18955         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
18956         I thought we were supposed to always call this, but there are a
18957         few places in the code where we dont do it.
18958
18959 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
18960
18961         * driver.cs: Add support in -linkres and -resource to specify the
18962         name of the identifier.
18963
18964 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
18965
18966         * ecore.cs (StandardConversionExists): Sync with the conversion
18967         code: allow anything-* to void* conversions.
18968
18969         (FindMostSpecificSource): Use an Expression argument
18970         instead of a Type, because we might be handed over a Literal which
18971         gets a few more implicit conversions that plain types do not.  So
18972         this information was being lost.
18973
18974         Also, we drop the temporary type-holder expression when not
18975         required.
18976
18977 2002-09-17  Martin Baulig  <martin@gnome.org>
18978
18979         * class.cs (PropertyBase.CheckBase): Don't check the base class if
18980         this is an explicit interface implementation.
18981
18982 2002-09-17  Martin Baulig  <martin@gnome.org>
18983
18984         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
18985         different `IndexerName' attributes.
18986
18987         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
18988         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
18989         virtual CommonResolve().
18990
18991 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
18992
18993         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
18994         and convert that to the UnderlyingType.
18995
18996         * statement.cs (Foreach.Resolve): Indexers are just like variables
18997         or PropertyAccesses.
18998
18999         * cs-tokenizer.cs (consume_string): Track line numbers and columns
19000         inside quoted strings, we were not doing this before.
19001
19002 2002-09-16  Martin Baulig  <martin@gnome.org>
19003
19004         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
19005         resolve it.  This is needed for the definite assignment check of the
19006         instance expression, fixes bug #29846.
19007         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
19008
19009 2002-09-16  Nick Drochak  <ndrochak@gol.com>
19010
19011         * parameter.cs: Fix compile error.  Cannot reference static member
19012         from an instance object.  Is this an mcs bug?
19013
19014 2002-09-14  Martin Baulig  <martin@gnome.org>
19015
19016         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
19017         multiple times.  Fixes bug #30295, added test-166.cs.
19018
19019 2002-09-14  Martin Baulig  <martin@gnome.org>
19020
19021         * statement.cs (Block.Emit): Don't emit unreachable code.
19022         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
19023         `break' statements.
19024         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
19025
19026 2002-09-14  Martin Baulig  <martin@gnome.org>
19027
19028         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
19029         is set.
19030
19031 2002-09-14  Martin Baulig  <martin@gnome.org>
19032
19033         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
19034         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
19035         be false on the ms runtime.
19036
19037 2002-09-13  Martin Baulig  <martin@gnome.org>
19038
19039         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
19040         the CS0038 error message.
19041
19042 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
19043
19044         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
19045         constant inside, return it.
19046
19047 2002-09-12  Martin Baulig  <martin@gnome.org>
19048
19049         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
19050         implicit conversion can be done between enum types.
19051
19052         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
19053         check whether an implicit conversion to the current enum's UnderlyingType
19054         exists and report an error if not.
19055
19056         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
19057         without debugging support.
19058
19059         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
19060         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
19061
19062 2002-09-12  Martin Baulig  <martin@gnome.org>
19063
19064         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
19065
19066         * ecore.cs (IMemberExpr.DeclaringType): New property.
19067         (SimpleName.SimpleNameResolve): Check whether we're accessing a
19068         nonstatic member of an outer type (CS0038).
19069
19070 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
19071
19072         * driver.cs: Activate the using-error detector at warning level
19073         4 (at least for MS-compatible APIs).
19074
19075         * namespace.cs (VerifyUsing): Small buglett fix.
19076
19077         * pending.cs (PendingImplementation): pass the container pointer. 
19078
19079         * interface.cs (GetMethods): Allow for recursive definition.  Long
19080         term, I would like to move every type to support recursive
19081         definitions, not the current ordering mechanism that we have right
19082         now.
19083
19084         The situation is this: Attributes are handled before interfaces,
19085         so we can apply attributes to interfaces.  But some attributes
19086         implement interfaces, we will now handle the simple cases
19087         (recursive definitions will just get an error).  
19088
19089         * parameter.cs: Only invalidate types at the end if we fail to
19090         lookup all types.  
19091
19092 2002-09-09  Martin Baulig  <martin@gnome.org>
19093
19094         * ecore.cs (PropertyExpr.Emit): Also check for
19095         TypeManager.system_int_array_get_length so this'll also work when
19096         compiling corlib.  Fixes #30003.
19097
19098 2002-09-09  Martin Baulig  <martin@gnome.org>
19099
19100         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
19101         and throw an exception if we can't get the type's size.  Fixed #30040,
19102         added test-165.cs.
19103
19104 2002-09-09  Martin Baulig  <martin@gnome.org>
19105
19106         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
19107
19108         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
19109         context.  Fixes bug #30027.
19110
19111         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
19112         virtual functions.  Fixes bug #30043, added test-164.cs.
19113
19114 2002-09-08  Ravi Pratap  <ravi@ximian.com>
19115
19116         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
19117
19118 2002-09-08  Nick Drochak  <ndrochak@gol.com>
19119
19120         * driver.cs: Use an object to get the windows codepage since it's not a
19121         static property.
19122
19123 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
19124
19125         * statement.cs (For.Emit): for infinite loops (test == null)
19126         return whether there is a break inside, not always "true".
19127
19128         * namespace.cs (UsingEntry): New struct to hold the name of the
19129         using definition, the location where it is defined, and whether it
19130         has been used in a successful type lookup.
19131
19132         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
19133         strings.
19134
19135         * decl.cs: ditto.
19136
19137 2002-09-06  Ravi Pratap  <ravi@ximian.com>
19138
19139         * attribute.cs : Fix incorrect code which relied on catching
19140         a NullReferenceException to detect a null being passed in
19141         where an object was expected.
19142
19143 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
19144
19145         * statement.cs (Try): flag the catch variable as assigned
19146
19147         * expression.cs (Cast): Simplified by using ResolveType instead of
19148         manually resolving.
19149
19150         * statement.cs (Catch): Fix bug by using ResolveType.
19151
19152 2002-09-06  Ravi Pratap  <ravi@ximian.com>
19153
19154         * expression.cs (BetterConversion): Special case for when we have
19155         a NullLiteral as the argument and we have to choose between string
19156         and object types - we choose string the way csc does.
19157
19158         * attribute.cs (Attribute.Resolve): Catch the
19159         NullReferenceException and report error #182 since the Mono
19160         runtime no more has the bug and having this exception raised means
19161         we tried to select a constructor which takes an object and is
19162         passed a null.
19163
19164 2002-09-05  Ravi Pratap  <ravi@ximian.com>
19165
19166         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
19167         message (1502, 1503) when we can't locate a method after overload
19168         resolution. This is much more informative and closes the bug
19169         Miguel reported.
19170
19171         * interface.cs (PopulateMethod): Return if there are no argument
19172         types. Fixes a NullReferenceException bug.
19173
19174         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
19175         expressions too. Previously we were checking only in one place for
19176         positional arguments leaving out named arguments.
19177
19178         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
19179         type to the enum type is not allowed. Remove code corresponding to
19180         that.
19181
19182         (ConvertNumericExplicit): Allow explicit conversions from
19183         the underlying type to enum type. This precisely follows the spec
19184         and closes a bug filed by Gonzalo.
19185
19186 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19187
19188         * compiler.csproj:
19189         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
19190
19191 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
19192
19193         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
19194         it was important that we stored the right value after the
19195         reduction in `converted'.
19196
19197 2002-09-04  Martin Baulig  <martin@gnome.org>
19198
19199         * location.cs (Location.SymbolDocument): Use full pathnames for the
19200         source files.
19201
19202 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
19203
19204         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
19205         of the expression resolve mechanism, because that will catch the
19206         SimpleName error failures.
19207
19208         (Conditional): If we can not resolve the
19209         expression, return, do not crash.
19210
19211 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19212
19213         * cs-tokenizer.cs:
19214         (location): display token name instead of its number.
19215
19216 2002-08-28  Martin Baulig  <martin@gnome.org>
19217
19218         * expression.cs (Binary.ResolveOperator): Don't silently return
19219         but return an error if an operator cannot be applied between two
19220         enum types.
19221
19222 2002-08-28  Martin Baulig  <martin@gnome.org>
19223
19224         * class.cs (Constructor.Define): Set the permission attributes
19225         correctly instead of making all constructors public.
19226
19227 2002-08-28  Martin Baulig  <martin@gnome.org>
19228
19229         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
19230         for private members before reporting a CS0103; if we find anything,
19231         it's a CS0122.
19232
19233 2002-08-28  Martin Baulig  <martin@gnome.org>
19234
19235         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
19236         to check whether `closure_start_type == closure_invocation_type',
19237         we also need to check whether `m.DeclaringType == closure_invocation_type'
19238         before bypassing the permission checks.  We might be accessing
19239         protected/private members from the base class.
19240         (TypeManager.RealMemberLookup): Only set private_ok if private
19241         members were requested via BindingFlags.NonPublic.
19242
19243         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
19244
19245         * expression.cs (MemberAccess.ResolveMemberAccess): Set
19246         MethodGroupExpr.IsExplicitImpl if appropriate.
19247         (Invocation.DoResolve): Don't report the CS0120 for explicit
19248         interface implementations.
19249
19250 2002-08-27  Martin Baulig  <martin@gnome.org>
19251
19252         * expression.cs (Invocation.DoResolve): If this is a static
19253         method and we don't have an InstanceExpression, we must report
19254         a CS0120.
19255
19256 2002-08-25  Martin Baulig  <martin@gnome.org>
19257
19258         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
19259         `==' between a valuetype and an object.
19260
19261 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
19262
19263         * ecore.cs (TypeExpr): Provide a ToString method.
19264
19265 2002-08-24  Martin Baulig  <martin@gnome.org>
19266
19267         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
19268         now called proggie.dbg and it's a binary file.
19269
19270 2002-08-23  Martin Baulig  <martin@gnome.org>
19271
19272         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
19273
19274 2002-08-23  Martin Baulig  <martin@gnome.org>
19275
19276         * struct.cs (MyStructInfo.ctor): Make this work with empty
19277         structs; it's not allowed to use foreach() on null.
19278
19279 2002-08-23  Martin Baulig  <martin@gnome.org>
19280
19281         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
19282         writer the full pathname of the generated assembly.
19283
19284 2002-08-23  Martin Baulig  <martin@gnome.org>
19285
19286         * statements.cs (FlowBranching.UsageVector.MergeChildren):
19287         A `finally' block never returns or breaks; improved handling of
19288         unreachable code.
19289
19290 2002-08-23  Martin Baulig  <martin@gnome.org>
19291
19292         * statement.cs (Throw.Resolve): Allow `throw null'.
19293
19294 2002-08-23  Martin Baulig  <martin@gnome.org>
19295
19296         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
19297         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
19298         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
19299         MemberLookup would return a wrong event if this is an explicit
19300         interface implementation and the class has an event with the same
19301         name.
19302
19303 2002-08-23  Martin Baulig  <martin@gnome.org>
19304
19305         * statement.cs (Block.AddChildVariableNames): New public method.
19306         (Block.AddChildVariableName): Likewise.
19307         (Block.IsVariableNameUsedInChildBlock): Likewise.
19308         (Block.AddVariable): Check whether a variable name has already
19309         been used in a child block.
19310
19311         * cs-parser.jay (declare_local_variables): Mark all variable names
19312         from the current block as being used in a child block in the
19313         implicit block.
19314
19315 2002-08-23  Martin Baulig  <martin@gnome.org>
19316
19317         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
19318         find the symbol writer.
19319
19320         * driver.cs: csc also allows the arguments to /define being
19321         separated by commas, not only by semicolons.
19322
19323 2002-08-23  Martin Baulig  <martin@gnome.org>
19324
19325         * interface.cs (Interface.GetMembers): Added static check for events.
19326
19327 2002-08-15  Martin Baulig  <martin@gnome.org>
19328
19329         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
19330         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
19331
19332         * ecore.cs (Expression.MemberLookup): Added documentation and explained
19333         why the MethodData.EmitDestructor() change was necessary.
19334
19335 2002-08-20  Martin Baulig  <martin@gnome.org>
19336
19337         * class.cs (TypeContainer.FindMembers): Added static check for events.
19338
19339         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
19340
19341         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
19342         use Type.GetEvents(), not Type.FindMembers().
19343
19344 2002-08-20  Martin Baulig  <martin@gnome.org>
19345
19346         * decl.cs (MemberCache): Added a special method cache which will
19347         be used for method-only searched.  This ensures that a method
19348         search will return a MethodInfo with the correct ReflectedType for
19349         inherited methods.      
19350
19351 2002-08-20  Martin Baulig  <martin@gnome.org>
19352
19353         * decl.cs (DeclSpace.FindMembers): Made this public.
19354
19355 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19356
19357         * delegate.cs: fixed build on windows.
19358         [FIXME:  Filed as bug #29150: MCS must report these errors.]
19359
19360 2002-08-19  Ravi Pratap  <ravi@ximian.com>
19361
19362         * ecore.cs (StandardConversionExists): Return a false
19363         if we are trying to convert the void type to anything else
19364         since that is not allowed.
19365
19366         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
19367         we flag error 70 in the event an event is trying to be accessed
19368         directly from outside the declaring type.
19369
19370 2002-08-20  Martin Baulig  <martin@gnome.org>
19371
19372         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
19373         MemberCache from typemanager.cs to decl.cs.
19374
19375 2002-08-19  Martin Baulig  <martin@gnome.org>
19376
19377         * class.cs (TypeContainer): Implement IMemberContainer.
19378         (TypeContainer.DefineMembers): Create the MemberCache.
19379         (TypeContainer.FindMembers): Do better BindingFlags checking; only
19380         return public members if BindingFlags.Public was given, check
19381         whether members are static.
19382
19383 2002-08-16  Martin Baulig  <martin@gnome.org>
19384
19385         * decl.cs (DeclSpace.Define): Splitted this in Define and
19386         DefineMembers.  DefineMembers is called first and initializes the
19387         MemberCache.
19388
19389         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
19390         DefineMembers() on all our DeclSpaces.
19391
19392         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
19393         but call DefineMembers() on all nested interfaces.  We call their
19394         Define() in our new Define() function.
19395
19396         * interface.cs (Interface): Implement IMemberContainer.
19397         (Interface.Define): Moved all code except the attribute stuf to
19398         DefineMembers().
19399         (Interface.DefineMembers): Initialize the member cache.
19400
19401         * typemanager.cs (IMemberFinder): Removed this interface, we don't
19402         need this anymore since we can use MemberCache.FindMembers directly.
19403
19404 2002-08-19  Martin Baulig  <martin@gnome.org>
19405
19406         * typemanager.cs (MemberCache): When creating the cache for an
19407         interface type, add all inherited members.
19408         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
19409         to `out bool used_cache' and documented it.
19410         (TypeManager.MemberLookup): If we already used the cache in the first
19411         iteration, we don't need to do the interfaces check.
19412
19413 2002-08-19  Martin Baulig  <martin@gnome.org>
19414
19415         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
19416         here from IMemberFinder and don't implement this interface anymore.
19417         (DeclSpace.MemberCache): Moved here from IMemberFinder.
19418
19419         * typemanager.cs (IMemberFinder): This interface is now only used by
19420         classes which actually support the member cache.
19421         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
19422         since we only put DeclSpaces into this Hashtable.
19423         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
19424         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
19425
19426 2002-08-16  Martin Baulig  <martin@gnome.org>
19427
19428         * typemanager.cs (ICachingMemberFinder): Removed.
19429         (IMemberFinder.MemberCache): New property.
19430         (TypeManager.FindMembers): Merged this with RealFindMembers().
19431         This function will never be called from TypeManager.MemberLookup()
19432         so we can't use the cache here, just the IMemberFinder.
19433         (TypeManager.MemberLookup_FindMembers): Check whether the
19434         IMemberFinder has a MemberCache and call the cache's FindMembers
19435         function.
19436         (MemberCache): Rewrote larger parts of this yet another time and
19437         cleaned it up a bit.
19438
19439 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
19440
19441         * driver.cs (LoadArgs): Support quoting.
19442
19443         (Usage): Show the CSC-like command line arguments.
19444
19445         Improved a few error messages.
19446
19447 2002-08-15  Martin Baulig  <martin@gnome.org>
19448
19449         * typemanager.cs (IMemberContainer.Type): New property.
19450         (IMemberContainer.IsInterface): New property.
19451
19452         The following changes are conditional to BROKEN_RUNTIME, which is
19453         defined at the top of the file.
19454
19455         * typemanager.cs (MemberCache.MemberCache): Don't add the base
19456         class'es members, but add all members from TypeHandle.ObjectType
19457         if we're an interface.
19458         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
19459         is the current type.
19460         (MemberCache.CacheEntry.Container): Removed this field.
19461         (TypeHandle.GetMembers): Include inherited members.
19462
19463 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19464
19465         * typemanager.cs: fixed compilation and added a comment on a field that
19466         is never used.
19467
19468 2002-08-15  Martin Baulig  <martin@gnome.org>
19469
19470         * class.cs (ConstructorInitializer.Resolve): In the
19471         Expression.MemberLookup call, use the queried_type as
19472         invocation_type.
19473
19474         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
19475         declared' attribute, it's always true.
19476         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
19477         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
19478         temporary wrapper for FindMembers which tells MemberLookup whether
19479         members from the base classes are included in the return value.
19480         This will go away soon.
19481         (TypeManager.MemberLookup): Use this temporary hack here; once the
19482         new MemberCache is completed, we don't need to do the DeclaredOnly
19483         looping here anymore since the MemberCache will take care of this.
19484         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
19485         (MemberCache): When creating the MemberCache for a class, get
19486         members from the current class and all its base classes.
19487         (MemberCache.CacheEntry.Container): New field.  This is a
19488         temporary hack until the Mono runtime is fixed to distinguish
19489         between ReflectedType and DeclaringType.  It allows us to use MCS
19490         with both the MS runtime and the unfixed Mono runtime without
19491         problems and without accecting performance.
19492         (MemberCache.SearchMembers): The DeclaredOnly looping from
19493         TypeManager.MemberLookup is now done here.      
19494
19495 2002-08-14  Martin Baulig  <martin@gnome.org>
19496
19497         * statement.cs (MyStructInfo.MyStructInfo): Don't call
19498         Type.GetFields on dynamic types but get the fields from the
19499         corresponding TypeContainer.
19500         (MyStructInfo.GetStructInfo): Added check for enum types.
19501
19502         * typemanager.cs (MemberList.IsSynchronized): Implemented.
19503         (MemberList.SyncRoot): Implemented.
19504         (TypeManager.FilterWithClosure): No need to check permissions if
19505         closure_start_type == closure_invocation_type, don't crash if
19506         closure_invocation_type is null.
19507
19508 2002-08-13  Martin Baulig  <martin@gnome.org>
19509
19510         Rewrote TypeContainer.FindMembers to use a member cache.  This
19511         gives us a speed increase of about 35% for the self-hosting MCS
19512         build and of about 15-20% for the class libs (both on GNU/Linux).
19513
19514         * report.cs (Timer): New class to get enhanced profiling.  This
19515         whole class is "TIMER" conditional since it remarkably slows down
19516         compilation speed.
19517
19518         * class.cs (MemberList): New class.  This is an IList wrapper
19519         which we're now using instead of passing MemberInfo[]'s around to
19520         avoid copying this array unnecessarily.
19521         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
19522         (ICachingMemberFinder, IMemberContainer): New interface.
19523         (TypeManager.FilterWithClosure): If `criteria' is null, the name
19524         has already been checked, otherwise use it for the name comparision.
19525         (TypeManager.FindMembers): Renamed to RealMemberFinder and
19526         provided wrapper which tries to use ICachingMemberFinder.FindMembers
19527         if possible.  Returns a MemberList, not a MemberInfo [].
19528         (TypeHandle): New class, implements IMemberContainer.  We create
19529         one instance of this class per type, it contains a MemberCache
19530         which is used to do the member lookups.
19531         (MemberCache): New class.  Each instance of this class contains
19532         all members of a type and a name-based hash table.
19533         (MemberCache.FindMembers): This is our new member lookup
19534         function.  First, it looks up all members of the requested name in
19535         the hash table.  Then, it walks this list and sorts out all
19536         applicable members and returns them.
19537
19538 2002-08-13  Martin Baulig  <martin@gnome.org>
19539
19540         In addition to a nice code cleanup, this gives us a performance
19541         increase of about 1.4% on GNU/Linux - not much, but it's already
19542         half a second for the self-hosting MCS compilation.
19543
19544         * typemanager.cs (IMemberFinder): New interface.  It is used by
19545         TypeManager.FindMembers to call FindMembers on a TypeContainer,
19546         Enum, Delegate or Interface.
19547         (TypeManager.finder_to_member_finder): New PtrHashtable.
19548         (TypeManager.finder_to_container): Removed.
19549         (TypeManager.finder_to_delegate): Removed.
19550         (TypeManager.finder_to_interface): Removed.
19551         (TypeManager.finder_to_enum): Removed.
19552
19553         * interface.cs (Interface): Implement IMemberFinder.
19554
19555         * delegate.cs (Delegate): Implement IMemberFinder.
19556
19557         * enum.cs (Enum): Implement IMemberFinder.
19558
19559         * class.cs (TypeContainer): Implement IMemberFinder.
19560
19561 2002-08-12  Martin Baulig  <martin@gnome.org>
19562
19563         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
19564
19565 2002-08-12  Martin Baulig  <martin@gnome.org>
19566
19567         * ecore.cs (ITypeExpression): New interface for expressions which
19568         resolve to a type.
19569         (TypeExpression): Renamed to TypeLookupExpression.
19570         (Expression.DoResolve): If we're doing a types-only lookup, the
19571         expression must implement the ITypeExpression interface and we
19572         call DoResolveType() on it.
19573         (SimpleName): Implement the new ITypeExpression interface.
19574         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
19575         hack, the situation that we're only looking up types can't happen
19576         anymore when this method is called.  Moved the type lookup code to
19577         DoResolveType() and call it.
19578         (SimpleName.DoResolveType): This ITypeExpression interface method
19579         is now doing the types-only lookup.
19580         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
19581         (ResolveFlags): Added MaskExprClass.
19582
19583         * expression.cs (MemberAccess): Implement the ITypeExpression
19584         interface.
19585         (MemberAccess.DoResolve): Added support for a types-only lookup
19586         when we're called via ITypeExpression.DoResolveType().
19587         (ComposedCast): Implement the ITypeExpression interface.
19588
19589         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
19590         Expression.Resolve() with ResolveFlags.Type instead.
19591
19592 2002-08-12  Martin Baulig  <martin@gnome.org>
19593
19594         * interface.cs (Interface.Define): Apply attributes.
19595
19596         * attribute.cs (Attribute.ApplyAttributes): Added support for
19597         interface attributes.
19598
19599 2002-08-11  Martin Baulig  <martin@gnome.org>
19600
19601         * statement.cs (Block.Emit): Only check the "this" variable if we
19602         do not always throw an exception.
19603
19604         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
19605         whether the property has a set accessor.
19606
19607 2002-08-11  Martin Baulig  <martin@gnome.org>
19608
19609         Added control flow analysis support for structs.
19610
19611         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
19612         with control flow analysis turned off.
19613         (IVariable): New interface.
19614         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
19615         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
19616         (FieldExpr.DoResolve): Resolve the instance expression with flow
19617         analysis turned off and do the definite assignment check after the
19618         resolving when we know what the expression will resolve to.
19619
19620         * expression.cs (LocalVariableReference, ParameterReference):
19621         Implement the new IVariable interface, only call the flow analysis
19622         code if ec.DoFlowAnalysis is true.
19623         (This): Added constructor which takes a Block argument.  Implement
19624         the new IVariable interface.
19625         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
19626         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
19627         This does the definite assignment checks for struct members.
19628
19629         * class.cs (Constructor.Emit): If this is a non-static `struct'
19630         constructor which doesn't have any initializer, call
19631         Block.AddThisVariable() to tell the flow analysis code that all
19632         struct elements must be initialized before control returns from
19633         the constructor.
19634
19635         * statement.cs (MyStructInfo): New public class.
19636         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
19637         argument to this indexer.  If non-zero, check an individual struct
19638         member, not the whole struct.
19639         (FlowBranching.CheckOutParameters): Check struct members.
19640         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
19641         overloaded versions of these methods which take an additional
19642         `int field_idx' argument to check struct members.
19643         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
19644         overloaded versions of these methods which take an additional
19645         `string field_name' argument to check struct member.s
19646         (VariableInfo): Implement the IVariable interface.
19647         (VariableInfo.StructInfo): New public property.  Returns the
19648         MyStructInfo instance of the variable if it's a struct or null.
19649         (Block.AddThisVariable): New public method.  This is called from
19650         Constructor.Emit() for non-static `struct' constructor which do
19651         not have any initializer.  It creates a special variable for the
19652         "this" instance variable which will be checked by the flow
19653         analysis code to ensure that all of the struct's fields are
19654         initialized before control returns from the constructor.
19655         (UsageVector): Added support for struct members.  If a
19656         variable/parameter is a struct with N members, we reserve a slot
19657         in the usage vector for each member.  A struct is considered fully
19658         initialized if either the struct itself (slot 0) or all its
19659         members are initialized.
19660
19661 2002-08-08  Martin Baulig  <martin@gnome.org>
19662
19663         * driver.cs (Driver.MainDriver): Only report an error CS5001
19664         if there were no compilation errors.
19665
19666         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
19667         `UnsafeContext' property to determine whether the parent is in
19668         unsafe context rather than checking the parent's ModFlags:
19669         classes nested in an unsafe class are unsafe as well.
19670
19671 2002-08-08  Martin Baulig  <martin@gnome.org>
19672
19673         * statement.cs (UsageVector.MergeChildren): Distinguish between
19674         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
19675         we return.  Added test17() and test18() to test-154.cs.
19676
19677 2002-08-08  Martin Baulig  <martin@gnome.org>
19678
19679         * typemanager.cs (TypeManager.FilterWithClosure): If we have
19680         Family access, make sure the invoking type isn't a subclass of the
19681         queried type (that'd be a CS1540).
19682
19683         * ecore.cs (Expression.MemberLookup): Added overloaded version of
19684         this method which takes an additional `Type invocation_type'.
19685
19686         * expression.cs (BaseAccess.DoResolve): Use the base type as
19687         invocation and query type.
19688         (MemberAccess.DoResolve): If the lookup failed and we're about to
19689         report a CS0122, try a lookup with the ec.ContainerType - if this
19690         succeeds, we must report a CS1540.
19691
19692 2002-08-08  Martin Baulig  <martin@gnome.org>
19693
19694         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
19695         (MethodGroupExpr): Implement the IMemberExpr interface.
19696
19697         * expression (MemberAccess.ResolveMemberAccess): No need to have
19698         any special code for MethodGroupExprs anymore, they're now
19699         IMemberExprs.   
19700
19701 2002-08-08  Martin Baulig  <martin@gnome.org>
19702
19703         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
19704         Family, FamANDAssem and FamORAssem permissions.
19705         (TypeManager.IsSubclassOrNestedChildOf): New public method.
19706
19707 2002-08-08  Martin Baulig  <martin@gnome.org>
19708
19709         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
19710         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
19711         or loop block.
19712
19713 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
19714
19715         * driver.cs: implemented /resource option to embed managed resources.
19716
19717 2002-08-07  Martin Baulig  <martin@gnome.org>
19718
19719         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
19720         (FieldBase.HasFieldInitializer): New public property.
19721         (FieldBase.GetInitializerExpression): New public method.  Resolves and
19722         returns the field initializer and makes sure it is only resolved once.
19723         (TypeContainer.EmitFieldInitializers): Call
19724         FieldBase.GetInitializerExpression to get the initializer, this ensures
19725         that it isn't resolved multiple times.
19726
19727         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
19728         the resolving process (SimpleName/MemberLookup) that we're currently
19729         emitting a field initializer (which must not access any instance members,
19730         this is an error CS0236).
19731
19732         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
19733         argument, if the `IsFieldInitializer' flag is set, we must report and
19734         error CS0236 and not an error CS0120.   
19735
19736 2002-08-07  Martin Baulig  <martin@gnome.org>
19737
19738         * ecore.cs (IMemberExpr): New public interface.
19739         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
19740         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
19741         if the expression is an IMemberExpr.
19742
19743         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
19744         to be null, implicitly default to `this' if we're non-static in
19745         this case.  Simplified the code a lot by using the new IMemberExpr
19746         interface.  Also fixed bug #28176 here.
19747
19748 2002-08-06  Martin Baulig  <martin@gnome.org>
19749
19750         * cs-parser.jay (SimpleLookup): Removed.  We need to create
19751         ParameterReferences during semantic analysis so that we can do a
19752         type-only search when resolving Cast, TypeOf and SizeOf.
19753         (block): Pass the `current_local_parameters' to the Block's
19754         constructor.
19755
19756         * class.cs (ConstructorInitializer): Added `Parameters parameters'
19757         argument to the constructor.
19758         (ConstructorInitializer.Resolve): Create a temporary implicit
19759         block with the parameters.
19760
19761         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
19762         references here if we aren't doing a type-only search.
19763
19764         * statement.cs (Block): Added constructor which takes a
19765         `Parameters parameters' argument.
19766         (Block.Parameters): New public property.
19767
19768         * support.cs (InternalParameters.Parameters): Renamed `parameters'
19769         to `Parameters' and made it public readonly.
19770
19771 2002-08-06  Martin Baulig  <martin@gnome.org>
19772
19773         * ecore.cs (Expression.Warning): Made this public as well.
19774
19775         * report.cs (Report.Debug): Print the contents of collections.
19776
19777 2002-08-06  Martin Baulig  <martin@gnome.org>
19778
19779         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
19780         used to tell Resolve() which kinds of expressions it may return.
19781         (Expression.Resolve): Added overloaded version of this method which
19782         takes a `ResolveFlags flags' argument.  This can be used to tell
19783         Resolve() which kinds of expressions it may return.  Reports a
19784         CS0118 on error.
19785         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
19786         ResolveFlags.SimpleName.
19787         (Expression.Error118): Added overloaded version of this method which
19788         takes a `ResolveFlags flags' argument.  It uses the flags to determine
19789         which kinds of expressions are allowed.
19790
19791         * expression.cs (Argument.ResolveMethodGroup): New public method.
19792         Resolves an argument, but allows a MethodGroup to be returned.
19793         This is used when invoking a delegate.
19794
19795         * TODO: Updated a bit.
19796
19797 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19798
19799         Fixed compilation with csc.
19800
19801         * ecore.cs: Expression.Error made public. Is this correct? Should
19802         Warning be made public too?
19803
19804         * expression.cs: use ea.Location instead of ea.loc.
19805         [FIXME:  Filed as bug #28607: MCS must report these errors.]
19806
19807 2002-08-06  Martin Baulig  <martin@gnome.org>
19808
19809         * ecore.cs (Expression.loc): Moved the location here instead of
19810         duplicating it in all derived classes.
19811         (Expression.Location): New public property.
19812         (Expression.Error, Expression.Warning): Made them non-static and
19813         removed the location argument.
19814         (Expression.Warning): Added overloaded version which takes an
19815         `int level' argument.
19816         (Expression.Error118): Make this non-static and removed the
19817         expression and location arguments.
19818         (TypeExpr): Added location argument to the constructor.
19819
19820         * expression.cs (StaticCallExpr): Added location argument to
19821         the constructor.
19822         (Indirection, PointerArithmetic): Likewise.
19823         (CheckedExpr, UnCheckedExpr): Likewise.
19824         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
19825         (StringPtr): Likewise.
19826
19827
19828 2002-08-05  Martin Baulig  <martin@gnome.org>
19829
19830         * expression.cs (BaseAccess.DoResolve): Actually report errors.
19831
19832         * assign.cs (Assign.DoResolve): Check whether the source
19833         expression is a value or variable.
19834
19835         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
19836         while resolving the corresponding blocks.
19837
19838         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
19839         an error, don't silently return null.
19840
19841         * statement.cs (Block.AddVariable): Do the error reporting here
19842         and distinguish between CS0128 and CS0136.
19843         (Block.DoResolve): Report all unused labels (warning CS0164).
19844         (LabeledStatement): Pass the location to the constructor.
19845         (LabeledStatement.HasBeenReferenced): New property.
19846         (LabeledStatement.Resolve): Set it to true here.
19847
19848         * statement.cs (Return.Emit): Return success even after reporting
19849         a type mismatch error (CS0126 or CS0127), this is what csc does and
19850         it avoids confusing the users with any consecutive errors.
19851
19852 2002-08-05  Martin Baulig  <martin@gnome.org>
19853
19854         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
19855
19856         * const.cs (Const.LookupConstantValue): Catch circular definitions.
19857
19858         * expression.cs (MemberAccess.DoResolve): Silently return if an
19859         error has already been reported.
19860
19861         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
19862         error has already been reported.
19863
19864 2002-08-05  Martin Baulig  <martin@gnome.org>
19865
19866         * statement.cs (UsageVector): Only initialize the `parameters'
19867         vector if we actually have any "out" parameters.
19868
19869 2002-08-05  Martin Baulig  <martin@gnome.org>
19870
19871         * expression.cs (Binary.ResolveOperator): When combining delegates,
19872         they must have the same type.
19873
19874 2002-08-05  Martin Baulig  <martin@gnome.org>
19875
19876         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
19877         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
19878         work with the ms runtime and we also don't need it: if we're a
19879         PropertyBuilder and not in the `indexer_arguments' hash, then we
19880         are a property and not an indexer.
19881
19882         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
19883         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
19884         since the latter one doesn't work with the ms runtime.
19885
19886 2002-08-03  Martin Baulig  <martin@gnome.org>
19887
19888         Fixed bugs #27998 and #22735.
19889
19890         * class.cs (Method.IsOperator): New public field.
19891         (Method.CheckBase): Report CS0111 if there's already a method
19892         with the same parameters in the current class.  Report CS0508 when
19893         attempting to change the return type of an inherited method.
19894         (MethodData.Emit): Report CS0179 if a method doesn't have a body
19895         and it's not marked abstract or extern.
19896         (PropertyBase): New abstract base class for Property and Indexer.
19897         (PropertyBase.CheckBase): Moved here from Property and made it work
19898         for indexers.
19899         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
19900         the same so we can reuse it there.
19901         (Property, Indexer): Derive from PropertyBase.
19902         (MethodSignature.inheritable_property_signature_filter): New delegate
19903         to find properties and indexers.
19904
19905         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
19906         argument and improved error reporting.
19907
19908         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
19909         EmptyReadOnlyParameters and made it a property.
19910
19911         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
19912         version of this method which takes a `PropertyInfo indexer'.
19913         (TypeManager.RegisterIndexer): New method.
19914
19915         * class.cs: Added myself as author of this file :-)
19916
19917 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19918
19919         * class.cs: fixed compilation on windoze.
19920
19921 2002-08-03  Martin Baulig  <martin@gnome.org>
19922
19923         * interface.cs (Interface.GetInterfaceBases): Check whether all
19924         base interfaces are at least as accessible than the current one.
19925
19926         * class.cs (TypeContainer.GetClassBases): Check whether base types
19927         are at least as accessible than the current type.
19928         (TypeContainer.AsAccessible): Implemented and made non-static.
19929         (MemberBase.CheckParameters): Report errors if the accessibility
19930         checks fail.
19931
19932         * delegate.cs (Delegate.Delegate): The default visibility is
19933         internal for top-level types and private for nested types.
19934         (Delegate.Define): Report errors if the accessibility checks fail.
19935
19936         * enum.cs (Enum.Enum): The default visibility is internal for
19937         top-level types and private for nested types.
19938         (Enum.DefineType): Compute the correct visibility.
19939
19940         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
19941         function which takes a `bool is_toplevel' instead of a TypeContainer.
19942
19943         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
19944         builtin type.
19945
19946 2002-08-02  Martin Baulig  <martin@gnome.org>
19947
19948         * expression.cs (LocalVariableReferenc): Added constructor which
19949         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
19950         (LocalVariableReference.IsReadOnly): New property.
19951         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
19952         variable is readonly, use our own readonly flag to do this; you can
19953         use the new constructor to get a writable reference to a read-only
19954         variable.
19955
19956         * cs-parser.jay (foreach_statement, using_statement): Get a writable
19957         reference to the local variable.
19958
19959 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
19960
19961         * rootcontext.cs (ResolveCore): Also include System.Exception
19962
19963         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
19964         we reach an EmptyStatement.
19965
19966         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
19967         is also fine.
19968
19969         * expression.cs (Binary.ResolveOperator): Check error result in
19970         two places.
19971
19972         use brtrue/brfalse directly and avoid compares to null.
19973
19974 2002-08-02  Martin Baulig  <martin@gnome.org>
19975
19976         * class.cs (TypeContainer.Define): Define all nested interfaces here.
19977         Fixes bug #28407, added test-155.cs.
19978
19979 2002-08-01  Martin Baulig  <martin@gnome.org>
19980
19981         * class.cs (Event.EmitDefaultMethod): Make this work with static
19982         events.  Fixes #28311, added verify-3.cs.
19983
19984 2002-08-01  Martin Baulig  <martin@gnome.org>
19985
19986         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
19987         `is_disposable' fields.
19988         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
19989         `hm.is_disposable' if we're using the collection pattern.
19990         (Foreach.EmitCollectionForeach): Use the correct type for the
19991         enumerator's local variable, only emit the try/finally block if
19992         necessary (fixes #27713).
19993
19994 2002-08-01  Martin Baulig  <martin@gnome.org>
19995
19996         * ecore.cs (Expression.report118): Renamed to Error118 and made
19997         it public static.
19998
19999         * statement.cs (Throw.Resolve): Check whether the expression is of
20000         the correct type (CS0118) and whether the type derives from
20001         System.Exception (CS0155).
20002         (Catch.Resolve): New method.  Do the type lookup here and check
20003         whether it derives from System.Exception (CS0155).
20004         (Catch.CatchType, Catch.IsGeneral): New public properties.
20005
20006         * typemanager.cs (TypeManager.exception_type): Added.
20007
20008 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
20009
20010         * driver.cs: Updated About function.
20011
20012 2002-07-31  Martin Baulig  <martin@gnome.org>
20013
20014         Implemented Control Flow Analysis.
20015
20016         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
20017         (EmitContext.CurrentBranching): Added.
20018         (EmitContext.StartFlowBranching): Added.
20019         (EmitContext.EndFlowBranching): Added.
20020         (EmitContext.KillFlowBranching): Added.
20021         (EmitContext.IsVariableAssigned): Added.
20022         (EmitContext.SetVariableAssigned): Added.
20023         (EmitContext.IsParameterAssigned): Added.
20024         (EmitContext.SetParameterAssigned): Added.
20025         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
20026         Added control flow analysis stuff here.
20027
20028         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
20029         resolve the expression as lvalue.
20030         (LocalVariableReference.DoResolve): Check whether the variable has
20031         already been assigned.
20032         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
20033         the parameter as assigned here.
20034         (ParameterReference.DoResolve): Check whether the parameter has already
20035         been assigned.
20036         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
20037         expression as lvalue.
20038
20039         * statement.cs (FlowBranching): New class for the flow analysis code.
20040         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
20041         (LabeledStatement.IsDefined): New public property.
20042         (LabeledStatement.AddUsageVector): New public method to tell flow
20043         analyis that the label may be reached via a forward jump.
20044         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
20045         flow analysis.
20046         (VariableInfo.Number): New public field.  This is used by flow analysis
20047         to number all locals of a block.
20048         (Block.CountVariables): New public property.  This is the number of
20049         local variables in this block (including the locals from all parent
20050         blocks).
20051         (Block.EmitMeta): Number all the variables.
20052
20053         * statement.cs: Added flow analysis support to all classes.
20054
20055 2002-07-31  Martin Baulig  <martin@gnome.org>
20056
20057         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
20058         To get debugging messages, compile mcs with /define:MCS_DEBUG and
20059         then use this argument.
20060
20061         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
20062
20063         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
20064         use this to specify /define options.
20065
20066 2002-07-29  Martin Baulig  <martin@gnome.org>
20067
20068         * statement.cs (Fixed): Moved all code that does variable lookups
20069         and resolvings from Emit to Resolve.
20070
20071         * statement.cs (For): Moved all code that does variable lookups
20072         and resolvings from Emit to Resolve.
20073
20074         * statement.cs (Using): Moved all code that does variable lookups
20075         and resolvings from Emit to Resolve.
20076
20077 2002-07-29  Martin Baulig  <martin@gnome.org>
20078
20079         * attribute.cs (Attribute.Resolve): Explicitly catch a
20080         System.NullReferenceException when creating the
20081         CustromAttributeBuilder and report a different warning message.
20082
20083 2002-07-29  Martin Baulig  <martin@gnome.org>
20084
20085         * support.cs (ParameterData.ParameterName): Added method to
20086         get the name of a parameter.
20087
20088         * typemanager.cs (TypeManager.IsValueType): New public method.
20089
20090 2002-07-29  Martin Baulig  <martin@gnome.org>
20091
20092         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
20093         is a flag which specifies that it's either ref or out.
20094         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
20095         the out parameter to `out Parameter.Modifier mod', also set the
20096         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
20097
20098         * support.cs (InternalParameters.ParameterModifier): Distinguish
20099         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
20100         Parameter.Modifier.ISBYREF flag if it's either ref or out.
20101
20102         * expression.cs (Argument.GetParameterModifier): Distinguish
20103         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
20104         Parameter.Modifier.ISBYREF flag if it's either ref or out.
20105
20106 2002-07-29  Martin Baulig  <martin@gnome.org>
20107
20108         * expression.cs (ParameterReference.ParameterReference): Added
20109         `Location loc' argument to the constructor.
20110
20111         * cs-parser.jay: Pass location to ParameterReference.
20112
20113 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
20114
20115         * statement.cs (Try): Initialize the location.
20116
20117         * cs-parser.jay: pass location to Try.
20118
20119         * expression.cs (Unary.Reduce): Change the prototype to return
20120         whether a constant fold could be performed or not.  The result is
20121         returned in an out parameters.  In the case of Indirection and
20122         AddressOf, we want to perform the full tests.
20123
20124 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
20125
20126         * statement.cs (Statement.Emit): Flag dead code.
20127
20128 2002-07-27  Andrew Birkett  <andy@nobugs.org>
20129
20130         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
20131
20132 2002-07-27  Martin Baulig  <martin@gnome.org>
20133
20134         * class.cs (MethodData.Define): Put back call to
20135         TypeManager.AddMethod(), accidentally commented this out.
20136
20137         * report.cs (Debug): New public method to print debugging information,
20138         this is `[Conditional ("DEBUG")]'.
20139
20140 2002-07-26  Martin Baulig  <martin@gnome.org>
20141
20142         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
20143         (switch_statement): Push the current_block to the switch_stack and
20144         pop it again when we're done with the switch.
20145         (switch_section): The new block is a child of the current_block.
20146         Fixes bug #24007, added test-152.cs.
20147
20148 2002-07-27  Martin Baulig  <martin@gnome.org>
20149
20150         * expression.cs (Invocation.EmitArguments): When calling a varargs
20151         function with only its fixed arguments, we need to pass an empty
20152         array.
20153
20154 2002-07-27  Martin Baulig  <martin@gnome.org>
20155
20156         Mono 0.13 has been released.
20157
20158 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
20159
20160         * driver.cs: Rename --resource to --linkres, because that is what
20161         we do currently, we dont support --resource yet.
20162
20163         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
20164
20165 2002-07-25  Martin Baulig  <martin@gnome.org>
20166
20167         * class.cs (MethodData): New public class.  This is a `method builder'
20168         class for a method or one accessor of a Property/Indexer/Event.
20169         (MethodData.GetMethodFlags): Moved here from MemberBase.
20170         (MethodData.ApplyAttributes): Likewise.
20171         (MethodData.ApplyObsoleteAttribute): Likewise.
20172         (MethodData.ApplyConditionalAttribute): Likewise.
20173         (MethodData.ApplyDllImportAttribute): Likewise.
20174         (MethodData.CheckAbstractAndExternal): Likewise.
20175         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
20176         (MethodData.Emit): Formerly known as Method.Emit().
20177         (MemberBase): Moved everything which was specific to a single
20178         accessor/method to MethodData.
20179         (Method): Create a new MethodData and call Define() and Emit() on it.
20180         (Property, Indexer, Event): Create a new MethodData objects for each
20181         accessor and call Define() and Emit() on them.
20182
20183 2002-07-25  Martin Baulig  <martin@gnome.org>
20184
20185         Made MethodCore derive from MemberBase to reuse the code from there.
20186         MemberBase now also checks for attributes.
20187
20188         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
20189         (MemberBase.GetMethodFlags): Moved here from class Method and marked
20190         as virtual.
20191         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
20192         `CallingConventions cc' and `Attributes opt_attrs' arguments.
20193         (MemberBase.ApplyAttributes): New virtual method; applies the
20194         attributes to a method or accessor.
20195         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
20196         (MemberBase.ApplyConditionalAttribute): Likewise.
20197         (MemberBase.ApplyDllImportAttribute): Likewise.
20198         (MemberBase.CheckAbstractAndExternal): Likewise.
20199         (MethodCore.ParameterTypes): This is now a property instead of a
20200         method, it's initialized from DoDefineParameters().
20201         (MethodCore.ParameterInfo): Removed the set accessor.
20202         (MethodCore.DoDefineParameters): New protected virtual method to
20203         initialize ParameterTypes and ParameterInfo.
20204         (Method.GetReturnType): We can now simply return the MemberType.
20205         (Method.GetMethodFlags): Override the MemberBase version and add
20206         the conditional flags.
20207         (Method.CheckBase): Moved some code from Define() here, call
20208         DoDefineParameters() here.
20209         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
20210         here to avoid some larger code duplication.
20211         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
20212         ensure that abstract and external accessors don't declare a body.
20213
20214         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
20215         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
20216         lookup in the attribute's parent classes, so we need to abort as soon
20217         as we found the first match.
20218         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
20219         the attribute has no arguments.
20220
20221         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
20222         of a Method.
20223
20224 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20225
20226         * cs-parser.jay: reverted previous patch.
20227
20228 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20229
20230         * cs-parser.jay: fixed bug #22119.
20231
20232 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20233
20234         * attribute.cs: fixed compilation. The error was:
20235         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
20236         be assigned to before control leaves the current method."
20237         [FIXME:  Filed as bug #28186: MCS must report this error.]
20238
20239 2002-07-25  Martin Baulig  <martin@gnome.org>
20240
20241         * attribute.cs (Attribute.Conditional_GetConditionName): New static
20242         method to pull the condition name ouf of a Conditional attribute.
20243         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
20244         the obsolete message and error flag out of an Obsolete attribute.
20245
20246         * class.cs (Method.GetMethodFlags): New public method to get the
20247         TypeManager.MethodFlags for this method.
20248         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
20249         private methods.
20250         (Method.Define): Get and apply the Obsolete and Conditional attributes;
20251         if we're overriding a virtual function, set the new private variable
20252         `parent_method'; call the new TypeManager.AddMethod().
20253
20254         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
20255         the MethodBuilder and the Method in a PtrHashtable.
20256         (TypeManager.builder_to_method): Added for this purpose.
20257         (TypeManager.MethodFlags): Added IsObsoleteError.
20258         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
20259         Obsolete and Conditional arguments in MethodBuilders.  If we discover
20260         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
20261         the message from the attribute.
20262
20263 2002-07-24  Martin Baulig  <martin@gnome.org>
20264
20265         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
20266         preprocessor directives, ensure that the argument to #define/#undef is
20267         exactly one identifier and that it's actually an identifier.
20268
20269         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
20270         did not work ....
20271
20272 2002-07-24  Martin Baulig  <martin@gnome.org>
20273
20274         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
20275         initialize it to TypeManager.object_type in the constructor.
20276         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
20277         of the `hm.get_current' method if we're using the collection pattern.
20278         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
20279         for the explicit conversion to make it work when we're using the collection
20280         pattern and the `Current' property has a different return type than `object'.
20281         Fixes #27713.
20282
20283 2002-07-24  Martin Baulig  <martin@gnome.org>
20284
20285         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
20286         does not match, but don't report any errors.  This method is called in
20287         order for all methods in a MethodGroupExpr until a matching method is
20288         found, so we don't want to bail out if the first method doesn't match.
20289         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
20290         matches, report the 123.  Fixes #28070.
20291
20292 2002-07-24  Martin Baulig  <martin@gnome.org>
20293
20294         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
20295         TypeManager.TypeToCoreType() to the top of the method so the
20296         following equality checks will work.  Fixes #28107.
20297
20298 2002-07-24  Martin Baulig  <martin@gnome.org>
20299
20300         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
20301         operand is of type uint, and the other operand is of type sbyte,
20302         short or int, the operands are converted to type long." -
20303         Actually do what this comment already told us.  Fixes bug #28106,
20304         added test-150.cs.
20305
20306 2002-07-24  Martin Baulig  <martin@gnome.org>
20307
20308         * class.cs (MethodBase): New abstract class.  This is now a base
20309         class for Property, Indexer and Event to avoid some code duplication
20310         in their Define() and DefineMethods() methods.
20311         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
20312         generic methods for Define() and DefineMethods().
20313         (FieldBase): Derive from MemberBase, not MemberCore.
20314         (Property): Derive from MemberBase, not MemberCore.
20315         (Property.DefineMethod): Moved all the code from this method to the
20316         new MethodBase.DefineAccessor(), just call it with appropriate
20317         argumetnts.
20318         (Property.Define): Call the new Property.DoDefine(), this does some
20319         sanity checks and we don't need to duplicate the code everywhere.
20320         (Event): Derive from MemberBase, not MemberCore.
20321         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
20322         accessors, this will also make them work with interface events.
20323         (Indexer): Derive from MemberBase, not MemberCore.
20324         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
20325         (Indexer.Define): Use the new MethodBase functions.
20326
20327         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
20328         argument to the constructor.
20329         (Interface.FindMembers): Added support for interface events.
20330         (Interface.PopluateEvent): Implemented.
20331
20332         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
20333
20334 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
20335
20336         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
20337         but this is required to check for a method name being the same as
20338         the containing class.  
20339
20340         Handle this now.
20341
20342 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20343
20344         * interface.cs: initialize variable.
20345
20346 2002-07-23  Martin Baulig  <martin@gnome.org>
20347
20348         Implemented the IndexerName attribute in interfaces.
20349
20350         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
20351         name if this is an explicit interface implementation.
20352         (Indexer.InterfaceIndexerName): New public variable.  If we're
20353         implementing an interface indexer, this is the IndexerName in that
20354         interface.  Otherwise, it's the IndexerName.
20355         (Indexer.DefineMethod): If we're implementing interface indexer,
20356         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
20357         and Pending.ImplementIndexer methods.
20358         (Indexer.Define): Also define the PropertyBuilder if we're
20359         implementing an interface indexer and this is neither an explicit
20360         interface implementation nor do the IndexerName match the one in
20361         the interface.
20362
20363         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
20364         If a method is defined here, then we always need to create a proxy
20365         for it.  This is used when implementing interface indexers.
20366         (Pending.IsInterfaceIndexer): New public method.
20367         (Pending.ImplementIndexer): New public method.
20368         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
20369         This is used when implementing interface indexers to define a proxy
20370         if necessary.
20371         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
20372         define a proxy if necessary.
20373
20374         * interface.cs (Interface.IndexerName): New public variable.
20375         (Interface.PopulateIndexer): Set the IndexerName.
20376         (Interface.DefineIndexers): New private method.  Populate all the
20377         indexers and make sure their IndexerNames match.
20378
20379         * typemanager.cs (IndexerPropertyName): Added support for interface
20380         indexers.
20381
20382 2002-07-22  Martin Baulig  <martin@gnome.org>
20383
20384         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
20385         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
20386         ret if HasReturnLabel.
20387         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
20388         variables.
20389
20390         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
20391         and set the ec.LoopBeginTryCatchLevel.
20392         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
20393         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
20394         the current ec.TryCatchLevel, the branch goes out of an exception
20395         block.  In this case, we need to use Leave and not Br.
20396
20397 2002-07-22  Martin Baulig  <martin@gnome.org>
20398
20399         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
20400         block unless the block does not always return or it is contained in
20401         another try { ... } catch { ... } block.  Fixes bug #26506.
20402         Added verify-1.cs to the test suite.
20403
20404 2002-07-22  Martin Baulig  <martin@gnome.org>
20405
20406         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
20407         then we do not always return.  Fixes bug #24985.
20408
20409 2002-07-22  Martin Baulig  <martin@gnome.org>
20410
20411         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
20412         lookup on a per-class level; ie. walk up the class hierarchy until we
20413         found at least one applicable method, then choose the best among them.
20414         Fixes bug #24463 and test-29.cs.
20415
20416 2002-07-22  Martin Baulig  <martin@gnome.org>
20417
20418         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
20419         return types of the methods.  The return type is not part of the
20420         signature and we must not check it to make the `new' modifier work.
20421         Fixes bug #27999, also added test-147.cs.
20422         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
20423
20424         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
20425         on the method's return type.
20426
20427 2002-07-21  Martin Baulig  <martin@gnome.org>
20428
20429         * assign.cs: Make this work if the rightmost source is a constant and
20430         we need to do an implicit type conversion.  Also adding a few more tests
20431         to test-38.cs which should have caught this.
20432
20433         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
20434         target in the makefile for this.  The makefile.gnu is primarily intended
20435         for end-users who don't want to debug the compiler.
20436
20437 2002-07-21  Martin Baulig  <martin@gnome.org>
20438
20439         * assign.cs: Improved the Assign class so it can now handle embedded
20440         assignments (X = Y = Z = something).  As a side-effect this'll now also
20441         consume less local variables.  test-38.cs now passes with MCS, added
20442         a few new test cases to that test.
20443
20444 2002-07-20  Martin Baulig  <martin@gnome.org>
20445
20446         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
20447         instructions.  Fixes bug #27977, also added test-146.cs.
20448
20449 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20450
20451         * cs-tokenizer.cs: fixed getHex ().
20452
20453 2002-07-19  Martin Baulig  <martin@gnome.org>
20454
20455         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
20456         not Type.GetType() to lookup the array type.  This is needed when
20457         we're constructing an array of a user-defined type.
20458         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
20459         single-dimensional arrays, but also for single-dimensial arrays of
20460         type decimal.
20461
20462 2002-07-19  Martin Baulig  <martin@gnome.org>
20463
20464         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
20465         this function is called, it's not allowed to share LocalBuilders
20466         among ILGenerators.
20467
20468 2002-07-19  Martin Baulig  <martin@gnome.org>
20469
20470         * expression.cs (Argument.Resolve): Report an error 118 when trying
20471         to pass a type as argument.
20472
20473 2002-07-18  Martin Baulig  <martin@gnome.org>
20474
20475         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
20476         Conv_R_Un for the signed `long' type.
20477
20478 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
20479
20480         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
20481         `expr' for the temporary result, as that will fail if we do
20482         multiple resolves on the same expression.
20483
20484 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
20485
20486         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
20487         ec.TypeContainer for looking up aliases. 
20488
20489         * class.cs (TypeContainer): Remove LookupAlias from here.
20490
20491         * decl.cs (DeclSpace); Move here.
20492
20493 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
20494
20495         * class.cs (FindMembers): Only call filter if the constructor
20496         bulider is not null.
20497
20498         Also handle delegates in `NestedTypes' now.  Now we will perform
20499         type lookups using the standard resolution process.  This also
20500         fixes a bug.
20501
20502         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
20503         This uses Expressions (the limited kind that can be parsed by the
20504         tree) instead of strings.
20505
20506         * expression.cs (ComposedCast.ToString): Implement, used to flag
20507         errors since now we have to render expressions.
20508
20509         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
20510         FormArrayType. 
20511
20512         * ecore.cs (SimpleName.ToString): ditto.
20513
20514         * cs-parser.jay: Instead of using strings to assemble types, use
20515         Expressions to assemble the type (using SimpleName, ComposedCast,
20516         MemberAccess).  This should fix the type lookups in declarations,
20517         because we were using a different code path for this.
20518
20519         * statement.cs (Block.Resolve): Continue processing statements
20520         even when there is an error.
20521
20522 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
20523
20524         * class.cs (Event.Define): Also remove the `remove' method from
20525         the list of pending items.
20526
20527         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
20528         generate more compact code. 
20529
20530 2002-07-17  Martin Baulig  <martin@gnome.org>
20531
20532         * const.cs (Const.LookupConstantValue): Add support for constant
20533         `unchecked' and `checked' expressions.
20534         Also adding test case test-140.cs for this.
20535
20536 2002-07-17  Martin Baulig  <martin@gnome.org>
20537
20538         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
20539         check whether mi.ReturnType implements the IEnumerator interface; the
20540         `==' and the IsAssignableFrom() will fail in this situation.
20541
20542 2002-07-16  Ravi Pratap  <ravi@ximian.com>
20543
20544         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
20545         here too.
20546
20547 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20548
20549         * expression.cs: fixed bug #27811.
20550
20551 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
20552
20553         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
20554         Molaro: when we are a ref, the value already contains a pointer
20555         value, do not take the address of it.
20556
20557 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
20558         * removed mb-parser.jay and mb-tokenizer.cs
20559
20560 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20561
20562         * expression.cs: check against the building corlib void type.
20563
20564 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
20565
20566         * ecore.cs: fix for valuetype static readonly fields: when 
20567         initializing them, we need their address, not the address of a copy.
20568
20569 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
20570
20571         * typemanager.cs: register also enum_type in corlib.
20572
20573 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20574
20575         * class.cs: allow calling this (but not base) initializers in structs.
20576
20577 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
20578
20579         * ecore.cs: make sure we compare against the building base types
20580         in GetTypeSize ().
20581
20582 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
20583
20584         * typemanager.cs: fix TypeToCoreType() to handle void and object
20585         (corlib gets no more typerefs after this change).
20586
20587 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
20588
20589         * expression.cs (ArrayCreation.EmitArrayArguments): use
20590         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
20591
20592         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
20593         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
20594         array indexes, the runtime actually forbids them.
20595
20596         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
20597         for array arguments here.
20598
20599         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
20600         instead of the default for ValueTypes.
20601
20602         (New.DoEmit): Use IsValueType instead of
20603         IsSubclassOf (value_type)
20604         (New.DoResolve): ditto.
20605         (Invocation.EmitCall): ditto.
20606
20607         * assign.cs (Assign): ditto.
20608
20609         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
20610         Statements *are* currently doing part of their resolution during
20611         Emit.  
20612
20613         Expressions do always resolve during resolve, but statements are
20614         only required to propagate resolution to their children.
20615
20616 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
20617
20618         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
20619
20620         (LoadAssembly): Do not add the dll if it is already specified
20621
20622         (MainDriver): Add the System directory to the link path at the end,
20623         after all the other -L arguments. 
20624
20625         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
20626         wrong opcode for loading bytes and bools (ldelem.i1 instead of
20627         ldelem.u1) and using the opposite for sbytes.
20628
20629         This fixes Digger, and we can finally run it.
20630
20631         * driver.cs (UnixParseOption): Move the option parsing here.  
20632         (CSCParseOption): Implement CSC-like parsing of options.
20633
20634         We now support both modes of operation, the old Unix way, and the
20635         new CSC-like way.  This should help those who wanted to make cross
20636         platform makefiles.
20637
20638         The only thing broken is that /r:, /reference: and /lib: are not
20639         implemented, because I want to make those have the same semantics
20640         as the CSC compiler has, and kill once and for all the confussion
20641         around this.   Will be doing this tomorrow.
20642
20643         * statement.cs (Unsafe.Resolve): The state is checked during
20644         resolve, not emit, so we have to set the flags for IsUnsfe here.
20645
20646 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
20647
20648         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
20649         not catch the Error_ObjectRefRequired in SimpleName (as it is
20650         possible to have a class/instance variable name that later gets
20651         deambiguated), we have to check this here.      
20652
20653 2002-07-10  Ravi Pratap  <ravi@ximian.com>
20654
20655         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
20656         make static and put into Expression.
20657
20658         (Event.Define): Register the private field of the event with the 
20659         TypeManager so that GetFieldFromEvent can get at it.
20660
20661         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
20662         keep track of the private field associated with an event which
20663         has no accessors.
20664
20665         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
20666         private field.
20667
20668         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
20669
20670 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
20671
20672         * expression.cs (Binary.EmitBranchable): this routine emits the
20673         Binary expression in a branchable context.  This basically means:
20674         we need to branch somewhere, not just get the value on the stack.
20675
20676         This works together with Statement.EmitBoolExpression.
20677
20678         * statement.cs (Statement.EmitBoolExpression): Use
20679         EmitBranchable. 
20680
20681 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
20682
20683         * statement.cs (For): Reduce the number of jumps in loops.
20684
20685         (For): Implement loop inversion for the For statement.
20686
20687         (Break): We can be breaking out of a Try/Catch controlled section
20688         (foreach might have an implicit try/catch clause), so we need to
20689         use Leave instead of Br.
20690
20691         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
20692         now).  If the instace expression supports IMemoryLocation, we use
20693         the AddressOf method from the IMemoryLocation to extract the
20694         address instead of emitting the instance.
20695
20696         This showed up with `This', as we were emitting the instance
20697         always (Emit) instead of the Address of This.  Particularly
20698         interesting when This is a value type, as we dont want the Emit
20699         effect (which was to load the object).
20700
20701 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
20702
20703         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
20704
20705         * statement.cs (Checked): Set the CheckedState during the resolve
20706         process too, as the ConvCast operations track the checked state on
20707         the resolve process, and not emit.
20708
20709         * cs-parser.jay (namespace_member_declaration): Flag that we have
20710         found a declaration when we do.  This is used to flag error 1529
20711
20712         * driver.cs: Report ok when we display the help only.
20713
20714 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
20715
20716         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
20717
20718 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
20719
20720         * cs-tokenizer.cs (define): We also have to track locally the
20721         defines.  AllDefines is just used for the Conditional Attribute,
20722         but we also need the local defines for the current source code. 
20723
20724 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
20725
20726         * statement.cs (While, For, Do): These loops can exit through a
20727         Break statement, use this information to tell whether the
20728         statement is the last piece of code.
20729
20730         (Break): Flag that we break.
20731
20732         * codegen.cs (EmitContexts): New `Breaks' state variable.
20733
20734 2002-07-03  Martin Baulig  <martin@gnome.org>
20735
20736         * class.cs (TypeContainer.MethodModifiersValid): Allow override
20737         modifiers in method declarations in structs.  Otherwise, you won't
20738         be able to override things like Object.Equals().
20739
20740 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
20741
20742         * class.cs (Method, Property, Indexer): Do not allow the public
20743         modifier to be used in explicit interface implementations.
20744
20745         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
20746         override modifiers in method declarations in structs
20747
20748 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
20749
20750         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
20751         integer or real overflow, report an error
20752
20753 2002-07-02  Martin Baulig  <martin@gnome.org>
20754
20755         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
20756         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
20757         to tell the runtime about our newly created System.Object and
20758         System.ValueType types.
20759
20760 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
20761
20762         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
20763         struct instead of Ldarg/Starg.
20764
20765 2002-07-02  Martin Baulig  <martin@gnome.org>
20766
20767         * expression.cs (Indirection.Indirection): Call
20768         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
20769
20770 2002-07-02  Martin Baulig  <martin@gnome.org>
20771
20772         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
20773         ValueType, call TypeManager.TypeToCoreType() on it.
20774         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
20775         the OpCodes.Newarr argument.
20776
20777 2002-07-02  Martin Baulig  <martin@gnome.org>
20778
20779         * expression.cs (Invocation.EmitCall): When compiling corlib,
20780         replace all calls to the system's System.Array type to calls to
20781         the newly created one.
20782
20783         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
20784         System.Array methods.
20785         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
20786         from the system's System.Array type which must be replaced.
20787
20788 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
20789
20790         * typemanager.cs: load unverifiable_code_ctor so we can build
20791         corlib using the correct type. Avoid using GetTypeCode() with
20792         TypeBuilders.
20793         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
20794         TypeManager.object_type to allow building corlib.
20795
20796 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
20797
20798         * ecore.cs: handle System.Enum separately in LoadFromPtr().
20799
20800 2002-07-01  Martin Baulig  <martin@gnome.org>
20801
20802         * class.cs: Make the last change actually work, we need to check
20803         whether `ifaces != null' to avoid a crash.
20804
20805 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20806
20807         * class.cs: when we build structs without fields that implement
20808         interfaces, we need to add the interfaces separately, since there is
20809         no API to both set the size and add the interfaces at type creation
20810         time.
20811
20812 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20813
20814         * expression.cs: the dimension arguments to the array constructors
20815         need to be converted if they are a long.
20816
20817 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
20818
20819         * class.cs: don't emit ldarg.0 if there is no parent constructor
20820         (fixes showstopper for corlib).
20821
20822 2002-06-29  Martin Baulig  <martin@gnome.org>
20823
20824         MCS now compiles corlib on GNU/Linux :-)
20825
20826         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
20827         ie. check for MethodImplOptions.InternalCall.
20828
20829         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
20830         and TypeManager.attribute_type are null, so we must explicitly check
20831         whether parent is not null to find out whether it's an attribute type.
20832         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
20833         and SetBuilder, not only if the property is neither abstract nor external.
20834         This is necessary to set the MethodImplOptions on the accessor methods.
20835         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
20836         SetBuilder, see Property.Emit().
20837
20838         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
20839         populate "System.Object", "System.ValueType" and "System.Attribute" since
20840         they've already been populated from BootCorlib_PopulateCoreTypes().
20841
20842 2002-06-29  Martin Baulig  <martin@gnome.org>
20843
20844         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
20845         is the NullLiteral, we also need to make sure that target_type is not
20846         an enum type.   
20847
20848 2002-06-29  Martin Baulig  <martin@gnome.org>
20849
20850         * rootcontext.cs (RootContext.ResolveCore): We must initialize
20851         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
20852         before calling BootstrapCorlib_ResolveDelegate ().
20853
20854 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20855
20856         * statement.cs: fixed build-breaker. All tests passed ok.
20857
20858 2002-06-27  Martin Baulig  <martin@gnome.org>
20859
20860         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
20861         for System.Decimal when compiling corlib.
20862
20863 2002-06-27  Martin Baulig  <martin@gnome.org>
20864
20865         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
20866         switch blocks which contain nothing but a default clause.
20867
20868 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
20869
20870        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
20871
20872 2002-06-27  Martin Baulig  <martin@gnome.org>
20873
20874         * ecore.cs (PropertyExpr.PropertyExpr): Call
20875         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
20876
20877         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
20878         is already a TypeBuilder.
20879
20880 2002-06-27  Martin Baulig  <martin@gnome.org>
20881
20882         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
20883         `target_type == TypeManager.array_type', not IsAssignableFrom() in
20884         the "from an array-type to System.Array" case.  This makes it work
20885         when compiling corlib.
20886
20887 2002-06-27  Martin Baulig  <martin@gnome.org>
20888
20889         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
20890         non-static PropertyExpr, set its InstanceExpression.  This makes
20891         the `ICollection.Count' property work in System/Array.cs.
20892
20893 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
20894
20895         * driver.cs: Made error handling more consistent.  Errors now
20896         tracked by Report class, so many methods which used to return int
20897         now return void.  Main() now prints success/failure and 
20898         errors/warnings message.
20899
20900         Renamed '--probe' compiler argument to '--expect-error'.  Removed
20901         the magic number return values (123 and 124).  Now, if the
20902         expected error occurs, the compiler exits with success (exit value
20903         0).  If the compilation completes without seeing that particular
20904         error, the compiler exits with failure (exit value 1).  The
20905         makefile in mcs/errors has been changed to handle the new behaviour.
20906
20907         * report.cs: Made 'expected error' number a property and renamed
20908         it from 'Probe' to 'ExpectedError'.
20909
20910         * genericparser.cs: Removed error handling support, since it is
20911         now all done by Report class.
20912
20913         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
20914         class, so parse() no longer returns an int.
20915
20916         * namespace.cs: Use Report.Error instead of GenericParser.error
20917
20918 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
20919
20920         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
20921         TypeContainer.AddOperator): At the front of the list put the
20922         explicit implementations, so they get resolved/defined first. 
20923
20924 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
20925
20926         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
20927         interface type is implemented by this TypeContainer.  Used during
20928         explicit interface implementation.
20929
20930         (Property.Define, Indexer.Define, Method.Define): Validate that
20931         the given interface in the explicit implementation is one of the
20932         base classes for the containing type.
20933
20934         Also if we are explicitly implementing an interface, but there is
20935         no match in the pending implementation table, report an error.
20936
20937         (Property.Define): Only define the property if we are
20938         not explicitly implementing a property from an interface.  Use the
20939         correct name also for those properties (the same CSC uses,
20940         although that is really not needed).
20941
20942         (Property.Emit): Do not emit attributes for explicitly implemented
20943         properties, as there is no TypeBuilder.
20944
20945         (Indexer.Emit): ditto.
20946
20947         Hiding then means that we do not really *implement* a pending
20948         implementation, which makes code fail.
20949
20950 2002-06-22  Martin Baulig  <martin@gnome.org>
20951
20952         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
20953         the return value of Object.GetType().  [FIXME: we need to do this whenever
20954         we get a type back from the reflection library].
20955
20956 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
20957
20958         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
20959
20960 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
20961
20962         * attribute.cs: Return null if we can not look up the type.
20963
20964         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
20965         the interface types found.
20966
20967         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
20968         interface types found.
20969
20970         * typemanager.cs (GetInterfaces): Make this routine returns alll
20971         the interfaces and work around the lame differences between
20972         System.Type and System.Reflection.Emit.TypeBuilder in the results
20973         result for GetInterfaces.
20974
20975         (ExpandInterfaces): Given an array of interface types, expand and
20976         eliminate repeated ocurrences of an interface.  This expands in
20977         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
20978         be IA, IB, IC.
20979
20980 2002-06-21  Martin Baulig  <martin@gnome.org>
20981
20982         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
20983         on System.Enum.
20984
20985 2002-06-21  Martin Baulig  <martin@gnome.org>
20986
20987         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
20988         and called with one of the core types, return the corresponding typebuilder for
20989         that type.
20990
20991         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
20992         element type.
20993
20994 2002-06-21  Martin Baulig  <martin@gnome.org>
20995
20996         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
20997         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
20998         (Expression.ConvertReferenceExplicit): Likewise.
20999
21000         * expression.cs (ElementAccess.DoResolve): Likewise.
21001         (ElementAccess.DoResolveLValue): Likewise.
21002
21003 2002-06-10  Martin Baulig  <martin@gnome.org>
21004
21005         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
21006         add the "value" parameter to the parameter list.
21007
21008         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
21009         to our caller.
21010
21011 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
21012
21013         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
21014         the argument to an int, uint, long or ulong, per the spec.  Also
21015         catch negative constants in array creation.
21016
21017 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
21018
21019         * class.cs: do not allow the same interface to appear twice in
21020         the definition list.
21021
21022 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
21023
21024         * ecore.cs: don't use ldlen with System.Array.
21025
21026 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
21027
21028         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
21029
21030 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
21031
21032         * modifiers.cs: produce correct field attributes for protected
21033         internal. Easy fix so miguel can work on ther harder stuff:-)
21034
21035 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
21036
21037         * pending.cs: New file.  Move the code from class.cs here.
21038         Support clearning the pending flag for all methods (when not doing
21039         explicit interface implementation).
21040
21041 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
21042
21043         * rootcontext.cs: added a couple more types needed to bootstrap.
21044
21045 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
21046
21047         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
21048         constructor in the type, instead of any constructor in the type
21049         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
21050         a bug in the Mono runtime when applying the params attribute). 
21051
21052 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
21053         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
21054
21055 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
21056
21057         * expression.cs (Unary.ResolveOperator): Use TypeManager
21058         to resolve the type.
21059
21060 2002-06-13  Ravi Pratap  <ravi@ximian.com>
21061
21062         * cs-parser.jay (enum_member_declaration): Pass in the attributes
21063         attached.
21064
21065         * enum.cs (AddEnumMember): Add support to store the attributes associated 
21066         with each member too.
21067
21068         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
21069         field builders too - this takes care of the enum member case.
21070
21071 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
21072
21073         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
21074         address-of operator on both value types and pointers.
21075
21076 2002-06-10  Martin Baulig  <martin@gnome.org>
21077
21078         * interface.cs (Interface.PopulateIndexer): Add the indexer's
21079         PropertyBuilder to the `property_builders' list.
21080
21081         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
21082         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
21083         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
21084         find any indexers which are inherited from an interface.
21085
21086 2002-06-09  Martin Baulig  <martin@gnome.org>
21087
21088         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
21089         the same type as the constant if necessary.  There's also a test-130.cs
21090         for this.
21091
21092         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
21093
21094         * typemanager.cs (TypeManager.ChangeType): Previously known as
21095         Enum.ChangeEnumType().
21096
21097 2002-06-09  Martin Baulig  <martin@gnome.org>
21098
21099         * expression.cs (Cast.TryReduce): Added support for consts.
21100
21101 2002-06-08  Ravi Pratap  <ravi@ximian.com>
21102
21103         * class.cs (Accessor): Hold attributes information so we can pass
21104         it along.
21105
21106         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
21107         Modify to pass in attributes attached to the methods.
21108
21109         (add_accessor_declaration, remove_accessor_declaration): Ditto.
21110
21111         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
21112         to handle the Accessor kind :-)
21113
21114         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
21115
21116 2002-06-08  Martin Baulig  <martin@gnome.org>
21117
21118         * expression.cs (Unary.TryReduceNegative): Added support for
21119         ULongConstants.
21120
21121 2002-06-08  Martin Baulig  <martin@gnome.org>
21122
21123         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
21124         name can't be found in the `defined_names' - the caller will do a
21125         MemberLookup in this case and thus find methods in System.Enum
21126         such as Enum.IsDefined().
21127
21128 2002-06-08  Martin Baulig  <martin@gnome.org>
21129
21130         * enum.cs (Enum.ChangeEnumType): This is a custom version of
21131         Convert.ChangeType() which works with TypeBuilder created types.
21132         (Enum.LookupEnumValue, Enum.Define): Use it here.
21133
21134         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
21135         `TypeBuilder.BaseType != null' check.
21136         (TypeContainer.FindMembers): Only lookup parent members if we
21137         actually have a parent.
21138         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
21139         (ConstructorInitializer.Resolve): Likewise.
21140
21141         * interface.cs (Interface.FindMembers): Added
21142         `TypeBuilder.BaseType != null' check.
21143
21144         * rootcontext.cs (RootContext.ResolveCore): Added
21145         "System.Runtime.CompilerServices.IndexerNameAttribute" to
21146         classes_second_stage.
21147
21148         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
21149         debug_type and trace_type when compiling with --nostdlib.       
21150
21151 2002-06-07  Martin Baulig  <martin@gnome.org>
21152
21153         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
21154         (AddField): Set it to true when adding a non-static field.
21155         (DefineType): Use `have_nonstatic_fields' to find out whether we
21156         have non-static fields, not `Fields != null'.
21157
21158 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
21159
21160         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
21161         dereferencing a null on the static-field code path)
21162
21163 2002-05-30  Martin Baulig  <martin@gnome.org>
21164
21165         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
21166         to take command line arguments.  Use reflection to call the new
21167         custom `Initialize' function on the symbol writer and pass it the
21168         command line arguments.
21169
21170         * driver.cs (--debug-args): New command line argument to pass command
21171         line arguments to the symbol writer.
21172
21173 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
21174
21175         * assign.cs (DoResolve): Forgot to do the implicit conversion to
21176         the target type for indexers and properties.  Thanks to Joe for
21177         catching this.
21178
21179 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
21180
21181         * typemanager.cs (MethodFlags): returns the method flags
21182         (Obsolete/ShouldIgnore) that control warning emission and whether
21183         the invocation should be made, or ignored. 
21184
21185         * expression.cs (Invocation.Emit): Remove previous hack, we should
21186         not do this on matching a base type, we should do this based on an attribute
21187
21188         Only emit calls to System.Diagnostics.Debug and
21189         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
21190         on the command line.
21191
21192         * rootcontext.cs: Global settings for tracing and debugging.
21193
21194         * cs-tokenizer.cs (define): New utility function to track
21195         defines.   Set the global settings for TRACE and DEBUG if found.
21196
21197 2002-05-25  Ravi Pratap  <ravi@ximian.com>
21198
21199         * interface.cs (Populate*): Pass in the TypeContainer as well as
21200         the DeclSpace as parameters so that we can create EmitContexts and
21201         then use that to apply attributes etc.
21202
21203         (PopulateMethod, PopulateEvent, PopulateProperty)
21204         (PopulateIndexer): Apply attributes everywhere.
21205
21206         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
21207         etc.
21208
21209         (ApplyAttributes): Update accordingly.
21210
21211         We now apply interface attributes for all members too.
21212
21213 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
21214
21215         * class.cs (Indexer.Define); Correctly check if we are explicit
21216         implementation (instead of checking the Name for a ".", we
21217         directly look up if the InterfaceType was specified).
21218
21219         Delay the creation of the PropertyBuilder.
21220
21221         Only create the PropertyBuilder if we are not an explicit
21222         interface implementation.   This means that explicit interface
21223         implementation members do not participate in regular function
21224         lookups, and hence fixes another major ambiguity problem in
21225         overload resolution (that was the visible effect).
21226
21227         (DefineMethod): Return whether we are doing an interface
21228         implementation. 
21229
21230         * typemanager.cs: Temporary hack until we get attributes in
21231         interfaces (Ravi is working on that) and we get IndexerName
21232         support in interfaces.
21233
21234         * interface.cs: Register the indexers as properties.
21235
21236         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
21237         warning, I have verified that this is a bug in the .NET runtime
21238         (JavaScript suffers of the same problem).
21239
21240         * typemanager.cs (MemberLookup): When looking up members for
21241         interfaces, the parent of an interface is the implicit
21242         System.Object (so we succeed in searches of Object methods in an
21243         interface method invocation.  Example:  IEnumerable x;  x.ToString
21244         ()) 
21245
21246 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
21247
21248         * class.cs (Event): Events should also register if they do
21249         implement the methods that an interface requires.
21250
21251         * typemanager.cs (MemberLookup); use the new GetInterfaces
21252         method. 
21253
21254         (GetInterfaces): The code used to lookup interfaces for a type is
21255         used in more than one place, factor it here. 
21256
21257         * driver.cs: Track the errors at the bottom of the file, we kept
21258         on going.
21259
21260         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
21261         instance if the method we are calling is static!
21262
21263 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
21264
21265         * attribute.cs (ApplyAttributes): Make this function filter out
21266         the IndexerName attribute (as that attribute in reality is never
21267         applied) and return the string constant for the IndexerName
21268         attribute. 
21269
21270         * class.cs (TypeContainer.Emit): Validate that all the indexers
21271         have the same IndexerName attribute, and if so, set the
21272         DefaultName attribute on the class. 
21273
21274         * typemanager.cs: The return value might contain other stuff (not
21275         only methods).  For instance, consider a method with an "Item"
21276         property and an Item method.
21277
21278         * class.cs: If there is a problem with the parameter types,
21279         return. 
21280
21281 2002-05-24  Ravi Pratap  <ravi@ximian.com>
21282
21283         * ecore.cs (ImplicitConversionExists): Wrapper function which also
21284         looks at user defined conversion after making a call to 
21285         StandardConversionExists - we need this for overload resolution.
21286
21287         * expression.cs : Update accordingly the various method calls.
21288
21289         This fixes 2 bugs filed against implicit user defined conversions 
21290
21291 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
21292
21293         * statement.cs: Track the result of the assignment.
21294
21295 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
21296
21297         * expression.cs (MemberAccess): Improved error reporting for
21298         inaccessible members.
21299
21300 2002-05-22  Martin Baulig  <martin@gnome.org>
21301
21302         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
21303         itself with debugging support.
21304
21305 2002-05-22  Martin Baulig  <martin@gnome.org>
21306
21307         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
21308         Removed, this isn't needed anymore.
21309
21310 2002-05-20  Martin Baulig  <martin@gnome.org>
21311
21312         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
21313         be underlying type for an enum.
21314
21315 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
21316
21317         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
21318         that splits out the loading of just the core types.
21319
21320         * rootcontext.cs (ResolveCore): Split the struct resolution in
21321         two, so we can load the enumeration underlying types before any
21322         enums are used.
21323
21324         * expression.cs (Is): Bandaid until we fix properly Switch (see
21325         bug #24985 for details).
21326
21327         * typemanager.cs (ImplementsInterface): The hashtable will contain
21328         a null if there are no interfaces implemented.
21329
21330 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
21331
21332         * cs-parser.jay (indexer_declarator): It is fine to have array
21333         parameters
21334
21335 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
21336
21337         * typemanager.cs: (RegisterBuilder): New function used to register
21338         TypeBuilders that implement interfaces.  Since
21339         TypeBuilder.GetInterfaces (as usual) does not work with lame
21340         Reflection.Emit. 
21341         (AddUserType): register interfaces.
21342
21343         (ImplementsInterface): Use the builder_to_ifaces hash if we are
21344         dealing with TypeBuilder.  Also, arrays are showing up as
21345         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
21346         methods can not be invoked on them!
21347
21348         * ecore.cs (ExplicitReferenceConversionExists): Made public.
21349         (ImplicitReferenceConversionExists): Split out from
21350         StandardConversionExists. 
21351
21352         * expression.cs (As): We were only implementing one of the three
21353         cases for the as operator.  We now implement them all.
21354         (Is): Implement the various other cases for Is as well.
21355
21356         * typemanager.cs (CACHE): New define used to control if we want or
21357         not the FindMembers cache.  Seems to have a negative impact on
21358         performance currently
21359
21360         (MemberLookup): Nested types have full acess to
21361         enclosing type members
21362
21363         Remove code that coped with instance/static returns for events, we
21364         now catch this in RealFindMembers.
21365
21366         (RealFindMembers): only perform static lookup if the instance
21367         lookup did not return a type or an event.  
21368
21369 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
21370
21371         * assign.cs (CompoundAssign): We pass more semantic information
21372         now to Compound Assignments than we did before: now we have all
21373         the information at hand, and now we resolve the target *before* we
21374         do the expression expansion, which allows the "CacheValue" method
21375         to have the effect we intended (before, a [x] += 1 would generate
21376         two differen ArrayAccess expressions from the ElementAccess,
21377         during the resolution process).
21378
21379         (CompoundAssign.DoResolve): Resolve target and original_source here.
21380
21381 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
21382
21383         * expression.cs (ArrayAccess): dropped debugging information. 
21384
21385         * typemanager.cs: Small bug fix: I was always returning i_members,
21386         instead of one of i_members or s_members (depending on which had
21387         the content).
21388
21389         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
21390         method is invoked before any code generation takes place, and it
21391         is a mechanism to inform that the expression will be invoked more
21392         than once, and that the method should use temporary values to
21393         avoid having side effects
21394
21395         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
21396
21397         * ecore.cs (Expression.CacheTemporaries): Provide empty default
21398         implementation.
21399
21400         * expression.cs (Indirection, ArrayAccess): Add support for
21401         CacheTemporaries in these two bad boys. 
21402
21403         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
21404         ldobj or ldind_ref.  
21405         (StoreFromPtr): Handle stobj as well.
21406
21407         * expression.cs (UnaryMutator): Share more code.
21408
21409         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
21410         down: I was not tracking the Filter function as well, which
21411         was affecting the results of the cache.
21412
21413 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
21414
21415         * attribute.cs: Remove the hack to handle the CharSet property on
21416         StructLayouts. 
21417
21418 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
21419
21420         * attribute.cs (DoResolve): More uglyness, we now only try to
21421         resolve the attribute partially, to extract the CharSet
21422         information (only if we are a StructLayout attribute).  Otherwise 
21423
21424         (GetExtraTypeInfo): Add some code to conditionally kill in the
21425         future this.   I am more and more convinced that the .NET
21426         framework has special code to handle the attribute setting on
21427         certain elements.
21428
21429         * expression.cs (IsParamsMethodApplicable): Revert my previous
21430         foreach change here, it was wrong.
21431
21432 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
21433
21434         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
21435         (pp_expr): do not abort on unknown input, just return.
21436         (eval): abort if there are pending chars.
21437
21438         * attribute.cs (Attribute.Resolve): Positional parameters are
21439         optional.  Deal with that case.
21440
21441         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
21442         the Ansi/Unicode/Auto information for the type.
21443
21444         (TypeContainer.DefineType): instantiate the EmitContext here, as
21445         we will be using it during the type definition (to resolve
21446         attributes) and during the emit phase.
21447
21448         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
21449         to pull type information out of the attributes
21450
21451         (Attribute.Resolve): track the constructor builder, and allow for
21452         multiple invocations (structs and classes will use this).
21453
21454         * ecore.cs (MemberLookupFinal): new version with all the
21455         parameters customizable.
21456
21457         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
21458         constructors.  Return if the result value is null (as the error
21459         would have been flagged already by MemberLookupFinal)
21460
21461         Do not allow instances of abstract classes or interfaces to be
21462         created.
21463
21464         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
21465         We have to compare the assembly property here when dealing with
21466         FamANDAssem and Assembly access modifiers, because we might be
21467         creating an assembly from *modules* (that means that we are not
21468         getting TypeBuilders for types defined in other modules that are
21469         part of this assembly).
21470
21471         (Method.Emit): If the method is marked abstract and has a body,
21472         emit an error. 
21473
21474         (TypeContainer.DefineMembers): If both the defined member and the
21475         parent name match are methods, then do not emit any warnings: let
21476         the Method.Define routine take care of flagging warnings.  But if
21477         there is a mismatch (method overrides something else, or method is
21478         overriwritten by something, then emit warning).
21479
21480         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
21481         set to null, this means `do not check for the return type on the
21482         signature'. 
21483
21484         (Method.Define): set the return type for the method signature to
21485         null, so that we get methods with the same name and parameters and
21486         different return types.  This is used to flag warning 114 (you are
21487         hiding a method, and you probably want to use the new/override
21488         keywords instead).
21489
21490         * typemanager.cs (MemberLookup): Implemented proper access
21491         control, closing a long standing set of bug reports.  The problem
21492         was that the Framework only has two bits: Public and NonPublic,
21493         and NonPublic includes private and protected methods, but we need
21494         to enforce the FamANDAssem, FamOrAssem and Family. 
21495
21496 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
21497
21498         * statement.cs (GotoCase): Return true: Ammounts to giving up
21499         knowledge on whether we return or not, and letting the other case
21500         be responsible for it.
21501
21502 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
21503
21504         * driver.cs: Do not load directories for each file processed, only
21505         do it if there is a pattern.
21506
21507         * ecore.cs: Report readonly assigns here as well, as we might have
21508         been resolved only by MemberAccess.
21509
21510         (SimpleName.SimpleNameResolve): Also be useful for LValue
21511         resolution.   We need this to propagate assign to local readonly variables
21512
21513         * typemanager.cs: Use a ptrhashtable for the criteria, because we
21514         do not want to reuse potential criteria memory.
21515
21516         * class.cs (MyEventBuilder): Set reflected_type;
21517
21518         * ecore.cs (Constantify): Added support for constifying bools.
21519
21520         (RootContext.LookupType): Added a cache for values looked up in
21521         the declaration space.
21522
21523         * typemanager.cs (FindMembers): Now is a front-end to
21524         RealFindMembers, and provides a two-level hashtable-based cache to
21525         the request.  
21526
21527         15% performance improvement: from 22.5 to 19.2 seconds.
21528
21529         * expression.cs (IsParamsMethodApplicable): use foreach.
21530         (Invocation.DoResolve): ditto.
21531         (New.DoResolve): ditto.
21532         (ArrayCreation.DoResolve): ditto.
21533
21534         * ecore.cs (FindMostEncompassingType): use foreach.
21535
21536         * delegate.cs (NewDelegate.DoResolve): Use foreach
21537
21538         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
21539         (RemoveMethods): use foreach.
21540
21541         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
21542         nested foreach statements instead of for, and also break out of
21543         the inner loop once a match is found.
21544
21545         (Invocation.OverloadResolve): Use foreach, simplify the code. 
21546
21547 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
21548
21549         * cfold.cs (BinaryFold): During an enumeration evaluation context,
21550         we actually unwrap the expression to allow for extra information
21551         to be extracted. 
21552
21553         * expression.cs: Use Shr_Un on unsigned operations. 
21554
21555 2002-05-08  Ravi Pratap  <ravi@ximian.com>
21556
21557         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
21558         applicable operators was not being considered correctly. This closes
21559         the bug Miguel reported.
21560
21561 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
21562
21563         * attribute.cs: check that the type derives from System.Attribute
21564         and report the correct error in that case (moved the duplicate code to
21565         its own method, too).
21566
21567 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
21568
21569         * attribute.cs: lookup attribute type name as the spec says: first the
21570         bare attribute name and then name + "Attribute" (nant compiles with
21571         mcs after this fix).
21572
21573 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
21574
21575         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
21576         Because of the way we parse things, we should try to see if a
21577         UIntConstant can fit in an integer.
21578
21579 2002-05-07  Ravi Pratap  <ravi@ximian.com>
21580
21581         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
21582         when we are in an explicit context.
21583
21584         (ConvertReferenceExplicit): When converting from Iface type S to Class
21585         T make sure the rules are implemented as an OR.
21586
21587         * parameter.cs (ParameterType): Make it a property for now although the
21588         purpose really isn't anything immediate.
21589
21590         * expression.cs (Is*Applicable): Do better checking on the parameter type
21591         of a ref/out parameter. The ones from the system assemblies are already 
21592         marked with the correct type so we don't need to do any correction.
21593
21594         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
21595         the object type is standard too so include that.
21596
21597 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
21598
21599         * ecore.cs (StandardConversionExists): Augment with missing code:
21600         deal with IntConstant, LongConstants and Enumerations.
21601
21602         * assign.cs: Report the error, instead of failing silently
21603
21604         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
21605         typecontainer that they are declared, because the
21606         typecontainer/namespace will have the list of using clauses that
21607         need to be applied.
21608
21609         Assembly Attributes were escaping the normal registration
21610         mechanism. 
21611
21612         (EmitCode): Apply attributes within an EmitContext that represents
21613         the container they were declared on.
21614
21615         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
21616
21617 2002-05-06  Ravi Pratap  <ravi@ximian.com>
21618
21619         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
21620         Revamp completely - make much cleaner as we now operate only
21621         on a set of Types.
21622
21623         (FindMostSpecificSource, FindMostSpecificTarget): New methods
21624         to implement the logic detailed in the spec more correctly.
21625
21626         (UserDefinedConversion): Update accordingly.
21627
21628 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
21629
21630         * statement.cs: Return flow analysis information up.
21631
21632         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
21633         and the default.
21634
21635         (token): Do not consume an extra character before calling
21636         decimal_digits.
21637
21638 2002-05-06  Piers Haken <piersh@friskit.com>
21639
21640         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
21641
21642 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
21643
21644         * class.cs (Constructor.Emit): Set the IsStatic flag in the
21645         EmitContext during the instance constructor initializer
21646         resolution, to stop access to instance variables.
21647
21648         This is mandated by the spec, last paragraph of the `constructor
21649         initializers' section. 
21650
21651 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
21652
21653         * cs-parser.jay, class.cs (Accessor): new class used to represent
21654         an accessor (get or set).  In the past we used `null' to represent
21655         a missing accessor.  But this is ambiguous because there was no
21656         way to tell in abstract indexers/properties if one of them was
21657         specified.
21658
21659         Now there is a way of addressing that.
21660
21661         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
21662         instead of FindMembers.
21663
21664         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
21665         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
21666
21667         * attribute.cs: Treat indexers and properties as the same in terms
21668         of applying attributes
21669
21670         * ecore.cs (FindMostEncompassedType): Use statically initialized
21671         EmptyExpressions()s like we do elsewhere to avoid creating useless
21672         objects (and we take this out of the tight loop).
21673
21674         (GetConversionOperators): Move the code to extract the actual
21675         operators to a separate routine to clean things up.
21676
21677 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
21678
21679         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
21680         events are always registered FieldBuilders.
21681
21682         * class.cs (FieldBase): New class shared by Fields 
21683
21684         * delegate.cs: If we are a toplevel delegate, use our full name.
21685         If we are a nested delegate, then only use our tail name.
21686
21687 2002-05-02  Ravi Pratap  <ravi@ximian.com>
21688
21689         * expression.cs (IsApplicable): Ensure that we add the "&" to
21690         ref/out types before comparing it with the type of the argument.
21691
21692         (IsParamsMethodApplicable): Ditto.
21693
21694         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
21695         silly me ;-)
21696
21697         * delegate.cs : Handle the case when we have more than one applicable
21698         method. Flag an error only when we finish checking all.
21699
21700 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
21701
21702         * expression.cs: Add support for boolean static initializers.
21703
21704 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
21705
21706         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
21707
21708         * parameter.cs (ComputeParameterTypes,
21709         ComputeAndDefineParameterTypes): Better error handling: now we
21710         clear the `types' cache if we fail during any of the type lookups.
21711         We also return the status code correctly to our caller
21712
21713         * delegate.cs: If we fail to define a delegate, abort the extra
21714         steps. 
21715
21716         * expression.cs (Binary.ResolveOperator): for
21717         operator==(object,object) and operator !=(object, object) we also
21718         have to verify that there is an implicit conversion from one to
21719         the other.
21720
21721         (ArrayAccess.DoResolve): Array Access can operate on
21722         non-variables. 
21723
21724 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
21725
21726         * assign.cs (CompoundAssign): A new class used as a "flag" that
21727         the assignment actually is happening as part of a compound
21728         assignment operator.
21729
21730         During compound assignment, a few new rules exist to enable things
21731         like:
21732
21733         byte b |= 1 + 2
21734
21735         From the spec:
21736
21737         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
21738         to the type of x) if y is implicitly convertible to the type of x,
21739         and the operator is a builtin operator and the return type of the
21740         operator is explicitly convertible to the type of x. 
21741
21742         * rootcontext.cs: Reset warning level to 2.  4 catches various
21743         "interesting" features in mcs, we must clean this up at some
21744         point, but currently am trying to kill other bugs ;-)
21745
21746         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
21747         in container classes as well.  
21748
21749         * expression.cs (Binary.ResolveOperator): Handle string case
21750         before anything else (as operator overloading does emit an error
21751         before doing anything else).
21752
21753         This code could go away when we move to a table driven model, but
21754         i could not come up with a good plan last night.
21755
21756 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
21757
21758         * typemanager.cs (CSharpName): reimplementation using regex.
21759         * class.cs: added null check for fields in Emit
21760         * rootcontext.cs: set warninglevel to 4
21761
21762 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
21763
21764         * typemanager.cs (CSharpName): reimplemented with Lupus
21765         suggestion.
21766
21767 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
21768
21769         * statement.cs (If): correclty implement Resolve, because we were
21770         not catching sem errors in there.  The same process is needed
21771         everywhere else. 
21772         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
21773
21774
21775         (Statement.Warning_DeadCodeFound): Factorize code.
21776         (While): Report dead code here too.
21777
21778         (Statement): Added Resolve virtual method to allow
21779         for resolution split from the emit code.
21780
21781 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
21782
21783         * statement.cs (EmitBoolExpression): No longer try to resolve the
21784         expression here.    
21785         (MakeBoolean): New utility function that resolve, implicitly
21786         converts to boolean and tags the expression. 
21787
21788
21789         (If, Do): Implement dead code elimination.
21790         (While): Implement loop inversion
21791
21792         (Do, While, For, If): Resolve the expression prior to calling our
21793         code generation.
21794
21795 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
21796
21797         * class.cs:
21798           - added method Report28 (warning: program has more than one entry point)
21799           - added method IsEntryPoint, implements paragraph 10.1 of the spec
21800           - modified method Method.Define, the part at the end of the method
21801
21802         * rootcontext.cs: added static public Location EntryPointLocation;
21803           
21804         * ../errors/cs0028.cs : Add test case for the above warning.              
21805
21806         * typemanager.cs:
21807           - modified method CSharpName to allow arrays of primitive type to
21808             be printed nicely (e.g. instead of System.Int32[][] it now prints
21809             int[][])
21810           - added method CSharpSignature: returns the signature of a method
21811             in string format to be used in reporting errors, warnings, etc.
21812
21813         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
21814         with String.Empty.
21815
21816 2002-04-26  Ravi Pratap  <ravi@ximian.com>
21817
21818         * delegate.cs (Define): Fix extremely silly bug where I was
21819         setting the type of the 'object' parameter of the BeginInvoke
21820         method to System.IAsyncResult instead of System.Object ;-)
21821
21822 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
21823
21824         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
21825         here. 
21826
21827         (Constructor.Emit): return if we fail to initialize the
21828         constructor.  Another door closed!  
21829
21830         * expression.cs (New.DoResolve): Improve error message (from -6 to
21831         1501).  Use DeclaredOnly lookup to find the exact constructor.
21832
21833         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
21834         loop.  This is useful.
21835
21836         * cs-parser.jay: Adjust the default parameters so that destructors
21837         have the proper signature.
21838
21839 2002-04-26  Martin Baulig  <martin@gnome.org>
21840
21841         * driver.cs (LoadAssembly): If `assembly' contains any characters
21842         which are only valid in path names and not in assembly names
21843         (currently slash, backslash and point), use Assembly.LoadFrom ()
21844         instead of Assembly.Load () on the `assembly' (before iteration
21845         over the link_paths).
21846
21847 2002-04-26  Martin Baulig  <martin@gnome.org>
21848
21849         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
21850
21851 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
21852
21853         * class.cs (Property): use the new typemanager.MemberLookup
21854
21855         (TypeContainer.MemberLookup): Implement using the
21856         TypeManager.MemberLookup now. 
21857
21858         * typemanager.cs: Make MemberLookup a function of the TypeManager,
21859         and return MemberInfos, so that these can be used without an
21860         EmitContext (what we had before).
21861
21862 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
21863
21864         * expression.cs: Fix the case where the argument to params if the
21865         type of the params.  I omitted handling this before.   Fixed
21866
21867 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
21868
21869         * driver.cs: Call BootCorlib_PopulateCoreType
21870
21871         * class.cs (Property.CheckBase): Check for properties only, not
21872         for all members. 
21873
21874         * interface.cs: Temporary hack: try/catch around the
21875         CustomAttributeBuilder, because I am getting an exception that I
21876         do not understand.
21877
21878         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
21879         types whose definitions are required to be there (attributes are
21880         defined before standard types).
21881
21882         Compute definitions as we boot the various types, as they are used
21883         immediately (value_type class will need object_type, but if we do
21884         not initialize object_type, we will pass a null, which will let
21885         the runtime pick the System.Object from the existing corlib, which
21886         is not what we want).
21887
21888 2002-04-22  Patrik Torstensson <totte@labs2.com>
21889
21890         * cs-tokenizer.cs: fixed a number of trim() issues.
21891
21892 2002-04-22  Ravi Pratap  <ravi@ximian.com>
21893
21894         * expression.cs (Argument.Type): Ensure that we return the correct
21895         type when we have out or ref parameters [in which case we 
21896         append a "&"].
21897
21898 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
21899
21900         * class.cs (Property, Indexer): Allow extern modifier in there. 
21901
21902         * typemanager.cs (InitBaseTypes): Initializes object_type and
21903         value_type, since those will be used early on during the bootstrap
21904         process to compile corlib.
21905
21906         (InitCoreTypes): Move code from here to InitBaseTypes.
21907
21908 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
21909
21910         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
21911         single-dimension arrays as using the ldlen opcode.  
21912
21913         Daniel Lewis discovered this optimization.  
21914
21915         * typemanager.cs: Add signature for System.Array::get_Length
21916
21917 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21918
21919         * statement.cs: report the error when the foreach does not apply to an
21920         array nor a collection.
21921
21922 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
21923
21924         * expression.cs: Add implicit conversions to the operator ~.
21925
21926         * constant.cs (DecimalConstant.Emit): Emit decimal value.
21927
21928         * typemanager.cs: Locate the decimal constructor.
21929
21930 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21931
21932         * attribute.cs: use the new property of TypeOf.
21933         * expression.cs: added 'get' property around typearg.
21934
21935         These changes fix a build breaker reported by NickD. Is this the
21936         correct way to fix?  If not, please, revert my changes and make it
21937         work :-).
21938
21939 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
21940
21941         * attribute.cs: Add support for typeof in attribute invocations.
21942         I am not sure that this is right though.
21943
21944 2002-04-14  Duncan Mak  <duncan@ximian.com>
21945
21946         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
21947         Binary.Operator.Division case.
21948
21949 2002-04-13  Ravi Pratap  <ravi@ximian.com>
21950
21951         * class.cs (DefineType): Ensure that we do a proper check on
21952         attribute types and also register it with the TypeManager.
21953
21954         (TypeContainer.Targets): The default for attribute types is
21955         AttributeTargets.All.
21956
21957         * attribute.cs (ApplyAttributes): Registering the attribute type
21958         is done elsewhere, not when we discover we have a Usage attribute.
21959
21960 2002-04-12  Ravi Pratap  <ravi@ximian.com>
21961
21962         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
21963         and get rid of is_delegate parameter.
21964
21965         * everywhere : update.
21966
21967 2002-04-12  Ravi Pratap  <ravi@ximian.com>
21968
21969         * cs-parser.jay (compilation_unit): Revamp completely to use
21970         some new ideas that I got from Rhys' grammar to solve the problems
21971         with assembly level attributes.
21972
21973         (outer_declaration): New grammar production.
21974
21975         (attribute_sections): Add.
21976
21977         (opt_attributes): Base on attribute_sections
21978
21979         (namespace_declaration): Allow opt_attributes to tackle the case
21980         when we have assembly level attributes - we are clever in this
21981         regard now ;-)
21982
21983         * attribute.cs (ApplyAttributes): Do not worry about assembly 
21984         attributes in the non-global context.
21985
21986         * rootcontext.cs (AddGlobalAttributes): Go back to using this
21987         instead of SetGlobalAttributes.
21988
21989         * class.cs, rootcontext.cs : Ensure we define and generate 
21990         attribute types before anything else.
21991
21992         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
21993         and flag the new error -20 for the case when the attribute type
21994         does not have valid targets specified. csc does not catch this.
21995
21996         * ../errors/errors.txt : update for error # -20
21997
21998 2002-04-11  Ravi Pratap  <ravi@ximian.com>
21999
22000         * support.cs (InternalParameters.ParameterModifier): Do some null
22001         checking and return sane values.
22002
22003         * class.cs (Method.Define): If we are a PInvoke method, ensure
22004         that we are static and extern. Report error # 601
22005
22006         * ../errors/cs0601.cs : Add test case for the above error.
22007
22008 2002-04-07  Ravi Pratap  <ravi@ximian.com>
22009
22010         * rootcontext.cs (attribute_types): We need to keep type of
22011         all attribute types separately and emit code for them first.
22012
22013         (RegisterAttribute) : Implement.
22014
22015         * class.cs (DefineType): Check if the current Type is a custom
22016         attribute type and register it accordingly.
22017
22018         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
22019         adding the first attribute twice and rename to
22020
22021         (SetGlobalAttributes): this.
22022
22023         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
22024         lookups.
22025
22026         * attribute.cs (ApplyAttributes): Take an additional argument telling us
22027         if we are processing global arguments. Hmm, I am unsure of this.
22028
22029 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22030
22031         * expression.cs: added static array of strings to avoid calling
22032         Enum.ToString () for Operator in Binary. Significant recover of
22033         performance.
22034
22035 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
22036
22037         * class.cs (FindMembers): Allow the Builders of the various
22038         members to be null.  If they are skip them.  This only happens
22039         during the PInvoke declaration.
22040
22041 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
22042
22043         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
22044         failure, so we do not keep going afterwards.
22045
22046         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
22047         wanted to pass `false' as the `is_delegate' argument.  If this is
22048         the case, why not use delegate_type == null to mean `is_delegate =
22049         false' and anything else as is_delegate = true.
22050
22051 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
22052
22053         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
22054         code for the section, not the beginning of the tests.
22055
22056 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
22057
22058         * cfold.cs: Handle operator + (Enum x, Underlying x) 
22059
22060         * expression.cs (Binary): same.  Warn about errors where we have
22061         Enum/Enum in operator + as well.
22062
22063 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
22064
22065         * statement.cs:
22066                 - added support for switch(bool)
22067                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
22068                 - add TableSwitchEmit() to handle table-based switch statements
22069
22070 2002-04-05  Ravi Pratap  <ravi@ximian.com>
22071
22072         * expression.cs (Invocation.OverloadResolve): Factor out code which
22073         does parameter compatibility checking with arguments so that we can 
22074         re-use the code even from Delegate.VerifyApplicability
22075
22076         (VerifyArgumentsCompat): Move above code here.
22077
22078         * delegate.cs (VerifyApplicability): Get rid of duplicate code
22079         and instead make a call to the above method.
22080
22081 2002-03-31  Ravi Pratap  <ravi@ximian.com>
22082
22083         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
22084         We use it to keep track of classes which are attribute types.
22085
22086 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
22087
22088         * delegate.cs (Delegate.Define): Correctly define the types in the
22089         presence of fixed and array parameters.
22090
22091         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
22092         doing FindMembers.
22093
22094         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
22095         include NonPublic after the first iteration.
22096
22097         * class.cs (Indexer.CheckBase): Only check if both parents are
22098         non-null. 
22099
22100         * cs-parser.jay (accessor_body): If empty, set to null.
22101
22102         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
22103         same code path here to resolve constants names that we did have in
22104         MemberAccess.DoResolve.  There is too much code duplicated here.
22105
22106 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
22107
22108         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
22109
22110         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
22111         to MakeUnionSet.
22112
22113         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
22114         tokens, numbers and strings.
22115
22116         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
22117         parenthesis.
22118
22119         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
22120         asyncronous parameters and the regular parameters.  
22121
22122         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
22123         specify the target directory.
22124
22125         * expression.cs: (This.DoResolve): Simplify
22126         (As.Emit): Optimize, do not generate IsInst if the expression is
22127         always of the given type.
22128
22129         (Is.DoResolve): Bug fix, we were reporting both always/never for
22130         the is expression.
22131
22132         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
22133         creating too many unnecessary arrays.
22134
22135 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
22136
22137         * class.cs (EmitFieldInitializer): Use Assign expression to assign
22138         fields instead of rolling our own initializer.   Takes care of all
22139         implicit conversions, and drops unnecessary static checks/argument.
22140
22141 2002-03-31  Dick Porter  <dick@ximian.com>
22142
22143         * driver.cs: use the GetDirectories() return values properly, and
22144         use "/" as path separator.
22145
22146 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
22147
22148         * expression.cs (Unary): Optimize - - expr into expr.
22149         (Binary): Optimize a + (-b) into a -b.
22150
22151         * codegen.cs (CodeGen): Made all methods static.
22152
22153 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
22154
22155         * rootcontext.cs: 
22156
22157         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
22158         TypeBuilder property.
22159
22160         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
22161         instead. 
22162
22163         * tree.cs: Removed the various RecordXXXX, and replaced with a
22164         single RecordDecl.  Removed all the accessor methods, and just
22165         left a single access point Type 
22166
22167         * enum.cs: Rename DefineEnum to DefineType.
22168
22169         * decl.cs: New abstract method `DefineType' used to unify the
22170         Defines for Enumerations, Interfaces, TypeContainers and
22171         Delegates.
22172
22173         (FindType): Moved LookupInterfaceOrClass here.  Moved the
22174         LookupBaseClasses method that used to live in class.cs and
22175         interface.cs here, and renamed to FindType.
22176
22177         * delegate.cs: Implement DefineType.  Take advantage of the
22178         refactored pattern for locating the parent builder without taking
22179         the parent_builder argument (which we know does not work if we are
22180         nested, and triggering a toplevel definition).
22181
22182 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
22183
22184         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
22185         accessibility of a member has changed during override and report
22186         an error if so.
22187
22188         * class.cs (Method.Define, Property.Define): Only complain on
22189         overrides if the method is private, any other accessibility is
22190         fine (and since we just checked the permission is the same, we are
22191         good to go).
22192
22193         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
22194         and elif are processed always.  The other pre-processing
22195         directives are only processed if we are "taking" the path
22196
22197 2002-03-29  Martin Baulig  <martin@gnome.org>
22198
22199         * class.cs (Method.Emit): Only emit symbolic debugging info if the
22200         current location is not Null.
22201
22202         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
22203         a separate method so we can profile it.
22204
22205         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
22206         `span.Seconds' are just seconds, but no minutes or hours.
22207         (MainDriver): Profile the CodeGen.SaveSymbols calls.
22208
22209 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
22210
22211         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
22212         Remove the gratuitous set of Final:
22213
22214                                 // If an interface implementation, then we can set Final.
22215                                 if (((flags & MethodAttributes.Abstract) == 0) &&
22216                                     implementing.DeclaringType.IsInterface)
22217                                         flags |= MethodAttributes.Final;
22218
22219         I do not know what I was smoking when I used that.
22220
22221
22222         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
22223         step into fixing the name resolution issues for delegates and
22224         unifying the toplevel name resolution.
22225
22226 2002-03-28  Martin Baulig  <martin@gnome.org>
22227
22228         * class.cs (Method.Emit): If we have a symbol writer, call its
22229         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
22230         tell it about the current method.
22231
22232         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
22233         writer that we're going to emit the first byte of IL code for a new
22234         statement (a new source line).
22235         (EmitContext.EmitTopBlock): If we have a symbol writer, call
22236         EmitContext.Mark() before emitting any code.
22237
22238         * location.cs (SymbolDocument): Return null when we're Null.
22239
22240         * statement.cs (Statement): Moved the `Location loc' variable here.
22241         (Statement.EmitBoolExpression): If we have a symbol writer, call
22242         ec.Mark() before emitting any code to tell it that we're at the
22243         beginning of a new statement.
22244         (StatementExpression): Added `Location' argument to the constructor.
22245         (Block): Added public readonly variable `StartLocation' and public
22246         variable `EndLocation'.  The latter is to be set using SetEndLocation().
22247         (Block): Added constructor which takes a start and end location.
22248         (Block.SetEndLocation): New method. This sets the end location.
22249         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
22250         local variables we create.
22251         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
22252         each statement and do also mark the begin and end of the block.
22253
22254         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
22255         tell it the current lexer.Location, use Location.Null for the end of the
22256         block.
22257         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
22258         current block, set its end location using SetEndLocation().
22259         (statement_expression): StatementExpression constructor now takes the
22260         lexer.Location as additional argument.
22261         (for_statement, declare_local_variables): Likewise.
22262         (declare_local_variables): When creating a new implicit block, use the
22263         new Block constructor and pass it the lexer.Location.
22264
22265 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
22266
22267         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
22268         members also on the parent interfaces recursively.
22269
22270 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
22271
22272         * report.cs: Use new formats, since Gonzalo finished the missing
22273         bits. 
22274
22275         * expression.cs (Binary.ResolveOperator): added missing operator|
22276         operator& and operator^ for bool/bool.
22277
22278         * cs-parser.jay: CheckDef now takes a Location argument that is
22279         used to report errors more precisly (instead of reporting the end
22280         of a definition, we try to track something which is a lot closer
22281         to the source of the problem).
22282
22283         * cs-tokenizer.cs: Track global token use, so we can properly flag
22284         the use of #define/#undef after the first token has been seen.
22285
22286         Also, rename the reportXXXX to Error_DescriptiveName
22287
22288         * decl.cs (DeclSpace.IsTopLevel): Move property here from
22289         TypeContainer, so that Enum and Interface can use this too.
22290
22291         * class.cs (TypeContainer.LookupInterfaceOrClass,
22292         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
22293         `builder' argument.  Typically this was used to pass the parent
22294         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
22295         the definition).  
22296
22297         The problem is that a nested class could trigger the definition of
22298         a toplevel class, and the builder would be obviously wrong in that
22299         case. 
22300
22301         So we drop this argument, and we compute dynamically the
22302         TypeBuilder/ModuleBuilder (the correct information was available
22303         to us anyways from DeclSpace.Parent)
22304
22305         * interface.cs (Interface.DefineInterface): Drop builder
22306         parameter cleanup like class.cs
22307
22308         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
22309         like class.cs
22310
22311         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
22312         values. 
22313
22314         (Try.Emit): Propagate the returns value from the statement.
22315
22316         (Return.Emit): Even if we are leavning 
22317
22318         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
22319
22320         * modifiers.cs: Fix the computation of MethodAttributes flags.
22321
22322 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
22323
22324         * driver.cs: allow compilation of files that start with '/'.
22325         Add a default case when checking the argument of --target.
22326
22327 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
22328
22329         * interface.cs: Implement the same search algorithm for types in
22330         the interface code.
22331
22332         * delegate.cs: Do not allow multiple definition.
22333
22334         * Recovered ChangeLog that got accidentally amputated
22335
22336         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
22337
22338         * rootcontext.cs: Load manually enum to allow core classes to
22339         contain enumerations.
22340
22341         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
22342         Update to new static methods in TypeManager.
22343
22344         * typemanager.cs (GetMethod, GetConstructor): Use our
22345         implementation of FindMembers to find the members, since during
22346         corlib compilation, the types are TypeBuilders and GetMethod and
22347         GetConstructor do not work.
22348
22349         Make all methods in TypeManager static.
22350
22351         (InitCodeHelpers): Split the functionality from
22352         the InitCodeTypes function.
22353
22354         * driver.cs: Call InitCodeHelpers after we have populated the
22355         types. 
22356
22357         * cs-parser.jay (delegate_declaration): we did not used to compute
22358         the delegate name correctly for void delegates.
22359
22360 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
22361
22362         * rootcontext.cs (RootContext): Init the interface_resolve_order
22363         and type_container_resolve_order always.
22364
22365         (ResolveCore, BootstrapCorlib_ResolveClass,
22366         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
22367         compiler when compiling with --nostdlib
22368
22369         * class.cs (TypeContainer.DefineType): Check that our parent is
22370         not null.  This test is most important when we are bootstraping
22371         the core types.
22372
22373         * codegen.cs: Split out the symbol writing code.
22374
22375 2002-03-25  Martin Baulig  <martin@gnome.org>
22376
22377         * driver.cs (-g): Made -g an alias for --debug.
22378
22379 2002-03-24  Martin Baulig  <martin@gnome.org>
22380
22381         * codegen.cs (SymbolWriter): New public variable. Returns the
22382         current symbol writer.
22383         (CodeGen): Added `bool want_debugging_support' argument to the
22384          constructor. If true, tell the ModuleBuild that we want debugging
22385         support and ask it for the ISymbolWriter.
22386         (Save): If we have a symbol writer, call it's Close() method after
22387         saving the assembly.
22388
22389         * driver.c (--debug): New command line argument to create a
22390         debugger information file.
22391
22392         * location.cs (SymbolDocument): New public property. Returns an
22393         ISymbolDocumentWriter object for the current source file or null
22394         if we don't have a symbol writer.
22395
22396 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
22397
22398         * driver.cs (LoadAssembly): Correctly return when all the paths
22399         have been tried and not before.
22400
22401         * statement.cs (Switch.Emit): return the actual coverage for this
22402         statement (returns/not-returns)
22403
22404         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
22405         switch of the statement if we are the last switch section.  That
22406         kills two problems: try/catch problems (we used to emit an empty
22407         nop at the end) and switch statements where all branches would
22408         return. 
22409
22410 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
22411
22412         * driver.cs: Add default assemblies (the equivalent to the
22413         Microsoft CSC.RSP file)
22414
22415         * cs-tokenizer.cs: When updating `cols and setting it to zero,
22416         also update tokens_seen and set it to false.
22417
22418         * driver.cs: Implement --recurse for Mike.
22419
22420         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
22421         correctly splitting out the paths.
22422
22423 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
22424
22425         * interface.cs (Interface.PopulateProperty): Instead of using
22426         `parent' as the declaration space for the set parameters, use
22427         `this' 
22428
22429         * support.cs (InternalParameters): InternalParameters constructor
22430         takes a DeclSpace instead of a TypeContainer.
22431
22432         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
22433         types are being initialized, load the address of it before calling
22434         the function.  
22435
22436         (New): Provide a mechanism to disable the generation of local
22437         value type temporaries when the caller will be providing us with
22438         an address to store it.
22439
22440         (ArrayCreation.EmitDynamicInitializers): Use it.
22441
22442 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
22443
22444         * expression.cs (Invocation.EmitArguments): Only probe for array
22445         property if there is more than one argument.  Sorry about that.
22446
22447         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
22448         empty param arrays.
22449
22450         * class.cs (Method.LabelParameters): Fix incorrect code path that
22451         prevented the `ParamArrayAttribute' from being applied to the
22452         params attribute.
22453
22454 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
22455
22456         * support.cs (ReflectionParameters): Correctly compute whether the
22457         last argument is a params array.  Fixes the problem with
22458         string.Split ('a')
22459
22460         * typemanager.cs: Make the assemblies array always be non-null
22461         (empty, but non-null)
22462
22463         * tree.cs (RecordDecl): New function that abstracts the recording
22464         of names.  This reports error 101, and provides a pointer to the
22465         previous declaration.  Fixes a crash in the compiler.
22466
22467         * cs-parser.jay (constructor_declaration): Update to new grammar,
22468         and provide a constructor_body that can be empty.
22469
22470 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
22471
22472         * driver.cs: Add support for --resources.
22473
22474         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
22475         Make all types for the various array helper methods be integer.
22476
22477         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
22478         CheckState to ConvCast.
22479
22480         (ConvCast): Now it takes a `checked' state argument, to avoid
22481         depending on the emit context for the conversion, and just using
22482         the resolve time setting.
22483
22484         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
22485         instead of Invocation.EmitArguments.  We do not emit the original
22486         arguments, instead we emit those which have been converted to
22487         unsigned int expressions.
22488
22489         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
22490
22491         * codegen.cs: ditto.
22492
22493         * expression.cs (LocalVariableReference): Drop the use of the
22494         Store function that depended on the variable index.
22495
22496         * statement.cs (VariableInfo): Drop the `Idx' property from this
22497         class, as this is not taking into account the indexes for
22498         temporaries tat we generate during the execution, getting the
22499         indexes wrong.
22500
22501         * class.cs: First emit class initializers, then call the parent
22502         constructor. 
22503
22504         * expression.cs (Binary): Fix opcode emision.
22505         (UnaryMutator.EmitCode): Support checked code generation
22506
22507         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
22508         matches for events for both the Static and Instance scans,
22509         pointing to the same element.   Fix that.
22510
22511 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
22512
22513         * rootcontext.cs (ResolveTree): Always set the
22514         interface_resolve_order, because nested interfaces will be calling
22515         into us.
22516
22517         * class.cs (GetInterfaceOrClass): Track the same resolution
22518         process used by TypeManager.LookupType.  This fixes the nested
22519         type lookups in class declarations (separate path from
22520         LookupType). 
22521
22522         (TypeContainer.DefineType): Also define nested interfaces.
22523         (TypeContainer.RegisterOrder): New public function used to
22524         register the order in which child interfaces need to be closed.
22525
22526         Nested interfaces need to be closed after their parents have been
22527         created. 
22528
22529         * interface.cs (InterfaceAttr): Put all the logic for computing
22530         the interface attribute here. 
22531
22532         (DefineInterface): Register our interface order with the
22533         RootContext or with the TypeContainer depending on the case.
22534
22535 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
22536
22537         * cs-parser.jay: rework foreach statement to work with the new
22538         changes to the policy on SimpleNames.
22539
22540         * report.cs: support Stacktrace on warnings as well.
22541
22542         * makefile: drop --unsafe and /unsafe from the compile.
22543
22544 2002-03-13  Ravi Pratap  <ravi@ximian.com>
22545
22546         * ecore.cs (StandardConversionExists): Modify to take an Expression
22547         as the first parameter. Ensure we do null -> reference type conversion
22548         checking.
22549
22550         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
22551         temporary Expression objects.
22552
22553 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
22554
22555         * interface.cs: workaround bug in method overloading resolution
22556         (there is already a bugzilla bug for it).
22557
22558 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
22559
22560         We could also solve this problem by having a separate path for
22561         performing type lookups, instead of DoResolve, we could have a
22562         ResolveType entry point, and only participating pieces of the
22563         production (simplename, deref, array) would implement this. 
22564
22565         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
22566         signal SimpleName to only resolve type names and not attempt to
22567         resolve anything else.
22568
22569         * expression.cs (Cast): Set the flag.
22570
22571         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
22572
22573         * class.cs: Only report 108 if there is no `new' modifier.
22574
22575         * cs-parser.jay: rework foreach statement to work with the new
22576         changes to the policy on SimpleNames.
22577
22578         * report.cs: support Stacktrace on warnings as well.
22579
22580         * makefile: drop --unsafe and /unsafe from the compile.
22581
22582 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
22583
22584         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22585         lookups here, instead of doing that at parse time.  This means
22586         that our grammar will not introduce `LocalVariableReferences' as
22587         expressions at this point.  That solves the problem of code like
22588         this:
22589
22590         class X {
22591            static void Main ()
22592            { int X = 1;
22593             { X x = null }}}
22594
22595         This is only half the fix.  The full fix requires parameters to
22596         also be handled in this way.
22597
22598         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
22599         makes the use more obvious of the DeclSpace.  The
22600         ec.TypeContainer.TypeBuilder is now only used to pull the
22601         TypeBuilder for it.
22602
22603         My theory is that I can get rid of the TypeBuilder completely from
22604         the EmitContext, and have typecasts where it is used (from
22605         DeclSpace to where it matters).  
22606
22607         The only pending problem is that the code that implements Aliases
22608         is on TypeContainer, and probably should go in DeclSpace.
22609
22610         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22611         lookups here, instead of doing that at parse time.  This means
22612         that our grammar will not introduce `LocalVariableReferences' as
22613         expressions at this point.  That solves the problem of code like
22614         this:
22615
22616         class X {
22617            static void Main ()
22618            { int X = 1;
22619             { X x = null }}}
22620
22621         This is only half the fix.  The full fix requires parameters to
22622         also be handled in this way.
22623
22624         * class.cs (Property.DefineMethod): When implementing an interface
22625         method, set newslot, when implementing an abstract method, do not
22626         set the flag (before we tried never setting it, or always setting
22627         it, which is the difference).
22628         (Indexer.DefineMethod): same.
22629         (Method.DefineMethod): same.
22630
22631         * ecore.cs: Only set the status used flag if we get back a Field.
22632
22633         * attribute.cs: Temporary hack, so Paolo can keep working.
22634
22635 2002-03-08  Ravi Pratap  <ravi@ximian.com>
22636
22637         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
22638         the unmanaged type in the case we have a MarshalAs attribute.
22639
22640         (Resolve): Handle the case when we are parsing the special MarshalAs
22641         attribute [we need to store the unmanaged type to use later]
22642
22643         * typemanager.cs (marshal_as_attr_type): Built in type for the 
22644         MarshalAs Attribute.
22645
22646         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
22647         on parameters and accordingly set the marshalling info.
22648
22649 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
22650
22651         * class.cs: Optimizing slightly by removing redundant code after
22652         we switched to the `NoTypes' return value.
22653         (Property.DefineMethod): use NoTypes here too.
22654
22655         This fixes the bug I introduced in my last batch of changes.
22656
22657 2002-03-05  Ravi Pratap  <ravi@ximian.com>
22658
22659         * tree.cs (RecordEnum): Add. We now keep track of enums too.
22660
22661         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
22662         Enums since those are types too. 
22663
22664         * cs-parser.jay (enum_declaration): Record enums as we parse them.
22665
22666         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
22667         thanks to a call during the lookup process.
22668
22669 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
22670
22671         * statement.cs (Foreach): Lots of work to accomodate a particular
22672         kind of foreach statement that I had not kept in mind.  It is
22673         possible to have foreachs on classes that provide a GetEnumerator
22674         method that return objects that implement the "pattern" for using
22675         a foreach, there is no need to support GetEnumerator
22676         specifically. 
22677
22678         This is needed to compile nant.
22679
22680         * decl.cs: Only report 114 if the member is not `Finalize' and if
22681         the warning level is at least 2.
22682
22683         * class.cs: Moved the compare function from Method to
22684         MethodSignature. 
22685
22686         (MethodSignature.InheritableMemberSignatureCompare): Add new
22687         filter function that is used to extract inheritable methods from a
22688         class. 
22689
22690         (Method.Define): Use the new `inheritable_method_signature_filter'
22691         delegate
22692
22693         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
22694         command. 
22695
22696 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
22697
22698         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
22699
22700         * cs-parser.jay: Add opt_semicolon to the interface declaration.
22701
22702         * expression.cs: Pass location information to
22703         ConvertImplicitStandard. 
22704
22705         * class.cs: Added debugging code to track return values from
22706         interfaces. 
22707
22708 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
22709
22710         * expression.cs (Is.DoResolve): If either side of the `is' is an
22711         interface, do not flag the warning.
22712
22713         * ecore.cs (ImplicitReferenceConversion): We need a separate test
22714         for interfaces
22715
22716         * report.cs: Allow for --fatal to be used with --probe.
22717
22718         * typemanager.cs (NoTypes): Move the definition for the empty Type
22719         array here. 
22720
22721         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
22722         properties. 
22723         (TypeContainer.DefineProxy): New function used to proxy to parent
22724         implementations when implementing interfaces.
22725         (TypeContainer.ParentImplements): used to lookup if our parent
22726         implements a public function that is required by an interface.
22727         (TypeContainer.VerifyPendingMethods): Hook this up.
22728
22729         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
22730         `modules' and `assemblies' arraylists into arrays.  We only grow
22731         these are the very early start up of the program, so this improves
22732         the speedof LookupType (nicely measured).
22733
22734         * expression.cs (MakeByteBlob): Replaced unsafe code with
22735         BitConverter, as suggested by Paolo.
22736
22737         * cfold.cs (ConstantFold.Binary): Special case: perform constant
22738         folding of string concatenation, but if either side is a string,
22739         and the other is not, then return null, and let the runtime use
22740         the concatenation on the string plus the object (using
22741         `Object.ToString'). 
22742
22743 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
22744
22745         Constant Folding has been implemented now.
22746
22747         * expression.cs (Unary.Reduce): Do not throw an exception, catch
22748         the error instead on types that are not supported in one's
22749         complement. 
22750
22751         * constant.cs (Constant and all children): New set of functions to
22752         perform implict and explicit conversions.
22753
22754         * ecore.cs (EnumConstant): Implement the new functions to perform
22755         conversion by proxying to the child expression.
22756
22757         * codegen.cs: (ConstantCheckState): Constant evaluation has its
22758         own separate setting that can not be turned off from the command
22759         line using --unchecked or --checked and is only controlled using
22760         the checked/unchecked statements and expressions.  This setting is
22761         used by the constant folder to flag errors.
22762
22763         * expression.cs (CheckedExpr, UncheckedExpr): Set the
22764         ConstantCheckState as well.   
22765
22766         During Resolve, they also have to flag the state, because the
22767         constant folder runs completely in the Resolve phase.
22768
22769         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
22770         well.
22771
22772 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
22773
22774         * cfold.cs: New file, this file contains the constant folder.
22775
22776         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
22777         argument to track whether we are using the resulting address to
22778         load or store a value and provide better error messages. 
22779
22780         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
22781         new AddressOf arguments.
22782
22783         * statement.cs (Foreach.EmitCollectionForeach): Update
22784
22785         * expression.cs (Argument.Emit): Call AddressOf with proper
22786         arguments to track usage.
22787
22788         (New.DoEmit): Call AddressOf with new arguments.
22789
22790         (Unary.Emit): Adjust AddressOf call.
22791
22792 2002-03-01  Ravi Pratap  <ravi@ximian.com>
22793
22794         * cs-parser.jay (member_access): Change the case for pre-defined types
22795         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
22796         this suggestion.
22797
22798         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
22799         a method body.
22800
22801         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
22802         essentially like methods and apply attributes like MethodImplOptions to them too.
22803
22804         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
22805         not being null.
22806
22807         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
22808         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
22809         is the DeclSpace.
22810
22811         * Update code everywhere accordingly.
22812
22813         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
22814
22815         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
22816
22817 2002-02-28  Ravi Pratap  <ravi@ximian.com>
22818
22819         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
22820         try performing lookups against those instead of jumping straight into using
22821         the 'using' clauses.
22822
22823         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
22824
22825         (LookupType): Perform lookups in implicit parents too.
22826
22827         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
22828         sequence as RootContext.LookupType. 
22829
22830         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
22831         the various cases of namespace lookups into this method.
22832
22833 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
22834
22835         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
22836         in positional arguments)
22837
22838         * class.cs (Operator): Update the AllowedModifiers to contain
22839         extern. 
22840
22841         * cs-parser.jay: Update operator declaration to allow for the
22842         operator body to be empty.
22843
22844         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
22845         values. 
22846
22847 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
22848
22849         * class.cs (Method.Emit): Label parameters.
22850
22851         * driver.cs: Return 1 or 0 as the program exit code.
22852
22853 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
22854
22855         * expression.cs: Special case the `null' object when trying to
22856         auto-compute the type, as anything can be explicitly converted to
22857         that. 
22858
22859         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
22860         spotting this Paolo.
22861
22862         (Expression.ImplicitNumericConversion): Perform comparissions of
22863         the type using the underlying type in the case of an enumeration
22864         rather than using the enumeration type for the compare.
22865
22866         Cope with the underlying == type case, which is not possible to
22867         catch before. 
22868
22869         (Expression.ConvertNumericExplicit): Perform comparissions of
22870         the type using the underlying type in the case of an enumeration
22871         rather than using the enumeration type for the compare.
22872
22873         * driver.cs: If the user does not supply an extension, assume .exe
22874
22875         * cs-parser.jay (if_statement): Rewrote so that we can track the
22876         location for the if statement.
22877
22878         * expression.cs (Binary.ConstantFold): Only concat strings when
22879         the operation is "+", not everything ;-)
22880
22881         * statement.cs (Statement.EmitBoolExpression): Take a location
22882         argument. 
22883         (If, While, Do): Track location.
22884
22885         * expression.cs (Binary.ResolveOperator): In the object + string
22886         case, I was missing a call to ConvertImplicit
22887
22888 2002-02-25  Ravi Pratap  <ravi@ximian.com>
22889
22890         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
22891         Location arguments. Ensure we use RootContext.LookupType to do our work
22892         and not try to do a direct Type.GetType and ModuleBuilder.GetType
22893
22894         * interface.cs (PopulateMethod): Handle the type of the parameter being
22895         null gracefully.
22896
22897         * expression.cs (Invocation.BetterFunction): Handle the case when we 
22898         have a params method with no fixed arguments and a call is made with no
22899         arguments.
22900
22901 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
22902
22903         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
22904         the verbatim-string-literal
22905
22906         * support.cs (InternalParameters.ParameterModifier): handle null
22907         fixed parameters.
22908         (InternalParameters.ParameterType): ditto.
22909
22910         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
22911         duplicating the name of the variable parameter.
22912         (GetParameterByName): Fix bug where we were not looking up array
22913         paramters if they were the only present (thanks Paolo!).
22914         (GetParameterInfo): We only have an empty set of types if both
22915         fixed and array are set to null.
22916         (GetParameterInfo-idx): Handle FixedParameter == null
22917
22918         * cs-parser.jay: Handle the case where there is no catch
22919         statements (missing null test).
22920
22921 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
22922
22923         * driver.cs (MainDriver): Be conservative on our command line
22924         handling.
22925
22926         Catch DirectoryNotFoundException when calling GetFiles.
22927
22928         (SplitPathAndPattern): Used to split the input specification into
22929         a path and a pattern that we can feed to Directory.GetFiles.
22930
22931 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
22932
22933         * statement.cs (Fixed): Implement the last case of the Fixed
22934         statement (string handling).
22935
22936         * expression.cs (StringPtr): New class used to return a char * to
22937         a string;  Used by the Fixed statement.
22938
22939         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
22940
22941         * expression.cs (Binary.ResolveOperator): Remove redundant
22942         MemberLookup pn parent type.
22943         Optimize union call, we do not need a union if the types are the same.
22944         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
22945         type.
22946
22947         Specialize the use of MemberLookup everywhere, instead of using
22948         the default settings. 
22949
22950         (StackAlloc): Implement stackalloc keyword.
22951
22952         * cs-parser.jay: Add rule to parse stackalloc.
22953
22954         * driver.cs: Handle /h, /help, /?
22955
22956         * expression.cs (MakeByteBlob): Removed the hacks we had in place
22957         before we supported unsafe code.
22958
22959         * makefile: add --unsafe to the self compilation of mcs.
22960
22961 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
22962
22963         * expression.cs (PointerArithmetic): New class that is used to
22964         perform pointer arithmetic.
22965         (Binary.Resolve): Handle pointer arithmetic
22966         Handle pointer comparission.
22967         (ArrayPtr): Utility expression class that is used to take the
22968         address of an array.
22969
22970         (ElementAccess): Implement array access for pointers
22971
22972         * statement.cs (Fixed): Implement fixed statement for arrays, we
22973         are missing one more case before we are done.
22974
22975         * expression.cs (Indirection): Implement EmitAssign and set the
22976         ExprClass to Variable.  This allows pointer dereferences to be
22977         treated as variables, and to have values assigned to them.
22978
22979         * ecore.cs (Expression.StoreFromPtr): New utility function to
22980         store values dereferencing.
22981
22982 2002-02-20  Ravi Pratap  <ravi@ximian.com>
22983
22984         * expression.cs (Binary.ResolveOperator): Ensure that we are
22985         not trying to operate on a void type - this fixes the reported
22986         bug.
22987
22988         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
22989         the parent implementation is sealed.
22990
22991         * ../errors/cs0239.cs : Add.
22992
22993         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
22994
22995         * typemanager.cs (unverifiable_code_type): Corresponds to 
22996         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
22997         which have unsafe code in them.
22998
22999         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
23000         unsafe context.
23001
23002 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
23003
23004         * cs-tokenizer.cs: Add support for @"litreal strings"
23005
23006         Make tokenizer accept pre-processor directives
23007         on any column (remove the old C-like limitation). 
23008
23009         * rootcontext.cs (EmitCode): Emit any global attributes.
23010         (AddGlobalAttributes): Used to keep track of assembly attributes. 
23011
23012         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
23013
23014         * cs-parser.jay: Add support for global attributes.  
23015
23016 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
23017
23018         * expression.cs (Indirection): New helper class.  Unary will
23019         create Indirection classes to be able to implement the
23020         IMemoryLocation interface on it.
23021
23022 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
23023
23024         * cs-parser.jay (fixed_statement): reference the right statement.
23025
23026         * statement.cs (Fixed.Emit): Finish implementing the fixed
23027         statement for the &x case.
23028
23029 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
23030
23031         * class.cs (Property.Define, Method.Define): Remove newslot when
23032         `implementing'.  
23033
23034         * modifiers.cs: My use of NewSlot when `Abstract' was set was
23035         wrong.  NewSlot should only be used if the `new' keyword is present.
23036
23037         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
23038         locating our system dir.  Sorry about this.
23039
23040 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
23041
23042         * driver.cs (GetSystemDir): Compute correctly the location of our
23043         system assemblies.  I was using the compiler directory instead of
23044         the library directory.
23045
23046 2002-02-13  Ravi Pratap  <ravi@ximian.com>
23047
23048         * expression.cs (BetterFunction): Put back in what Miguel commented out
23049         since it is the correct fix. The problem is elsewhere ;-)
23050
23051         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
23052         parameters of the parms method are themselves compatible or not !
23053
23054         (StandardConversionExists): Fix very dangerous bug where we were forgetting
23055         to check that a class implements an interface before saying that an implicit
23056         conversion was allowed. Use ImplementsInterface to do the checking.
23057
23058 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
23059
23060         * class.cs (Method.Define): Track whether we are an explicit
23061         implementation or not.  And only call DefineMethodOverride if we
23062         are an explicit implementation.
23063
23064         (Property.DefineMethod): Ditto.
23065
23066 2002-02-11  Ravi Pratap  <ravi@ximian.com>
23067
23068         * expression.cs (BetterFunction): Catch hideous bug which was
23069          preventing us from detecting ambiguous calls due to implicit casts i.e
23070         cs0121.
23071
23072 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
23073
23074         * support.cs (Pair): Remove un-needed method.  I figured why I was
23075         getting the error in cs-parser.jay, the variable in a foreach loop
23076         is readonly, and the compiler does not really treat this as a variable.
23077
23078         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
23079         instead of EQUALS in grammar.  
23080
23081         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
23082
23083         * expression.cs (Unary.DoResolve): Check whether the argument is
23084         managed or not.
23085
23086 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
23087
23088         * support.cs: Api for Pair to set a value.  Despite the fact that
23089         the variables are public the MS C# compiler refuses to compile
23090         code that accesses the field if the variable is part of a foreach
23091         statement. 
23092
23093         * statement.cs (Fixed): Begin implementation of the fixed
23094         statement.
23095
23096         (Block.AddVariable): Return the VariableInfo on success and null
23097         on failure instead of true/false. 
23098
23099         * cs-parser.jay (foreach): Catch errors on variables already
23100         defined (we were ignoring this value before) and properly unwind
23101         the block hierarchy
23102
23103         (fixed_statement): grammar for the fixed statement.
23104
23105 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
23106
23107         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
23108         pointer types to be incretemented.
23109
23110         (SizeOf): Implement.
23111
23112         * cs-parser.jay (pointer_member_access): Implement
23113         expr->IDENTIFIER production.
23114
23115         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
23116         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
23117         on safe contexts.
23118
23119         (Unary): Implement indirection.
23120
23121         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
23122         use in non-unsafe context).
23123
23124         (SimpleName.DoResolve): Check for pointers in field access on safe
23125         contexts. 
23126
23127         (Expression.LoadFromPtr): Factor the load-indirect code in this
23128         function.  This was duplicated in UnboxCast and ParameterReference
23129
23130 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
23131
23132         * expression.cs (ComposedCast): report an error if a pointer cast
23133         is used in a safe region.
23134
23135         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
23136         pointer type casts in unsafe context.
23137
23138         * codegen.cs (EmitContext): Set up IsUnsafe.
23139
23140         * cs-parser.jay (non_expression_type): Add productions for pointer
23141         casts. 
23142
23143         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
23144         code.  We should not use force into static mode if the method is
23145         not virtual.  Fixes bug in MIS
23146
23147         * statement.cs (Do.Emit, While.Emit, For.Emit,
23148         Statement.EmitBoolExpression): Add support to Do and While to
23149         propagate infinite loop as `I do return' semantics.
23150
23151         Improve the For case to also test for boolean constants.
23152
23153         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
23154         to the list of attributes we can add.
23155
23156         Remove `EmitContext' argument.
23157
23158         * class.cs (Method.Define): Apply parameter attributes.
23159         (Constructor.Define): Apply parameter attributes.
23160         (MethodCore.LabelParameters): Move here the core of labeling
23161         parameters. 
23162
23163         * support.cs (ReflectionParameters.ParameterModifier,
23164         InternalParameters.ParameterModifier): Use IsByRef on the type and
23165         only return the OUT bit for these parameters instead of in/out/ref
23166         flags.
23167
23168         This is because I miss-understood things.  The ParameterInfo.IsIn
23169         and IsOut represent whether the parameter has the [In] and [Out]
23170         attributes set.  
23171
23172 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
23173
23174         * ecore.cs (FieldExpr.Emit): Release temporaries.
23175
23176         * assign.cs (LocalTemporary.Release): new function.
23177
23178         * codegen.cs (EmitContext.GetTemporaryStorage,
23179         EmitContext.FreeTemporaryStorage): Rework the way we deal with
23180         temporary storage.  Now we can "put back" localbuilders when we
23181         are done with them
23182
23183 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
23184
23185         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
23186         need to make a copy of the variable to generate verifiable code.
23187
23188 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
23189
23190         * driver.cs: Compute dynamically the system directory.
23191
23192         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
23193         Slower, but more generally useful.  Used by the abstract
23194         registering implementation. 
23195
23196         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
23197         the rules for the special rule on Type/instances.  First check if
23198         we have the same name, and if so, try that special static path
23199         rather than the instance path.
23200
23201 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
23202
23203         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
23204         for, while and if.
23205
23206         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
23207         Enum, ValueType, Delegate or Array for non-corlib compiles.
23208
23209         * cs-tokenizer.cs: Catch long identifiers (645)
23210
23211         * typemanager.cs (IndexerPropetyName): Ravi never tested this
23212         piece of code.
23213
23214         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
23215         fix, we were returning too early, so we were not registering
23216         pending methods from abstract classes.
23217
23218         Do not register pending methods if the class is abstract.
23219
23220         * expression.cs (Conditional.DoResolve): Report circular implicit
23221         conversions when we neecd to compute it for conditional
23222         expressions. 
23223
23224         (Is.DoResolve): If the expression is always of the provided type,
23225         flag warning 183.  If the expression can not ever be of the
23226         provided type flag warning 184.
23227
23228         * class.cs: Catch 169 as well.
23229
23230         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
23231         read. 
23232
23233 2002-01-18  Nick Drochak  <ndrochak@gol.com>
23234
23235         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
23236
23237 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
23238
23239         * interface.cs: (PopulateMethod): Check for pointers being defined
23240         only if the unsafe context is active.
23241         (PopulateProperty): ditto.
23242         (PopulateIndexer): ditto.
23243
23244         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
23245         specified.  If pointers are present, make sure that they are
23246         present in an unsafe context.
23247         (Constructor, Constructor.Define): ditto.
23248         (Field, Field.Define): ditto.
23249         (Property, Property.Define): ditto.
23250         (Event, Event.Define): ditto.
23251
23252         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
23253         hashtable if there are classes or structs defined.
23254
23255         * expression.cs (LocalVariableReference.DoResolve): Simplify this
23256         code, as the constant resolution moved.
23257
23258         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
23259         the metadata, so we can flag error 133. 
23260
23261         * decl.cs (MemberCore.UnsafeOK): New function to test that a
23262         pointer is being declared in an unsafe context.
23263
23264 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
23265
23266         * modifiers.cs (Modifiers.Check): Require a Location argument.
23267         Report error 227 for Unsafe use.
23268
23269         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
23270
23271         * statement.cs (For.Emit): If the test is null, then report that
23272         we do `return', as we wont reach anything afterwards.
23273
23274         (Switch.SwitchGoverningType): Track the expression that matched
23275         the conversion.
23276
23277         * driver.cs: Allow negative numbers as an error code to flag.
23278
23279         * cs-parser.jay: Handle 1551.
23280
23281         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
23282
23283 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
23284
23285         * cs-parser.jay: Report 1518 (type declaration can only contain
23286         class, struct, interface, enum or delegate)
23287
23288         (switch_label): Report 1523 (keywords `case' or `default' must
23289         preced code)
23290
23291         (opt_switch_sections): Report 1522 (empty switch)
23292
23293         * driver.cs: Report 1515 (response file specified multiple times)
23294         Report 1516 (Source file specified multiple times).
23295
23296         * expression.cs (Argument.Resolve): Signal 1510
23297
23298         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
23299         access not allowed in static code)
23300
23301 2002-01-11  Ravi Pratap  <ravi@ximian.com>
23302
23303         * typemanager.cs (IsPointerType): Utility method which we are going
23304         to need a lot.
23305
23306         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
23307         the object type, so we take care of that.
23308
23309         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
23310
23311         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
23312         added to non-params parameters :-)
23313
23314         * typemanager.cs (CSharpName): Include 'void' type too. 
23315
23316         (void_ptr_type): Include in the set of core types.
23317
23318         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
23319         duplicating code.
23320
23321         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
23322         an unsafe context.
23323
23324         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
23325         completely forgotten about it.
23326
23327 2002-01-10  Ravi Pratap  <ravi@ximian.com>
23328
23329         * cs-parser.jay (pointer_type): Add. This begins our implementation
23330         of parsing rules for unsafe code.
23331
23332         (unsafe_statement): Implement.
23333
23334         (embedded_statement): Modify to include the above.
23335
23336         * statement.cs (Unsafe): Implement new class for unsafe blocks.
23337
23338         * codegen.cs (EmitContext.InUnsafe): Add. This determines
23339         if the current context is an unsafe one.
23340
23341         * cs-parser.jay (local_variable_pointer_type): Since local variable types
23342         are handled differently, we need separate rules for them.
23343
23344         (local_variable_declaration): Update to use local_variable_pointer_type
23345         to allow variable declarations of unmanaged pointer types.
23346
23347         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
23348         in unsafe contexts.
23349
23350         * ../errors/cs0214.cs : Add.
23351
23352 2002-01-16  Nick Drochak  <ndrochak@gol.com>
23353
23354         * makefile: remove 'response' file when cleaning.
23355
23356 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
23357
23358         * cs-parser.jay: Report 1524.
23359
23360 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
23361
23362         * typemanager.cs (RegisterMethod): drop checking if we have
23363         registered this from here
23364
23365 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
23366
23367         * class.cs (Method.EmitDestructor): Implement calling our base
23368         destructor. 
23369
23370         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
23371         value of InFinally.
23372
23373         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
23374         this routine and will wrap the call in a try/catch block.  Deal
23375         with the case.
23376
23377 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
23378
23379         * ecore.cs (Expression.MemberLookup): instead of taking a
23380         parameter `same_type' that was used to tell whether we could
23381         access private members we compute our containing type from the
23382         EmitContext.
23383
23384         (FieldExpr): Added partial support for volatile fields.  This does
23385         not work for volatile fields exposed from assemblies, as I can not
23386         figure out how to extract the modreq from it.
23387
23388         Updated all the source files to use this.
23389
23390         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
23391         because it is referenced by MemberLookup very often. 
23392
23393 2002-01-09  Ravi Pratap  <ravi@ximian.com>
23394
23395         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
23396         TypeBuilder.GetCustomAttributes to retrieve what we need.
23397
23398         Get rid of redundant default_member_attr_type as this is the same as
23399         default_member_type which already exists.
23400
23401         * interface.cs, attribute.cs : Update accordingly.
23402
23403 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
23404
23405         * typemanager.cs: Enable IndexerPropertyName again.  It does not
23406         work for TYpeBuilders though.  Ravi, can you please fix this?
23407
23408         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
23409
23410         * expression.cs (Argument.Emit): Handle the case of ref objects
23411         being passed to ref functions;  
23412
23413         (ParameterReference.EmitLoad): Loads the content of the pointer
23414         without dereferencing.
23415
23416 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
23417
23418         * cs-tokenizer.cs: Implemented the pre-processing expressions.
23419
23420 2002-01-08  Ravi Pratap  <ravi@ximian.com>
23421
23422         * class.cs (Indexer.DefineMethod): Incorporate the interface
23423         type in the name of the method if we are doing explicit interface
23424         implementation.
23425
23426         * expression.cs (ConversionExists): Remove as it is completely obsolete.
23427
23428         (BetterConversion): Fix extremely trivial bug where we were referring to
23429         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
23430         again !
23431
23432         * ../errors/bug16.cs : Add although we have fixed it.
23433
23434 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
23435
23436         * expression.cs (BaseIndexer): Begin implementation.
23437
23438         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
23439
23440         * cs-parser.jay (indexer_declarator): Use qualified_identifier
23441         production directly to remove a shift/reduce, and implement
23442         explicit interface implementation.
23443
23444         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
23445         after a floating point suffix.
23446
23447         * expression.cs (DoNumericPromotions): Improved the conversion for
23448         uint/uint.  If we have a constant, we avoid doing a typecast to a
23449         larger type.
23450
23451         * class.cs (Indexer): Implement explicit interface implementation
23452         for indexers.
23453
23454 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
23455
23456         * class.cs: make the default instance constructor public and hidebysig.
23457
23458 2001-01-03  Ravi Pratap  <ravi@ximian.com>
23459
23460         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
23461         so we can call it from elsewhere.
23462
23463         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
23464         we emit it internally if the class has a defined indexer; otherwise the user
23465         emits it by decorating the class definition with the DefaultMemberAttribute.
23466
23467         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
23468         attribute is not used on a type which defines an indexer.
23469
23470         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
23471         character when we skip whitespace.
23472
23473         * ../errors/cs0646.cs : Add.
23474
23475 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
23476
23477         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
23478         again. 
23479
23480         * makefile: Add practical target `mcs3.exe' which builds the third
23481         generation compiler. 
23482
23483         * expression.cs (New): Fix structures constructor calling.
23484
23485         * class.cs (Property, Method, Indexer): Emit Final flag on the
23486         method if we are an interface implementation and we are not
23487         abstract. 
23488
23489         * ecore.cs (PropertyExpr): New public field `IsBase', tells
23490         whether this property is referencing a `base' method.
23491
23492         * expression.cs (Invocation.EmitCall): take an extra argument:
23493         is_base, this is used to determine whether the `call' or
23494         `callvirt' opcode should be used.
23495
23496
23497         * delegate.cs: update EmitCall.
23498
23499         * class.cs (Method.Define): Set NewSlot for the cases where we are
23500         not implementing an interface method.
23501
23502         (Property.Define): ditto.
23503
23504 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
23505
23506         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
23507         'r'.  Allows mcs to parse itself fully.
23508
23509 2002-01-02  Ravi Pratap  <ravi@ximian.com>
23510
23511         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
23512         of the number of initializers that require the InitializeArray method.
23513
23514         (CheckIndices): Store the Expression in all cases - not the plain value. Also
23515         update the above field where necessary.
23516
23517         (MakeByteBlob): Update accordingly.
23518
23519         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
23520         greater than 2.
23521
23522         (EmitDynamicInitializers): Update in accordance with the new optimization.
23523
23524         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
23525         same OpCode applies.
23526
23527         * cs-parser.jay : Fix some glaring errors I introduced.
23528
23529 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
23530
23531         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
23532         so that we can check for name clashes there too.
23533
23534         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
23535         for interface indexers.
23536
23537         * interfaces.cs (Define): Emit the default member attribute.
23538
23539         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
23540         variable was being referred to while setting the value ;-)
23541
23542 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
23543
23544         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
23545         byte-by-byte information when we know the data is zero.
23546
23547         Make the block always a multiple of 4, because
23548         DefineInitializedData has a bug.
23549
23550         * assign.cs: Fix, we should assign from the temporary, not from
23551         the source. 
23552
23553         * expression.cs (MakeByteBlob): Fix my incorrect code.
23554
23555 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
23556
23557         * typemanager.cs (EnumToUnderlying): This function is used to get
23558         the underlying type from an enumeration, because it does not
23559         always work. 
23560
23561         * constant.cs: Use the I4_S form for values between -128 and 127.
23562
23563         * statement.cs (Block.LookupLabel): Looks up a label.
23564         (Block): Drop support for labeled blocks.
23565
23566         (LabeledStatement): New kind of statement that represents a label
23567         only.
23568
23569         (Goto): Finally implement this bad boy.
23570
23571         * cs-parser.jay: Update to reflect new mechanism to implement
23572         labels.
23573
23574 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
23575
23576         * codegen.cs (EmitContext.This): a codegen property that keeps the
23577         a single instance of this instead of creating many different this
23578         instances. 
23579
23580         * delegate.cs (Delegate.DoResolve): Update to use the property;
23581
23582         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
23583
23584         * expression.cs (BaseAccess.DoResolve): Ditto.
23585
23586 2001-12-29  Ravi Pratap  <ravi@ximian.com>
23587
23588         * typemanager.cs (methodimpl_attr_type): Add to hold the type
23589         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
23590
23591         (InitCoreTypes): Update accordingly.
23592
23593         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
23594         so we can quickly store the state.
23595
23596         (ApplyAttributes): Set the correct implementation flags
23597         for InternalCall methods.
23598
23599 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
23600
23601         * expression.cs (EmitCall): if a method is not virtual, then do
23602         not use callvirt on it.
23603
23604         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
23605         user defined stuff) requires the use of stobj, which takes an
23606         address on the stack instead of an array and an index.  So emit
23607         the Ldelema operation for it.
23608
23609         (EmitStoreOpcode): Use stobj for valuetypes.
23610
23611         (UnaryMutator.EmitCode): Use the right 1 value depending on
23612         whether we are dealing with int64/uint64, float or doubles.
23613
23614         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
23615         constructors that I implemented last night.
23616
23617         (Constructor.IsDefault): Fix to work properly for static
23618         constructors.
23619
23620         * cs-parser.jay (CheckDef): report method signature errors.
23621         Update error number 103 to be 132.
23622
23623         * decl.cs: New AdditionResult enumeration value: MethodExists.
23624         Although we do this check for methods later on in the semantic
23625         analysis, catching repeated default constructors is so easy that
23626         we catch these here. 
23627
23628         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
23629         promotions code.
23630
23631         (ParameterReference.EmitAssign, Emit): handle
23632         bools as bytes.
23633
23634         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
23635         (ArrayAccess.EmitStoreOpcode): ditto.
23636
23637         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
23638
23639         * expression.cs (MakeByteBlob): Complete all the missing types
23640         (uint, short, ushort, byte, sbyte)
23641
23642         * class.cs: Only init instance field initializers on instance
23643         constructors. 
23644
23645         Rename `constructors' to instance_constructors. 
23646
23647         (TypeContainer.AddConstructor): Only add constructors to the list
23648         if it is not static.
23649
23650         Make sure that we handle default_static_constructor independently
23651         everywhere where we handle instance_constructors
23652
23653 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
23654
23655         * class.cs: Do not lookup or create a base initializer for a
23656         static constructor.
23657
23658         (ConstructorInitializer.Resolve): use the proper type to lookup
23659         for constructors.
23660
23661         * cs-parser.jay: Report error 1585 (modifiers between type and name).
23662
23663         * enum.cs, interface.cs: Remove CloseType, this is taken care by
23664         in DeclSpace. 
23665
23666         * decl.cs: CloseType is now an virtual method, the default
23667         implementation just closes this type.
23668
23669 2001-12-28  Ravi Pratap  <ravi@ximian.com>
23670
23671         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
23672         to PreserveSig by default. Also emit HideBySig on such methods.
23673
23674         Basically, set the defaults to standard values.
23675
23676         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
23677         argument, if candidate is better, it can't be worse than the best !
23678
23679         (Invocation): Re-write bits to differentiate between methods being
23680         applicable in their expanded form and their normal form - for params
23681         methods of course.
23682
23683         Get rid of use_standard everywhere as only standard conversions are allowed
23684         in overload resolution. 
23685
23686         More spec conformance.
23687
23688 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
23689
23690         * driver.cs: Add --timestamp, to see where the compiler spends
23691         most of its time.
23692
23693         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
23694         `this' in static code.
23695
23696         (SimpleName.DoResolve): Implement in terms of a helper function
23697         that allows static-references to be passed upstream to
23698         MemberAccess.
23699
23700         (Expression.ResolveWithSimpleName): Resolve specially simple
23701         names when called by MemberAccess to implement the special
23702         semantics. 
23703
23704         (Expression.ImplicitReferenceConversion): Handle conversions from
23705         Null to reference types before others, as Null's type is
23706         System.Object. 
23707
23708         * expression.cs (Invocation.EmitCall): Handle the special case of
23709         calling methods declared on a reference type from a ValueType
23710         (Base classes System.Object and System.Enum)
23711
23712         (MemberAccess.Resolve): Only perform lookups on Enumerations if
23713         the left hand side is a TypeExpr, not on every enumeration. 
23714
23715         (Binary.Resolve): If types are reference types, then do a cast to
23716         object on operators != and == of both arguments.
23717
23718         * typemanager.cs (FindMembers): Extract instance and static
23719         members if requested.
23720
23721         * interface.cs (PopulateProperty): Use void_type instead of null
23722         as the return type for the setter method.
23723
23724         (PopulateIndexer): ditto.
23725
23726 2001-12-27  Ravi Pratap  <ravi@ximian.com>
23727
23728         * support.cs (ReflectionParameters): Fix minor bug where we
23729         were examining the wrong parameter for the ParamArray attribute.
23730
23731         Cope with requests for the type of the parameter at position
23732         greater than the params parameter's. We now return the element
23733         type of the params array as that makes more sense.
23734
23735         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
23736         accordingly as we no longer have to extract the element type
23737         ourselves.
23738
23739         (Invocation.OverloadResolve): Update.
23740
23741 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
23742
23743         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
23744         against IEnumerator, test whether the return value is a descendant
23745         of the IEnumerator interface.
23746
23747         * class.cs (Indexer.Define): Use an auxiliary method to implement
23748         the other bits of the method definition.  Begin support for
23749         explicit interface implementation.
23750
23751         (Property.DefineMethod): Use TypeManager.void_type instead of null
23752         for an empty return value.
23753
23754 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
23755
23756         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
23757         dealing with a FieldExpr which is composed of a FieldBuilder, in
23758         the code path we did extract the constant, but we should have
23759         obtained the underlying value to be able to cast it (otherwise we
23760         end up in an infinite loop, this is what Ravi was running into).
23761
23762         (ArrayCreation.UpdateIndices): Arrays might be empty.
23763
23764         (MemberAccess.ResolveMemberAccess): Add support for section
23765         14.5.4.1 that deals with the special case of E.I when E is a type
23766         and something else, that I can be a reference to a static member.
23767
23768         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
23769         handle a particular array type to create byte blobs, it is just
23770         something we dont generate byteblobs for.
23771
23772         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
23773         arguments. 
23774
23775         * location.cs (Push): remove the key from the hashtable that we
23776         are about to add.   This happens for empty files.
23777
23778         * driver.cs: Dispose files after we have parsed them.
23779
23780         (tokenize): new function that only runs the tokenizer on its
23781         input, for speed testing.
23782
23783 2001-12-26  Ravi Pratap  <ravi@ximian.com>
23784
23785         * class.cs (Event.Define): Define the private field only if there
23786         are no accessors defined.
23787
23788         * expression.cs (ResolveMemberAccess): If there is no associated
23789         field with the event, that means we have an event defined with its
23790         own accessors and we should flag error cs0070 since transforming
23791         ourselves into a field is not valid in that case.
23792
23793         * ecore.cs (SimpleName.DoResolve): Same as above.
23794
23795         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
23796         and charset to sane values.
23797
23798 2001-12-25  Ravi Pratap  <ravi@ximian.com>
23799
23800         * assign.cs (DoResolve): Perform check on events only if they 
23801         are being accessed outside the declaring type.
23802
23803         * cs-parser.jay (event_declarations): Update rules to correctly
23804         set the type of the implicit parameter etc.
23805
23806         (add_accessor, remove_accessor): Set current local parameters.
23807
23808         * expression.cs (Binary): For delegate addition and subtraction,
23809         cast the return value from the method into the appropriate delegate
23810         type.
23811
23812 2001-12-24  Ravi Pratap  <ravi@ximian.com>
23813
23814         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
23815         of these as the workaround is unnecessary.
23816
23817         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
23818         delegate data - none of that is needed at all.
23819
23820         Re-write bits to extract the instance expression and the delegate method
23821         correctly.
23822
23823         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
23824         on delegates too.
23825
23826         * attribute.cs (ApplyAttributes): New method to take care of common tasks
23827         of attaching attributes instead of duplicating code everywhere.
23828
23829         * everywhere : Update code to do attribute emission using the above method.
23830
23831 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
23832
23833         * expression.cs (IsParamsMethodApplicable): if there are not
23834         parameters, return immediately.
23835
23836         * ecore.cs: The 0 literal can be implicity converted to an enum
23837         type. 
23838
23839         (SimpleName.DoResolve): First lookup the type, then lookup the
23840         members. 
23841
23842         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
23843         want to get its address.  If the InstanceExpression is not
23844         addressable, store the result in a temporary variable, then get
23845         the address of it.
23846
23847         * codegen.cs: Only display 219 errors on warning level or above. 
23848
23849         * expression.cs (ArrayAccess): Make it implement the
23850         IMemoryLocation interface.
23851
23852         (Binary.DoResolve): handle the operator == (object a, object b)
23853         and operator != (object a, object b) without incurring into a
23854         BoxedCast (because 5 != o should never be performed).
23855
23856         Handle binary enumerator operators.
23857
23858         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
23859         value type, otherwise use Ldelem_ref.
23860
23861         Use precomputed names;
23862
23863         (AddressOf): Implement address of
23864
23865         * cs-parser.jay (labeled_statement): Fix recursive block
23866         addition by reworking the production.
23867
23868         * expression.cs (New.DoEmit): New has a special case:
23869                 
23870                  If we are dealing with a ValueType, we have a few
23871                  situations to deal with:
23872                 
23873                     * The target of New is a ValueType variable, that is
23874                       easy, we just pass this as the variable reference
23875                 
23876                     * The target of New is being passed as an argument,
23877                       to a boxing operation or a function that takes a
23878                       ValueType.
23879                 
23880                       In this case, we need to create a temporary variable
23881                       that is the argument of New.
23882
23883
23884 2001-12-23  Ravi Pratap  <ravi@ximian.com>
23885
23886         * rootcontext.cs (LookupType): Check that current_type is not null before
23887         going about looking at nested types.
23888
23889         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
23890         not implement the IAssignMethod interface any more.
23891
23892         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
23893         where we tranform them into FieldExprs if they are being resolved from within
23894         the declaring type.
23895
23896         * ecore.cs (SimpleName.DoResolve): Do the same here.
23897
23898         * assign.cs (DoResolve, Emit): Clean up code considerably. 
23899
23900         * ../errors/bug10.cs : Add.
23901
23902         * ../errors/cs0070.cs : Add.
23903
23904         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
23905
23906         * assign.cs : Get rid of EventIsLocal everywhere.
23907
23908 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
23909
23910         * ecore.cs (ConvertIntLiteral): finished the implementation.
23911
23912         * statement.cs (SwitchLabel): Convert the value we are using as a
23913         key before looking up the table.
23914
23915 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
23916
23917         * codegen.cs (EmitTopBlock): Require a Location argument now.
23918
23919         * cs-parser.jay (constructor_declarator): We need to setup
23920         current_local_parameters before we parse the
23921         opt_constructor_initializer, to allow the variables to be bound
23922         to the constructor arguments.
23923
23924         * rootcontext.cs (LookupType): First lookup nested classes in our
23925         class and our parents before we go looking outside our class.
23926
23927         * expression.cs (ConstantFold): Extract/debox the values at the
23928         beginnning. 
23929
23930         * rootcontext.cs (EmitCode): Resolve the constants first before we
23931         resolve the types.  This is not really needed, but it helps debugging.
23932
23933         * statement.cs: report location.
23934
23935         * cs-parser.jay: pass location to throw statement.
23936
23937         * driver.cs: Small bug fix.
23938
23939         * report.cs: Updated format to be 4-zero filled digits.
23940
23941 2001-12-22  Ravi Pratap  <ravi@ximian.com>
23942
23943         * expression.cs (CheckIndices): Fix minor bug where the wrong
23944         variable was being referred to ;-)
23945
23946         (DoEmit): Do not call EmitStaticInitializers when the 
23947         underlying type is System.Object.
23948
23949 2001-12-21  Ravi Pratap  <ravi@ximian.com>
23950
23951         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
23952         and do the usual workaround for SRE.
23953
23954         * class.cs (MyEventBuilder.EventType): New member to get at the type
23955         of the event, quickly.
23956
23957         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
23958
23959         * assign.cs (Assign.DoResolve): Handle the case when the target
23960         is an EventExpr and perform the necessary checks.
23961
23962         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
23963         interface.
23964
23965         (SimpleName.MemberStaticCheck): Include check for EventExpr.
23966
23967         (EventExpr): Set the type in the constructor itself since we 
23968         are meant to be born fully resolved.
23969
23970         (EventExpr.Define): Revert code I wrote earlier.
23971                 
23972         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
23973         instance expression is null. The instance expression is a This in that case
23974         or a null, depending on whether it is a static method or not.
23975
23976         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
23977         refers to more than one method.
23978
23979         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
23980         and accordingly flag errors.
23981
23982 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
23983
23984         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
23985
23986 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
23987
23988         * location.cs (ToString): Provide useful rutine.
23989
23990 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
23991
23992         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
23993         objects, return the actual integral boxed.
23994
23995         * statement.cs (SwitchLabel): define an ILLabel for each
23996         SwitchLabel. 
23997
23998         (Switch.CheckSwitch): If the value is a Literal, extract
23999         the underlying literal.
24000
24001         Also in the unused hashtable we had, add the SwitchLabel so we can
24002         quickly look this value up.
24003
24004         * constant.cs: Implement a bunch of new constants.  Rewrite
24005         Literal based on this.  Made changes everywhere to adapt to this.
24006
24007         * expression.cs (Expression.MakeByteBlob): Optimize routine by
24008         dereferencing array only once, and also copes with enumrations.
24009
24010         bytes are two bytes wide, not one.
24011
24012         (Cast): Perform constant conversions.
24013
24014         * ecore.cs (TryImplicitIntConversion): Return literals instead of
24015         wrappers to the literals here.
24016
24017         * expression.cs (DoNumericPromotions): long literals can converted
24018         to ulong implicity (this is taken care of elsewhere, but I was
24019         missing this spot).
24020
24021         * ecore.cs (Expression.Literalize): Make the return type Literal,
24022         to improve type checking.
24023
24024         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
24025
24026 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
24027
24028         * literal.cs: Revert code from ravi that checked the bounds.  The
24029         bounds are sane by the definition of the type itself. 
24030
24031         * typemanager.cs: Fix implementation of ImplementsInterface.  We
24032         need to actually look up in our parent hierarchy for interfaces
24033         implemented. 
24034
24035         * const.cs: Use the underlying type for enumerations
24036
24037         * delegate.cs: Compute the basename for the delegate creation,
24038         that should fix the delegate test case, and restore the correct
24039         Type Lookup semantics in rootcontext
24040
24041         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
24042         referencing a nested type with the Reflection API is using the "+"
24043         sign. 
24044
24045         * cs-parser.jay: Do not require EOF token at the end.
24046
24047 2001-12-20  Ravi Pratap  <ravi@ximian.com>
24048
24049         * rootcontext.cs (LookupType): Concatenate type names with
24050         a '.' instead of a '+' The test suite passes again.
24051
24052         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
24053         field of the enumeration.
24054
24055         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
24056         the case when the member is an EventExpr.
24057
24058         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
24059         static has an associated instance expression.
24060
24061         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
24062
24063         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
24064
24065         * class.cs (Event.Define): Register event and perform appropriate checks
24066         for error #111.
24067
24068         We define the Add and Remove methods even if the use provides none because
24069         in that case, we provide default implementations ourselves.
24070
24071         Define a private field of the type of the event. This is done by the CSC compiler
24072         and we should be doing it too ;-)
24073
24074         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
24075         More methods we use in code we generate.
24076
24077         (multicast_delegate_type, delegate_type): Two separate types since the distinction
24078         is important.
24079
24080         (InitCoreTypes): Update accordingly for the above.
24081
24082         * class.cs (Event.Emit): Generate code for default accessors that we provide
24083
24084         (EmitDefaultMethod): Do the job in the above.
24085
24086         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
24087         appropriate place.
24088
24089 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
24090
24091         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
24092         builders even if we were missing one.
24093
24094         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
24095         pass the Basename as our class name instead of the Name.  The
24096         basename will be correctly composed for us.
24097
24098         * parameter.cs (Paramters): Now takes a Location argument.
24099
24100         * decl.cs (DeclSpace.LookupType): Removed convenience function and
24101         make all the code call directly LookupType in RootContext and take
24102         this chance to pass the Location information everywhere.
24103
24104         * Everywhere: pass Location information.
24105
24106 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
24107
24108         * class.cs (Constructor.Define): Updated way of detecting the
24109         length of the parameters.
24110
24111         (TypeContainer.DefineType): Use basename as the type name for
24112         nested types.
24113
24114         (TypeContainer.Define): Do not recursively define types here, as
24115         definition is taken care in order by the RootContext.
24116
24117         * tree.cs: Keep track of namespaces in a per-file basis.
24118
24119         * parameter.cs (Parameter.ComputeSignature): Update to use
24120         DeclSpace. 
24121
24122         (Parameters.GetSignature): ditto.
24123
24124         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
24125         instead of a TypeContainer.
24126
24127         (Interface.SemanticAnalysis): Use `this' instead of our parent to
24128         resolve names.  Because we need to be resolve in our context, not
24129         our parents.
24130
24131         * driver.cs: Implement response files.
24132
24133         * class.cs (TypeContainer.DefineType): If we are defined, do not
24134         redefine ourselves.
24135
24136         (Event.Emit): Emit the code for add/remove handlers.
24137         (Event.Define): Save the MethodBuilders for add/remove.
24138
24139         * typemanager.cs: Use pair here too.
24140
24141         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
24142         DictionaryEntry requires the first argument to be non-null.  
24143
24144         (enum_declaration): Compute full name for registering the
24145         enumeration.
24146
24147         (delegate_declaration): Instead of using
24148         formal_parameter_list, use opt_formal_parameter_list as the list
24149         can be empty.
24150
24151         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
24152         (EventParsing): New property that controls whether `add' and
24153         `remove' are returned as tokens or identifiers (for events);
24154
24155 2001-12-19  Ravi Pratap  <ravi@ximian.com>
24156
24157         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
24158         use MyEventBuilder only and let it wrap the real builder for us.
24159
24160         (MyEventBuilder): Revamp constructor etc.
24161
24162         Implement all operations that we perform on EventBuilder in precisely the same
24163         way here too.
24164
24165         (FindMembers): Update to use the EventBuilder member.
24166
24167         (Event.Emit): Update accordingly.
24168
24169 2001-12-18  Ravi Pratap  <ravi@ximian.com>
24170
24171         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
24172         by calling the appropriate methods.
24173
24174         (GetCustomAttributes): Make stubs as they cannot possibly do anything
24175         useful.
24176
24177         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
24178
24179 2001-12-17  Ravi Pratap  <ravi@ximian.com>
24180
24181         * delegate.cs (Delegate.Populate): Check that the return type
24182         and various parameters types are indeed accessible.
24183
24184         * class.cs (Constructor.Define): Same here.
24185
24186         (Field.Define): Ditto.
24187
24188         (Event.Define): Ditto.
24189
24190         (Operator.Define): Check that the underlying Method defined itself
24191         correctly - so it's MethodBuilder should not be null.
24192
24193         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
24194         expression happens to be null.
24195
24196         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
24197         members but as of now we don't seem to be able to do anything really useful with it.
24198
24199         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
24200         not the EventBuilder.
24201
24202 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
24203
24204         * cs-tokenizer.cs: Add support for defines.
24205         Add support for #if, #elif, #else, #endif
24206
24207         (eval_var): evaluates a variable.
24208         (eval): stubbed for evaluating functions.
24209
24210         * cs-parser.jay: Pass the defines information
24211
24212         * driver.cs: Add --define command line option.
24213
24214         * decl.cs: Move MemberCore here.
24215
24216         Make it the base class for DeclSpace.  This allows us to catch and
24217         report 108 and 109 for everything now.
24218
24219         * class.cs (TypeContainer.Define): Extract all the members
24220         before populating and emit the warning 108 (new keyword required
24221         to override) instead of having each member implement this.
24222
24223         (MemberCore.Define): New abstract method, we will be using this in
24224         the warning reporting engine in Populate.
24225
24226         (Operator.Define): Adjust to new MemberCore protocol. 
24227
24228         * const.cs (Const): This does not derive from Expression, it is a
24229         temporary object we use to create fields, it is a MemberCore. 
24230
24231         * class.cs (Method.Define): Allow the entry point to be in a
24232         specific class.
24233
24234         * driver.cs: Rewrite the argument handler to clean it up a bit.
24235
24236         * rootcontext.cs: Made it just an auxiliary namespace feature by
24237         making everything static.
24238
24239         * driver.cs: Adapt code to use RootContext type name instead of
24240         instance variable.
24241
24242         * delegate.cs: Remove RootContext argument.
24243
24244         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
24245         argument. 
24246
24247         * class.cs (Event.Define): The lookup can fail.
24248
24249         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
24250
24251         * expression.cs: Resolve the this instance before invoking the code.
24252
24253 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
24254
24255         * cs-parser.jay: Add a production in element_access that allows
24256         the thing to become a "type" reference.  This way we can parse
24257         things like "(string [])" as a type.
24258
24259         Note that this still does not handle the more complex rules of
24260         casts. 
24261
24262
24263         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
24264
24265         * ecore.cs: (CopyNewMethods): new utility function used to
24266         assemble the list of methods from running FindMembers.
24267
24268         (MemberLookup): Rework FindMembers so that 
24269
24270 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
24271
24272         * class.cs (TypeContainer): Remove Delegates who fail to be
24273         defined.
24274
24275         * delegate.cs (Populate): Verify that we dont get null return
24276         values.   TODO: Check for AsAccessible.
24277
24278         * cs-parser.jay: Use basename to emit error 574 (destructor should
24279         have the same name as container class), not the full name.
24280
24281         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
24282         possible representation.  
24283
24284         Also implements integer type suffixes U and L.
24285
24286 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
24287
24288         * expression.cs (ArrayCreation.DoResolve): We need to do the
24289         argument resolution *always*.
24290
24291         * decl.cs: Make this hold the namespace.  Hold the root context as
24292         well.
24293         (LookupType): Move here.
24294
24295         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
24296
24297         * location.cs (Row, Name): Fixed the code, it was always returning
24298         references to the first file.
24299
24300         * interface.cs: Register properties defined through interfaces.
24301
24302         * driver.cs: Add support for globbing on the command line
24303
24304         * class.cs (Field): Make it derive from MemberCore as well.
24305         (Event): ditto.
24306
24307 2001-12-15  Ravi Pratap  <ravi@ximian.com>
24308
24309         * class.cs (Event::Define): Check that the type of the event is a delegate
24310         type else flag error #66.
24311
24312         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
24313         same.
24314
24315         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
24316         values of EntryPoint, CharSet etc etc.
24317
24318         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
24319
24320         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
24321         be null and we should ignore this. I am not sure if this is really clean. Apparently,
24322         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
24323         which needs this to do its work.
24324
24325         * ../errors/cs0066.cs : Add.
24326
24327 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
24328
24329         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
24330         helper functions.
24331
24332         * class.cs: (MethodSignature.MethodSignature): Removed hack that
24333         clears out the parameters field.
24334         (MemberSignatureCompare): Cleanup
24335
24336         (MemberCore): New base class used to share code between MethodCore
24337         and Property.
24338
24339         (RegisterRequiredImplementations) BindingFlags.Public requires
24340         either BindingFlags.Instace or Static.  Use instance here.
24341
24342         (Property): Refactored code to cope better with the full spec.
24343
24344         * parameter.cs (GetParameterInfo): Return an empty array instead
24345         of null on error.
24346
24347         * class.cs (Property): Abstract or extern properties have no bodies.
24348
24349         * parameter.cs (GetParameterInfo): return a zero-sized array.
24350
24351         * class.cs (TypeContainer.MethodModifiersValid): Move all the
24352         method modifier validation to the typecontainer so we can reuse
24353         this on properties.
24354
24355         (MethodCore.ParameterTypes): return an empty sized array of types.
24356
24357         (Property.Define): Test property modifier validity.
24358
24359         Add tests for sealed/override too.
24360
24361         (Method.Emit): abstract or extern methods have no bodies.
24362
24363 2001-12-14  Ravi Pratap  <ravi@ximian.com>
24364
24365         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
24366         thing.
24367
24368         (Method::Define, ::Emit): Modify accordingly.
24369
24370         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
24371
24372         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
24373
24374         * makefile: Pass in /unsafe.
24375
24376 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
24377
24378         * class.cs (MakeKey): Kill routine.
24379
24380         * class.cs (TypeContainer.Define): Correctly define explicit
24381         method implementations (they require the full interface name plus
24382         the method name).
24383
24384         * typemanager.cs: Deply the PtrHashtable here and stop using the
24385         lame keys.  Things work so much better.
24386
24387         This of course broke everyone who depended on `RegisterMethod' to
24388         do the `test for existance' test.  This has to be done elsewhere.
24389
24390         * support.cs (PtrHashtable): A hashtable that avoid comparing with
24391         the object stupid Equals method (because, that like fails all over
24392         the place).  We still do not use it.
24393
24394         * class.cs (TypeContainer.SetRequiredInterface,
24395         TypeContainer.RequireMethods): Killed these two routines and moved
24396         all the functionality to RegisterRequiredImplementations.
24397
24398         (TypeContainer.RegisterRequiredImplementations): This routine now
24399         registers all the implementations required in an array for the
24400         interfaces and abstract methods.  We use an array of structures
24401         which can be computed ahead of time to reduce memory usage and we
24402         also assume that lookups are cheap as most classes will not
24403         implement too many interfaces.
24404
24405         We also avoid creating too many MethodSignatures.
24406
24407         (TypeContainer.IsInterfaceMethod): Update and optionally does not
24408         clear the "pending" bit if we find that there are problems with
24409         the declaration.
24410
24411         (TypeContainer.VerifyPendingMethods): Update to report errors of
24412         methods that look like implementations but are not.
24413
24414         (TypeContainer.Define): Add support for explicit interface method
24415         implementation. 
24416
24417 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
24418
24419         * typemanager.cs: Keep track of the parameters here instead of
24420         being a feature of the TypeContainer.
24421
24422         * class.cs: Drop the registration of parameters here, as
24423         InterfaceMethods are also interface declarations.
24424
24425         * delegate.cs: Register methods with the TypeManager not only with
24426         the TypeContainer.  This code was buggy.
24427
24428         * interface.cs: Full registation here.
24429
24430 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
24431
24432         * expression.cs: Remove reducer for binary expressions, it can not
24433         be done this way.
24434
24435         * const.cs: Put here the code that used to go into constant.cs
24436
24437         * constant.cs: Put here the code for constants, this is a new base
24438         class for Literals.
24439
24440         * literal.cs: Make Literal derive from Constant.
24441
24442 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
24443
24444         * statement.cs (Return.Emit): Report error 157 if the user
24445         attempts to return from a finally block.
24446
24447         (Return.Emit): Instead of emitting a return, jump to the end of
24448         the function.
24449
24450         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
24451         LocalBuilder to store the result of the function.  ReturnLabel is
24452         the target where we jump.
24453
24454
24455 2001-12-09  Radek Doulik  <rodo@ximian.com>
24456
24457         * cs-parser.jay: remember alias in current namespace
24458
24459         * ecore.cs (SimpleName::DoResolve): use aliases for types or
24460         namespaces
24461
24462         * class.cs (LookupAlias): lookup alias in my_namespace
24463
24464         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
24465         aliases hashtable
24466         (LookupAlias): lookup alias in this and if needed in parent
24467         namespaces
24468
24469 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
24470
24471         * support.cs: 
24472
24473         * rootcontext.cs: (ModuleBuilder) Made static, first step into
24474         making things static.  I need this to avoid passing the
24475         TypeContainer when calling ParameterType.
24476
24477         * support.cs (InternalParameters.ParameterType): Remove ugly hack
24478         that did string manipulation to compute the type and then call
24479         GetType.  Use Parameter.ParameterType instead.
24480
24481         * cs-tokenizer.cs: Consume the suffix for floating values.
24482
24483         * expression.cs (ParameterReference): figure out whether this is a
24484         reference parameter or not.  Kill an extra variable by computing
24485         the arg_idx during emission.
24486
24487         * parameter.cs (Parameters.GetParameterInfo): New overloaded
24488         function that returns whether a parameter is an out/ref value or not.
24489
24490         (Parameter.ParameterType): The type of the parameter (base,
24491         without ref/out applied).
24492
24493         (Parameter.Resolve): Perform resolution here.
24494         (Parameter.ExternalType): The full type (with ref/out applied).
24495
24496         * statement.cs (Using.Emit, Using.EmitExpression): Implement
24497         support for expressions on the using statement.
24498
24499 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
24500
24501         * statement.cs (Using.EmitLocalVariableDecls): Split the
24502         localvariable handling of the using statement.
24503
24504         (Block.EmitMeta): Keep track of variable count across blocks.  We
24505         were reusing slots on separate branches of blocks.
24506
24507         (Try.Emit): Emit the general code block, we were not emitting it. 
24508
24509         Check the type of the declaration to be an IDisposable or
24510         something that can be implicity converted to it. 
24511
24512         Emit conversions if required.
24513
24514         * ecore.cs (EmptyExpression): New utility class.
24515         (Expression.ImplicitConversionExists): New utility function.
24516
24517 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
24518
24519         * statement.cs (Using): Implement.
24520
24521         * expression.cs (LocalVariableReference): Support read only variables.
24522
24523         * statement.cs: Remove the explicit emit for the Leave opcode.
24524         (VariableInfo): Add a readonly field.
24525
24526 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
24527
24528         * ecore.cs (ConvCast): new class used to encapsulate the various
24529         explicit integer conversions that works in both checked and
24530         unchecked contexts.
24531
24532         (Expression.ConvertNumericExplicit): Use new ConvCast class to
24533         properly generate the overflow opcodes.
24534
24535 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
24536
24537         * statement.cs: The correct type for the EmptyExpression is the
24538         element_type, not the variable type.  Ravi pointed this out.
24539
24540 2001-12-04  Ravi Pratap  <ravi@ximian.com>
24541
24542         * class.cs (Method::Define): Handle PInvoke methods specially
24543         by using DefinePInvokeMethod instead of the usual one.
24544
24545         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
24546         above to do the task of extracting information and defining the method.
24547
24548 2001-12-04  Ravi Pratap  <ravi@ximian.com>
24549
24550         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
24551         of the condition for string type.
24552
24553         (Emit): Move that here. 
24554
24555         (ArrayCreation::CheckIndices): Keep string literals in their expression
24556         form.
24557
24558         (EmitDynamicInitializers): Handle strings appropriately.
24559
24560 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
24561
24562         * codegen.cs (EmitContext): Replace multiple variables with a
24563         single pointer to the current Switch statement.
24564
24565         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
24566         EmitContext.
24567
24568 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
24569
24570         * statement.cs 
24571
24572         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
24573         default'.
24574
24575         (Foreach.Emit): Foreach on arrays was not setting
24576         up the loop variables (for break/continue).
24577
24578         (GotoCase): Semi-implented.
24579
24580 2001-12-03  Ravi Pratap  <ravi@ximian.com>
24581
24582         * attribute.cs (CheckAttribute): Handle system attributes by using
24583         Attribute.GetAttributes to examine information we need.
24584
24585         (GetValidPlaces): Same here.
24586
24587         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
24588
24589         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
24590
24591         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
24592
24593         (Method::Define): Set appropriate flags if we have a DllImport attribute.
24594
24595         (Method::Emit): Handle the case when we are a PInvoke method.
24596
24597 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
24598
24599         * expression.cs: Use ResolveWithSimpleName on compound names.
24600
24601 2001-12-02  Ravi Pratap  <ravi@ximian.com>
24602
24603         * constant.cs (EmitConstant): Make sure we resolve the associated expression
24604         before trying to reduce it.
24605
24606         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
24607
24608         * constant.cs (LookupConstantValue): Implement.
24609
24610         (EmitConstant): Use the above in emitting the constant.
24611
24612         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
24613         that are user-defined by doing a LookupConstantValue on them.
24614
24615         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
24616         too, like above.
24617
24618 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
24619
24620         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
24621
24622         (BaseAccess.DoResolve): Implement.
24623
24624         (MemberAccess.DoResolve): Split this routine into a
24625         ResolveMemberAccess routine that can be used independently
24626
24627 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
24628
24629         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
24630         As that share bits of the implementation.  Is returns a boolean,
24631         while As returns the Type that is being probed.
24632
24633 2001-12-01  Ravi Pratap  <ravi@ximian.com>
24634
24635         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
24636         instead of a Literal - much easier.
24637
24638         (EnumInTransit): Remove - utterly useless :-)
24639
24640         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
24641
24642         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
24643
24644         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
24645         chain when we have no associated expression.
24646
24647 2001-11-30  Ravi Pratap  <ravi@ximian.com>
24648
24649         * constant.cs (Define): Use Location while reporting the errror.
24650
24651         Also emit a warning when 'new' is used and there is no inherited
24652         member to hide.
24653
24654         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
24655         populated.
24656
24657         (LookupEnumValue): Implement to lookup an enum member's value and define it
24658         if necessary.
24659
24660         (Populate): Re-write accordingly to use the above routine.
24661
24662 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
24663
24664         * expression.cs (This): Fix prototype for DoResolveLValue to
24665         override the base class DoResolveLValue.
24666
24667         * cs-parser.cs: Report errors cs574 and cs575 (destructor
24668         declarations) 
24669
24670         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
24671         (we need to load the address of the field here).  This fixes
24672         test-22. 
24673
24674         (FieldExpr.DoResolveLValue): Call the DoResolve
24675         function to initialize the Instance expression.
24676
24677         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
24678         correctly the GetEnumerator operation on a value type.
24679
24680         * cs-parser.jay: Add more simple parsing error catches.
24681
24682         * statement.cs (Switch): Add support for string switches.
24683         Handle null specially.
24684
24685         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
24686
24687 2001-11-28  Ravi Pratap  <ravi@ximian.com>
24688
24689         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
24690
24691         (declare_local_constant): New helper function.
24692
24693         * statement.cs (AddConstant): Keep a separate record of constants
24694
24695         (IsConstant): Implement to determine if a variable is a constant.
24696
24697         (GetConstantExpression): Implement.
24698
24699         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
24700
24701         * statement.cs (IsVariableDefined): Re-write.
24702
24703 2001-11-27  Ravi Pratap  <ravi@ximian.com>
24704
24705         * class.cs (TypeContainer::FindMembers): Look for constants
24706         in the case when we are looking for MemberTypes.Field
24707
24708         * expression.cs (MemberAccess::DoResolve): Check that in the
24709         case we are a FieldExpr and a Literal, we are not being accessed
24710         by an instance reference.
24711
24712         * cs-parser.jay (local_constant_declaration): Implement.
24713
24714         (declaration_statement): Implement for constant declarations.
24715
24716 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
24717
24718         * statement.cs (Switch): Catch double defaults.
24719
24720         (Switch): More work on the switch() statement
24721         implementation.  It works for integral values now, need to finish
24722         string support.
24723
24724
24725 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
24726
24727         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
24728         integer literals into other integer literals.  To be used by
24729         switch. 
24730
24731 2001-11-24  Ravi Pratap  <ravi@ximian.com>
24732
24733         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
24734         some memory.
24735
24736         (EmitDynamicInitializers): Cope with the above since we extract data
24737         directly from ArrayData now.
24738
24739         (ExpectInitializers): Keep track of whether initializers are mandatory
24740         or not.
24741
24742         (Bounds): Make it a hashtable to prevent the same dimension being 
24743         recorded for every element in that dimension.
24744
24745         (EmitDynamicInitializers): Fix bug which prevented the Set array method
24746         from being found.
24747
24748         Also fix bug which was causing the indices to be emitted in the reverse
24749         order.
24750
24751 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
24752
24753         * expression.cs (ArrayCreation): Implement the bits that Ravi left
24754         unfinished.  They do not work, because the underlying code is
24755         sloppy.
24756
24757 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
24758
24759         * cs-parser.jay: Remove bogus fixme.
24760
24761         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
24762         on Switch statement.
24763
24764 2001-11-23  Ravi Pratap  <ravi@ximian.com>
24765
24766         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
24767         the same. 
24768
24769         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
24770         parameter. Apparently, any expression is allowed. 
24771
24772         (ValidateInitializers): Update accordingly.
24773
24774         (CheckIndices): Fix some tricky bugs thanks to recursion.
24775
24776         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
24777         I was being completely brain-dead.
24778
24779         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
24780         and re-write acordingly.
24781
24782         (DelegateInvocation): Re-write accordingly.
24783
24784         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
24785
24786         (MakeByteBlob): Handle types more correctly.
24787
24788         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
24789         initialization from expressions but it is incomplete because I am a complete
24790         Dodo :-|
24791
24792 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
24793
24794         * statement.cs (If.Emit): Fix a bug that generated incorrect code
24795         on If.  Basically, we have to return `true' (ie, we do return to
24796         our caller) only if both branches of the if return.
24797
24798         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
24799         short-circuit operators, handle them as short circuit operators. 
24800
24801         (Cast.DoResolve): Resolve type.
24802         (Cast.Cast): Take an expression as the target type.
24803
24804         * cs-parser.jay (cast_expression): Remove old hack that only
24805         allowed a limited set of types to be handled.  Now we take a
24806         unary_expression and we resolve to a type during semantic
24807         analysis.
24808
24809         Use the grammar productions from Rhys to handle casts (this is
24810         not complete like Rhys syntax yet, we fail to handle that corner
24811         case that C# has regarding (-x), but we will get there.
24812
24813 2001-11-22  Ravi Pratap  <ravi@ximian.com>
24814
24815         * class.cs (EmitFieldInitializer): Take care of the case when we have a
24816         field which is an array type.
24817
24818         * cs-parser.jay (declare_local_variables): Support array initialization too.
24819
24820         * typemanager.cs (MakeKey): Implement.
24821
24822         (everywhere): Use the above appropriately.
24823
24824         * cs-parser.jay (for_statement): Update for array initialization while
24825         declaring variables.
24826
24827         * ecore.cs : The error message was correct, it's the variable's names that
24828         were misleading ;-) Make the code more readable.
24829
24830         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
24831         the correct type etc.
24832
24833         (ConvertExplicit): Handle Enum types by examining the underlying type.
24834
24835 2001-11-21  Ravi Pratap  <ravi@ximian.com>
24836
24837         * parameter.cs (GetCallingConvention): Always return
24838         CallingConventions.Standard for now.
24839
24840 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
24841
24842         * expression.cs (Binary.ResolveOperator): Update the values of `l'
24843         and `r' after calling DoNumericPromotions.
24844
24845         * ecore.cs: Fix error message (the types were in the wrong order).
24846
24847         * statement.cs (Foreach.ProbeCollectionType): Need to pass
24848         BindingFlags.Instance as well 
24849
24850         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
24851         implicit int literal conversion in an empty cast so that we
24852         propagate the right type upstream.
24853
24854         (UnboxCast): new class used to unbox value types.
24855         (Expression.ConvertExplicit): Add explicit type conversions done
24856         by unboxing.
24857
24858         (Expression.ImplicitNumericConversion): Oops, forgot to test for
24859         the target type before applying the implicit LongLiterals to ULong
24860         literal cast.
24861
24862 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
24863
24864         * cs-parser.jay (for_statement): Reworked the way For works: now
24865         we declare manually any variables that are introduced in
24866         for_initializer to solve the problem of having out-of-band code
24867         emition (that is what got for broken).
24868
24869         (declaration_statement): Perform the actual variable declaration
24870         that used to be done in local_variable_declaration here.
24871
24872         (local_variable_declaration): Do not declare anything, just pass
24873         the information on a DictionaryEntry
24874
24875 2001-11-20  Ravi Pratap  <ravi@ximian.com>
24876
24877         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
24878         re-write of the logic to now make it recursive.
24879
24880         (UpdateIndices): Re-write accordingly.
24881
24882         Store element data in a separate ArrayData list in the above methods.
24883
24884         (MakeByteBlob): Implement to dump the array data into a byte array.
24885
24886 2001-11-19  Ravi Pratap  <ravi@ximian.com>
24887
24888         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
24889         into CheckIndices.
24890
24891         * constant.cs (Define): Implement.
24892
24893         (EmitConstant): Re-write fully.
24894
24895         Pass in location info.
24896
24897         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
24898         respectively.
24899
24900         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
24901         DictionaryEntry since we need location info too.
24902
24903         (constant_declaration): Update accordingly.
24904
24905         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
24906         code into another method : UpdateIndices.
24907
24908 2001-11-18  Ravi Pratap  <ravi@ximian.com>
24909
24910         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
24911         some type checking etc.
24912
24913 2001-11-17  Ravi Pratap  <ravi@ximian.com>
24914
24915         * expression.cs (ArrayCreation::ValidateInitializers): Implement
24916         bits to provide dimension info if the user skips doing that.
24917
24918         Update second constructor to store the rank correctly.
24919
24920 2001-11-16  Ravi Pratap  <ravi@ximian.com>
24921
24922         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
24923         and try to implement.
24924
24925         * ../errors/cs0150.cs : Add.
24926
24927         * ../errors/cs0178.cs : Add.
24928
24929 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
24930
24931         * statement.cs: Implement foreach on multi-dimensional arrays. 
24932
24933         * parameter.cs (Parameters.GetParameterByName): Also lookup the
24934         name of the params argument.
24935
24936         * expression.cs: Use EmitStoreOpcode to get the right opcode while
24937         initializing the array.
24938
24939         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
24940         we can use this elsewhere.
24941
24942         * statement.cs: Finish implementation of foreach for single
24943         dimension arrays.
24944
24945         * cs-parser.jay: Use an out-of-band stack to pass information
24946         around, I wonder why I need this.
24947
24948         foreach_block: Make the new foreach_block the current_block.
24949
24950         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
24951         function used to return a static Parameters structure.  Used for
24952         empty parameters, as those are created very frequently.
24953
24954         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
24955
24956 2001-11-15  Ravi Pratap  <ravi@ximian.com>
24957
24958         * interface.cs : Default modifier is private, not public. The
24959         make verify test passes again.
24960
24961 2001-11-15  Ravi Pratap  <ravi@ximian.com>
24962
24963         * support.cs (ReflectionParameters): Fix logic to determine
24964         whether the last parameter is a params one. Test 9 passes again.
24965
24966         * delegate.cs (Populate): Register the builders we define with
24967         RegisterParameterForBuilder. Test 19 passes again.
24968
24969         * cs-parser.jay (property_declaration): Reference $6 instead
24970         of $$ to get at the location.
24971
24972         (indexer_declaration): Similar stuff.
24973
24974         (attribute): Ditto.
24975
24976         * class.cs (Property): Register parameters for the Get and Set methods
24977         if they exist. Test 23 passes again.
24978
24979         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
24980         call to EmitArguments as we are sure there aren't any params arguments. 
24981         Test 32 passes again.
24982
24983         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
24984         IndexOutOfRangeException. 
24985
24986         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
24987         Test 33 now passes again.
24988
24989 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
24990
24991         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
24992         broke a bunch of things.  Will have to come up with a better way
24993         of tracking locations.
24994
24995         * statement.cs: Implemented foreach for single dimension arrays.
24996
24997 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
24998
24999         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
25000         an error.  This removes the lookup from the critical path.
25001
25002         * cs-parser.jay: Removed use of temporary_loc, which is completely
25003         broken. 
25004
25005 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
25006
25007         * support.cs (ReflectionParameters.ParameterModifier): Report
25008         whether the argument is a PARAMS argument or not.
25009
25010         * class.cs: Set the attribute `ParamArrayAttribute' on the
25011         parameter argument.
25012
25013         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
25014         and cons_param_array_attribute (ConstructorInfo for
25015         ParamArrayAttribute)., 
25016
25017         * codegen.cs: Emit the return using the `Return' statement, that
25018         way we can report the error correctly for missing return values. 
25019
25020         * class.cs (Method.Emit): Clean up.
25021
25022         * expression.cs (Argument.Resolve): Take another argument: the
25023         location where this argument is used.  Notice that this is not
25024         part of the "Argument" class as to reduce the size of the
25025         structure (we know the approximate location anyways).
25026
25027         Test if the argument is a variable-reference, if not, then
25028         complain with a 206.
25029
25030         (Argument.Emit): Emit addresses of variables.
25031
25032         (Argument.FullDesc): Simplify.
25033
25034         (Invocation.DoResolve): Update for Argument.Resolve.
25035
25036         (ElementAccess.DoResolve): ditto.
25037
25038         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
25039         method should be virtual, as this method is always virtual.
25040
25041         (NewDelegate.DoResolve): Update for Argument.Resolve.
25042
25043         * class.cs (ConstructorInitializer.DoResolve): ditto.
25044
25045         * attribute.cs (Attribute.Resolve): ditto.
25046
25047 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
25048
25049         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
25050
25051         * expression.cs (ParameterReference): Drop IStackStorage and implement
25052         IAssignMethod instead. 
25053
25054         (LocalVariableReference): ditto.
25055
25056         * ecore.cs (FieldExpr): Drop IStackStorage and implement
25057         IAssignMethod instead. 
25058
25059 2001-11-13  Miguel de Icaza <miguel@ximian.com>
25060
25061         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
25062         enumerations that are used in heavily used structures derive from
25063         byte in a laughable and pathetic attempt to reduce memory usage.
25064         This is the kind of pre-optimzations that you should not do at
25065         home without adult supervision.
25066
25067         * expression.cs (UnaryMutator): New class, used to handle ++ and
25068         -- separatedly from the other unary operators.  Cleans up the
25069         code, and kills the ExpressionStatement dependency in Unary.
25070
25071         (Unary): Removed `method' and `Arguments' from this class, making
25072         it smaller, and moving it all to SimpleCall, so I can reuse this
25073         code in other locations and avoid creating a lot of transient data
25074         strucutres when not required.
25075
25076         * cs-parser.jay: Adjust for new changes.
25077
25078 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
25079
25080         * enum.cs (Enum.Populate): If there is a failure during
25081         definition, return
25082
25083         * cs-parser.jay (opt_enum_base): we used to catch type errors
25084         here, but this is really incorrect.  The type error should be
25085         catched during semantic analysis.
25086
25087 2001-12-11  Ravi Pratap  <ravi@ximian.com>
25088
25089         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
25090         current_local_parameters as expected since I, in my stupidity, had forgotten
25091         to do this :-)
25092
25093         * attribute.cs (GetValidPlaces): Fix stupid bug.
25094
25095         * class.cs (Method::Emit): Perform check on applicability of attributes.
25096
25097         (Constructor::Emit): Ditto.
25098
25099         (Field::Emit): Ditto.
25100
25101         (Field.Location): Store location information.
25102
25103         (Property, Event, Indexer, Operator): Ditto.
25104
25105         * cs-parser.jay (field_declaration): Pass in location for each field.
25106
25107         * ../errors/cs0592.cs : Add.
25108
25109 2001-11-12  Ravi Pratap  <ravi@ximian.com>
25110
25111         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
25112
25113         (InitCoreTypes): Update accordingly.
25114
25115         (RegisterAttrType, LookupAttr): Implement.
25116
25117         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
25118         info about the same.
25119
25120         (Resolve): Update to populate the above as necessary.
25121
25122         (Error592): Helper.
25123
25124         (GetValidPlaces): Helper to the above.
25125
25126         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
25127
25128         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
25129
25130 2001-11-12  Ravi Pratap  <ravi@ximian.com>
25131
25132         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
25133
25134         * ../errors/cs0617.cs : Add.
25135
25136 2001-11-11  Ravi Pratap  <ravi@ximian.com>
25137
25138         * enum.cs (Emit): Rename to Populate to be more consistent with what
25139         we expect it to do and when exactly it is called.
25140
25141         * class.cs, rootcontext.cs : Update accordingly.
25142
25143         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
25144         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
25145
25146         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
25147
25148         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
25149         of a fieldinfo using the above, when dealing with a FieldBuilder.
25150
25151 2001-11-10  Ravi Pratap  <ravi@ximian.com>
25152
25153         * ../errors/cs0031.cs : Add.
25154
25155         * ../errors/cs1008.cs : Add.
25156
25157         * ../errrors/cs0543.cs : Add.
25158
25159         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
25160         enum type.
25161
25162         (FindMembers): Implement.
25163
25164         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
25165         enums and delegates too.
25166
25167         (enum_types): Rename to builder_to_enum.
25168
25169         (delegate_types): Rename to builder_to_delegate.
25170
25171         * delegate.cs (FindMembers): Implement.
25172
25173 2001-11-09  Ravi Pratap  <ravi@ximian.com>
25174
25175         * typemanager.cs (IsEnumType): Implement.
25176
25177         * enum.cs (Emit): Re-write parts to account for the underlying type
25178         better and perform checking etc.
25179
25180         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
25181         of the underlying type.
25182
25183         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
25184         value
25185
25186         * enum.cs (error31): Helper to report error #31.
25187
25188         * cs-parser.jay (enum_declaration): Store location of each member too.
25189
25190         * enum.cs (member_to_location): New hashtable. 
25191
25192         (AddEnumMember): Update location hashtable.
25193
25194         (Emit): Use the location of each member while reporting errors.
25195
25196 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
25197
25198         * cs-parser.jay: A for_initializer if is a
25199         local_variable_declaration really ammount to have an implicit
25200         block with the variable declaration and no initializer for for.
25201
25202         * statement.cs (For.Emit): Cope with null initializers.
25203
25204         This fixes the infinite loop on for initializers.
25205
25206 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
25207
25208         * enum.cs: More cleanup.
25209
25210         * ecore.cs: Remove dead code.
25211
25212         * class.cs (Property.Emit): More simplification.
25213         (Event.Emit): ditto.
25214
25215         Reworked to have less levels of indentation.
25216
25217 2001-11-08  Ravi Pratap  <ravi@ximian.com>
25218
25219         * class.cs (Property): Emit attributes.
25220
25221         (Field): Ditto.
25222
25223         (Event): Ditto.
25224
25225         (Indexer): Ditto.
25226
25227         (Operator): Ditto.
25228
25229         * enum.cs (Emit): Ditto.
25230
25231         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
25232         Enums too.
25233
25234         * class.cs (Field, Event, etc.): Move attribute generation into the
25235         Emit method everywhere.
25236
25237         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
25238         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
25239         as we had no way of defining nested enums !
25240
25241         * rootcontext.cs : Adjust code accordingly.
25242
25243         * typemanager.cs (AddEnumType): To keep track of enum types separately.
25244
25245 2001-11-07  Ravi Pratap  <ravi@ximian.com>
25246
25247         * expression.cs (EvalConstantExpression): Move into ecore.cs
25248
25249         * enum.cs (Enum): Rename some members and make them public and readonly
25250         according to our convention.
25251
25252         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
25253         nothing else.
25254
25255         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
25256
25257         (Enum::Emit): Write a simple version for now which doesn't try to compute
25258         expressions. I shall modify this to be more robust in just a while.
25259
25260         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
25261
25262         (TypeContainer::CloseType): Create the Enum types too.
25263
25264         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
25265
25266         * expression.cs (EvalConstantExpression): Get rid of completely.
25267
25268         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
25269         user-defined values and other cases.
25270
25271         (IsValidEnumLiteral): Helper function.
25272
25273         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
25274         out there in the case we had a literal FieldExpr.
25275
25276         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
25277
25278         (Literalize): Revamp a bit to take two arguments.
25279
25280         (EnumLiteral): New class which derives from Literal to wrap enum literals.
25281
25282 2001-11-06  Ravi Pratap  <ravi@ximian.com>
25283
25284         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
25285
25286         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
25287
25288         (Resolve): Use the above to ensure we have proper initializers.
25289
25290 2001-11-05  Ravi Pratap  <ravi@ximian.com>
25291
25292         * expression.cs (Expression::EvalConstantExpression): New method to 
25293         evaluate constant expressions.
25294
25295         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
25296
25297 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
25298
25299         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
25300         in an array.
25301
25302         (Binary.ResolveOperator): Handle operator != (object a, object b)
25303         and operator == (object a, object b);
25304
25305         (Binary.DoNumericPromotions): Indicate whether the numeric
25306         promotion was possible.
25307
25308         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
25309         Implement.  
25310
25311         Made the ArrayAccess implement interface IAssignMethod instead of
25312         IStackStore as the order in which arguments are passed reflects
25313         this.
25314
25315         * assign.cs: Instead of using expr.ExprClass to select the way of
25316         assinging, probe for the IStackStore/IAssignMethod interfaces.
25317
25318         * typemanager.cs: Load InitializeArray definition.
25319
25320         * rootcontext.cs (RootContext.MakeStaticData): Used to define
25321         static data that can be used to initialize arrays. 
25322
25323 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
25324
25325         * expression.cs: Handle operator== and operator!= for booleans.
25326
25327         (Conditioal.Reduce): Implement reducer for the ?: operator.
25328
25329         (Conditional.Resolve): Implement dead code elimination.
25330
25331         (Binary.Resolve): Catch string literals and return a new
25332         concatenated string.
25333
25334         (Unary.Reduce): Implement reduction of unary expressions.
25335
25336         * ecore.cs: Split out the expression core handling here.
25337
25338         (Expression.Reduce): New method used to perform constant folding
25339         and CSE.  This is needed to support constant-expressions. 
25340
25341         * statement.cs (Statement.EmitBoolExpression): Pass true and false
25342         targets, and optimize for !x.
25343
25344 2001-11-04  Ravi Pratap  <ravi@ximian.com>
25345
25346         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
25347         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
25348         set custom atttributes.
25349
25350         * literal.cs (Literal::GetValue): New abstract method to return the actual
25351         value of the literal, cast as an object.
25352
25353         (*Literal): Implement GetValue method.
25354
25355         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
25356         expressions to the arraylist but objects of type Argument.
25357
25358         * class.cs (TypeContainer::Emit): Emit our attributes too.
25359
25360         (Method::Emit, Constructor::Emit): Ditto.
25361
25362         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
25363         to be ignoring earlier.
25364
25365 2001-11-03  Ravi Pratap  <ravi@ximian.com>
25366
25367         * attribute.cs (AttributeSection::Define): Implement to do the business
25368         of constructing a CustomAttributeBuilder.
25369
25370         (Attribute): New trivial class. Increases readability of code.  
25371
25372         * cs-parser.jay : Update accordingly.
25373
25374         (positional_argument_list, named_argument_list, named_argument): New rules
25375
25376         (attribute_arguments): Use the above so that we are more correct.
25377
25378 2001-11-02  Ravi Pratap  <ravi@ximian.com>
25379
25380         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
25381         to perform all checks for a method with a params parameter.
25382
25383         (Invocation::OverloadResolve): Update to use the above method and therefore
25384         cope correctly with params method invocations.
25385
25386         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
25387         params too.
25388
25389         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
25390         constructors in our parent too because we can't afford to miss out on 
25391         protected ones ;-)
25392
25393         * attribute.cs (AttributeSection): New name for the class Attribute
25394
25395         Other trivial changes to improve readability.
25396
25397         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
25398         use the new class names.
25399
25400 2001-11-01  Ravi Pratap  <ravi@ximian.com>
25401
25402         * class.cs (Method::Define): Complete definition for params types too
25403
25404         (Indexer::Define): Ditto.
25405
25406         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
25407         Cope everywhere with a request for info about the array parameter.
25408
25409 2001-11-01  Ravi Pratap  <ravi@ximian.com>
25410
25411         * tree.cs (RecordNamespace): Fix up to check for the correct key.
25412
25413         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
25414         local_variable_type to extract the string corresponding to the type.
25415
25416         (local_variable_type): Fixup the action to use the new helper method.
25417
25418         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
25419         go.
25420
25421         * expression.cs : Clean out code which uses the above.
25422
25423 2001-10-31  Ravi Pratap  <ravi@ximian.com>
25424
25425         * typemanager.cs (RegisterMethod): Check if we already have an existing key
25426         and bale out if necessary by returning a false.
25427
25428         (RegisterProperty): Ditto.
25429
25430         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
25431         and print out appropriate error messages.
25432
25433         * interface.cs (everywhere): Ditto.
25434
25435         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
25436         location to constructor.
25437
25438         * class.cs (Property, Event, Indexer): Update accordingly.
25439
25440         * ../errors/cs111.cs : Added.
25441
25442         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
25443         of a method, as laid down by the spec.
25444
25445         (Invocation::OverloadResolve): Use the above method.
25446
25447 2001-10-31  Ravi Pratap  <ravi@ximian.com>
25448
25449         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
25450         now take a TypeContainer and a Parameters object.
25451
25452         (ParameterData): Modify return type of ParameterModifier method to be 
25453         Parameter.Modifier and not a string.
25454
25455         (ReflectionParameters, InternalParameters): Update accordingly.
25456
25457         * expression.cs (Argument::GetParameterModifier): Same here.
25458
25459         * support.cs (InternalParameters::ParameterType): Find a better way of determining
25460         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
25461         symbol in it at all so maybe this is only for now.
25462
25463 2001-10-30  Ravi Pratap  <ravi@ximian.com>
25464
25465         * support.cs (InternalParameters): Constructor now takes an extra argument 
25466         which is the actual Parameters class.
25467
25468         (ParameterDesc): Update to provide info on ref/out modifiers.
25469
25470         * class.cs (everywhere): Update call to InternalParameters to pass in
25471         the second argument too.
25472
25473         * support.cs (ParameterData): Add ParameterModifier, which is a method 
25474         to return the modifier info [ref/out etc]
25475
25476         (InternalParameters, ReflectionParameters): Implement the above.
25477
25478         * expression.cs (Argument::ParameterModifier): Similar function to return
25479         info about the argument's modifiers.
25480
25481         (Invocation::OverloadResolve): Update to take into account matching modifiers 
25482         too.
25483
25484         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
25485         a new SetFormalParameters object which we pass to InternalParameters.
25486
25487 2001-10-30  Ravi Pratap  <ravi@ximian.com>
25488
25489         * expression.cs (NewArray): Merge into the ArrayCreation class.
25490
25491 2001-10-29  Ravi Pratap  <ravi@ximian.com>
25492
25493         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
25494         NewUserdefinedArray into one as there wasn't much of a use in having
25495         two separate ones.
25496
25497         * expression.cs (Argument): Change field's name to ArgType from Type.
25498
25499         (Type): New readonly property which returns the proper type, taking into 
25500         account ref/out modifiers.
25501
25502         (everywhere): Adjust code accordingly for the above.
25503
25504         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
25505         whether we are emitting for a ref or out parameter.
25506
25507         * expression.cs (Argument::Emit): Use the above field to set the state.
25508
25509         (LocalVariableReference::Emit): Update to honour the flag and emit the
25510         right stuff.
25511
25512         * parameter.cs (Attributes): Set the correct flags for ref parameters.
25513
25514         * expression.cs (Argument::FullDesc): New function to provide a full desc.
25515
25516         * support.cs (ParameterData): Add method ParameterDesc to the interface.
25517
25518         (ReflectionParameters, InternalParameters): Implement the above method.
25519
25520         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
25521         reporting errors.
25522
25523         (Invocation::FullMethodDesc): Ditto. 
25524
25525 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
25526
25527         * cs-parser.jay: Add extra production for the second form of array
25528         creation. 
25529
25530         * expression.cs (ArrayCreation): Update to reflect the above
25531         change. 
25532
25533         * Small changes to prepare for Array initialization.
25534
25535 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
25536
25537         * typemanager.cs (ImplementsInterface): interface might be null;
25538         Deal with this problem;
25539
25540         Also, we do store negative hits on the cache (null values), so use
25541         this instead of calling t.GetInterfaces on the type everytime.
25542
25543 2001-10-28  Ravi Pratap  <ravi@ximian.com>
25544
25545         * typemanager.cs (IsBuiltinType): New method to help determine the same.
25546
25547         * expression.cs (New::DoResolve): Get rid of array creation code and instead
25548         split functionality out into different classes.
25549
25550         (New::FormArrayType): Move into NewBuiltinArray.
25551
25552         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
25553         quite useless.
25554
25555         (NewBuiltinArray): New class to handle creation of built-in arrays.
25556
25557         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
25558         account creation of one-dimensional arrays.
25559
25560         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
25561
25562         (NewUserdefinedArray::DoResolve): Implement.
25563
25564         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
25565
25566         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
25567         we maintain inside the TypeManager. This is necessary to perform lookups on the
25568         module builder.
25569
25570         (LookupType): Update to perform GetType on the module builders too.     
25571
25572         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
25573
25574         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
25575
25576 2001-10-23  Ravi Pratap  <ravi@ximian.com>
25577
25578         * expression.cs (New::DoResolve): Implement guts of array creation.
25579
25580         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
25581
25582 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
25583
25584         * expression.cs: Fix bug I introduced lsat night that broke
25585         Delegates. 
25586
25587         (Expression.Resolve): Report a 246 error (can not resolve name)
25588         if we find a SimpleName in the stream.
25589
25590         (Expression.ResolveLValue): Ditto.
25591
25592         (Expression.ResolveWithSimpleName): This function is a variant of
25593         ResolveName, this one allows SimpleNames to be returned without a
25594         warning.  The only consumer of SimpleNames is MemberAccess
25595
25596 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
25597
25598         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
25599         might arrive here.  I have my doubts that this is correct.
25600
25601         * statement.cs (Lock): Implement lock statement.
25602
25603         * cs-parser.jay: Small fixes to support `lock' and `using'
25604
25605         * cs-tokenizer.cs: Remove extra space
25606
25607         * driver.cs: New flag --checked, allows to turn on integer math
25608         checking. 
25609
25610         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
25611         Threading.Monitor.Exit 
25612
25613 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
25614
25615         * expression.cs (IndexerAccess::DoResolveLValue): Set the
25616         Expression Class to be IndexerAccess.
25617
25618         Notice that Indexer::DoResolve sets the eclass to Value.
25619
25620 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
25621
25622         * class.cs (TypeContainer::Emit): Emit code for indexers.
25623
25624         * assign.cs (IAssignMethod): New interface implemented by Indexers
25625         and Properties for handling assignment.
25626
25627         (Assign::Emit): Simplify and reuse code. 
25628
25629         * expression.cs (IndexerAccess, PropertyExpr): Implement
25630         IAssignMethod, clean up old code. 
25631
25632 2001-10-22  Ravi Pratap  <ravi@ximian.com>
25633
25634         * typemanager.cs (ImplementsInterface): New method to determine if a type
25635         implements a given interface. Provides a nice cache too.
25636
25637         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
25638         method.
25639
25640         (ConvertReferenceExplicit): Ditto.
25641
25642         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
25643         various methods, with correct names etc.
25644
25645         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
25646         Operator.UnaryNegation.
25647
25648         * cs-parser.jay (operator_declarator): Be a little clever in the case where
25649         we have a unary plus or minus operator.
25650
25651         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
25652         UnaryMinus.
25653
25654         * everywhere : update accordingly.
25655
25656         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
25657         respectively.
25658
25659         * class.cs (Method::Define): For the case where we are implementing a method
25660         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
25661         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
25662
25663 2001-10-21  Ravi Pratap  <ravi@ximian.com>
25664
25665         * interface.cs (FindMembers): Implement to work around S.R.E
25666         lameness.
25667
25668         * typemanager.cs (IsInterfaceType): Implement.
25669
25670         (FindMembers): Update to handle interface types too.
25671
25672         * expression.cs (ImplicitReferenceConversion): Re-write bits which
25673         use IsAssignableFrom as that is not correct - it doesn't work.
25674
25675         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
25676         and accordingly override EmitStatement.
25677
25678         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
25679         using the correct logic :-)
25680
25681 2001-10-19  Ravi Pratap  <ravi@ximian.com>
25682
25683         * ../errors/cs-11.cs : Add to demonstrate error -11 
25684
25685 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
25686
25687         * assign.cs (Assign::Resolve): Resolve right hand side first, and
25688         then pass this as a hint to ResolveLValue.
25689
25690         * expression.cs (FieldExpr): Add Location information
25691
25692         (FieldExpr::LValueResolve): Report assignment to readonly
25693         variable. 
25694
25695         (Expression::ExprClassFromMemberInfo): Pass location information.
25696
25697         (Expression::ResolveLValue): Add new method that resolves an
25698         LValue. 
25699
25700         (Expression::DoResolveLValue): Default invocation calls
25701         DoResolve. 
25702
25703         (Indexers): New class used to keep track of indexers in a given
25704         Type. 
25705
25706         (IStackStore): Renamed from LValue, as it did not really describe
25707         what this did.  Also ResolveLValue is gone from this interface and
25708         now is part of Expression.
25709
25710         (ElementAccess): Depending on the element access type
25711
25712         * typemanager.cs: Add `indexer_name_type' as a Core type
25713         (System.Runtime.CompilerServices.IndexerNameAttribute)
25714
25715         * statement.cs (Goto): Take a location.
25716
25717 2001-10-18  Ravi Pratap  <ravi@ximian.com>
25718
25719         * delegate.cs (Delegate::VerifyDelegate): New method to verify
25720         if two delegates are compatible.
25721
25722         (NewDelegate::DoResolve): Update to take care of the case when
25723         we instantiate a delegate from another delegate.
25724
25725         * typemanager.cs (FindMembers): Don't even try to look up members
25726         of Delegate types for now.
25727
25728 2001-10-18  Ravi Pratap  <ravi@ximian.com>
25729
25730         * delegate.cs (NewDelegate): New class to take care of delegate
25731         instantiation.
25732
25733         * expression.cs (New): Split the delegate related code out into 
25734         the NewDelegate class.
25735
25736         * delegate.cs (DelegateInvocation): New class to handle delegate 
25737         invocation.
25738
25739         * expression.cs (Invocation): Split out delegate related code into
25740         the DelegateInvocation class.
25741
25742 2001-10-17  Ravi Pratap  <ravi@ximian.com>
25743
25744         * expression.cs (New::DoResolve): Implement delegate creation fully
25745         and according to the spec.
25746
25747         (New::DoEmit): Update to handle delegates differently.
25748
25749         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
25750         because of which we were printing out arguments in reverse order !
25751
25752         * delegate.cs (VerifyMethod): Implement to check if the given method
25753         matches the delegate.
25754
25755         (FullDelegateDesc): Implement.
25756
25757         (VerifyApplicability): Implement.
25758
25759         * expression.cs (Invocation::DoResolve): Update to accordingly handle
25760         delegate invocations too.
25761
25762         (Invocation::Emit): Ditto.
25763
25764         * ../errors/cs1593.cs : Added.
25765
25766         * ../errors/cs1594.cs : Added.
25767
25768         * delegate.cs (InstanceExpression, TargetMethod): New properties.
25769
25770 2001-10-16  Ravi Pratap  <ravi@ximian.com>
25771
25772         * typemanager.cs (intptr_type): Core type for System.IntPtr
25773
25774         (InitCoreTypes): Update for the same.
25775
25776         (iasyncresult_type, asynccallback_type): Ditto.
25777
25778         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
25779         correct.
25780
25781         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
25782         too.
25783
25784         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
25785         the builders for the 4 members of a delegate type :-)
25786
25787         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
25788         type.
25789
25790         * expression.cs (New::DoResolve): Implement guts for delegate creation.
25791
25792         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
25793
25794 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
25795
25796         * statement.cs (Break::Emit): Implement.   
25797         (Continue::Emit): Implement.
25798
25799         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
25800         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
25801         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
25802         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
25803         end loop
25804
25805         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
25806         properties that track the label for the current loop (begin of the
25807         loop and end of the loop).
25808
25809 2001-10-15  Ravi Pratap  <ravi@ximian.com>
25810
25811         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
25812         use of emitting anything at all.
25813
25814         * class.cs, rootcontext.cs : Get rid of calls to the same.
25815
25816         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
25817
25818         (Populate): Define the constructor correctly and set the implementation
25819         attributes.
25820
25821         * typemanager.cs (delegate_types): New hashtable to hold delegates that
25822         have been defined.
25823
25824         (AddDelegateType): Implement.
25825
25826         (IsDelegateType): Implement helper method.
25827
25828         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
25829
25830         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
25831         and accordingly handle it.
25832
25833         * delegate.cs (Populate): Take TypeContainer argument.
25834         Implement bits to define the Invoke method. However, I still haven't figured out
25835         how to take care of the native int bit :-(
25836
25837         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
25838         Qualify the name of the delegate, not its return type !
25839
25840         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
25841         conversion.
25842
25843         (StandardConversionExists): Checking for array types turns out to be recursive.
25844
25845         (ConvertReferenceExplicit): Implement array conversion.
25846
25847         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
25848
25849 2001-10-12  Ravi Pratap  <ravi@ximian.com>
25850
25851         * cs-parser.jay (delegate_declaration): Store the fully qualified
25852         name as it is a type declaration.
25853
25854         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
25855         readonly.
25856
25857         (DefineDelegate): Renamed from Define. Does the same thing essentially,
25858         as TypeContainer::DefineType.
25859
25860         (Populate): Method in which all the definition of the various methods (Invoke)
25861         etc is done.
25862
25863         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
25864         see.
25865
25866         (CloseDelegate): Finally creates the delegate.
25867
25868         * class.cs (TypeContainer::DefineType): Update to define delegates.
25869         (Populate, Emit and CloseType): Do the same thing here too.
25870
25871         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
25872         delegates in all these operations.
25873
25874 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
25875
25876         * expression.cs: LocalTemporary: a new expression used to
25877         reference a temporary that has been created.
25878
25879         * assign.cs: Handle PropertyAccess back here, so that we can
25880         provide the proper semantic access to properties.
25881
25882         * expression.cs (Expression::ConvertReferenceExplicit): Implement
25883         a few more explicit conversions. 
25884
25885         * modifiers.cs: `NEW' modifier maps to HideBySig.
25886
25887         * expression.cs (PropertyExpr): Make this into an
25888         ExpressionStatement, and support the EmitStatement code path. 
25889
25890         Perform get/set error checking, clean up the interface.
25891
25892         * assign.cs: recognize PropertyExprs as targets, and if so, turn
25893         them into toplevel access objects.
25894
25895 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
25896
25897         * expression.cs: PropertyExpr::PropertyExpr: use work around the
25898         SRE.
25899
25900         * typemanager.cs: Keep track here of our PropertyBuilders again to
25901         work around lameness in SRE.
25902
25903 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
25904
25905         * expression.cs (LValue::LValueResolve): New method in the
25906         interface, used to perform a second resolution pass for LValues. 
25907
25908         (This::DoResolve): Catch the use of this in static methods.
25909
25910         (This::LValueResolve): Implement.
25911
25912         (This::Store): Remove warning, assigning to `this' in structures
25913         is 
25914
25915         (Invocation::Emit): Deal with invocation of
25916         methods on value types.  We need to pass the address to structure
25917         methods rather than the object itself.  (The equivalent code to
25918         emit "this" for structures leaves the entire structure on the
25919         stack instead of a pointer to it). 
25920
25921         (ParameterReference::DoResolve): Compute the real index for the
25922         argument based on whether the method takes or not a `this' pointer
25923         (ie, the method is static).
25924
25925         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
25926         value types returned from functions when we need to invoke a
25927         method on the sturcture.
25928
25929
25930 2001-10-11  Ravi Pratap  <ravi@ximian.com>
25931
25932         * class.cs (TypeContainer::DefineType): Method to actually do the business of
25933         defining the type in the Modulebuilder or Typebuilder. This is to take
25934         care of nested types which need to be defined on the TypeBuilder using
25935         DefineNestedMethod.
25936
25937         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
25938         methods in RootContext, only ported to be part of TypeContainer.
25939
25940         (TypeContainer::GetInterfaceOrClass): Ditto.
25941
25942         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
25943
25944         * interface.cs (Interface::DefineInterface): New method. Does exactly
25945         what RootContext.CreateInterface did earlier, only it takes care of nested types 
25946         too.
25947
25948         (Interface::GetInterfaces): Move from RootContext here and port.
25949
25950         (Interface::GetInterfaceByName): Same here.
25951
25952         * rootcontext.cs (ResolveTree): Re-write.
25953
25954         (PopulateTypes): Re-write.
25955
25956         * class.cs (TypeContainer::Populate): Populate nested types too.
25957         (TypeContainer::Emit): Emit nested members too.
25958
25959         * typemanager.cs (AddUserType): Do not make use of the FullName property,
25960         instead just use the name argument passed in as it is already fully
25961         qualified.
25962
25963         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
25964         to TypeContainer mapping to see if a type is user-defined.
25965
25966         * class.cs (TypeContainer::CloseType): Implement. 
25967
25968         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
25969         the default constructor.
25970
25971         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
25972         twice.
25973
25974         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
25975
25976         * interface.cs (CloseType): Create the type here.
25977
25978         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
25979         the hierarchy.
25980
25981         Remove all the methods which are now in TypeContainer.
25982
25983 2001-10-10  Ravi Pratap  <ravi@ximian.com>
25984
25985         * delegate.cs (Define): Re-write bits to define the delegate
25986         correctly.
25987
25988 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
25989
25990         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
25991
25992         * expression.cs (ImplicitReferenceConversion): handle null as well
25993         as a source to convert to any reference type.
25994
25995         * statement.cs (Return): Perform any implicit conversions to
25996         expected return type.  
25997
25998         Validate use of return statement.  
25999
26000         * codegen.cs (EmitContext): Pass the expected return type here.
26001
26002         * class.cs (Method, Constructor, Property): Pass expected return
26003         type to EmitContext.
26004
26005 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
26006
26007         * expression.cs: Make DoResolve take an EmitContext instead of a
26008         TypeContainer.
26009
26010         Replaced `l' and `location' for `loc', for consistency.
26011
26012         (Error, Warning): Remove unneeded Tc argument.
26013
26014         * assign.cs, literal.cs, constant.cs: Update to new calling
26015         convention. 
26016
26017         * codegen.cs: EmitContext now contains a flag indicating whether
26018         code is being generated in a static method or not.
26019
26020         * cs-parser.jay: DecomposeQI, new function that replaces the old
26021         QualifiedIdentifier.  Now we always decompose the assembled
26022         strings from qualified_identifier productions into a group of
26023         memberaccesses.
26024
26025 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
26026
26027         * rootcontext.cs: Deal with field-less struct types correctly now
26028         by passing the size option to Define Type.
26029
26030         * class.cs: Removed hack that created one static field. 
26031
26032 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
26033
26034         * statement.cs: Moved most of the code generation here. 
26035
26036 2001-10-09  Ravi Pratap  <ravi@ximian.com>
26037
26038         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
26039         seem very right.
26040
26041         (ElementAccess): Remove useless bits for now - keep checks as the spec
26042         says.
26043
26044 2001-10-08  Ravi Pratap  <ravi@ximian.com>
26045
26046         * expression.cs (ElementAccess::DoResolve): Remove my crap code
26047         and start performing checks according to the spec.
26048
26049 2001-10-07  Ravi Pratap  <ravi@ximian.com>
26050
26051         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
26052         rank_specifiers instead.
26053
26054         (rank_specifiers): Change the order in which the rank specifiers are stored
26055
26056         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
26057
26058         * expression.cs (ElementAccess): Implement the LValue interface too.
26059
26060 2001-10-06  Ravi Pratap  <ravi@ximian.com>
26061
26062         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
26063         except that user defined conversions are not included.
26064
26065         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
26066         perform the conversion of the return type, if necessary.
26067
26068         (New::DoResolve): Check whether we are creating an array or an object
26069         and accordingly do the needful.
26070
26071         (New::Emit): Same here.
26072
26073         (New::DoResolve): Implement guts of array creation.
26074
26075         (New::FormLookupType): Helper function.
26076
26077 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
26078
26079         * codegen.cs: Removed most of the code generation here, and move the
26080         corresponding code generation bits to the statement classes. 
26081
26082         Added support for try/catch/finalize and throw.
26083
26084         * cs-parser.jay: Added support for try/catch/finalize.
26085
26086         * class.cs: Catch static methods having the flags override,
26087         virtual or abstract.
26088
26089         * expression.cs (UserCast): This user cast was not really doing
26090         what it was supposed to do.  Which is to be born in fully resolved
26091         state.  Parts of the resolution were being performed at Emit time! 
26092
26093         Fixed this code.
26094
26095 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
26096
26097         * expression.cs: Implicity convert the result from UserCast.
26098
26099 2001-10-05  Ravi Pratap  <ravi@ximian.com>
26100
26101         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
26102         prevented it from working correctly. 
26103
26104         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
26105         merely ConvertImplicit.
26106
26107 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
26108
26109         * typemanager.cs: Make the LookupTypeContainer function static,
26110         and not per-instance.  
26111
26112         * class.cs: Make static FindMembers (the one that takes a Type
26113         argument). 
26114
26115         * codegen.cs: Add EmitForeach here.
26116
26117         * cs-parser.jay: Make foreach a toplevel object instead of the
26118         inline expansion, as we need to perform semantic analysis on it. 
26119
26120 2001-10-05  Ravi Pratap  <ravi@ximian.com>
26121
26122         * expression.cs (Expression::ImplicitUserConversion): Rename to
26123         UserDefinedConversion.
26124
26125         (Expression::UserDefinedConversion): Take an extra argument specifying 
26126         whether we look for explicit user conversions too.
26127
26128         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
26129
26130         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
26131
26132         (ExplicitUserConversion): Make it a call to UserDefinedConversion
26133         with the appropriate arguments.
26134
26135         * cs-parser.jay (cast_expression): Record location too.
26136
26137         * expression.cs (Cast): Record location info.
26138
26139         (Expression::ConvertExplicit): Take location argument.
26140
26141         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
26142         to determine if we are doing explicit conversions.
26143
26144         (UserCast::Emit): Update accordingly.
26145
26146         (Expression::ConvertExplicit): Report an error if everything fails.
26147
26148         * ../errors/cs0030.cs : Add.
26149
26150 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
26151
26152         * modifiers.cs: If the ABSTRACT keyword is present, also set the
26153         virtual and newslot bits. 
26154
26155         * class.cs (TypeContainer::RegisterRequiredImplementations):
26156         Record methods we need.
26157
26158         (TypeContainer::MakeKey): Helper function to make keys for
26159         MethodBases, since the Methodbase key is useless.
26160
26161         (TypeContainer::Populate): Call RegisterRequiredImplementations
26162         before defining the methods.   
26163
26164         Create a mapping for method_builders_to_methods ahead of time
26165         instead of inside a tight loop.
26166
26167         (::RequireMethods):  Accept an object as the data to set into the
26168         hashtable so we can report interface vs abstract method mismatch.
26169
26170 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
26171
26172         * report.cs: Make all of it static.
26173
26174         * rootcontext.cs: Drop object_type and value_type computations, as
26175         we have those in the TypeManager anyways.
26176
26177         Drop report instance variable too, now it is a global.
26178
26179         * driver.cs: Use try/catch on command line handling.
26180
26181         Add --probe option to debug the error reporting system with a test
26182         suite. 
26183
26184         * report.cs: Add support for exiting program when a probe
26185         condition is reached.
26186
26187 2001-10-03  Ravi Pratap  <ravi@ximian.com>
26188
26189         * expression.cs (Binary::DoNumericPromotions): Fix the case when
26190         we do a forcible conversion regardless of type, to check if 
26191         ForceConversion returns a null.
26192
26193         (Binary::error19): Use location to report error.
26194
26195         (Unary::error23): Use location here too.
26196
26197         * ../errors/cs0019.cs : Check in.
26198
26199         * ../errors/cs0023.cs : Check in.
26200
26201         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
26202         case of a non-null MethodInfo object with a length of 0 !
26203
26204         (Binary::ResolveOperator): Flag error if overload resolution fails to find
26205         an applicable member - according to the spec :-)
26206         Also fix logic to find members in base types.
26207
26208         (Unary::ResolveOperator): Same here.
26209
26210         (Unary::report23): Change name to error23 and make first argument a TypeContainer
26211         as I was getting thoroughly confused between this and error19 :-)
26212
26213         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
26214         (::FindMostEncompassedType): Implement.
26215         (::FindMostEncompassingType): Implement.
26216         (::StandardConversionExists): Implement.
26217
26218         (UserImplicitCast): Re-vamp. We now need info about most specific
26219         source and target types so that we can do the necessary conversions.
26220
26221         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
26222         mathematical union with no duplicates.
26223
26224 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
26225
26226         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
26227         in order from base classes to child classes, so that we can in
26228         child classes look up in our parent for method names and
26229         attributes (required for handling abstract, virtual, new, override
26230         constructs: we need to instrospect our base class, and if we dont
26231         populate the classes in order, the introspection might be
26232         incorrect.  For example, a method could query its parent before
26233         the parent has any methods and would determine that the parent has
26234         no abstract methods (while it could have had them)).
26235
26236         (RootContext::CreateType): Record the order in which we define the
26237         classes.
26238
26239 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
26240
26241         * class.cs (TypeContainer::Populate): Also method definitions can
26242         fail now, keep track of this.
26243
26244         (TypeContainer::FindMembers): Implement support for
26245         DeclaredOnly/noDeclaredOnly flag.
26246
26247         (Constructor::Emit) Return the ConstructorBuilder.
26248
26249         (Method::Emit) Return the MethodBuilder. 
26250         Check for abstract or virtual methods to be public.
26251
26252         * rootcontext.cs (RootContext::CreateType): Register all the
26253         abstract methods required for the class to be complete and the
26254         interface methods that must be implemented. 
26255
26256         * cs-parser.jay: Report error 501 (method requires body if it is
26257         not marked abstract or extern).
26258
26259         * expression.cs (TypeOf::Emit): Implement.
26260
26261         * typemanager.cs: runtime_handle_type, new global type.
26262
26263         * class.cs (Property::Emit): Generate code for properties.
26264
26265 2001-10-02  Ravi Pratap  <ravi@ximian.com>
26266
26267         * expression.cs (Unary::ResolveOperator): Find operators on base type
26268         too - we now conform exactly to the spec.
26269
26270         (Binary::ResolveOperator): Same here.
26271
26272         * class.cs (Operator::Define): Fix minor quirk in the tests.
26273
26274         * ../errors/cs0215.cs : Added.
26275
26276         * ../errors/cs0556.cs : Added.
26277
26278         * ../errors/cs0555.cs : Added.
26279
26280 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
26281
26282         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
26283         single integer which is really efficient
26284
26285 2001-10-01  Ravi Pratap  <ravi@ximian.com>
26286
26287         *  expression.cs (Expression::ImplicitUserConversion): Use location
26288         even in the case when we are examining True operators.
26289  
26290         * class.cs (Operator::Define): Perform extensive checks to conform
26291         with the rules for operator overloading in the spec.
26292
26293         * expression.cs (Expression::ImplicitReferenceConversion): Implement
26294         some of the other conversions mentioned in the spec.
26295
26296         * typemanager.cs (array_type): New static member for the System.Array built-in
26297         type.
26298
26299         (cloneable_interface): For System.ICloneable interface.
26300
26301         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
26302         we start resolving the tree and populating types.
26303
26304         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
26305  
26306 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
26307
26308         * expression.cs (Expression::ExprClassFromMemberInfo,
26309         Expression::Literalize): Create literal expressions from
26310         FieldInfos which are literals.
26311
26312         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
26313         type casts, because they were wrong.  The test suite in tests
26314         caught these ones.
26315
26316         (ImplicitNumericConversion): ushort to ulong requires a widening
26317         cast. 
26318
26319         Int32 constant to long requires widening cast as well.
26320
26321         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
26322         for integers because the type on the stack is not i4.
26323
26324 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
26325
26326         * expression.cs (report118): require location argument. 
26327
26328         * parameter.cs: Do not dereference potential null value.
26329
26330         * class.cs: Catch methods that lack the `new' keyword when
26331         overriding a name.  Report warnings when `new' is used without
26332         anything being there to override.
26333
26334         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
26335
26336         * class.cs: Only add constructor to hashtable if it is non-null
26337         (as now constructors can fail on define).
26338
26339         (TypeManager, Class, Struct): Take location arguments.
26340
26341         Catch field instance initialization in structs as errors.
26342
26343         accepting_filter: a new filter for FindMembers that is static so
26344         that we dont create an instance per invocation.
26345
26346         (Constructor::Define): Catch errors where a struct constructor is
26347         parameterless 
26348
26349         * cs-parser.jay: Pass location information for various new
26350         constructs. 
26351
26352         * delegate.cs (Delegate): take a location argument.
26353
26354         * driver.cs: Do not call EmitCode if there were problesm in the
26355         Definition of the types, as many Builders wont be there. 
26356
26357         * decl.cs (Decl::Decl): Require a location argument.
26358
26359         * cs-tokenizer.cs: Handle properly hex constants that can not fit
26360         into integers, and find the most appropiate integer for it.
26361
26362         * literal.cs: Implement ULongLiteral.
26363
26364         * rootcontext.cs: Provide better information about the location of
26365         failure when CreateType fails.
26366
26367 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
26368
26369         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
26370         as well.
26371
26372         * expression.cs (Binary::CheckShiftArguments): Add missing type
26373         computation.
26374         (Binary::ResolveOperator): Add type to the logical and and logical
26375         or, Bitwise And/Or and Exclusive Or code paths, it was missing
26376         before.
26377
26378         (Binary::DoNumericPromotions): In the case where either argument
26379         is ulong (and most signed types combined with ulong cause an
26380         error) perform implicit integer constant conversions as well.
26381
26382 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
26383
26384         * expression.cs (UserImplicitCast): Method should always be
26385         non-null. 
26386         (Invocation::BetterConversion): Simplified test for IntLiteral.
26387
26388         (Expression::ImplicitNumericConversion): Split this routine out.
26389         Put the code that performs implicit constant integer conversions
26390         here. 
26391
26392         (Expression::Resolve): Become a wrapper around DoResolve so we can
26393         check eclass and type being set after resolve.
26394
26395         (Invocation::Badness): Remove this dead function
26396
26397         (Binary::ResolveOperator): Do not compute the expensive argumnets
26398         unless we have a union for it.
26399
26400         (Probe::Emit): Is needs to do an isinst and then
26401         compare against null.
26402
26403         (::CanConvert): Added Location argument.  If the Location argument
26404         is null (Location.Null), then we do not report errors.  This is
26405         used by the `probe' mechanism of the Explicit conversion.  We do
26406         not want to generate an error for something that the user
26407         explicitly requested to be casted.  But the pipeline for an
26408         explicit cast first tests for potential implicit casts.
26409
26410         So for now, if the Location is null, it means `Probe only' to
26411         avoid adding another argument.   Might have to revise this
26412         strategy later.
26413
26414         (ClassCast): New class used to type cast objects into arbitrary
26415         classes (used in Explicit Reference Conversions).
26416
26417         Implement `as' as well.
26418
26419         Reverted all the patches from Ravi below: they were broken:
26420
26421                 * The use of `level' as a mechanism to stop recursive
26422                   invocations is wrong.  That was there just to catch the
26423                   bug with a strack trace but not as a way of addressing
26424                   the problem.
26425
26426                   To fix the problem we have to *understand* what is going
26427                   on and the interactions and come up with a plan, not
26428                   just get things going.
26429
26430                 * The use of the type conversion cache that I proposed
26431                   last night had an open topic: How does this work across
26432                   protection domains.  A user defined conversion might not
26433                   be public in the location where we are applying the
26434                   conversion, a different conversion might be selected
26435                   (ie, private A->B (better) but public B->A (worse),
26436                   inside A, A->B applies, but outside it, B->A will
26437                   apply).
26438
26439                 * On top of that (ie, even if the above is solved),
26440                   conversions in a cache need to be abstract.  Ie, `To
26441                   convert from an Int to a Short use an OpcodeCast', not
26442                   `To convert from an Int to a Short use the OpcodeCast on
26443                   the variable 5' (which is what this patch was doing).
26444
26445 2001-09-28  Ravi Pratap  <ravi@ximian.com>
26446
26447         * expression.cs (Invocation::ConversionExists): Re-write to use
26448         the conversion cache
26449
26450         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
26451         cache all conversions done, not just user-defined ones.
26452
26453         (Invocation::BetterConversion): The real culprit. Use ConversionExists
26454         to determine if a conversion exists instead of acutually trying to 
26455         perform the conversion. It's faster too.
26456
26457         (Expression::ConvertExplicit): Modify to use ConversionExists to check
26458         and only then attempt the implicit conversion.
26459
26460 2001-09-28  Ravi Pratap  <ravi@ximian.com>
26461
26462         * expression.cs (ConvertImplicit): Use a cache for conversions
26463         already found. Check level of recursion and bail out if necessary.
26464
26465 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
26466
26467         * typemanager.cs (string_concat_string_string, string_concat_object_object):
26468         Export standard methods that we expect for string operations.
26469
26470         * statement.cs (Block::UsageWarning): Track usage of variables and
26471         report the errors for not used variables.
26472
26473         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
26474         operator. 
26475
26476 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
26477
26478         * codegen.cs: remove unnneded code 
26479
26480         * expression.cs: Removed BuiltinTypeAccess class
26481
26482         Fix the order in which implicit conversions are
26483         done.  
26484
26485         The previous fixed dropped support for boxed conversions (adding a
26486         test to the test suite now)
26487
26488         (UserImplicitCast::CanConvert): Remove test for source being null,
26489         that code is broken.  We should not feed a null to begin with, if
26490         we do, then we should track the bug where the problem originates
26491         and not try to cover it up here.
26492
26493         Return a resolved expression of type UserImplicitCast on success
26494         rather than true/false.  Ravi: this is what I was talking about,
26495         the pattern is to use a static method as a "constructor" for
26496         objects. 
26497
26498         Also, do not create arguments until the very last minute,
26499         otherwise we always create the arguments even for lookups that
26500         will never be performed. 
26501
26502         (UserImplicitCast::Resolve): Eliminate, objects of type
26503         UserImplicitCast are born in a fully resolved state. 
26504
26505         * typemanager.cs (InitCoreTypes): Init also value_type
26506         (System.ValueType). 
26507
26508         * expression.cs (Cast::Resolve): First resolve the child expression.
26509
26510         (LValue): Add new method AddressOf to be used by
26511         the `&' operator.  
26512
26513         Change the argument of Store to take an EmitContext instead of an
26514         ILGenerator, because things like FieldExpr need to be able to call
26515         their children expression to generate the instance code. 
26516
26517         (Expression::Error, Expression::Warning): Sugar functions for
26518         reporting errors.
26519
26520         (Expression::MemberLookup): Accept a TypeContainer instead of a
26521         Report as the first argument.
26522
26523         (Expression::ResolvePrimary): Killed.  I still want to improve
26524         this as currently the code is just not right.
26525
26526         (Expression::ResolveMemberAccess): Simplify, but it is still
26527         wrong. 
26528
26529         (Unary::Resolve): Catch errors in AddressOf operators.
26530
26531         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
26532         index to a byte for the short-version, or the compiler will choose
26533         the wrong Emit call, which generates the wrong data.
26534
26535         (ParameterReference::Emit, ::Store): same.
26536
26537         (FieldExpr::AddressOf): Implement.
26538
26539         * typemanager.cs: TypeManager: made public variable instead of
26540         property.
26541
26542         * driver.cs: document --fatal.
26543
26544         * report.cs (ErrorMessage, WarningMessage): new names for the old
26545         Error and Warning classes.
26546
26547         * cs-parser.jay (member_access): Turn built-in access to types
26548         into a normal simplename
26549
26550 2001-09-27  Ravi Pratap  <ravi@ximian.com>
26551
26552         * expression.cs (Invocation::BetterConversion): Fix to cope
26553         with q being null, since this was introducing a bug.
26554
26555         * expression.cs (ConvertImplicit): Do built-in conversions first.
26556
26557 2001-09-27  Ravi Pratap  <ravi@ximian.com>
26558
26559         * expression.cs (UserImplicitCast::Resolve): Fix bug.
26560
26561 2001-09-27  Ravi Pratap  <ravi@ximian.com>
26562
26563         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
26564         I had introduced long ago (what's new ?).
26565
26566         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
26567         the work of all the checking. 
26568         (ConvertImplicit): Call CanConvert and only then create object if necessary.
26569         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
26570
26571         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
26572         that is the right way. 
26573
26574         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
26575         overloading resolution. Use everywhere instead of cutting and pasting code.
26576
26577         (Binary::ResolveOperator): Use MakeUnionSet.
26578
26579         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
26580         we have to convert to bool types. Not complete yet.
26581
26582 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
26583
26584         * typemanager.cs (TypeManager::CSharpName): support ushort.
26585
26586         * expression.cs (Expression::TryImplicitIntConversion): Attempts
26587         to provide an expression that performsn an implicit constant int
26588         conversion (section 6.1.6).
26589         (Expression::ConvertImplicitRequired): Reworked to include
26590         implicit constant expression conversions.
26591
26592         (Expression::ConvertNumericExplicit): Finished.
26593
26594         (Invocation::Emit): If InstanceExpression is null, then it means
26595         that we perform a call on this.
26596
26597 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
26598
26599         * expression.cs (Unary::Emit): Remove some dead code.
26600         (Probe): Implement Resolve and Emit for `is'.
26601         (Expression::ConvertImplicitRequired): Attempt to do constant
26602         expression conversions here.  Maybe should be moved to
26603         ConvertImplicit, but I am not sure.
26604         (Expression::ImplicitLongConstantConversionPossible,
26605         Expression::ImplicitIntConstantConversionPossible): New functions
26606         that tell whether is it possible to apply an implicit constant
26607         expression conversion.
26608
26609         (ConvertNumericExplicit): Started work on explicit numeric
26610         conversions.
26611
26612         * cs-parser.jay: Update operator constants.
26613
26614         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
26615         (Parameters::GetSignature): Hook up VerifyArgs here.
26616         (Parameters::VerifyArgs): Verifies that no two arguments have the
26617         same name. 
26618
26619         * class.cs (Operator): Update the operator names to reflect the
26620         ones that the spec expects (as we are just stringizing the
26621         operator names).
26622
26623         * expression.cs (Unary::ResolveOperator): Fix bug: Use
26624         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
26625         previous usage did only work for our methods.
26626         (Expression::ConvertImplicit): Handle decimal implicit numeric
26627         conversions as well.
26628         (Expression::InternalTypeConstructor): Used to invoke constructors
26629         on internal types for default promotions.
26630
26631         (Unary::Emit): Implement special handling for the pre/post
26632         increment/decrement for overloaded operators, as they need to have
26633         the same semantics as the other operators.
26634
26635         (Binary::ResolveOperator): ditto.
26636         (Invocation::ConversionExists): ditto.
26637         (UserImplicitCast::Resolve): ditto.
26638
26639 2001-09-26  Ravi Pratap  <ravi@ximian.com>
26640
26641         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
26642         operator, return after emitting body. Regression tests pass again !
26643
26644         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
26645         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
26646         (Invocation::OverloadResolve): Ditto.
26647         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
26648
26649         * everywhere : update calls to the above methods accordingly.
26650
26651 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
26652
26653         * assign.cs (Assign): Make it inherit from ExpressionStatement.
26654
26655         * expression.cs (ExpressionStatement): New base class used for
26656         expressions that can appear in statements, so that we can provide
26657         an alternate path to generate expression that do not leave a value
26658         on the stack.
26659
26660         (Expression::Emit, and all the derivatives): We no longer return
26661         whether a value is left on the stack or not.  Every expression
26662         after being emitted leaves a single value on the stack.
26663
26664         * codegen.cs (EmitContext::EmitStatementExpression): Use the
26665         facilties of ExpressionStatement if possible.
26666
26667         * cs-parser.jay: Update statement_expression.
26668
26669 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
26670
26671         * driver.cs: Change the wording of message
26672
26673 2001-09-25  Ravi Pratap  <ravi@ximian.com>
26674
26675         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
26676         the type of the expression to the return type of the method if
26677         we have an overloaded operator match ! The regression tests pass again !
26678         (Unary::ResolveOperator): Ditto.
26679
26680         * expression.cs (Invocation::ConversionExists): Correct the member lookup
26681         to find "op_Implicit", not "implicit" ;-)
26682         (UserImplicitCast): New class to take care of user-defined implicit conversions.
26683         (ConvertImplicit, ForceConversion): Take TypeContainer argument
26684
26685         * everywhere : Correct calls to the above accordingly.
26686
26687         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
26688         (ConvertImplicit): Do user-defined conversion if it exists.
26689
26690 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
26691
26692         * assign.cs: track location.
26693         (Resolve): Use implicit conversions on assignment.
26694
26695         * literal.cs: Oops.  Not good, Emit of short access values should
26696         pass (Bytes) or the wrong argument will be selected.
26697
26698         * expression.cs (Unary::Emit): Emit code for -expr.
26699
26700         (Unary::ResolveOperator): Handle `Substract' for non-constants
26701         (substract from zero from the non-constants).
26702         Deal with Doubles as well. 
26703
26704         (Expression::ConvertImplicitRequired): New routine that reports an
26705         error if no implicit conversion exists. 
26706
26707         (Invocation::OverloadResolve): Store the converted implicit
26708         expressions if we make them
26709
26710 2001-09-24  Ravi Pratap  <ravi@ximian.com>
26711
26712         * class.cs (ConstructorInitializer): Take a Location argument.
26713         (ConstructorBaseInitializer): Same here.
26714         (ConstructorThisInitializer): Same here.
26715
26716         * cs-parser.jay : Update all calls accordingly.
26717
26718         * expression.cs (Unary, Binary, New): Take location argument.
26719         Update accordingly everywhere.
26720
26721         * cs-parser.jay : Update all calls to the above to take a location
26722         argument.
26723
26724         * class.cs : Ditto.
26725
26726 2001-09-24  Ravi Pratap  <ravi@ximian.com>
26727
26728         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
26729         (Invocation::BetterConversion): Same here
26730         (Invocation::ConversionExists): Ditto.
26731
26732         (Invocation::ConversionExists): Implement.
26733
26734 2001-09-22  Ravi Pratap  <ravi@ximian.com>
26735
26736         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
26737         Also take an additional TypeContainer argument.
26738
26739         * All over : Pass in TypeContainer as argument to OverloadResolve.
26740
26741         * typemanager.cs (CSharpName): Update to check for the string type and return
26742         that too.
26743
26744         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
26745         a given method.
26746
26747 2001-09-21  Ravi Pratap  <ravi@ximian.com>
26748
26749         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
26750         (Invocation::BetterFunction): Implement.
26751         (Invocation::BetterConversion): Implement.
26752         (Invocation::ConversionExists): Skeleton, no implementation yet.
26753
26754         Okay, things work fine !
26755
26756 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
26757
26758         * typemanager.cs: declare and load enum_type, delegate_type and
26759         void_type. 
26760
26761         * expression.cs (Expression::Emit): Now emit returns a value that
26762         tells whether a value is left on the stack or not.  This strategy
26763         might be reveted tomorrow with a mechanism that would address
26764         multiple assignments.
26765         (Expression::report118): Utility routine to report mismatches on
26766         the ExprClass.
26767
26768         (Unary::Report23): Report impossible type/operator combination
26769         utility function.
26770
26771         (Unary::IsIncrementableNumber): Whether the type can be
26772         incremented or decremented with add.
26773         (Unary::ResolveOperator): Also allow enumerations to be bitwise
26774         complemented. 
26775         (Unary::ResolveOperator): Implement ++, !, ~,
26776
26777         (Invocation::Emit): Deal with new Emit convetion.
26778
26779         * All Expression derivatives: Updated their Emit method to return
26780         whether they leave values on the stack or not.
26781
26782         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
26783         stack for expressions that are statements. 
26784
26785 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
26786
26787         * expression.cs (LValue): New interface.  Must be implemented by
26788         LValue objects.
26789         (LocalVariableReference, ParameterReference, FieldExpr): Implement
26790         LValue interface.
26791
26792         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
26793         interface for generating code, simplifies the code.
26794
26795 2001-09-20  Ravi Pratap  <ravi@ximian.com>
26796
26797         * expression.cs (everywhere): Comment out return statements in ::Resolve
26798         methods to avoid the warnings.
26799
26800 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
26801
26802         * driver.cs (parse): Report error 2001 if we can not open the
26803         source file.
26804
26805         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
26806         not resolve it.
26807
26808         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
26809         object. 
26810
26811         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
26812         otherwise nested blocks end up with the same index.
26813
26814         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
26815
26816         * expression.cs:  Instead of having FIXMEs in the Resolve
26817         functions, throw exceptions so it is obvious that we are facing a
26818         bug. 
26819
26820         * cs-parser.jay (invocation_expression): Pass Location information.
26821
26822         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
26823         Use a basename for those routines because .NET does not like paths
26824         on them. 
26825
26826         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
26827         already defined.
26828
26829 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
26830
26831         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
26832         are loading the correct data types (throws an exception if not).
26833         (TypeManager::InitCoreTypes): Use CoreLookupType
26834
26835         * expression.cs (Unary::ResolveOperator): return the child
26836         expression for expressions which are just +expr.
26837         (Unary::ResolveOperator): Return negative literals for -LITERAL
26838         expressions (otherwise they are Unary {Literal}).
26839         (Invocation::Badness): Take into account `Implicit constant
26840         expression conversions'.
26841
26842         * literal.cs (LongLiteral): Implement long literal class.
26843         (IntLiteral): export the `Value' of the intliteral. 
26844
26845 2001-09-19  Ravi Pratap  <ravi@ximian.com>
26846
26847         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
26848
26849         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
26850         instead of 'Operator'
26851
26852         * expression.cs (Binary::ResolveOperator): Update accordingly.
26853         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
26854         and 'Minus'
26855
26856         * cs-parser.jay (unary_expression): Update to use the new names.
26857
26858         * gen-treedump.cs (GetUnary): Same here.
26859
26860         * expression.cs (Unary::Resolve): Implement.
26861         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
26862         operators are found instead of making noise ;-)
26863         (Unary::ResolveOperator): New method to do precisely the same thing which
26864         Binary::ResolveOperator does for Binary expressions.
26865         (Unary.method, .Arguments): Add.
26866         (Unary::OperName): Implement.   
26867         (Unary::ForceConversion): Copy and Paste !
26868
26869         * class.cs (Operator::Define): Fix a small bug for the case when we have 
26870         a unary operator.
26871
26872         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
26873         for the inbuilt operators. Only overloading works for now ;-)
26874
26875 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
26876
26877         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
26878         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
26879
26880         * expression.cs (This::Emit): Implement. 
26881         (This::Resolve): Implement.
26882         (TypeOf:Resolve): Implement.
26883         (Expression::ResolveSimpleName): Add an implicit this to instance
26884         field references. 
26885         (MemberAccess::Resolve): Deal with Parameters and Fields. 
26886         Bind instance variable to Field expressions.
26887         (FieldExpr::Instance): New field used to track the expression that
26888         represents the object instance.
26889         (FieldExpr::Resolve): Track potential errors from MemberLookup not
26890         binding 
26891         (FieldExpr::Emit): Implement.
26892
26893         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
26894         the last instruction contains a return opcode to avoid generating
26895         the last `ret' instruction (this generates correct code, and it is
26896         nice to pass the peverify output).
26897
26898         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
26899         initializer for static and instance variables.
26900         (Constructor::Emit): Allow initializer to be null in the case of
26901         static constructors.  Only emit initializer for instance
26902         constructors. 
26903
26904         (TypeContainer::FindMembers): Return a null array if there are no
26905         matches.
26906
26907         Also fix the code for the MemberTypes.Method branch, as it was not
26908         scanning that for operators (or tried to access null variables before).
26909
26910         * assign.cs (Assign::Emit): Handle instance and static fields. 
26911
26912         * TODO: Updated.
26913
26914         * driver.cs: Stop compilation if there are parse errors.
26915
26916         * cs-parser.jay (constructor_declaration): Provide default base
26917         initializer for non-static constructors.
26918         (constructor_declarator): Do not provide a default base
26919         initializers if none was specified.
26920         Catch the fact that constructors should not have parameters.
26921
26922         * class.cs: Do not emit parent class initializers for static
26923         constructors, that should be flagged as an error.
26924
26925 2001-09-18  Ravi Pratap  <ravi@ximian.com>
26926
26927         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
26928         Move back code into TypeContainer::Populate.
26929
26930 2001-09-18  Ravi Pratap  <ravi@ximian.com>
26931
26932         * class.cs (TypeContainer::AddConstructor): Fix the check to
26933         compare against Name, not Basename. 
26934         (Operator::OpType): Change Plus and Minus to Add and Subtract.
26935
26936         * cs-parser.jay : Update accordingly.
26937
26938         * class.cs (TypeContainer::FindMembers): For the case where we are searching
26939         for methods, don't forget to look into the operators too.
26940         (RegisterMethodBuilder): Helper method to take care of this for
26941         methods, constructors and operators.
26942         (Operator::Define): Completely revamp.
26943         (Operator.OperatorMethod, MethodName): New fields.
26944         (TypeContainer::Populate): Move the registering of builders into
26945         RegisterMethodBuilder.
26946         (Operator::Emit): Re-write.
26947
26948         * expression.cs (Binary::Emit): Comment out code path to emit method
26949         invocation stuff for the case when we have a user defined operator. I am
26950         just not able to get it right !
26951
26952 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
26953
26954         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
26955         argument. 
26956
26957         (Expression::MemberLookup): Provide a version that allows to
26958         specify the MemberTypes and BindingFlags. 
26959
26960         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
26961         so it was not fetching variable information from outer blocks.
26962
26963         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
26964         Beforefieldinit as it was buggy.
26965
26966         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
26967         that Ravi put here.  
26968
26969         * class.cs (Constructor::Emit): Only emit if block is not null.
26970         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
26971         deal with this by semantically definining it as if the user had
26972         done it.
26973
26974         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
26975         constructors as we now "emit" them at a higher level.
26976
26977         (TypeContainer::DefineDefaultConstructor): Used to define the
26978         default constructors if none was provided.
26979
26980         (ConstructorInitializer): Add methods Resolve and Emit. 
26981
26982         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
26983
26984 2001-09-17  Ravi Pratap  <ravi@ximian.com>
26985
26986         * class.cs (TypeContainer::EmitDefaultConstructor): Register
26987         the default constructor builder with our hashtable for methodbuilders
26988         to methodcores.
26989
26990         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
26991         and argument_count is 0 in which case we have a match.
26992         (Binary::ResolveOperator): More null checking and miscellaneous coding
26993         style cleanup.
26994
26995 2001-09-17  Ravi Pratap  <ravi@ximian.com>
26996
26997         * rootcontext.cs (IsNameSpace): Compare against null.
26998
26999         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
27000
27001         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
27002         and Unary::Operator.
27003
27004         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
27005         accordingly.
27006
27007         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
27008         we have overloaded operators.
27009         (Binary::ResolveOperator): Implement the part which does the operator overload
27010         resolution.
27011
27012         * class.cs (Operator::Emit): Implement.
27013         (TypeContainer::Emit): Emit the operators we have too.
27014
27015         * expression.cs (Binary::Emit): Update to emit the appropriate code for
27016         the case when we have a user-defined operator.
27017
27018 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
27019
27020         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
27021
27022 2001-09-16  Ravi Pratap  <ravi@ximian.com>
27023
27024         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
27025         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
27026         (Constructor::Emit): Implement.
27027         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
27028         if we have no work to do. 
27029         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
27030         Emit method.
27031
27032         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
27033         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
27034
27035         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
27036         of parent.parent.
27037
27038 2001-09-15  Ravi Pratap  <ravi@ximian.com>
27039
27040         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
27041         in the source.
27042         (Tree::RecordNamespace): Method to do what the name says ;-)
27043         (Tree::Namespaces): Property to get at the namespaces hashtable.
27044
27045         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
27046         keep track.
27047
27048         * rootcontext.cs (IsNamespace): Fixed it :-)
27049
27050 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
27051
27052         * class.cs (TypeContainer::FindMembers): Add support for
27053         constructors. 
27054         (MethodCore): New class that encapsulates both the shared aspects
27055         of a Constructor and a Method.  
27056         (Method, Constructor): Factored pieces into MethodCore.
27057
27058         * driver.cs: Added --fatal which makes errors throw exceptions.
27059         Load System assembly as well as part of the standard library.
27060
27061         * report.cs: Allow throwing exceptions on errors for debugging.
27062
27063         * modifiers.cs: Do not use `parent', instead use the real type
27064         container to evaluate permission settings.
27065
27066         * class.cs: Put Ravi's patch back in.  He is right, and we will
27067         have to cope with the
27068
27069 2001-09-14  Ravi Pratap  <ravi@ximian.com>
27070
27071         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
27072         FamORAssem, not FamANDAssem.
27073
27074 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
27075
27076         * driver.cs: Added --parse option that only parses its input files
27077         and terminates.
27078
27079         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
27080         incorrect.  IsTopLevel is not used to tell whether an object is
27081         root_types or not (that can be achieved by testing this ==
27082         root_types).  But to see if this is a top-level *class* (not
27083         necessarly our "toplevel" container). 
27084
27085 2001-09-14  Ravi Pratap  <ravi@ximian.com>
27086
27087         * enum.cs (Enum::Define): Modify to call the Lookup method on the
27088         parent instead of a direct call to GetType.
27089
27090 2001-09-14  Ravi Pratap  <ravi@ximian.com>
27091
27092         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
27093         Modifiers.TypeAttr. This should just be a call to that method.
27094
27095         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
27096         object so that we can determine if we are top-level or not.
27097
27098         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
27099         TypeContainer too.
27100
27101         * enum.cs (Enum::Define): Ditto.
27102
27103         * modifiers.cs (FieldAttr): Re-write.
27104
27105         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
27106         (TypeContainer::HaveStaticConstructor): New property to provide access
27107         to precisely that info.
27108
27109         * modifiers.cs (MethodAttr): Re-write.
27110         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
27111
27112         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
27113         of top-level types as claimed.
27114
27115 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
27116
27117         * expression.cs (MemberLookup): Fruitless attempt to lookup
27118         constructors.  Maybe I need to emit default constructors?  That
27119         might be it (currently .NET emits this for me automatically).
27120         (Invocation::OverloadResolve): Cope with Arguments == null.
27121         (Invocation::EmitArguments): new function, shared by the new
27122         constructor and us.
27123         (Invocation::Emit): Handle static and instance methods.  Emit
27124         proper call instruction for virtual or non-virtual invocations.
27125         (New::Emit): Implement.
27126         (New::Resolve): Implement.
27127         (MemberAccess:Resolve): Implement.
27128         (MethodGroupExpr::InstanceExpression): used conforming to the spec
27129         to track instances.
27130         (FieldExpr::Resolve): Set type.
27131
27132         * support.cs: Handle empty arguments.
27133                 
27134         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
27135         SimpleLookup): Auxiliary routines to help parse a qualifier
27136         identifier.  
27137
27138         Update qualifier_identifier rule.
27139
27140         * codegen.cs: Removed debugging messages.
27141
27142         * class.cs: Make this a global thing, this acts just as a "key" to
27143         objects that we might have around.
27144
27145         (Populate): Only initialize method_builders_to_methods once.
27146
27147         * expression.cs (PropertyExpr): Initialize type from the
27148         PropertyType. 
27149
27150         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
27151         Resolve pattern.  Attempt to implicitly convert value to boolean.
27152         Emit code.
27153
27154         * expression.cs: Set the type for the int32/int32 argument case.
27155         (Binary::ResolveOperator): Set the return type to boolean for
27156         comparission operators
27157
27158         * typemanager.cs: Remove debugging print code.
27159
27160         (Invocation::Resolve): resolve type.
27161
27162         * class.cs: Allocate a MemberInfo of the correct size, as the code
27163         elsewhere depends on the test to reflect the correct contents.
27164
27165         (Method::) Keep track of parameters, due to System.Reflection holes
27166
27167         (TypeContainer::Populate): Keep track of MethodBuilders to Method
27168         mapping here.
27169
27170         (TypeContainer::FindMembers): Use ArrayList and then copy an array
27171         of the exact size and return that.
27172
27173         (Class::LookupMethodByBuilder): New function that maps
27174         MethodBuilders to its methods.  Required to locate the information
27175         on methods because System.Reflection bit us again.
27176
27177         * support.cs: New file, contains an interface ParameterData and
27178         two implementations: ReflectionParameters and InternalParameters
27179         used to access Parameter information.  We will need to grow this
27180         as required.
27181
27182         * expression.cs (Invocation::GetParameterData): implement a cache
27183         and a wrapper around the ParameterData creation for methods. 
27184         (Invocation::OverloadResolve): Use new code.
27185
27186 2001-09-13  Ravi Pratap  <ravi@ximian.com>
27187
27188         * class.cs (TypeContainer::EmitField): Remove and move into 
27189         (Field::Define): here and modify accordingly.
27190         (Field.FieldBuilder): New member.
27191         (TypeContainer::Populate): Update accordingly.
27192         (TypeContainer::FindMembers): Implement.
27193
27194 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
27195
27196         * statement.cs: (VariableInfo::VariableType): New field to be
27197         initialized with the full type once it is resolved. 
27198
27199 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
27200
27201         * parameter.cs (GetParameterInfo): Use a type cache to compute
27202         things only once, and to reuse this information
27203
27204         * expression.cs (LocalVariableReference::Emit): Implement.
27205         (OpcodeCast::Emit): fix.
27206
27207         (ParameterReference::Resolve): Implement.
27208         (ParameterReference::Emit): Implement.
27209
27210         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
27211         that are expressions need to stay as Expressions.
27212
27213         * typemanager.cs (CSharpName): Returns the C# name of a type if
27214         possible. 
27215
27216         * expression.cs (Expression::ConvertImplicit): New function that
27217         implements implicit type conversions.
27218
27219         (Expression::ImplicitReferenceConversion): Implements implicit
27220         reference conversions.
27221
27222         (EmptyCast): New type for transparent casts.
27223
27224         (OpcodeCast): New type for casts of types that are performed with
27225         a sequence of bytecodes.
27226
27227         (BoxedCast): New type used for casting value types into reference
27228         types.  Emits a box opcode.
27229
27230         (Binary::DoNumericPromotions): Implements numeric promotions of
27231         and computation of the Binary::Type.
27232
27233         (Binary::EmitBranchable): Optimization.
27234
27235         (Binary::Emit): Implement code emission for expressions.
27236
27237         * typemanager.cs (TypeManager): Added two new core types: sbyte
27238         and byte.
27239
27240 2001-09-12  Ravi Pratap  <ravi@ximian.com>
27241
27242         * class.cs (TypeContainer::FindMembers): Method which does exactly
27243         what Type.FindMembers does, only we don't have to use reflection. No
27244         implementation yet.
27245
27246         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
27247         typecontainer objects as we need to get at them.
27248         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
27249
27250         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
27251         typecontainer object.
27252
27253         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
27254         of just a Report object.
27255
27256 2001-09-11  Ravi Pratap  <ravi@ximian.com>
27257
27258         * class.cs (Event::Define): Go back to using the prefixes "add_" and
27259         "remove_"
27260         (TypeContainer::Populate): Now define the delegates of the type too.
27261         (TypeContainer.Delegates): Property to access the list of delegates defined
27262         in the type.
27263
27264         * delegates.cs (Delegate::Define): Implement partially.
27265
27266         * modifiers.cs (TypeAttr): Handle more flags.
27267
27268 2001-09-11  Ravi Pratap  <ravi@ximian.com>
27269
27270         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
27271         and not <=
27272         (Operator::Define): Re-write logic to get types by using the LookupType method
27273         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
27274         (Indexer::Define): Ditto.
27275         (Event::Define): Ditto.
27276         (Property::Define): Ditto.
27277
27278 2001-09-10  Ravi Pratap  <ravi@ximian.com>
27279
27280         * class.cs (TypeContainer::Populate): Now define operators too. 
27281         (TypeContainer.Operators): New property to access the list of operators
27282         in a type.
27283         (Operator.OperatorMethodBuilder): New member to hold the method builder
27284         for the operator we are defining.
27285         (Operator::Define): Implement.
27286
27287 2001-09-10  Ravi Pratap  <ravi@ximian.com>
27288
27289         * class.cs (Event::Define): Make the prefixes of the accessor methods
27290         addOn_ and removeOn_ 
27291
27292         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
27293         of the location being passed in too. Ideally, this should go later since all
27294         error reporting should be done through the Report object.
27295
27296         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
27297         (Populate): Iterate thru the indexers we have and define them too.
27298         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
27299         for the get and set accessors.
27300         (Indexer::Define): Implement.
27301
27302 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
27303
27304         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
27305         my previous implementation, did not work.
27306
27307         * typemanager.cs: Add a couple of missing types (the longs).
27308
27309         * literal.cs: Use TypeManager.bool_type instead of getting it.
27310
27311         * expression.cs (EventExpr): New kind of expressions.
27312         (Expressio::ExprClassFromMemberInfo): finish
27313
27314 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
27315
27316         * assign.cs: Emit stores to static fields differently.
27317
27318 2001-09-08  Ravi Pratap  <ravi@ximian.com>
27319
27320         * Merge in changes and adjust code to tackle conflicts. Backed out my
27321         code in Assign::Resolve ;-) 
27322
27323 2001-09-08  Ravi Pratap  <ravi@ximian.com>
27324
27325         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
27326         instead Report.Error and also pass in the location.
27327         (CSharpParser::Lexer): New readonly property to return the reference
27328         to the Tokenizer object.
27329         (declare_local_variables): Use Report.Error with location instead of plain 
27330         old error.
27331         (CheckDef): Ditto.
27332
27333         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
27334         (Operator.CheckBinaryOperator): Ditto.
27335
27336         * cs-parser.jay (operator_declarator): Update accordingly.
27337
27338         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
27339         (CheckBinaryOperator): Same here.
27340
27341         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
27342         on the name without any prefixes of namespace names etc. This is because we
27343         already might have something already fully qualified like 
27344         'System.Console.WriteLine'
27345
27346         * assign.cs (Resolve): Begin implementation. Stuck ;-)
27347
27348 2001-09-07  Ravi Pratap  <ravi@ximian.com>
27349
27350         * cs-tokenizer.cs (location): Return a string which also contains
27351         the file name.
27352
27353         * expression.cs (ElementAccess): New class for expressions of the
27354         type 'element access.'
27355         (BaseAccess): New class for expressions of the type 'base access.'
27356         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
27357         respectively.
27358
27359         * cs-parser.jay (element_access): Implement action.
27360         (base_access): Implement actions.
27361         (checked_expression, unchecked_expression): Implement.
27362
27363         * cs-parser.jay (local_variable_type): Correct and implement.
27364         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
27365
27366         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
27367
27368         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
27369         name and the specifiers.
27370
27371         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
27372
27373         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
27374         making them all public ;-)
27375
27376         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
27377         class anyways.
27378
27379 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
27380
27381         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
27382         PropertyExprs.
27383         (FieldExpr, PropertyExprs): New resolved expressions.
27384         (SimpleName::MemberStaticCheck): Perform static checks for access
27385         to non-static fields on static methods. Maybe this should be
27386         generalized for MemberAccesses. 
27387         (SimpleName::ResolveSimpleName): More work on simple name
27388         resolution. 
27389
27390         * cs-parser.jay (primary_expression/qualified_identifier): track
27391         the parameter index.
27392
27393         * codegen.cs (CodeGen::Save): Catch save exception, report error.
27394         (EmitContext::EmitBoolExpression): Chain to expression generation
27395         instead of temporary hack.
27396         (::EmitStatementExpression): Put generic expression code generation.
27397
27398         * assign.cs (Assign::Emit): Implement variable assignments to
27399         local variables, parameters and fields.
27400
27401 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
27402
27403         * statement.cs (Block::GetVariableInfo): New method, returns the
27404         VariableInfo for a variable name in a block.
27405         (Block::GetVariableType): Implement in terms of GetVariableInfo
27406
27407         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
27408         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
27409
27410 2001-09-06  Ravi Pratap  <ravi@ximian.com>
27411
27412         * cs-parser.jay (operator_declaration): Continue on my quest : update
27413         to take attributes argument.
27414         (event_declaration): Ditto.
27415         (enum_declaration): Ditto.
27416         (indexer_declaration): Ditto.
27417
27418         * class.cs (Operator::Operator): Update constructor accordingly.
27419         (Event::Event): Ditto.
27420
27421         * delegate.cs (Delegate::Delegate): Same here.
27422
27423         * enum.cs (Enum::Enum): Same here.
27424
27425 2001-09-05  Ravi Pratap  <ravi@ximian.com>
27426
27427         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
27428
27429         * ../tests/cs0658.cs : New file to demonstrate error 0658.
27430
27431         * attribute.cs (Attributes): New class to encapsulate all attributes which were
27432         being passed around as an arraylist.
27433         (Attributes::AddAttribute): Method to add attribute sections.
27434
27435         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
27436         (struct_declaration): Update accordingly.
27437         (constant_declaration): Update.
27438         (field_declaration): Update.
27439         (method_header): Update.
27440         (fixed_parameter): Update.
27441         (parameter_array): Ditto.
27442         (property_declaration): Ditto.
27443         (destructor_declaration): Ditto.
27444
27445         * class.cs (Struct::Struct): Update constructors accordingly.
27446         (Class::Class): Ditto.
27447         (Field::Field): Ditto.
27448         (Method::Method): Ditto.
27449         (Property::Property): Ditto.
27450         (TypeContainer::OptAttribute): update property's return type.
27451
27452         * interface.cs (Interface.opt_attributes): New member.
27453         (Interface::Interface): Update to take the extra Attributes argument.
27454
27455         * parameter.cs (Parameter::Parameter): Ditto.
27456
27457         * constant.cs (Constant::Constant): Ditto.
27458
27459         * interface.cs (InterfaceMemberBase): New OptAttributes field.
27460         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
27461         the attributes as a parameter.
27462         (InterfaceProperty): Update constructor call.
27463         (InterfaceEvent): Ditto.
27464         (InterfaceMethod): Ditto.
27465         (InterfaceIndexer): Ditto.
27466
27467         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
27468         pass the attributes too.
27469         (interface_event_declaration): Ditto.
27470         (interface_property_declaration): Ditto.
27471         (interface_method_declaration): Ditto.
27472         (interface_declaration): Ditto.
27473
27474 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
27475
27476         * class.cs (Method::Define): Track the "static Main" definition to
27477         create an entry point. 
27478
27479         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
27480         EntryPoint if we find it. 
27481
27482         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
27483         (EmitContext::ig): Make this variable public.
27484
27485         * driver.cs: Make the default output file be the first file name
27486         with the .exe extension.  
27487
27488         Detect empty compilations
27489
27490         Handle various kinds of output targets.  Handle --target and
27491         rename -t to --dumper.
27492
27493         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
27494         methods inherited from Expression return now an Expression.  This
27495         will is used during the tree rewriting as we resolve them during
27496         semantic analysis.
27497
27498         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
27499         the spec.  Missing entirely is the information about
27500         accessability of elements of it.
27501
27502         (Expression::ExprClassFromMemberInfo): New constructor for
27503         Expressions that creates a fully initialized Expression based on
27504         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
27505         a Type.
27506
27507         (Invocation::Resolve): Begin implementing resolution of invocations.
27508
27509         * literal.cs (StringLiteral):  Implement Emit.
27510
27511 2001-09-05  Ravi Pratap  <ravi@ximian.com>
27512
27513         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
27514         member.
27515
27516 2001-09-04  Ravi Pratap  <ravi@ximian.com>
27517
27518         * cs-parser.jay (attribute_arguments): Implement actions.
27519         (attribute): Fix bug in production. Implement action.
27520         (attribute_list): Implement.
27521         (attribute_target): Implement.
27522         (attribute_target_specifier, opt_target_specifier): Implement
27523         (CheckAttributeTarget): New method to check if the attribute target
27524         is valid.
27525         (attribute_section): Implement.
27526         (opt_attributes): Implement.
27527
27528         * attribute.cs : New file to handle attributes.
27529         (Attribute): Class to hold attribute info.
27530
27531         * cs-parser.jay (opt_attribute_target_specifier): Remove production
27532         (attribute_section): Modify production to use 2 different rules to 
27533         achieve the same thing. 1 s/r conflict down !
27534         Clean out commented, useless, non-reducing dimension_separator rules.
27535
27536         * class.cs (TypeContainer.attributes): New member to hold list
27537         of attributes for a type.
27538         (Struct::Struct): Modify to take one more argument, the attribute list.
27539         (Class::Class): Ditto.
27540         (Field::Field): Ditto.
27541         (Method::Method): Ditto.
27542         (Property::Property): Ditto.
27543
27544         * cs-parser.jay (struct_declaration): Update constructor call to
27545         pass in the attributes too.
27546         (class_declaration): Ditto.
27547         (constant_declaration): Ditto.
27548         (field_declaration): Ditto.
27549         (method_header): Ditto.
27550         (fixed_parameter): Ditto.
27551         (parameter_array): Ditto.
27552         (property_declaration): Ditto.
27553
27554         * constant.cs (Constant::Constant): Update constructor similarly.
27555         Use System.Collections.
27556
27557         * parameter.cs (Parameter::Parameter): Update as above.
27558
27559 2001-09-02  Ravi Pratap  <ravi@ximian.com>
27560
27561         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
27562         (TypeContainer.delegates): New member to hold list of delegates.
27563
27564         * cs-parser.jay (delegate_declaration): Implement the action correctly 
27565         this time as I seem to be on crack ;-)
27566
27567 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
27568
27569         * rootcontext.cs (RootContext::IsNamespace): new function, used to
27570         tell whether an identifier represents a namespace.
27571
27572         * expression.cs (NamespaceExpr): A namespace expression, used only
27573         temporarly during expression resolution.
27574         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
27575         utility functions to resolve names on expressions.
27576
27577 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
27578
27579         * codegen.cs: Add hook for StatementExpressions. 
27580
27581         * class.cs: Fix inverted test for static flag in methods.
27582
27583 2001-09-02  Ravi Pratap  <ravi@ximian.com>
27584
27585         * class.cs (Operator::CheckUnaryOperator): Correct error number used
27586         to make it coincide with MS' number.
27587         (Operator::CheckBinaryOperator): Ditto.
27588
27589         * ../errors/errors.txt : Remove error numbers added earlier.
27590
27591         * ../errors/cs1019.cs : Test case for error # 1019
27592
27593         * ../errros/cs1020.cs : Test case for error # 1020
27594
27595         * cs-parser.jay : Clean out commented cruft.
27596         (dimension_separators, dimension_separator): Comment out. Ostensibly not
27597         used anywhere - non-reducing rule.
27598         (namespace_declarations): Non-reducing rule - comment out.
27599
27600         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
27601         with TypeContainer::AddEnum.
27602
27603         * delegate.cs : New file for delegate handling classes.
27604         (Delegate): Class for declaring delegates.
27605
27606         * makefile : Update.
27607
27608         * cs-parser.jay (delegate_declaration): Implement.
27609
27610 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
27611
27612         * class.cs (Event::Define): Implement.
27613         (Event.EventBuilder): New member.
27614
27615         * class.cs (TypeContainer::Populate): Update to define all enums and events
27616         we have.
27617         (Events): New property for the events arraylist we hold. Shouldn't we move to using
27618         readonly fields for all these cases ?
27619
27620 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
27621
27622         * class.cs (Property): Revamp to use the convention of making fields readonly.
27623         Accordingly modify code elsewhere.
27624
27625         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
27626         the Define method of the Property class.
27627
27628         * class.cs : Clean up applied patch and update references to variables etc. Fix 
27629         trivial bug.
27630         (TypeContainer::Populate): Update to define all the properties we have. Also
27631         define all enumerations.
27632
27633         * enum.cs (Define): Implement.
27634
27635 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
27636
27637         * cs-parser.jay (overloadable_operator): The semantic value is an
27638         enum of the Operator class.
27639         (operator_declarator): Implement actions.
27640         (operator_declaration): Implement.
27641
27642         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
27643         validity of definitions.
27644         (Operator::CheckBinaryOperator): Static method to check for binary operators
27645         (TypeContainer::AddOperator): New method to add an operator to a type.
27646
27647         * cs-parser.jay (indexer_declaration): Added line to actually call the
27648         AddIndexer method so it gets added ;-)
27649
27650         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
27651         already taken care of by the MS compiler ?  
27652
27653 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
27654
27655         * class.cs (Operator): New class for operator declarations.
27656         (Operator::OpType): Enum for the various operators.
27657
27658 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
27659
27660         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
27661         ostensibly handle this in semantic analysis.
27662
27663         * cs-parser.jay (general_catch_clause): Comment out
27664         (specific_catch_clauses, specific_catch_clause): Ditto.
27665         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
27666         (catch_args, opt_catch_args): New productions.
27667         (catch_clause): Rewrite to use the new productions above
27668         (catch_clauses): Modify accordingly.
27669         (opt_catch_clauses): New production to use in try_statement
27670         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
27671         and re-write the code in the actions to extract the specific and
27672         general catch clauses by being a little smart ;-)
27673
27674         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
27675         Hooray, try and catch statements parse fine !
27676
27677 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
27678
27679         * statement.cs (Block::GetVariableType): Fix logic to extract the type
27680         string from the hashtable of variables.
27681
27682         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
27683         I end up making that mistake ;-)
27684         (catch_clauses): Fixed gross error which made Key and Value of the 
27685         DictionaryEntry the same : $1 !!
27686
27687 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
27688
27689         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
27690
27691         * cs-parser.jay (event_declaration): Correct to remove the semicolon
27692         when the add and remove accessors are specified. 
27693
27694 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
27695
27696         * cs-parser.jay (IndexerDeclaration): New helper class to hold
27697         information about indexer_declarator.
27698         (indexer_declarator): Implement actions.
27699         (parsing_indexer): New local boolean used to keep track of whether
27700         we are parsing indexers or properties. This is necessary because 
27701         implicit_parameters come into picture even for the get accessor in the 
27702         case of an indexer.
27703         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
27704
27705         * class.cs (Indexer): New class for indexer declarations.
27706         (TypeContainer::AddIndexer): New method to add an indexer to a type.
27707         (TypeContainer::indexers): New member to hold list of indexers for the
27708         type.
27709
27710 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
27711
27712         * cs-parser.jay (add_accessor_declaration): Implement action.
27713         (remove_accessor_declaration): Implement action.
27714         (event_accessors_declaration): Implement
27715         (variable_declarators): swap statements for first rule - trivial.
27716
27717         * class.cs (Event): New class to hold information about event
27718         declarations.
27719         (TypeContainer::AddEvent): New method to add an event to a type
27720         (TypeContainer::events): New member to hold list of events.
27721
27722         * cs-parser.jay (event_declaration): Implement actions.
27723
27724 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
27725
27726         * cs-parser.jay (dim_separators): Implement. Make it a string
27727         concatenating all the commas together, just as they appear.
27728         (opt_dim_separators): Modify accordingly
27729         (rank_specifiers): Update accordingly. Basically do the same
27730         thing - instead, collect the brackets here.
27731         (opt_rank_sepcifiers): Modify accordingly.
27732         (array_type): Modify to actually return the complete type string
27733         instead of ignoring the rank_specifiers.
27734         (expression_list): Implement to collect the expressions
27735         (variable_initializer): Implement. We make it a list of expressions
27736         essentially so that we can handle the array_initializer case neatly too.
27737         (variable_initializer_list): Implement.
27738         (array_initializer): Make it a list of variable_initializers
27739         (opt_array_initializer): Modify accordingly.
27740
27741         * expression.cs (New::NType): Add enumeration to help us
27742         keep track of whether we have an object/delegate creation
27743         or an array creation.
27744         (New:NewType, New::Rank, New::Indices, New::Initializers): New
27745         members to hold data about array creation.
27746         (New:New): Modify to update NewType
27747         (New:New): New Overloaded contructor for the array creation
27748         case.
27749
27750         * cs-parser.jay (array_creation_expression): Implement to call
27751         the overloaded New constructor.
27752
27753 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
27754
27755         * class.cs (TypeContainer::Constructors): Return member
27756         constructors instead of returning null.
27757
27758 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
27759
27760         * typemanager.cs (InitCoreTypes): Initialize the various core
27761         types after we have populated the type manager with the user
27762         defined types (this distinction will be important later while
27763         compiling corlib.dll)
27764
27765         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
27766         on Expression Classification.  Now all expressions have a method
27767         `Resolve' and a method `Emit'.
27768
27769         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
27770         generation from working.     Also add some temporary debugging
27771         code. 
27772
27773 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
27774
27775         * codegen.cs: Lots of code generation pieces.  This is only the
27776         beginning, will continue tomorrow with more touches of polish.  We
27777         handle the fundamentals of if, while, do, for, return.  Others are
27778         trickier and I need to start working on invocations soon.
27779
27780         * gen-treedump.cs: Bug fix, use s.Increment here instead of
27781         s.InitStatement. 
27782
27783         * codegen.cs (EmitContext): New struct, used during code
27784         emission to keep a context.   Most of the code generation will be
27785         here. 
27786
27787         * cs-parser.jay: Add embedded blocks to the list of statements of
27788         this block.  So code generation proceeds in a top down fashion.
27789
27790 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
27791
27792         * statement.cs: Add support for multiple child blocks.
27793
27794 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
27795
27796         * codegen.cs (EmitCode): New function, will emit the code for a
27797         Block of code given a TypeContainer and its ILGenerator. 
27798
27799         * statement.cs (Block): Standard public readonly optimization.
27800         (Block::Block constructors): Link children. 
27801         (Block::Child): Child Linker.
27802         (Block::EmitVariables): Emits IL variable declarations.
27803
27804         * class.cs: Drop support for MethodGroups here, delay until
27805         Semantic Analysis.
27806         (Method::): Applied the same simplification that I did before, and
27807         move from Properties to public readonly fields.
27808         (Method::ParameterTypes): Returns the parameter types for the
27809         function, and implements a cache that will be useful later when I
27810         do error checking and the semantic analysis on the methods is
27811         performed.
27812         (Constructor::GetCallingConvention): Renamed from CallingConvetion
27813         and made a method, optional argument tells whether this is a class
27814         or a structure to apply the `has-this' bit.
27815         (Method::GetCallingConvention): Implement, returns the calling
27816         convention. 
27817         (Method::Define): Defines the type, a second pass is performed
27818         later to populate the methods.
27819
27820         (Constructor::ParameterTypes): implement a cache similar to the
27821         one on Method::ParameterTypes, useful later when we do semantic
27822         analysis. 
27823
27824         (TypeContainer::EmitMethod):  New method.  Emits methods.
27825
27826         * expression.cs: Removed MethodGroup class from here.
27827
27828         * parameter.cs (Parameters::GetCallingConvention): new method.
27829
27830 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
27831
27832         * class.cs (TypeContainer::Populate): Drop RootContext from the
27833         argument. 
27834
27835         (Constructor::CallingConvention): Returns the calling convention.
27836         (Constructor::ParameterTypes): Returns the constructor parameter
27837         types. 
27838
27839         (TypeContainer::AddConstructor): Keep track of default constructor
27840         and the default static constructor.
27841
27842         (Constructor::) Another class that starts using `public readonly'
27843         instead of properties. 
27844
27845         (Constructor::IsDefault): Whether this is a default constructor. 
27846
27847         (Field::) use readonly public fields instead of properties also.
27848
27849         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
27850         track of static constructors;  If none is used, turn on
27851         BeforeFieldInit in the TypeAttributes. 
27852
27853         * cs-parser.jay (opt_argument_list): now the return can be null
27854         for the cases where there are no arguments. 
27855
27856         (constructor_declarator): If there is no implicit `base' or
27857         `this', then invoke the default parent constructor. 
27858
27859         * modifiers.cs (MethodAttr): New static function maps a set of
27860         modifiers flags into a MethodAttributes enum
27861         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
27862         MethodAttr, TypeAttr to represent the various mappings where the
27863         modifiers are used.
27864         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
27865
27866 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
27867
27868         * parameter.cs (GetParameterInfo): Fix bug where there would be no
27869         method arguments.
27870
27871         * interface.cs (PopulateIndexer): Implemented the code generator
27872         for interface indexers.
27873
27874 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
27875
27876         * interface.cs (InterfaceMemberBase): Now we track the new status
27877         here.  
27878
27879         (PopulateProperty): Implement property population.  Woohoo!  Got
27880         Methods and Properties going today. 
27881
27882         Removed all the properties for interfaces, and replaced them with
27883         `public readonly' fields. 
27884
27885 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
27886
27887         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
27888         initialize their hashtables/arraylists only when they are needed
27889         instead of doing this always.
27890
27891         * parameter.cs: Handle refs and out parameters.
27892
27893         * cs-parser.jay: Use an ArrayList to construct the arguments
27894         instead of the ParameterCollection, and then cast that to a
27895         Parameter[] array.
27896
27897         * parameter.cs: Drop the use of ParameterCollection and use
27898         instead arrays of Parameters.
27899
27900         (GetParameterInfo): Use the Type, not the Name when resolving
27901         types. 
27902
27903 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
27904
27905         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
27906         and instead use public readonly fields.
27907
27908         * class.cs: Put back walking code for type containers.
27909
27910 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
27911
27912         * class.cs (MakeConstant): Code to define constants.
27913
27914         * rootcontext.cs (LookupType): New function.  Used to locate types 
27915
27916
27917 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
27918
27919         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
27920         this System.Reflection code is.  Kudos to Microsoft
27921
27922         * typemanager.cs: Implement a type cache and avoid loading all
27923         types at boot time.  Wrap in LookupType the internals.  This made
27924         the compiler so much faster.  Wow.  I rule!
27925
27926         * driver.cs: Make sure we always load mscorlib first (for
27927         debugging purposes, nothing really important).
27928
27929         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
27930         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
27931
27932         * rootcontext.cs: Lookup types on their namespace;  Lookup types
27933         on namespaces that have been imported using the `using' keyword.
27934
27935         * class.cs (TypeContainer::TypeAttr): Virtualize.
27936         (Class::TypeAttr): Return attributes suitable for this bad boy.
27937         (Struct::TypeAttr): ditto.
27938         Handle nested classes.
27939         (TypeContainer::) Remove all the type visiting code, it is now
27940         replaced with the rootcontext.cs code
27941
27942         * rootcontext.cs (GetClassBases): Added support for structs. 
27943
27944 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
27945
27946         * interface.cs, statement.cs, class.cs, parameter.cs,
27947         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
27948         Drop use of TypeRefs, and use strings instead.
27949
27950 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
27951
27952         * rootcontext.cs: 
27953
27954         * class.cs (Struct::Struct): set the SEALED flags after
27955         checking the modifiers.
27956         (TypeContainer::TypeAttr): new property, returns the
27957         TypeAttributes for a class.  
27958
27959         * cs-parser.jay (type_list): Oops, list production was creating a
27960         new list of base types.
27961
27962         * rootcontext.cs (StdLib): New property.
27963         (GetInterfaceTypeByName): returns an interface by type name, and
27964         encapsulates error handling here.
27965         (GetInterfaces): simplified.
27966         (ResolveTree): Encapsulated all the tree resolution here.
27967         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
27968         types. 
27969
27970         * driver.cs: Add support for --nostdlib, to avoid loading the
27971         default assemblies.
27972         (Main): Do not put tree resolution here. 
27973
27974         * rootcontext.cs: Beginning of the class resolution.
27975
27976 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
27977
27978         * rootcontext.cs: Provide better error reporting. 
27979
27980         * cs-parser.jay (interface_base): set our $$ to be interfaces.
27981
27982         * rootcontext.cs (CreateInterface): Handle the case where there
27983         are no parent interfaces.
27984
27985         (CloseTypes): Routine to flush types at the end.
27986         (CreateInterface): Track types.
27987         (GetInterfaces): Returns an array of Types from the list of
27988         defined interfaces.
27989
27990         * typemanager.c (AddUserType): Mechanism to track user types (puts
27991         the type on the global type hash, and allows us to close it at the
27992         end). 
27993
27994 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
27995
27996         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
27997         RecordInterface instead.
27998
27999         * cs-parser.jay: Updated to reflect changes above.
28000
28001         * decl.cs (Definition): Keep track of the TypeBuilder type that
28002         represents this type here.  Not sure we will use it in the long
28003         run, but wont hurt for now.
28004
28005         * driver.cs: Smaller changes to accomodate the new code.
28006
28007         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
28008         when done. 
28009
28010         * rootcontext.cs (CreateInterface):  New method, used to create
28011         the System.TypeBuilder type for interfaces.
28012         (ResolveInterfaces): new entry point to resolve the interface
28013         hierarchy. 
28014         (CodeGen): Property, used to keep track of the code generator.
28015
28016 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
28017
28018         * cs-parser.jay: Add a second production for delegate_declaration
28019         with `VOID'.
28020
28021         (enum_body): Put an opt_comma here instead of putting it on
28022         enum_body or enum_member_declarations so we can handle trailing
28023         commas on enumeration members.  Gets rid of a shift/reduce.
28024
28025         (type_list): Need a COMMA in the middle.
28026
28027         (indexer_declaration): Tell tokenizer to recognize get/set
28028
28029         * Remove old targets.
28030
28031         * Re-add the parser target.
28032
28033 2001-07-13  Simon Cozens <simon@simon-cozens.org>
28034
28035         * cs-parser.jay: Add precendence rules for a number of operators
28036         ot reduce the number of shift/reduce conflicts in the grammar.
28037
28038 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
28039
28040         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
28041         and put it here.
28042
28043         Get rid of old crufty code.
28044
28045         * rootcontext.cs: Use this to keep track of the parsed
28046         representation and the defined types available to the program. 
28047
28048         * gen-treedump.cs: adjust for new convention.
28049
28050         * type.cs: Split out the type manager, and the assembly builder
28051         from here. 
28052
28053         * typemanager.cs: the type manager will live here now.
28054
28055         * cil-codegen.cs: And the code generator here. 
28056
28057 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
28058
28059         * makefile: Fixed up for easy making.
28060
28061 2001-07-13  Simon Cozens <simon@simon-cozens.org>
28062
28063         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
28064         the 
28065
28066         (unary_expression): Expand pre_increment_expression and
28067         post_decrement_expression to reduce a shift/reduce.
28068
28069 2001-07-11  Simon Cozens
28070
28071         * cs-tokenizer.cs: Hex numbers should begin with a 0.
28072
28073         Improve allow_keyword_as_indent name.
28074
28075 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
28076
28077         * Adjustments for Beta2. 
28078
28079 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
28080
28081         * decl.cs: Added `Define' abstract method.
28082         (InTransit): new property, used to catch recursive definitions. 
28083
28084         * interface.cs: Implement `Define'. 
28085
28086         * modifiers.cs: Map Modifiers.constants to
28087         System.Reflection.TypeAttribute flags.
28088
28089         * class.cs: Keep track of types and user-defined types.
28090         (BuilderInit): New method for creating an assembly
28091         (ResolveType): New function to launch the resolution process, only
28092         used by interfaces for now.
28093
28094         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
28095         that are inserted into the name space. 
28096
28097 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
28098
28099         * ARGH.  I have screwed up my tree so many times due to the use of
28100         rsync rather than using CVS.  Going to fix this at once. 
28101
28102         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
28103         load types.
28104
28105 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
28106
28107         * Experiment successful: Use System.Type rather that our own
28108         version of Type.  
28109
28110 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
28111
28112         * cs-parser.jay: Removed nsAliases from here.
28113
28114         Use new namespaces, handle `using XXX;' 
28115
28116         * namespace.cs: Reimplemented namespace handling, use a recursive
28117         definition of the class.  Now we can keep track of using clauses
28118         and catch invalid using clauses.
28119
28120 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
28121
28122         * gen-treedump.cs: Adapted for all the renaming.
28123
28124         * expression.cs (Expression): this class now has a Type property
28125         which returns an expression Type.
28126
28127         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
28128         `Type', as this has a different meaning now in the base
28129
28130 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
28131
28132         * interface.cs, class.cs: Removed from all the sources the
28133         references to signature computation, as we can not do method
28134         signature computation during the parsing time, as we are not
28135         trying to solve at that point distinguishing:
28136
28137         class X {
28138                 void a (Blah x) {}
28139                 void a (NS.Blah x) {}
28140         }
28141
28142         Which depending on the context might be valid or not, as we do not
28143         know if Blah is the same thing as NS.Blah at that point.
28144
28145         * Redid everything so the code uses TypeRefs now instead of
28146         Types.  TypeRefs are just temporary type placeholders, that need
28147         to be resolved.  They initially have a pointer to a string and the
28148         current scope in which they are used.  This is used later by the
28149         compiler to resolve the reference to an actual Type. 
28150
28151         * DeclSpace is no longer a CIR.Type, and neither are
28152         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
28153         are all DeclSpaces, but no Types. 
28154
28155         * type.cs (TypeRefManager): This implements the TypeRef manager,
28156         which keeps track of all the types that need to be resolved after
28157         the parsing has finished. 
28158
28159 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
28160
28161         * ARGH.  We are going to have to store `foreach' as a class rather
28162         than resolving it, as we need to verify error 1579 after name
28163         resolution.   *OR* we could keep a flag that says `This request to
28164         IEnumerator comes from a foreach statement' which we can then use
28165         to generate the error.
28166
28167 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
28168
28169         * class.cs (TypeContainer.AddMethod): we now add methods to the
28170         MethodGroup instead of the method hashtable.  
28171
28172         * expression.cs: Add MethodGroup abstraction, which gets us one
28173         step closer to the specification in the way we handle method
28174         declarations.  
28175
28176         * cs-parser.jay (primary_expression): qualified_identifier now
28177         tried to match up an identifier to a local variable reference or
28178         to a parameter reference.
28179
28180         current_local_parameters is now a parser global variable that
28181         points to the current parameters for the block, used during name
28182         lookup.
28183
28184         (property_declaration): Now creates an implicit `value' argument to
28185         the set accessor.
28186
28187 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
28188
28189         * parameter.cs: Do not use `param' arguments as part of the
28190         signature, per the spec.
28191
28192 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
28193
28194         * decl.cs: Base class for classes, structs and interfaces.  This
28195         is the "Declaration Space" 
28196
28197         * cs-parser.jay: Use CheckDef for checking declaration errors
28198         instead of having one on each function.
28199
28200         * class.cs: Factor out some code for handling error handling in
28201         accordance to the "Declarations" section in the "Basic Concepts"
28202         chapter in the ECMA C# spec.
28203
28204         * interface.cs: Make all interface member classes derive from
28205         InterfaceMemberBase.
28206
28207 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
28208
28209         * Many things: all interfaces are parsed and generated in
28210         gen-treedump.  Support for member variables, constructors,
28211         destructors, properties, constants is there.
28212
28213         Beginning of the IL backend, but very little done, just there for
28214         testing purposes. 
28215
28216 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
28217
28218         * cs-parser.jay: Fix labeled statement.
28219
28220         * cs-tokenizer.cs (escape): Escape " and ' always.
28221         ref_line, ref_name: keep track of the line/filename as instructed
28222         by #line by the compiler.
28223         Parse #line.
28224
28225 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
28226
28227         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
28228         to match the values in System.CodeDOM.
28229
28230         Divid renamed to Divide.
28231
28232         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
28233         statements. 
28234         (Statements.set): remove.
28235
28236         * System.CodeDOM/CodeCatchClause.cs: always have a valid
28237         statements. 
28238
28239         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
28240         falseStatements always have valid values. 
28241
28242         * cs-parser.jay: Use System.CodeDOM now.
28243