2007-08-17 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / gmcs / ChangeLog
1 2007-08-17  Marek Safar  <marek.safar@gmail.com>
2
3         * linq.cs: MethodGroupExpr update.
4         
5 2007-08-14  Marek Safar  <marek.safar@gmail.com>
6
7         ** C# 3.0 Object and collection initializers
8         
9         * cs-parser.jay: Grammar update.
10         
11 2007-08-11  Marek Safar  <marek.safar@gmail.com>
12
13         A fix for bug #82412
14         * generics.cs (TypeInferenceContext.LowerBoundInference): Don't 
15         terminate type inference when an array is not paired.
16         
17 2007-08-10  Miguel de Icaza  <miguel@novell.com>
18
19         * generic.cs (DefaultValueExpression): Add CloneTo support to this
20         as well. 
21
22 2007-08-09  Marek Safar  <marek.safar@gmail.com>
23  
24         ** C# 3.0 Anonymous Types (update to the latest standard)
25         
26         * cs-parser.jay: Updated parameters and type names.
27
28 2007-08-03  Raja R Harinath  <harinath@gmail.com>
29
30         * cs-parser.jay (class_declaration): Update to changes in class.cs.
31         Move calling of 'AddBasesForPart' to ...
32         (class_bases): ... here.
33         (struct_declaration, interface_declaration): Update to changes.
34
35 2007-08-02  Raja R Harinath  <harinath@gmail.com>
36
37         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
38         * cs-parser.jay: Some whitespace cleanups.
39         (method_header): Refer to the correct symbol for parameters.
40
41 2007-08-01  Marek Safar  <marek.safar@gmail.com>
42
43         A fix for bug #82181
44         * cs-parser.jay: Ignore partial keyword inside block expression.
45         
46 2007-08-01  Marek Safar  <marek.safar@gmail.com>
47
48         ** C# 3.0 Type Inference (major bits are working)
49         
50         * generic.cs: Introduced new abstract class as an entry point to type
51         inference. Old type inference moved to TypeInferenceV2. Implemented C# 3.0
52         type inference as descibed in the standard in TypeInferenceV2 class.
53         
54         * linq.cs (ALinqExpression): Disabled caching because it's wrong.
55         
56 2007-07-25  Jb Evain  <jbevain@novell.com>
57
58         * Makefile: don't install on net_2_1.
59
60 2007-07-18  Marek Safar  <marek.safar@gmail.com>
61
62         * cs-parser.jay: Use ImplicitLambdaParameter everywhere.
63
64 2007-07-17  Marek Safar  <marek.safar@gmail.com>
65
66         * cs-parser.jay: Correct placeholder for implicit linq parameter.
67         
68         * linq: Add ImplicitArgument.
69
70 2007-07-03  Marek Safar  <marek.safar@gmail.com>
71
72         * cs-parser.jay: Switch to ImplicitLambdaParameter.
73
74 2007-07-03  Marek Safar  <marek.safar@gmail.com>
75
76         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
77         members too.
78         
79         * linq.cs (QueryExpression.DoResolve): Resolve implicitly typed query
80         variable.
81         
82 2007-06-20  Marek Safar  <marek.safar@gmail.com>
83
84         * cs-parser.jay: Reworked var keyword handling. We cannot handle var as
85         static keyword because var becomes keyword only if no type with the var
86         name exists in the scope of variable which uses var declaration.
87         
88 2007-06-18  Marek Safar  <marek.safar@gmail.com>
89
90         * cs-parser.jay: Add implicitly typed local variable checks.
91
92 2007-06-15  Marek Safar  <marek.safar@gmail.com>
93
94         * cs-parser.jay: Correctly split generic arguments and generic
95          parameters. Correctly implemented typeof of generic unbound types.
96
97 2007-06-14  Marek Safar  <marek.safar@gmail.com>
98
99         * cs-parser.jay: Assembly and module attributes must precede all other
100         elements except using clauses and extern alias declarations.
101
102 2007-06-08  Marek Safar  <marek.safar@gmail.com>
103
104         * cs-parser.jay: Uses newly defined GroupBy class.
105         
106         * linq.cs (GroupBy): Implemented.
107         (AQueryClause.BuildQueryClause): Refactored to allow customize query
108         method arguments.
109
110 2007-06-08  Marek Safar  <marek.safar@gmail.com>
111
112         * generics.cs (InferTypeArguments): Uses AnonymousMethodExpression
113         InferTypeArguments.
114
115 2007-06-06  Marek Safar  <marek.safar@gmail.com>
116
117         * generics.cs (TypeArguments): New contructor fow known number of
118         arguments.
119
120 2007-06-04  Raja R Harinath  <rharinath@novell.com>
121
122         * linq.cs (Select.DoResolve): Pass the created parameters to the
123         ToplevelBlock too.
124
125 2007-05-29  Raja R Harinath  <rharinath@novell.com>
126
127         * cs-parser.jay: Update to changes in ToplevelBlock.
128         (top_current_block): Remove.
129
130 2007-05-27  Raja R Harinath  <harinath@gmail.com>
131
132         * cs-parser.jay: Update to new ExplicitBlock invariant.
133
134         * cs-parser.jay: Update to changes introduced in Block and
135         ExplicitBlock.
136
137 2007-05-25  Raja R Harinath  <rharinath@novell.com>
138
139         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
140         modifying current_block directly.
141
142 2007-05-22  Scott Peterson  <lunchtimemama@gmail.com>
143         
144         * cs-parser.jay: Implemented automatic properties (C# 3.0)
145
146 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
147         
148         * cs-parser.jay: Improved grammar for object and collection
149           initialization.
150
151 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
152
153         This code is contributed under the MIT X11 license
154         
155         * cs-parser.jay: Added support for C# 3.0 language features:
156           Variable type inference (the "var" keyword)
157           Anonymous types
158           Array type inference
159           Object initialization
160           Collection initialization
161
162 2007-05-06  Marek Safar  <marek.safar@gmail.com>
163
164         A fix for bug #81500
165         * cs-parser.jay: Add special handling for coalescing operator.
166
167 2007-05-02  Raja R Harinath  <rharinath@novell.com>
168
169         Fix regression in cs0631-3.cs
170         * cs-parser.jay (operator_declarator): Add opt_attributes to error
171         fallback.  Make error fallback catch more cases.
172
173 2007-05-01  Miguel de Icaza  <miguel@novell.com>
174
175         * cs-parser.jay: Allow parameters in operator declarations to have
176         attributes. 
177
178 2007-04-27  Miguel de Icaza  <miguel@novell.com>
179
180         * generic.cs (TypeManager.LambdaInfer): now this routine will
181         make only one inference from the list of lambda expression that
182         have not participated in inferring a type.
183
184         (TypeManager.InferTypeArguments): The logic that drives the type
185         inference in lambda expressions is now driven here. 
186
187 2007-04-23  Miguel de Icaza  <miguel@novell.com>
188
189         * generic.cs: Large update to LambdaInfer, this is merely an
190         update to start the lambda type inference.   It is by no means
191         complete.  It is currently merely able to build a sample program
192         (with no iteration for the type parameters).
193
194 2007-04-12  Duncan Mak  <duncan@a-chinaman.com>
195
196         * cs-parser.jay (interface_method_declaration_body): Fixed typo.
197
198 2007-04-08  Marek Safar  <marek.safar@gmail.com>
199
200         * cs-parser.jay, linq.cs: First select implementation (hacky).
201
202         * generic.cs (InferTypeArguments): Simplified.
203
204 2007-03-31  Marek Safar  <marek.safar@gmail.com>
205
206         * generic.cs (InferTypeArguments): Restored validation check.
207         (InferTypeArguments): Move all logic to Compatible method for re-usability.
208
209 2007-03-25  Marek Safar  <marek.safar@gmail.com>
210
211         * generic.cs (InferTypeArguments): Infer arguments before they are used
212         for compatibility check.
213
214 2007-03-15  Marek Safar  <marek.safar@gmail.com>
215
216         * generic.cs (InflatedConstraints): Fixed the check order.
217         (TypeArguments.Resolve): Small optimization for generic parameters.
218         (InferTypeArguments): Add infering support for anonymous methods.
219
220 2007-03-15  Martin Baulig  <martin@ximian.com>
221
222         Fix #79984.
223
224         * generic.cs
225         (TypeParameter.HasConstructorConstraint): Removed.
226         (ConstraintChecker.HasDefaultConstructor): Removed the
227         `TypeBuilder' argument here; correctly check for the ctor
228         constraint on type parameters.
229
230 2007-03-15  Martin Baulig  <martin@ximian.com>
231
232         Fix #79302.
233
234         * generic.cs
235         (TypeParameter): Create a `MemberCache' here as well.  Note that
236         we need to create this on-demand when it's actually used.
237
238 2007-03-10  Marek Safar  <marek.safar@gmail.com>
239
240         * generic.cs (TypeArguments.Resolve): Avoid redundant checks.
241
242 2007-03-09  Raja R Harinath  <rharinath@novell.com>
243
244         * cs-parser.jay (WHERE): Move before QUERY_FIRST_TOKEN.  'where'
245         is a valid keyword outside a linq expression too.
246
247 2007-03-03  Marek Safar  <marek.safar@gmail.com>
248
249         * cs-parser.jay: Implemented basic linq grammar.
250
251         * linq.cs: New file for hosting query specific classes.
252
253 2007-02-26  Marek Safar  <marek.safar@gmail.com>
254
255         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
256
257 2007-02-20  Marek Safar  <marek.safar@gmail.com>
258
259         A fix for bug #80650
260         * cs-parser.jay: Anonymous container starts at constructor declaration
261         and not at block beginning because it has to be usable in constructor
262         initializer.
263
264 2007-02-18  Marek Safar  <marek.safar@gmail.com>
265
266         A fix for bug #80493 by Atsushi Enomoto
267         * cs-parser.jay: Ignore invalid attribute target.
268
269 2007-02-15  Miguel de Icaza  <miguel@novell.com>
270
271         * Remove the call to SetExpression for lambda expressions, we do
272         not actually need it.
273
274         Remove expression tracking code as its not needed.
275
276 2007-02-11  Miguel de Icaza  <miguel@novell.com>
277
278         * cs-parser.jay (lambda_expression_body): when the body is an
279         expression add a statement of the form:
280
281                 contextual-return expression.
282
283         Where `contextual-return' is similar to `return', the difference
284         being that if the delegate that the lambda will be converted to
285         has a void return type, it will check that the result is a
286         ExpressionStatement and the result is a plain ret (no return
287         values on the stack).  If the return type of the delegate is of a
288         given type, this turns into a return with a value and does the
289         regular checking to check that the computed value can be
290         implicitly converted to the delegate return.
291
292 2007-01-30  Miguel de Icaza  <miguel@novell.com>
293
294         * cs-parser.jay (anonymous_method_expression): move the
295         before/after productions to the start_anonymous and end_anonymous
296         methods so the code can be reused for lambda functions.
297
298         (lambda_expression_body): wrap expressions implicitly into a
299         block.
300
301         (block): factor out the setup/teardown of parsing a block so we
302         can reuse that in lambda_expression_body
303
304         (lambda_expression): use new anonymous method helper methods.
305
306 2007-01-29  Miguel de Icaza  <miguel@novell.com>
307
308         * cs-parser.jay: oob_stack make it static (am guessing that is why
309         we no longer initialize it anymore) and reuse it across
310         instances.
311
312 2007-01-28  Miguel de Icaza  <miguel@novell.com>
313
314         * cs-parser.jay (open_parens): Introduce new non-terminal that
315         abstracts OPEN_PARENS and OPEN_PARENS_LAMBDA as the later can now
316         be returned in places where types are followed by identifiers
317         (this is expected in declaration, fixed, using, foreach and catch
318         clauses). 
319
320         Use open_parens in those places, keep OPEN_PARENS in the
321         expressions.  
322
323         cs-parser.jay: New grammar bits for parsing lambda expressions. 
324
325 2007-01-28  Raja R Harinath  <rharinath@novell.com>
326
327         Fix #80534, gtest-309.cs
328         * generic.cs (UnifyType): Rename from InferType.  Make unification
329         of generic insts simpler and don't insist on inferring all generic
330         parameters in a single generic inst unification.
331         (UnifyTypes): New.
332         (InferGenericInstance): Remove.
333         Analysis and initial patch by David Mitchell <dmitchell@logos.com>.
334
335 2007-01-20  Marek Safar  <marek.safar@gmail.com>
336
337         * cs-parser.jay: Better parameter error handling.
338
339 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
340             Raja R Harinath  <rharinath@novell.com>
341
342         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
343         Note the order in which accessors are declared in the source.
344
345 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
346
347         * generic.cs (TypeParameter.FindMembers): Use the generic
348         constraints, not the constraints to check for methods (first fix
349         of 80518).
350
351 2006-12-30  Marek Safar  <marek.safar@gmail.com>
352
353         * cs-parser.jay: Better syntax errors handling.
354
355 2006-11-21  Marek Safar  <marek.safar@gmail.com>
356
357         * cs-parser.jay: Tiny change to work with mcs tokenizer.
358
359         * cs-tokenizer.cs: Remove after unification with mcs.
360
361 2006-10-28  Marek Safar  <marek.safar@gmail.com>
362
363         A fix for bug #78998
364         * generic.cs (ConstructedType.AsAccessible): Check accessibility of type
365         arguments as well.
366
367 2006-10-26  Marek Safar  <marek.safar@gmail.com>
368
369         A fix for bug #76591
370         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous methods.
371
372 2006-10-25  Brian Crowell  <brian@fluggo.com>
373
374         Fix #79703
375         * generic.cs (CheckConstraints): Allow generic parameters with
376         inheritance constraints to satisfy reference type constraints.
377
378 2006-10-09  Martin Baulig  <martin@ximian.com>
379
380         * generic.cs
381         (NullCoalescingOperator.DoResolve): Fix #78964; added gtest-294.cs.
382
383 2006-09-25  Martin Baulig  <martin@ximian.com>
384
385         * class.cs: Remove after unification with mcs source.
386
387 2006-09-24  Raja R Harinath  <harinath@gmail.com>
388
389         * convert.cs: Remove after unification with mcs source.
390
391 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
392
393         * class.cs (MemberBase.VerifyClsCompliance): When method has type
394         parameters verify them as well.
395
396         * generic.cs (Constraints.VerifyClsCompliance): Verify CLS-Compliance of
397         the type parameter constraints.
398         (Generics.VerifyClsCompliance): Ditto.
399
400 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
401
402         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
403         for anonymous block with out argument.
404
405 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
406
407         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
408         not used private events only.
409
410 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
411
412         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
413
414         * cs-parser.jay: Parse correctly cast of default (T).
415
416         * generic.cs (DefaultValueExpression.DoResolve): Check for void type.
417         Store original type via EmptyConstantCast.
418
419 2006-09-22  Martin Baulig  <martin@ximian.com>
420
421         * delegate.cs: Removed; this file is now shared with mcs.
422
423         * attribute.cs: Removed; this file is now shared with mcs.
424
425 2006-09-22  Martin Baulig  <martin@ximian.com>
426
427         * ecore.cs: Removed; this file is now shared with mcs.
428
429 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
430
431         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
432
433         * ecore.cs (NullCast): Derives from NullConstant.
434
435         * generic.cs (DefaultValueExpression): Fixed to cope with the constant
436         results.
437
438 2006-09-21  Martin Baulig  <martin@ximian.com>
439
440         * decl.cs: Removed; this file is now shared with mcs.
441
442 2006-09-21  Raja R Harinath  <rharinath@novell.com>
443
444         * rootcontext.cs: Remove after unification with mcs source.
445
446         * report.cs: Remove after unification with mcs source.
447         * generic.cs (AddTypeParameter, LookupTypeParameter): Move to
448         mcs/typemanager.cs.
449         (InitGenerics, CleanUpGenerics): Remove.
450
451         * support.cs: Remove after unification with mcs source.
452
453 2006-09-20  Raja R Harinath  <rharinath@novell.com>
454
455         * codegen.cs: Remove after unification with mcs source.
456
457 2006-09-19  Martin Baulig  <martin@ximian.com>
458
459         * expression.cs: Removed; this file is now shared with mcs.
460
461 2006-09-19  Martin Baulig  <martin@ximian.com>
462
463         * generic.cs
464         (TypeManager.IsEqual): Moved into ../mcs/typemanager.cs.
465         (TypeManager.DropGenericTypeArguments): Likewise.
466         (TypeManager.DropGenericMethodArguments): Likewise.
467         (TypeManager.GetTypeArguments): Likewise.
468         (TypeManager.HasGenericArguments): Likewise.
469
470 2006-09-19  Martin Baulig  <martin@ximian.com>
471
472         * ecore.cs (PropertyExpr.InstanceResolve): Fix the CS1540 check.
473
474 2006-09-19  Martin Baulig  <martin@ximian.com>
475
476         * typemanager.cs: Removed; this file is now shared with mcs.
477
478 2006-09-16  Raja R Harinath  <rharinath@novell.com>
479
480         * Makefile (LOCAL_MCS_FLAGS): Use instead of PROFILE_MCS_FLAGS.
481         * AssemblyInfo.cs, driver.cs: Remove after unification with mcs source.
482
483 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
484
485         A fix for #79401
486         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
487         only if parent type is class.
488         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
489         update.
490
491 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
492
493         * cs-parser.jay,
494         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
495         keywords are used.
496         * typemanager.cs(CSharpName): Converts NullType to null.
497
498 2006-09-15  Martin Baulig  <martin@ximian.com>
499
500         * pending.cs: Removed; this file is now shared with mcs.
501
502 2006-09-15  Martin Baulig  <martin@ximian.com>
503
504         * statement.cs: Removed; this file is now shared with mcs.
505
506 2006-09-15  Martin Baulig  <martin@ximian.com>
507
508         * rootcontext.cs (RootContext.BrokenCircularDeps): Removed.
509
510         * driver.cs: Removed the `--broken-cycles' argument.
511
512 2006-09-15  Martin Baulig  <martin@ximian.com>
513
514         * namespace.cs: Removed; this file is now shared with mcs.
515
516 2006-09-15  Martin Baulig  <martin@ximian.com>
517
518         * decl.cs (MemberName): Minor code cleanups.
519
520 2006-09-15  Martin Baulig  <martin@ximian.com>
521
522         * parameter.cs: Removed; this file is now shared with mcs.
523
524 2006-09-15  Martin Baulig  <martin@ximian.com>
525
526         * enum.cs: Removed; this file is now shared with mcs.
527
528 2006-09-15  Martin Baulig  <martin@ximian.com>
529
530         * Makefile: Define `GMCS_SOURCE'.
531
532         * flowanalysis.cs: Removed; this file is now shared with mcs.
533
534 2006-09-15  Martin Baulig  <martin@ximian.com>
535
536         Removed modifiers.cs, literal.cs, location.cs, roottypes.cs,
537         assign.cs, const.cs, cfold.cs, constant.cs, symbolwriter.cs and
538         doc.cs - they are now shared with mcs.
539
540         * gmcs.exe.sources: Include these files from ../mcs/.
541
542 2006-09-15  Martin Baulig  <martin@ximian.com>
543
544         * old-code.cs, gen-il.cs, gen-treedump.cs: Removed old stuff.
545         * g1.cs, sample-hello.cs, sample-stack.il: Likewise.
546
547 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
548
549         * assign.cs, ecore.cs, expression.cs: Share error message text.
550         * class.cs (FieldMember.Define): Check for variable of static type.
551         * decl.cs (check_type_parameter): Report correct type name.
552         * driver.cs (LoadAssembly): Uses error output for errors.
553         * generic.cs (Constraints.Resolve): Add check for constraint accessibility
554         (TypeArguments.Resolve): Static class cannot be used as an argument.
555         * statement.cs (ResolveMeta): Constants cannot be generic types.
556
557 2006-09-12  Martin Baulig  <martin@ximian.com>
558
559         * generic.cs (TypeManager.IsIList): Moved into convert.cs.
560
561         * convert.cs (Convert.Array_To_IList): Moved here and correctly
562         implement it; fixes #79345.
563
564 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
565
566         * decl.cs (DeclSpace.SetParameterInfo): Check for nonexistent type
567         parameter.
568         * expression.cs (TypeOf.GetAttributableValue): Check for open generic
569         types.
570         * generic.cs: Improved error messages.
571         * typemanager.cs (RemoveGenericArity): Made public.
572
573 2006-09-08  Martin Baulig  <martin@ximian.com>
574
575         * typemanager.cs (TypeManager.interlocked_type): New public field.
576         (TypeManager.int_interlocked_compare-exchange): New public field.
577         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
578         enumerator types here and call InitGenericCoreTypes().
579         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
580         after calling InitEnumUnderlyingTypes().
581
582         * rootcontext.cs
583         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
584         `classes_second_stage'. 
585
586 2006-09-07  Marek Safar  <marek.safar@seznam.cz>
587  
588         * class.cs, generic.cs (GenericMethod.Define): Check for type parameter
589         collisions.
590         * statement.cs (Block.Variables): Made public.
591
592 2006-09-07  Martin Baulig  <martin@ximian.com>
593
594         * driver.cs
595         (MainDriver): Revert r62663 from Marek; see #70506 for details.
596
597 2006-09-01  Martin Baulig  <martin@ximian.com>
598
599         * generic.cs
600         (TypeManager.IsIList): Also handle base classes and interfaces. 
601
602 2006-09-01  Raja R Harinath  <rharinath@novell.com>
603
604         Fix #79238
605         * expression.cs (Invocation.MoreSpecific): Check for reference
606         types earlier.
607
608 2006-08-29  Miguel de Icaza  <miguel@novell.com>
609
610         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
611
612 2006-08-17  Miguel de Icaza  <miguel@novell.com>
613
614         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
615         #52019 and #79064, the use of the \uXXXX sequence in source code
616         to represent unicode characters.
617
618 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
619  
620         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
621         support.
622         * class.cs, ecore.cs, statement.cs: Merged to one error message.
623
624 2006-08-14  Raja R Harinath  <rharinath@novell.com>
625
626         Fix #79067
627         * cs-tokenizer.cs (parse_less_than): Allow '*' to appear in a type
628         parameter too.  This only avoids a parse error -- the semantic
629         error is caught elsewhere.
630
631 2006-08-13  Miguel de Icaza  <miguel@novell.com>
632
633         * assign.cs: Catch attempts to assign to a method groups in += and
634         report as 1656
635
636 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
637
638         A fix for #79056
639         * cs-parser.jay: Don't destroy current array type by typeof of array's.
640
641 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
642
643         * cs-parser.jay: Check whether a constraint clause has already been
644         specified for type parameter.
645         * generic.cs (Constraints): Exposed location.
646
647 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
648
649         * class.cs (Method.Define): Issue a warning when generic method looks like
650         an entry point.
651         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
652         as well.
653         * report.cs: New warning number.
654
655 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
656  
657         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
658         looking for ctor.
659         * decl.cs (MemberCache.FindMembers): When container is interface we need to
660         search all base interfaces as a member can be ambiguous.
661         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
662         Constructor member type filter. 
663         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
664         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
665         reporting for returned memberinfos.
666         * report.cs: Updated.
667         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
668         version to work on all runtimes.
669         (TypeManager.RealMemberLookup): Removed members filtering.
670
671 2006-08-08  Raja R Harinath  <rharinath@novell.com>
672
673         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
674         (PropertyExpr.EmitAssign): Likewise.
675         * expression.cs (Indirection.EmitAssign): Likewise.
676         (LocalVariableReference.EmitAssign): Likewise.
677         (ParameterReference.EmitAssign): Likewise.
678         (Invocation.EmitArguments): Likewise.
679         (ArrayAccess.EmitAssign): Likewise.
680         (IndexerAccess.EmitAssign): Likewise.
681         (This.EmitAssign): Likewise.
682         (ConditionalLogicalOperator.Emit): Likewise.
683
684         Fix #79026
685         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
686         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
687         leave it in after returning it.
688         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
689
690 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
691
692         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
693         message.
694
695 2006-08-05  Marek Safar  <marek.safar@seznam.cz>
696
697         * class.cs (TypeContainer.AddPartial): Add check for partial declarations
698         with different type names.
699         (TypeContainer.UpdateTypeParameterConstraints): Updated an error message.
700
701 2006-08-03  Raja R Harinath  <rharinath@novell.com>
702
703         Fix cs0146-3.cs and cs0146-4.cs.
704         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
705         enclosing types don't depend on the current type.
706
707 2006-08-02  Raja R Harinath  <rharinath@novell.com>
708
709         Fix #77963
710         * class.cs (TypeContainer.DoDefineMembers): Use
711         FindBaseMemberWithSameName on Parent, since we're interested in
712         whether we hide inherited members or not.
713         (FindBaseMemberWithSameName): Make slightly more robust.
714
715         Fix #77396
716         * codegen.cs (IResolveContext.GenericDeclContainer): New.
717         (EmitContext): Implement new interface requirement.
718         * namespace.cs (UsingEntry, LocalAliasEntry): Likewise.
719         * decl.cs (MemberCore): Likewise.
720         (DeclSpace.GenericDeclContainer): Rename from DeclContainer.
721         * ecore.cs (SimpleName.ResolveAsTypeTerminal): Use
722         ec.GenericDeclContainer to check for generic parameters.
723         (SimpleName.DoSimpleNameResolve): Likewise.
724         * generic.cs (TypeParameter.DeclContainer): Remove override.
725
726         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
727         declspaces for doppelgangers too.
728         (UsingEntry): Implement IResolveContext.
729         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
730         'this' as the resolve context.
731         (LocalAliasEntry): Likewise.
732
733         Implement parts of #77403
734         * roottypes.cs (RootDeclSpace): New.  Used to represent the
735         toplevel declaration space.  Each namespace declaration introduces
736         a "partial" root declaretion space.
737         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
738         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
739         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
740         from 'current_namespace.SlaveDeclSpace'.
741         (namespace_declaration): Likewise.
742         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
743         check.  It can't happen now.
744         * decl.cs (DeclSpace.LookupType): Likewise.
745         * driver.cs (MainDriver): Sanity check.
746
747 2006-08-01  Raja R Harinath  <rharinath@novell.com>
748
749         * decl.cs (DeclSpace.FindNestedType): Remove.
750         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
751         LookupTypeContainer to get the container of the nested type.
752         * class.cs (TypeContainer.FindNestedType): Make non-override.
753
754 2006-07-31  Raja R Harinath  <rharinath@novell.com>
755
756         * decl.cs (DeclSpace.PartialContainer): Move field from ...
757         * class.cs (TypeContainer.PartialContainer): ... here.
758         (TypeContainer.AddBasesForPart): New helper.
759         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
760         instead.
761         * cs-parser.jay (current_class): Convert to DeclSpace.
762         (struct_declaration, interface_declaration, class_declaration):
763         Use AddBasesForPart instead of .Bases directly.
764         * const.cs, iterators.cs: Update to changes.
765
766 2006-07-28  Raja R Harinath  <rharinath@novell.com>
767
768         * class.cs (TypeContainer.AddMemberType): Rename from
769         AddToTypeContainer.
770         (TypeContainer.AddMember): Rename from AddToMemberContainer.
771         (AddTypeContainer): New.  Combine AddClassOrStruct and
772         AddInterface.
773         (AddPartial): Update.  Add 'is_partial' argument.
774         * roottypes.cs: Update to changes.
775         * cs-parser.jay (push_current_class): New helper for handling
776         current_container and current_class.
777         (struct_declaration, interface_declaration, class_declaration):
778         Use it.
779
780 2006-07-26  Raja R Harinath  <rharinath@novell.com>
781
782         * roottypes.cs: Rename from tree.cs.
783
784         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
785         * tree.cs (Tree, ITreeDump): Remove types.
786         * rootcontext.cs (tree, Tree): Remove fields.
787         (root, ToplevelTypes): New.
788         * *.cs: Update to rename.
789
790         * tree.cs (Tree.RecordDecl): Remove.
791         (RootTypes.AddToTypeContainer): Record the toplevel type in its
792         namespace here.
793         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
794
795 2006-07-23  Raja R Harinath  <harinath@gmail.com>
796
797         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
798         DoFlowAnalysis and OmitStructFlowAnalysis here.
799         (ec.With): Rename from WithUnsafe and generalize.
800         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
801         (ec.WithFlowAnalyis): New.
802         * ecore.cs, expression.cs, statement.cs: Update.
803
804 2006-07-22  Raja R Harinath  <harinath@gmail.com>
805
806         * statement.cs (Block.ResolveMeta): Simplify slightly.
807
808         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
809         multiple boolean fields.  Convert InUnsafe, constant_check_state,
810         check_state to flags.
811         (CheckState, ConstantCheckState): Update.
812         (InUnsafe): New read-only property.
813         (FlagsHandle): Rename from CheckStateHandle and convert to handle
814         arbitrary flags.
815         (WithUnsafe): New helper similar to WithCheckState.
816         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
817         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
818
819 2006-07-21  Raja R Harinath  <rharinath@novell.com>
820
821         Make comparisons use the same IL irrespective of whether they're
822         in a 'checked' or 'unchecked' context: one of the issues in #78899
823         * codegen.cs (EmitContext.CheckState): Make read-only property.
824         (EmitContext.ConstantCheckState): Likewise.
825         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
826         helper that implement a save/restore stack for CheckState
827         values.  This is the only way to change check-state.
828         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
829         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
830         (CheckedExpr.EmitBranchable): New forwarding method.
831         (UnCheckedExpr): Likewise.
832         * statement.cs (Block.ResolveMeta): Use WithCheckState.
833         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
834         (Checked.Resolve, checked.DoEmit): Likewise.
835
836 2006-07-21  Martin Baulig  <martin@ximian.com>
837
838         * generic.cs (TypeManager.InferType): When inferring an array
839         type, also allow IList<T> and ICollection<T>.  Fixes #78900.
840
841 2006-07-21  Martin Baulig  <martin@ximian.com>
842
843         * generic.cs (TypeManager.IsIEnumerable): Renamed into IsIList()
844         and allow IList`1 and all its base interfaces.
845
846         * convert.cs (Convert.ImplicitReferenceConversion): Allow
847         converting from an array-type of T to IList<T>.
848
849 2006-07-21  Martin Baulig  <martin@ximian.com>
850
851         * ecore.cs (SimpleName.DoSimpleNameResolve): Added CS0307 check.
852
853 2006-07-20  Miguel de Icaza  <miguel@novell.com>
854
855         * anonymous.cs: Cache the resolved anonymous delegate, and return
856         this so that the ResolveTopBlock is only triggered once, not
857         twice.
858
859         Currently we trigger ResolvetopBlock twice due to a first pass of
860         argument check compatibility, and a second pass that does the
861         actual resolution.   
862
863 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
864
865         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
866         modifiers.
867         * rootcontext.cs (Reset): Add helper_classes.
868
869 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
870
871         A fix for #78860
872         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
873         correctly.
874
875 2006-07-13  Miguel de Icaza  <miguel@novell.com>
876
877         * statement.cs (Lock): Handle expressions of type
878         TypeManager.null_type specially.  Fixes #78770
879
880 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
881
882         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
883         to an event.
884
885 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
886
887         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
888         for accessors as well.
889         * ecore.cs (EventExpr): Add AccessorTable.
890
891 2006-07-03  Martin Baulig  <martin@ximian.com>
892
893         * ecore.cs (UnboxCast.Emit): Also use `Unbox_Any' for generic
894         instances of value types.
895
896         * convert.cs (Convert.ExplicitConversion): Correctly handle
897         object->nullable conversions.   
898
899 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
900
901         A fix for #78738
902         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
903         for CS0122 where appropriate.
904         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
905         level attributes.
906         (Filter): Assembly can be null in the case of top level attributes.
907
908 2006-06-28  Raja R Harinath  <rharinath@novell.com>
909
910         Fix #78716
911         * generic.cs (TypeManager.InferParamsTypeArguments): If there are
912         no arguments, return 'false': nothing can be inferred.
913
914 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
915
916         A fix for #78690
917
918         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
919         is done at global level.
920
921 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
922
923         A fix for #77002, Implemented TypeForwarder support.
924
925         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
926         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Add TypeForwarder
927         attribute handling.
928         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
929         * typemanager.cs (): Add type_forwarder_attr_type.
930
931 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
932
933         * report.cs: Add CS0469 warning.
934
935 2006-06-22  Martin Baulig  <martin@ximian.com>
936
937         * class.cs
938         (TypeContainer.GetNormalBases): Also use ResolveAsBaseTerminal()
939         for interfaces; fixes #78686, which is a modification of #78380
940         with interfaces instead of classes.
941
942 2006-06-21  Martin Baulig  <martin@ximian.com>
943
944         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
945         the `try'-block, so we also report CS0016 etc. there.
946
947 2006-06-21  Martin Baulig  <martin@ximian.com>
948
949         * ecore.cs (FieldExpr.EmitAssign, FieldExpr.AddressOf): Correctly
950         handle SetAssigned() and SetMemberIsUsed() for generic types;
951         fixes #77545.
952
953 2006-06-21  Martin Baulig  <martin@ximian.com>
954
955         * delegate.cs
956         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
957
958 2006-06-21  Martin Baulig  <martin@ximian.com>
959
960         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
961         also report CS1686 for parameters.
962
963 2006-06-21  Martin Baulig  <martin@ximian.com>
964
965         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
966         instead of an error if the value is not implicitly convertible to
967         the switch types; fixes #77964.
968
969 2006-06-21  Raja R Harinath  <rharinath@novell.com>
970
971         Fix #78673
972         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
973         FieldBuilder is null.
974
975         Fix #78662
976         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
977         'left' and 'right' before error-checking.
978
979 2006-06-19  Martin Baulig  <martin@ximian.com>
980
981         * convert.cs
982         (Convert.ImplicitConversionStandard): Cleanup and correctly
983         implement nullable conversions.
984         (Convert.ImplicitStandardConversionExists): Likewise.
985         (Convert.ExplicitConversion): Likewise.
986
987 2006-06-19  Martin Baulig  <martin@ximian.com>
988
989         * generic.cs
990         (Nullable.Wrap.Create, Nullable.Unwrap.Create): New public static
991         methods; make the ctors protected.
992
993 2006-06-19  Martin Baulig  <martin@ximian.com>
994
995         Fixed #78380; added gtest-273.cs.
996
997         * ecore.cs
998         (Expression.ResolveAsBaseTerminal): Move the constraint checking
999         into ResolveAsTypeTerminal().
1000
1001         * generic.cs
1002         (ConstraintChecker.HasDefaultConstructor): Use the non-cache based
1003         TypeManager.FindMembers() to check for the default ctor.
1004
1005 2006-06-18  Marek Safar  <marek.safar@seznam.cz>
1006
1007         * generic.cs: Fixed NullableInfo accessibility.
1008
1009 2006-06-16  Martin Baulig  <martin@ximian.com>
1010
1011         * generic.cs
1012         (Constraints.InflatedConstraints.inflate): Correctly inflate
1013         generic types; fixes #78400.
1014
1015 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
1016
1017         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
1018         Fixed bug #78601.
1019         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
1020         (FieldExpr.DoResolve): likewise.
1021         (PropertyExpr.InstanceResolve): likewise.
1022         (EventExpr.InstanceResolve): likewise. 
1023
1024 2006-06-15  Martin Baulig  <martin@ximian.com>
1025
1026         * statement.cs
1027         (SwitchLabel.ResolveAndReduce): Added `bool allow_nullable'
1028         argument; always allow a `null' label if true.
1029         (Switch.SwitchGoverningType): Take an `Expression expr' argument.
1030         (Switch.TableSwitchEmit, Switch.SimpleSwitchEmit): Check whether
1031         we have a `null' label and mark the new `null_target' label;
1032         default to the `default' label.
1033         (Switch.Resolve): Add support for nullable types.  Fixes #78630.
1034
1035 2006-06-15  Martin Baulig  <martin@ximian.com>
1036
1037         * class.cs (Operator.Define): Allow an implicit/explicit operator
1038         to convert to/from a nullable value of the enclosing type.
1039
1040         * generic.cs (TypeManager.IsNullableTypeOf): New public method.
1041         (Nullable.Unwrap, Nullable.Wrap): Make these classes public.
1042
1043         * convert.cs
1044         (Convert.ImplicitStandardConversionExists): Add support for lifted
1045         implicit/explicit conversions.
1046         (Convert.ImplicitConversionStandard): Likewise.
1047
1048 2006-06-13  Martin Baulig  <martin@ximian.com>
1049
1050         * ecore.cs (SimpleName.DoSimpleNameResolve): Check whether we have
1051         type arguments and create a ConstructedType if necessary.  Fixes #78400.
1052
1053 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
1054
1055         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
1056         attribute applicable tests for attribute argument.
1057
1058 2006-06-02  Raja R Harinath  <rharinath@novell.com>
1059
1060         Fix #78079
1061         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
1062         (Binary.OverloadResolve_PredefinedIntegral): New.
1063         (Binary.OverloadResolve_PredefinedFloating): New.
1064         (Binary.OverloadResolve_PredefinedString): New.
1065         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
1066         Follow the standard more closely, and treat numeric promotions in
1067         terms of overload resolution.
1068         (Binary.CheckShiftArguments): Simplify.
1069
1070 2006-06-01  Raja R Harinath  <rharinath@novell.com>
1071
1072         * flowanalysis.cs (MyBitVector): Simplify representation.
1073         (MyBitVector.Clone): Avoid allocating BitArray.
1074         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
1075         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
1076         (*): Update.  Change all references to MyBitVector.And and
1077         MyBitVector.Or to &= and |=.
1078
1079 2006-05-31  Raja R Harinath  <rharinath@novell.com>
1080
1081         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
1082         Use bne.un instead of ceq+brfalse.
1083
1084         Fix cs0208-[23].cs
1085         * typemanager.cs (IsUnmanagedType): Disallow generic types and
1086         generic parameters.
1087
1088 2006-05-29  Raja R Harinath  <rharinath@novell.com>
1089
1090         Fix cs0231-[34].cs.
1091         * cs-parser.jay (formal_parameter_list): Extend the pattern below
1092         to param arguments too.
1093
1094 2006-05-26  Miguel de Icaza  <miguel@novell.com>
1095
1096         * cs-parser.jay: Catch another parsing form for arglist being
1097         followed by other arguments.  Fixes #78313.
1098
1099 2006-05-25  Raja R Harinath  <rharinath@novell.com>
1100
1101         Fix #78324
1102         * expression.cs (Binary.DoResolve): Use Nullable.LiftedBinaryOperator
1103         also when one of the operands is a null literal.
1104         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality): Rewrite
1105         to improve clarity, and generate slightly better code.
1106
1107 2006-05-24  Raja R Harinath  <rharinath@novell.com>
1108
1109         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
1110         checking of out parameters to ...
1111         (FlowBranchingToplevel.Merge): ... here.
1112         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
1113         set, propagate the origin upward, and only complain if there was
1114         no other error.
1115         (FlowBranchingException.AddContinueOrigin): Likewise.
1116         (FlowBranchingException.AddReturnOrigin): Likewise.
1117         (FlowBranchingException.AddGotoOrigin): Likewise.       
1118
1119 2006-05-23  Raja R Harinath  <rharinath@novell.com>
1120
1121         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
1122         unreachable, skip it.
1123         (FlowBranchingException.Merge): Always propagate jumps, even if
1124         the finally block renders subsequent code unreachable.
1125
1126 2006-05-18  Raja R Harinath  <rharinath@novell.com>
1127
1128         Fix #77601
1129         * statement.cs (Goto.Resolve): Move responsibility for resolving
1130         'goto' to FlowBranching.AddGotoOrigin.
1131         (Goto.SetResolvedTarget): New.  Callback to set the
1132         LabeledStatement that's the target of the goto.
1133         (Goto.DoEmit): Use Leave instead of Br when crossing an
1134         unwind-protect boundary.
1135         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
1136         LookupLabel and adjust to new semantics.
1137         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
1138         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
1139         Goto.SetResolvedTarget to update target.
1140         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
1141         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
1142         AddBreakOrigin & co.  Delay propagation until ...
1143         (FlowBranchingException.Merge): ... this.
1144
1145         * statement.cs (Block.Resolve): Always depend on flow-branching to
1146         determine unreachability.  Kill workaround that originally emitted
1147         only one statement after an "unreachable" label (see infloop in
1148         test-515.cs).
1149
1150         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
1151         This is still "wrong", but anything better would probably need a
1152         multi-pass algorithm.
1153         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
1154         usage vector.  Force current usage vector to be reachable, to
1155         optimistically signify backward jumps.
1156         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
1157         detected.
1158         (FlowBranchingLabeled.Merge): New.  If no backward jump was
1159         detected, return the original salted-away usage vector instead,
1160         updated with appropriate changes.  Print unreachable warning if
1161         necessary.
1162         * statement.cs (Block.Resolve): Don't print unreachable warning on
1163         a labeled statement.
1164
1165 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
1166
1167         * driver.cs: Pass filename without path to AssemblyBuilder's
1168         AddResourceFile. Fixes bug #78407.
1169
1170 2006-05-17  Raja R Harinath  <rharinath@novell.com>
1171
1172         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
1173         * flowanalysis.cs (FlowBranchingLabeled): ... here.
1174         (FlowBranching.MergeChild): Overwrite
1175         reachability information from Labeled branchings too.
1176
1177 2006-05-16  Raja R Harinath  <rharinath@novell.com>
1178
1179         * statement.cs (Goto.Resolve): Merge jump origins here ...
1180         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
1181
1182         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
1183         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
1184         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
1185         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
1186         here, ...
1187         * statement.cs (Goto.Resolve): ... not here.
1188         (Goto.Emit): Remove CS1632 check.
1189
1190 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
1191
1192         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
1193         error message.
1194
1195 2006-05-11  Raja R Harinath  <rharinath@novell.com>
1196
1197         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
1198         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
1199         (FlowBranchingException.Label): Likewise.
1200
1201         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
1202         given value.
1203         (MyBitVector.Or): Use it to avoid losing information (Count).
1204         (FlowBranching.MergeOrigins): Likewise.
1205
1206         * flowanalysis.cs (UsageVector.IsDirty): Remove.
1207         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
1208         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
1209         (UsageVector.ToString): Simplify.
1210         (UsageVector.MergeSiblings): Move here from ...
1211         (FlowBranching.Merge): ... here.
1212         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
1213         not a MyBitVector.
1214
1215 2006-05-10  Raja R Harinath  <rharinath@novell.com>
1216
1217         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
1218         null bitvector is treated as all-true.
1219
1220         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
1221         (MyBitVector): Rationalize invariants.  'vector != null' implies
1222         that we have our own copy of the bitvector.  Otherwise,
1223         'InheritsFrom == null' implies all inherited bits are true.
1224
1225 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
1226
1227         * statement.cs (LocalInfo): Add IsConstant.
1228         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
1229         local variable for constants.
1230
1231 2006-05-09  Raja R Harinath  <rharinath@novell.com>
1232
1233         * flowanalysis.cs (MyBitVector.Empty): New.
1234         (MyBitVector): Don't allow InheritedFrom to be null.
1235         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
1236         (UsageVector, FlowBranching): Update to changes.
1237
1238         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
1239         recursion.  The 'Parent == null' condition isn't sufficient for
1240         anonymous methods.
1241         (FlowBranching.AddBreakOrigin): Likewise.
1242         (FlowBranching.AddContinueOrigin): Likewise.
1243         (FlowBranching.AddReturnOrigin): Likewise.
1244         (FlowBranching.StealFinallyClauses): Likewise.
1245         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
1246         (FlowBranching.CheckOutParameters): Likewise.
1247         (FlowBranchingToplevel): Terminate all the above recursions here.
1248         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
1249         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
1250
1251         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
1252         toplevel block.
1253         (FlowBranchingToplevel): New.  Empty for now.
1254         (FlowBranching.MergeTopBlock): Update.
1255         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1256         branching for the anonymous delegate.
1257         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1258
1259         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1260         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1261         information at the start of the merge.  Reorganize.
1262
1263 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1264
1265         * class.cs (MethodData.Define): Method cannot implement interface accessor.
1266
1267 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1268
1269         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1270         to newly introduced ctor.
1271
1272         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1273         message to one place.
1274         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1275         global namespace.
1276
1277 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1278
1279         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1280
1281         * ecore.cs (Expression.ResolveAsConstant): Updated.
1282
1283         * statement.cs (ResolveMeta): Updated.
1284
1285 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1286
1287         * cs-parser.jay: __arglist cannot be used in initializer.
1288
1289 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1290
1291         A fix for #77879
1292         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1293         private types.
1294
1295 2006-05-05  Raja R Harinath  <rharinath@novell.com>
1296
1297         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1298         (LabeledStatement): Add 'name' parameter.
1299         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1300         (Block.AddLabel): Update to changes.
1301         * cs-parser.jay (labeled_statement): Likewise.
1302
1303         * flowanalysis.cs (BranchingType.Labeled): New.
1304         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1305         (FlowBranchingLabeled): New.  Does nothing for now, but will
1306         eventually handle 'goto' flows.
1307         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1308         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1309         that's terminated ...
1310         (Block.Resolve): ... here.
1311
1312         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1313         (UsageVector.MergeFinallyOrigins): Likewise.
1314         (FlowBranching.InTryOrCatch): Likewise.
1315         (FlowBranching.AddFinallyVector): Likewise.
1316         (FlowBranchingException): Update to changes.
1317
1318         Fix #78290
1319         * statement.cs (Return.Resolve): Move error checking to ...
1320         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1321         (FlowBranchingException): Handle return origins like break and
1322         continue origins.
1323         (FlowBranching.UsageVector.CheckOutParameters): Remove.
1324
1325 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1326
1327         A fix for #76122
1328         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1329         filter.
1330
1331 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1332
1333         A fix for #77543
1334         * class.cs (MethodData.Define): Do public accessor check only when method
1335         implements an interface.
1336
1337 2006-05-04  Raja R Harinath  <rharinath@novell.com>
1338
1339         Remove special handling of 'break'
1340         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1341         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
1342         (UsageVector.Break): Remove.
1343         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1344         reachability.
1345         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1346
1347         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1348         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
1349
1350 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1351
1352         A fix for #75726
1353         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1354         be the interface member.
1355
1356 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1357
1358         A fix for #60069
1359         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1360         for emitting small (int) values.
1361
1362 2006-05-03  Raja R Harinath  <rharinath@novell.com>
1363
1364         Fix #59427
1365         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1366         control-flow passes through the 'finally' after merging-in all the
1367         control-flows from 'try' and the 'catch' clauses.
1368
1369         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1370         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
1371         always true at the only non-recursive entry point.
1372         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1373         FlowBranchingBreakable.
1374         (FlowBranchingLoop): Remove.
1375         * statement.cs (Return.DoResolve): Update to changes.
1376
1377         Fix #76471, #76665
1378         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1379         (FlowBranching.CreateBranching): Handle it: create a
1380         FlowBranchingContinuable.
1381         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1382         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1383         except that it handles the 'continue' command.
1384         (FlowBranching.UsageVector.MergeOrigins): Rename from
1385         MergeBreakOrigins.
1386         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1387         except that it overrides AddContinueOrigin.
1388         (FlowBranchingException): Override AddContinueOrigin, similar to
1389         AddBreakOrigin.
1390         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1391         Create a new branching around the embedded statement.
1392         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
1393         control flow after the embedded statement.
1394         (Continue.Resolve): Move all error checking to AddContinueOrigin.
1395
1396         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1397         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1398         FlowBranchingBreakable.
1399         (FlowBranchingSwitch): Remove.
1400
1401         Fix test-503.cs
1402         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
1403         error reporting to ...
1404         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1405         Rename from 'AddBreakVector'.  Add new location argument.  Return
1406         a bool indicating whether the 'break' crosses an unwind-protect.
1407         (FlowBranchingException.AddBreakOrigin): Add.
1408         (FlowBranchingException.Merge): Propagate 'break's to surrounding
1409         flowbranching after updating with the effects of the 'finally'
1410         clause.
1411         (FlowBranchingBreakable): New common base class for
1412         FlowBranchingLoop and FlowBranchingSwitch.
1413
1414         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1415         embedded statement.
1416         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1417
1418 2006-05-02  Raja R Harinath  <rharinath@novell.com>
1419
1420         * statement.cs (Do.Resolve): If the loop is infinite, set the
1421         barrier.
1422         (While.Resolve, For.Resolve): Set a barrier after the embedded
1423         statement.  There's no direct control flow that goes from the end
1424         of the embedded statement to the end of the loop.
1425         * flowanalysis.cs (FlowBranching.Infinite): Remove.
1426         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
1427         above ensure that the reachability is correctly computed.
1428
1429         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1430         (UsageVector.MergeBreakOrigins): If the current path is
1431         unreachable, treat it as if all parameters/locals are initialized.
1432         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
1433         infinite loops before merging-in break origins.
1434
1435         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1436         (Reachability.Reachable): Split part into ...
1437         (Reachability.Unreachable): ... this.  Simplify.
1438         (Reachability.IsUnreachable): Use 'Unreachable' instead.
1439
1440         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1441         (Reachability.SetThrowsSometimes): Likewise.
1442         (FlowBranchingBlock.MergeTopBlock): Don't compare against
1443         TriState.Always, use corresponding property.
1444         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1445         (Block.Resolve): Likewise.  Remove some redundant checks.
1446
1447 2006-05-02  Raja R Harinath  <harinath@gmail.com>
1448
1449         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1450         (Reachability.Meet): Don't bother checking AlwaysThrows --
1451         barrier is always set.
1452         (FlowBranchingBlock.Merge): Likewise.
1453
1454 2006-05-01  Rafael Teixeira <rafaelteixeirabr@hotmail.com>
1455
1456         * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
1457         defined, so it's references should also compile only for NET_2_0
1458         (as occurs in mcs version)
1459
1460 2006-05-01  Raja R Harinath  <harinath@gmail.com>
1461
1462         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1463         checks for unreachable.
1464
1465 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
1466
1467         A fix for #77980
1468         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1469
1470         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1471         whether field is really assigned.
1472
1473 2006-04-30  Raja R Harinath  <harinath@gmail.com>
1474
1475         * flowanalysis.cs (Reachability): Make 4-argument constructor
1476         private.
1477         (Reachability.Meet): Rename from 'And'.  Remove static variant.
1478         (Reachability.Always): Rename from the highly misleading
1479         'Reachability.Never'.
1480         (FlowBranching.Merge): Update to changes.  Mark an impossible
1481         situation with a 'throw'.
1482         (*): Update to changes.
1483
1484 2006-04-29  Raja R Harinath  <harinath@gmail.com>
1485
1486         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1487         Remove 'Undefined'.
1488         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1489         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1490         (*): Update to changes.
1491         * statement.cs: Update to changes.
1492
1493 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
1494
1495         A fix for #78049
1496         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1497
1498 2006-04-28  Raja R Harinath  <harinath@gmail.com>
1499
1500         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1501         dummy UsageVector.
1502
1503         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1504         argument to two arguments: an usage-vector and a bool.  Move call
1505         to FlowBranching.Merge () ...
1506         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1507
1508         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1509         handling of loop and switch reachability to ...
1510         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1511
1512 2006-04-27  Raja R Harinath  <harinath@gmail.com>
1513
1514         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1515         handling to FlowBranchingLoop.InLoop.
1516         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1517
1518 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
1519
1520         A fix for #78115
1521         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1522         anonymous method is allowed from AnonymousContainer here.
1523
1524         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1525
1526 2006-04-24  Raja R Harinath  <rharinath@novell.com>
1527
1528         Fix #78156
1529         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1530
1531 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
1532
1533         A fix for #49011.
1534         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1535         (DoubleConstant.Reduce): Ditto.
1536
1537 2006-04-23  Raja R Harinath  <rharinath@novell.com>
1538
1539         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1540         Remove 'lvalue_right_side' argument.  Move parts to ...
1541         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1542         (LocalVariable.DoResolveLValue): ... these.
1543
1544 2006-04-21  Raja R Harinath  <rharinath@novell.com>
1545
1546         Fix cs1655.cs
1547         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1548         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1549         (LocalVariableReference.DoResolveBase): Use it to implement new
1550         CS1655 check.
1551         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1552         (Argument.Resolve): Simplify.  Move CS1510 check ...
1553         * ecore.cs (Expression.ResolveLValue): ... here.
1554         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1555         (PropertyExpr.DoResolveLValue): Likewise.
1556         (FieldExpr.Report_AssignToReadonly): Likewise.
1557         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
1558         LValueMemberAccess or LValueMemberOutAccess on instance depending
1559         on it.
1560         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1561         DoResolve as appropriate.
1562
1563 2006-04-20  Raja R Harinath  <rharinath@novell.com>
1564
1565         Fix #75800
1566         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1567         implicit conversions on 'out' and 'ref' arguments.
1568
1569         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1570         improve clarity.  Remove dead code.
1571
1572         Fix #66031
1573         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1574         (Catch.Resolve): Resolve VarBlock if it exists.
1575
1576 2006-04-19  Miguel de Icaza  <miguel@novell.com>
1577
1578         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1579         twice, this was some residual code, the enumerator was emitted
1580         properly in the two branche of if later.
1581
1582         Fixes #78031
1583         
1584         Thanks to Martin for finding the source of the problem
1585         
1586 2006-04-19  Raja R Harinath  <rharinath@novell.com>
1587
1588         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
1589         cast is never an lvalue.
1590         (Cast.DoResolve, Cast.ResolveRest): Combine.
1591         (Argument.Emit): Simplify slightly.  Move 'Expr is
1592         IMemoryLocation' check ...
1593         (Argument.Resolve): ... here.
1594         (Argument.Error_LValueRequired): Remove.  Inline into only user.
1595
1596         Simplifications.  Fix cs0191-2.cs
1597         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1598         CS1649 and CS1651 to ...
1599         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
1600         the actual selection of the error code and message to a lookup
1601         table.  Add a dummy return value to simplify callsites.
1602         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1603         readonly fields of other instances of the same type.  Move CS0197
1604         warning from ...
1605         * expression.cs (Argument.Resolve): ... here.  Simplify code.
1606         Ensure that ec.InRefOutArgumentResolving is only set during LValue
1607         resolution of an out or ref argument.  The code simplification
1608         above uses this invariant.
1609
1610 2006-04-18  Raja R Harinath  <rharinath@novell.com>
1611
1612         Possibly fix #77752.  Fix cs1690-[4-7].cs.
1613         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1614         CheckMarshallByRefAccess.  Drop parameter.
1615         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
1616         warning.
1617         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1618         InstanceExpression.
1619         * report.cs (AllWarnings): Add CS1690.
1620         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1621         for ref access too.
1622         (LocalVariableReference.DoResolveBase): Update.
1623
1624 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1625
1626         * class.cs (MethodOrOperator): Moved common parts from method class.
1627         detect obsolete attributes.
1628         (Method.Define): Simplified as it reuses code from base.
1629         (Constructor.ValidAttributeTargets): Fixed issue found during
1630         refactoring.
1631         (Destructor.ValidAttributeTargets): Fixed issue found during
1632         refactoring.
1633         (Operator): Finished refactoring set off by #78020. Operator class is now
1634         ordinary method class.
1635
1636         * anonymous.cs: Updated.
1637
1638 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1639
1640         * class.cs (Constructor.Emit): Don't emit the attributes twice.
1641
1642 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1643
1644         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1645         detect obsolete attributes.
1646         (Method.CreateEmitContext): Moved to MethodOrOperator.
1647
1648 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1649
1650         A fix for #78048.
1651         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1652         customized exception to make crash detection easier.
1653         (MethodOrOperator): Started to work on new base class for methods and
1654         operators.
1655         (Method): Derives from MethodOrOperator.
1656         (Constructor.Emit): Emits its own attributes.
1657         (AbstractPropertyEventMethod.Emit): Ditto.
1658         (Operator): Derives from MethodOrOperator, will refactor fully in extra
1659         patch.
1660         (Operator.Emit): It's temporary more tricky than should be.
1661         
1662         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1663
1664         * report.cs (InternalErrorException): Add ctor with inner exception.
1665
1666 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
1667
1668         A fix for #76744.
1669         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1670         only not visible.
1671
1672 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
1673
1674         A fix for #77916.
1675         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1676         array.
1677
1678 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1679
1680         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1681         attribute is present and Guid not.
1682         (Interface.ApplyAttributeBuilder): Ditto.
1683
1684         * attribute.cs: Add error message.
1685
1686 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1687
1688         A fix for #78020.
1689
1690         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1691         sources (it's composite) so hold them in extra array as they are used in
1692         Emit phase only. It worked in the previous versions by mistake.
1693         (Attribute.Emit): Emit attribute for more owners when exist.
1694
1695         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1696         it has now different behaviour.
1697
1698 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
1699
1700         * constant.cs (Constant.IsDefaultInitializer): New method.
1701
1702         * class.cs: Updated.
1703
1704         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1705         re-initialize default values. It saves KBs almost for every assembly.
1706         Thanks Zoltan for the idea.
1707         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1708         (ArrayCreation.DoResolve): Resolve only once.
1709         (ArrayCreation.Emit): Emit static initializer only when it is faster.
1710         (ArrayCreation.GetAttributableValue): Cope with optimized values.
1711
1712 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
1713
1714         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1715         From #77961.
1716
1717 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1718
1719         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1720         in an embedded statement too.
1721
1722 2006-04-01  Raja R Harinath  <rharinath@novell.com>
1723
1724         Fix #77929
1725         * typemanager.cs (IsNestedChildOf): Drop generic arguments before
1726         testing.
1727
1728         Fix #77958
1729         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1730
1731         Fix #77962
1732         * report.cs (SymbolRelatedToPreviousError): Drop generic type
1733         arguments before checking whether a type is reflected or not.
1734
1735         Fix #77954
1736         * expression.cs (Invocation.IsApplicable): Ensure a generic method
1737         definition doesn't take part in overload resolution.
1738         (Invocation.IsParamsMethodApplicable): Likewise.
1739         (Invocation.OverloadResolve): When replacing a reflected override
1740         method with its base definition, ensure that type arguments are
1741         applied.
1742
1743 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1744
1745         A fix for #77966.
1746
1747         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1748         was not specified.
1749
1750         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1751
1752 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
1753
1754         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1755         phase.
1756
1757         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1758         LocalTemporary change.
1759
1760         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1761         TypeContainer.
1762         (ClassOrStruct.DefineFieldInitializers): Implemented static field
1763         initializers optimization.
1764         (ClassOrStruct.TypeAttr): Moved from modifiers.
1765         (Constructor.CheckBase): Don't crash when static ctor has parameters.
1766         (FieldBase.ResolveInitializer): Resolves initializer.
1767         (FieldBase.HasDefaultInitializer): New property.
1768
1769         * cs-parser.jay: Removed message.
1770
1771         * expression.cs (CompilerGeneratedThis): New specialization.
1772
1773         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1774
1775 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
1776
1777         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1778
1779 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1780
1781         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1782         be now EnumConstants only.
1783
1784 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1785
1786         * attribute.cs, driver.cs: Reset more caches.
1787
1788 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1789
1790         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1791
1792 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1793
1794         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1795         for easier reuse. Updated all overrides.
1796         (IntegralConstant): New base class for all integral constants.
1797         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1798         of the constant range, report custom error.
1799         (UIntConstant.Reduce): Fixed uint conversion.
1800
1801         * ecore.cs, literal.cs: Reduce updates.
1802
1803 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1804
1805         A fix for #75813.
1806
1807         * class.cs (Constructor.Define): Removed extra if for default ctors.
1808         A patch from Atsushi Enomoto.
1809
1810 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1811
1812         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1813         GetAttributableValue.
1814
1815         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1816         when required.
1817
1818         * convert.cs (ImplicitConversionRequired): Error message moved to
1819         DoubleLiteral.
1820
1821         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1822         automatic implicit conversion of an output value.
1823         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1824
1825         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1826         conversion.
1827         (TypeOf.GetAttributableValue): Add extra handling for object type.
1828
1829         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1830         special error message.
1831
1832 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
1833
1834         * class.cs (Constructor.Emit): Don't crash when struct ctor is
1835         InternalCall.
1836         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1837         compatible with MS runtime.
1838
1839 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
1840
1841         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1842         attribute arguments here.
1843
1844         * class.cs (Indexer.Define): The check was moved to attribute class.
1845
1846 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1847
1848         * expression.cs (StringConcat.Append): Reverted back to no warning state.
1849
1850 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1851
1852         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1853
1854         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1855         the blocks too.
1856
1857 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
1858
1859         * doc-bootstrap.cs : fix build.
1860
1861 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1862
1863         * expression.cs (StringConcat.Append): Issue a warning when empty string
1864         is going to append.
1865
1866 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1867
1868         * assign.cs (CompoundAssign.ResolveSource): Removed.
1869
1870         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1871         clean up.
1872
1873         * class.cs (TypeContainer.FindMethods): Removed.
1874         (TypeContainer.CheckMemberUsage): Made static.
1875
1876         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1877
1878         * constant.cs (CheckRange): Removed unused type argument.
1879         (CheckUnsigned): Removed unused type argument.
1880
1881         * cs-parser.jay: Updated after MemberAccess clean up.
1882         Uses Length for empty string test.
1883
1884         * cs-tokenizer.cs: Uses Length for empty string test.
1885         (IsCastToken): Made static.
1886         (is_hex): Made static.
1887         (real_type_suffix): Made static.
1888
1889         * decl.cs (SetupCache): Made static.
1890         (OnGenerateDocComment): Removed unused ds argument.
1891
1892         * delegate.cs (VerifyDelegate): Removed unused argument.
1893
1894         * doc.cs: Uses Length for empty string test.
1895
1896         * driver.cs: Uses Length for empty string test.
1897
1898         * enum.cs (IsValidEnumType): Made static
1899
1900         * expression.cs (EnumLiftUp): Removed unused argument.
1901         (ResolveMethodGroup): Ditto.
1902         (BetterConversion): Ditto.
1903         (GetVarargsTypes): Ditto.
1904         (UpdateIndices): Ditto.
1905         (ValidateInitializers): Ditto.
1906         (MemberAccess.ctor): Ditto.
1907         (GetIndexersForType): Ditto.
1908
1909         * flowanalysis.cs: (MergeFinally): Removed unused argument.
1910
1911         * iterators.cs: Updated after MemberAccess clean up.
1912
1913         * location.cs: Uses Length for empty string test.
1914
1915         * namespace.cs: Uses Length for empty string test.
1916
1917          * report.cs (CheckWarningCode): Made static.
1918
1919         * statement.cs (LabeledStatement): Removed unused argument.
1920
1921         * typemanager.cs (FilterNone): Removed.
1922
1923 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1924
1925         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1926         obsolete.
1927
1928         * class.cs: Updated.
1929
1930 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1931
1932         * cs-parser.jay.cs: __arglist is not allowed for delegates.
1933
1934 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1935
1936         A fix for #77816.
1937
1938         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
1939         host container.
1940         (AnonymousMethod.ImplicitStandardConversionExists): New method.
1941         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1942         Add more error reporting; Fixed issue with params.
1943
1944         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1945
1946         * cs-parser.jay: AnonymousMethod requires host container.
1947
1948         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1949
1950 2006-03-18  Raja R Harinath  <harinath@gmail.com>
1951
1952         * class.cs: Change 'TypeContainer ds' constructor argument to
1953         'DeclSpace parent'.  Some classes were missed below due to
1954         different naming convention.
1955
1956         * class.cs (MemberCore.Parent): Delete.  This makes the
1957         ParentContainer changes below enforceable by the compiler.
1958
1959         Treat pointers to enclosing declaration space as 'DeclSpace', not
1960         'TypeContainer'.
1961         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1962         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1963
1964         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1965         of TypeContainer.
1966         (Block.AddThisVariable): Likewise.
1967         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1968         (AbstractPropertyEventMethod.Emit): Likewise.
1969         (AbstractPropertyEventMethod.EmitMethod): Likewise.
1970         (GetMethod.Define, SetMethod.Define): Likewise.
1971         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1972         (DelegateMethod.EmitMethod): Likewise.
1973
1974         Fix regression test-partial-13.cs.
1975         Rationalize use of PartialContainer.  Ensure that the partial
1976         class semantics can be tied to type-correctness, i.e., any
1977         violation will cause a compile error.
1978         * class.cs, const.cs: Access all fields that belong to class
1979         TypeContainer via ParentContainer.  Arguments of EmitContexts and
1980         Resolve()-like functions still use 'Parent'.
1981
1982         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1983         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1984         (PropertyMethod.CheckModifiers): Remove unused argument.
1985         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1986         DeclSpace.
1987
1988 2006-03-28  Raja R Harinath  <rharinath@novell.com>
1989
1990         * decl.cs (DeclSpace.LookupGeneric): Update to changes.
1991
1992 2006-03-17  Raja R Harinath  <harinath@gmail.com>
1993
1994         Make semantics of PartialContainer simpler.
1995         * decl.cs (DeclSpace.IsPartial): Remove.
1996         * class.cs (TypeContainer.IsPartial): Likewise.
1997         (TypeContainer..ctor): Set PartialContainer to point to self.
1998         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1999         (TypeContainer.FindNestedType): Likewise.
2000         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
2001
2002 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
2003
2004         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
2005
2006 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
2007
2008         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
2009         classes.
2010
2011 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
2012
2013         * class.cs (Operator.Define): An error for base conversion was not
2014         reported correctly.
2015
2016 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
2017
2018         A fix for #77593, #77574.
2019
2020         * class.cs (MethodCore.CheckBase): Another if for operator.
2021
2022 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2023
2024         A fix for #77822.
2025
2026         * expression.cs (VerifyArgumentsCompat): Reverted to double error
2027         reporting, it's more tricky than I thought.
2028
2029 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
2030
2031         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
2032         were not resolved
2033
2034         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
2035         (DelegateCreation.ImplicitStandardConversionExists): New method for just
2036         conversion test.
2037         
2038         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
2039         not needed.
2040
2041 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
2042
2043         A fix for #77353.
2044
2045         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
2046         (Event.Define): ditto
2047         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
2048
2049         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
2050         Removed redundant code and set NewSlot for Invoke method too.
2051
2052         * parameter.cs (Parameters.ctor): Add custom, type ctor.
2053         (Parameters.MergeGenerated): New method. Use this method when you merge
2054         compiler generated argument with user arguments.
2055
2056 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
2057
2058         * attribute.cs (ResolveAsTypeTerminal): Removed.
2059
2060         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
2061         specialization for predefined types; 30% speed up.
2062         Finally placed obsolete check to right place.
2063         (Expression.ResolveType): Removed.
2064
2065         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
2066         Updated after ResolveType was removed.
2067
2068         * expression.cs (Cast.ctor): Check void cast.
2069         (Binary.ResolveAsTypeTerminal): Is never type.
2070         (Conditional.ResolveAsTypeTerminal): Is never type.
2071
2072         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
2073
2074 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
2075
2076         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
2077
2078 2006-03-23  Martin Baulig  <martin@ximian.com>
2079
2080         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
2081         type check if either of the types is an open generic type.
2082
2083 2006-03-23  Martin Baulig  <martin@ximian.com>
2084
2085         * convert.cs
2086         (Convert.ExplicitTypeParameterConversion): New method; implement
2087         explicit type parameter conversions.
2088
2089 2006-03-23  Martin Baulig  <martin@ximian.com>
2090
2091         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
2092         blindly allow all conversions if we do not have any constraints.
2093
2094 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
2095
2096         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
2097         these two separated members to simplify the code.
2098         (Attribute.Resolve): Refactored to use new fields and methods.
2099         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
2100         implemented obsolete attribute checking.
2101         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
2102         implemented obsolete checking again. It look line never ending quest ;-)
2103         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
2104
2105         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
2106
2107         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
2108
2109         *class.cs (Property.Define): Add RegisterProperty call.
2110
2111         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
2112         argument groups (only 2).
2113
2114         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
2115         encoding expression to arguments.
2116         (Expression.ExprClassToResolveFlags): Just turned to property.
2117
2118         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
2119         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
2120         optimized as well as implemented support for zero-length attributes.
2121
2122         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
2123         Add caching of PropertyInfo's.
2124
2125 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
2126
2127         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
2128         error multiple times.
2129
2130 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
2131
2132         New partial class implementation.
2133         A fix for #77027, #77029, #77403
2134
2135         * attribute.cs (Attributable): Made attributes protected.
2136
2137         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
2138         the replacements of ClassPart and PartialContainer.
2139         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
2140         (TypeContainer.AddInterface): Ditto.
2141         (TypeContainer.AddPartial): The main method for partial classes. It checks
2142         for errors and merges ModFlags and attributes. At the end class is added to
2143         partial_parts list.
2144         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
2145         required here.
2146         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
2147         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
2148         from the rest of partial classes.
2149         (TypeContainer.GetClassBases): Simplified.
2150         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
2151         DefineType.
2152         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
2153         (TypeContainer.HasExplicitLayout): Uses Flags now.
2154         (PartialContainer): Removed.
2155         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
2156         (StaticClass): Was merged with Class.
2157         (Class.GetClassBases): class and static class bases are verified here.
2158         (Class.TypeAttr): Added static attributes when class is static.
2159         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
2160         (MemberBase): In some cases we need to call parent container for partial
2161         class. It should be eliminated but it's not easy now.
2162
2163         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
2164
2165         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
2166         partial classed to accumulate class comments.
2167         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
2168
2169         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
2170
2171         * driver.cs (MainDriver): Tree.GetDecl was removed.
2172
2173         * modifiers.cs (Modifiers): Add partial modifier.
2174
2175         * tree.cs (Tree.decl): Removed.
2176         (RootTypes): Started to use this class more often for root types
2177         specializations.
2178
2179 2006-03-23  Raja R Harinath  <rharinath@novell.com>
2180
2181         * generic.cs (TypeParameter.UpdateConstraints): Update
2182         'constraints' if null.
2183
2184 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
2185
2186         A fix for #77615
2187
2188         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
2189         external interface does not have an attribute.
2190
2191 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
2192
2193         Another prerequisites for new partial classs implementation.
2194         
2195         * attribute.cs (Attribute.Equal): Implemented.
2196         (Attribute.Emit): Changed as attributes can be applied more than twice.
2197         (Attributes.Emit): Check for duplicate attributes here.
2198
2199         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
2200         as a parameter, clean-up.
2201
2202 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2203
2204         A fix for #77485
2205
2206         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
2207         contains obsolete attribute check which can in some cases look for base
2208         type of current class which is not initialized yet.
2209         (TypeContainer.BaseType): Replacement of ptype.
2210
2211         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2212
2213 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2214
2215         First of prerequisites for new partial classs implemention.
2216         
2217         * attribute.cs (Attributable): Extended by ResolveContext;
2218         Attributes finally have correct context for resolving in all cases.
2219         (AttachTo): Attribute owner is assigned here.
2220
2221         * codegen.cs (IResolveContext): Introduce new interface to hold
2222         all information needed in resolving phase.
2223         (EmitContext): Implements IResolveContext; more clean-up needed here.
2224         
2225         * decl.cs (MemberCore): Implemented IResolveContext.
2226
2227         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
2228         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
2229         parameter.cs, statement.cs, tree.cs, typemanager.cs:
2230         Refactored to use new IResolveContext instead of EmitContext; cleanup
2231
2232 2006-03-22  Raja R Harinath  <rharinath@novell.com>
2233
2234         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
2235         mcs to keep code differences small.
2236         * attribute.cs (Attribute.GetParameterDefaultValue): New.
2237         * typemanager.cs (parameter_default_value_attribute_type): New.
2238         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
2239         CS1908 check.
2240
2241 2006-03-22  Martin Baulig  <martin@ximian.com>
2242
2243         * generic.cs
2244         (Nullable.NullableLiteral): Derive from `NullLiteral'.
2245
2246         * convert.cs
2247         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
2248         instead of the normal `NullLiteral'.
2249
2250 2006-03-21  Martin Baulig  <martin@ximian.com>
2251
2252         Fix #77583.
2253         * generic.cs (TypeManager.InferType): If `pt' is a generic
2254         parameter, don't check whether `pt == at'.
2255
2256 2006-03-20  Raja R Harinath  <rharinath@novell.com>
2257
2258         Fix #77852
2259         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
2260         (TypeParameter.Resolve): Update to change.
2261         (ConstraintChecker.CheckConstraints): Resolve type-argument
2262         constraints before use.
2263
2264 2006-03-16  Martin Baulig  <martin@ximian.com>
2265
2266         * generic.cs
2267         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
2268         and don't have any instance constructors, also lookup in the base class.
2269         (TypeManager.IsNullableValueType): New public method.
2270
2271         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
2272         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
2273         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
2274
2275         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
2276         instead of just TypeManager.IsNullableType() to determine whether
2277         a lifted operator exists.
2278         (UnaryMutator.DoResolve): Likewise.
2279         (Conditional.DoResolve): Likewise.
2280         (Binary.DoResolve): A lifted operator only exists if both operands
2281         are valuetypes and at least one of them is a nullable type.
2282
2283 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
2284
2285         * iterator.cs : yield break is allowed in try statement which has
2286           catch clauses. Fixed bug #77767.
2287
2288 2006-03-12  Martin Baulig  <martin@ximian.com>
2289
2290         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
2291         private IsSignatureEqual() to compare types; see the comment in
2292         that method; fixes #77674.
2293
2294 2006-03-10  Raja R Harinath  <rharinath@novell.com>
2295
2296         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
2297         (Expression.ResolveAsTypeTerminal): Likewise.
2298         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
2299         * expression.cs, generic.cs, iterators.cs: Likewise.
2300         * parameter.cs, statement.cs, typemanager.cs: Likewise.
2301
2302 2006-03-09  Martin Baulig  <martin@ximian.com>
2303
2304         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
2305         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
2306
2307 2006-03-09  Martin Baulig  <martin@ximian.com>
2308
2309         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
2310         `prepared' flag is set.
2311
2312         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
2313         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
2314         issues; see gtest-254.cs.
2315
2316 2006-03-07  Martin Baulig  <martin@ximian.com>
2317
2318         * generic.cs (TypeManager.InferType): Allow infering
2319         `IEnumerable<T>' with an array of T; see gtest-251.cs.
2320
2321 2006-03-06  Martin Baulig  <martin@ximian.com>
2322
2323         * generic.cs
2324         (TypeManager.InferType): Fix gtest-250.cs.
2325
2326         * typemanager.cs
2327         (TypeManager.IsSubclassOf): Also check the base class.
2328
2329         * expression.cs
2330         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
2331         fixes gtest-249.cs.
2332
2333 2006-03-01  Raja R Harinath  <rharinath@novell.com>
2334
2335         Fix #77679.
2336         * expression.cs (ParameterReference.DoResolveBase): Change return
2337         type to bool.
2338         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2339         Update.
2340
2341         Fix #77628.
2342         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2343
2344         Fix #77642.
2345         * typemanager.cs (GetFullNameSignature): Don't nullref on
2346         protected accessors.
2347
2348 2006-02-16  Martin Baulig  <martin@ximian.com>
2349
2350         * generic.cs
2351         (TypeManager.GetGenericFieldDefinition): New public method; use it
2352         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
2353
2354 2006-02-14  Martin Baulig  <martin@ximian.com>
2355
2356         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
2357
2358 2006-02-14  Martin Baulig  <martin@ximian.com>
2359
2360         * generic.cs
2361         (TypeManager.DropGenericMethodArguments): New public method; don't
2362         use GetGenericMethodDefinition() on something which is not a
2363         generic method.
2364
2365 2006-02-14  Martin Baulig  <martin@ximian.com>
2366
2367         * generic.cs
2368         (ConstraintChecker.CheckConstraints): If a type parameter has the
2369         `struct' constraint, the type must be a non-nullable valuetype.
2370
2371 2006-02-10  Martin Baulig  <martin@ximian.com>
2372
2373         * typemanager.cs
2374         (TypeManager.IsOverride): Make this work for instantiated methods
2375         in a generic class; fixes #77509.
2376         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
2377         rather than calling it directly; fixes #77488.  
2378
2379 2006-02-08  Martin Baulig  <martin@ximian.com>
2380
2381         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
2382         reporting into CheckConstraint() so we can use the correctly
2383         instantiated type.
2384
2385 2006-02-08  Martin Baulig  <martin@ximian.com>
2386
2387         * expression.cs (BaseAccess): Add support for generic methods.
2388
2389         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
2390         the new MethodGroupExpr.
2391
2392 2006-02-07  Martin Baulig  <martin@ximian.com>
2393
2394         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
2395         also reference types; fixes #77483.
2396
2397 2006-02-07  Martin Baulig  <martin@ximian.com>
2398
2399         * generic.cs
2400         (TypeManager.IsGenericMethod): We now return whether something is
2401         an instantiated generic method (and not a generic method def).
2402         (TypeManager.IsGenericMethodDefinition): New public method.
2403
2404         * typemanager.cs
2405         (TypeManager.CSharpSignature): Only include type arguments for
2406         "real" generic methods, not for any instantiated method.
2407         (TypeManager.GetMethodName): Likewise, but also allow generic
2408         method definitions here.
2409
2410 2006-02-06  Miguel de Icaza  <miguel@novell.com>
2411
2412         * codegen.cs (EmitScopeInitFromBlock): check here the
2413         capture_context, there is no need to make two calls to the
2414         EmitContext. 
2415
2416         * anonymous.cs: Add some debugging messages that might help me
2417         track other instances of this problem in the future (the
2418         regression of test 467).
2419
2420         * cs-parser.jay: track the variable block, as we need to initalize
2421         any captured variables declared in this block for the "catch"
2422         portion of the "Try" statement.
2423
2424         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2425         scope initialization for captured variables. 
2426
2427         Also, move the emit for the variables after the block location has
2428         been marked.
2429
2430 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
2431
2432        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2433         
2434 2006-02-06  Martin Baulig  <martin@ximian.com>
2435
2436         * class.cs (TypeContainer.DefineType): If we're a struct, pass
2437         `TypeManager.value_type' as parent type to
2438         ModuleBuilder.DefineType().  Fixes #77358.      
2439
2440 2006-02-02  Miguel de Icaza  <miguel@novell.com>
2441
2442         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2443         commit yesterday, the initialization for the roots is necessary.
2444         What is not necessary is the scope activation.
2445
2446 2006-02-02  Raja R Harinath  <rharinath@novell.com>
2447
2448         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2449         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2450         CS0206 checks.
2451         (Argument.Resolve): Remove CS0206 checks.
2452
2453 2006-02-01  Miguel de Icaza  <miguel@novell.com>
2454
2455         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2456         scopes for all the roots, the scopes will now be emitted when the
2457         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
2458
2459         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2460         code.  This reduces a lot of existing cruft.
2461         
2462         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2463         that the ScopeInfo is generated as we enter the scope, not at the
2464         time of use, which is what we used to do before.
2465
2466         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2467         every time a Block is about to be emitted if we have a
2468         CaptureContext. 
2469
2470 2006-02-01  Raja R Harinath  <rharinath@novell.com>
2471
2472         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
2473         attribute for mscorlib too.
2474
2475         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2476         (Reset): Update.
2477         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2478
2479         * typemanager.cs (cons_param_array_attribute): Make private.
2480         (Reset): Set it to null.
2481         (InitCoreHelpers): Don't initialize it.
2482         (ConsParamArrayAttribute): New.  Initialize it as needed.
2483         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2484
2485 2006-01-31  Miguel de Icaza  <miguel@novell.com>
2486
2487         * expression.cs: There might be errors reported during the
2488         selection of applicable methods.  If there are errors, do not
2489         continue execution as it will lead the compiler to crash.
2490
2491 2006-01-30  Miguel de Icaza  <miguel@novell.com>
2492
2493         * expression.cs: Member access is not allowed on anonymous
2494         methods.  Fixes #77402.
2495
2496 2006-01-30  Raja R Harinath  <rharinath@novell.com>
2497
2498         Fix #77401
2499         * cs-parser.jay (VariableDeclaration): Don't set
2500         current_array_type to null.
2501         (field_declaration, event_declaration, declaration_statement):
2502         Set it to null here.
2503
2504 2006-01-29  Raja R Harinath  <harinath@gmail.com>
2505
2506         Fix part of #77397
2507         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
2508
2509 2006-01-28  Raja R Harinath  <harinath@gmail.com>
2510
2511         * typemanager.cs (GenericParameterPosition): New.
2512         * doc.cs: Use it.
2513
2514 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
2515
2516         * doc.cs : To process "include" elements, first we should create
2517           another list than XmlNodeList, because it could result in node
2518           removal, which could result in that the XmlNodeList gives up
2519           yielding next node.
2520
2521 2006-01-25  Miguel de Icaza  <miguel@novell.com>
2522
2523         * expression.cs: Introduce an error report that we were not
2524         catching before.   Gonzalo ran into it.
2525
2526 2006-01-23  Miguel de Icaza  <miguel@novell.com>
2527
2528         A fix for bug: #76957
2529         
2530         * iterators.cs (MoveNextMethod.CreateMethodHost): call
2531         ComputeMethodHost before creating the method, this is a new
2532         requirement. 
2533
2534         * anonymous.cs (AnonymousContainer): Now we track all the scopes
2535         that this method references (RegisterScope).  The actual scope
2536         where the method is hosted is computed with the ComputeMethodHost
2537         before we create the method.
2538
2539         Moved the Deepest routine here.
2540
2541         (AnonymousContainer.ComputeMethodHost): New routine used to
2542         compute the proper ScopeInfo that will host the anonymous method.
2543
2544         (ScopeInfo): Deal with multiple roots.  The problem was that we
2545         did not have a unique root where all ScopeInfos could be hanged
2546         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
2547         of roots.  
2548
2549         Remove AdjustMethodScope which is now computed at the end.  Remove
2550         LinkScope which did a partial link, instead link all ScopeInfos
2551         before code generation from the new "LinkScopes" routine. 
2552
2553         Simplify all the Add* routines as they no longer need to maintain
2554         the tree, they just need to record that they are using variables
2555         from a ScopeInfo.
2556
2557         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2558         routines to produce the forest of ScopeInfo trees.
2559
2560         * class.cs (TypeContainer.AppendMethod): This is just like
2561         AddMethod, but ensures that an interface implementation method
2562         (IEnumerable.XXX) is not inserted at the beginning of the queue of
2563         methods, but at the end.
2564
2565         We use this functionality to ensure that the generated MoveNext
2566         method in the iterator class is resolved/emitted before the
2567         enumerator methods created.   
2568
2569         This is required because the MoveNext method computes the right
2570         ScopeInfo for the method.  And the other methods will eventually
2571         need to resolve and fetch information computed from the anonymous
2572         method. 
2573
2574         
2575 2006-01-23  Raja R Harinath  <rharinath@novell.com>
2576
2577         Improve implementation of section 14.4.2.2 (Better function member).
2578         * expression.cs (Invocation.MoreSpecific): Compare all type
2579         arguments before deciding if one type is more specific than
2580         another.  Handle array types too.  Return the more specific type.
2581         (Invocation.BetterFunction): Add more tie-breaking rules from
2582         section 14.4.2.2.  Perform "more specific" check after
2583         other tie-breaking rules.  Compare all parameter types before
2584         choosing the "more specific" method.
2585
2586 2006-01-21  Raja R Harinath  <harinath@gmail.com>
2587             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
2588
2589         Fix rest of #76995.
2590         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2591         the 'aliases' hash.
2592         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2593         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2594
2595 2006-01-18  Martin Baulig  <martin@ximian.com>
2596
2597         * class.cs (TypeContainer.AddToMemberContainer): Use
2598         `symbol.MemberName.MethodName' instead of just `symbol.Name';
2599         fixes #77124.
2600
2601 2006-01-18  Martin Baulig  <martin@ximian.com>
2602
2603         Fix #76417: a generic class may now have methods which may unify
2604         for some type parameter substitutions.
2605
2606         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
2607         for methods which may unify anymore.
2608
2609         * expression.cs (Invocation.MoreSpecific): New private static
2610         method; checks whether one method is more specific than another
2611         according to 14.4.2.2 of the spec.
2612         (Invocation.BetterFunction): Implement the tie-breaking rules from
2613         14.4.2.2 of the spec: if two methods unify for some type parameter
2614         substitution, we need to pick the more specific one.
2615
2616 2006-01-18  Raja R Harinath  <rharinath@novell.com>
2617
2618         Fix #76656, cs0231-2.cs.
2619         * cs-parser.jay (formal_parameter_list): Make error case catch
2620         more issues.
2621         (parenthesized_expression_0): Add CS1026 check.
2622         (invocation_expression): Remove unused { $$ = lexer.Location }.
2623
2624 2006-01-17  Raja R Harinath  <rharinath@novell.com>
2625
2626         Fix #76824.
2627         * cs-parser.jay (statement_expression): Don't list out the
2628         individual statement-expressions.  Convert syntax error into
2629         CS0201 check.
2630
2631 2006-01-16  Raja R Harinath  <rharinath@novell.com>
2632
2633         Fix #76874.
2634         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2635         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
2636         CheckIntermediateModification.
2637         (FieldExpr.DoResolve): Add new two-argument version that
2638         allows us to resolve the InstanceExpression as an lvalue.
2639         The one-argument variant is now just a wrapper.
2640         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2641         Resolve the lhs as an lvalue if the it has a value type.
2642         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2643         from Assign.DoResolve.
2644         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2645         resolved as an lvalue.
2646         (PropertyExpr.DoResolve): Update.
2647         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2648         has a value type.  Move CS1612 check here from
2649         CheckIntermediateModification.
2650         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2651         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
2652         'right_side' of a ResolveLValue on an 'out' argument.
2653         (EmptyExpression.LValueMemberAccess): New.  Used as the
2654         'right_side' of a propagated ResolveLValue on a value type.
2655         (LocalVariableReference.DoResolveBase): Recognize
2656         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2657         Add CS1654 check.
2658         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2659         EmptyExpression.Null.
2660
2661 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
2662
2663         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
2664           Type.IsGenericParameter(). Fixed bug #77183.
2665         * doc.cs : it is now identical to doc.cs in mcs.
2666
2667 2006-01-16  Martin Baulig  <martin@ximian.com>
2668
2669         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
2670
2671 2006-01-16  Martin Baulig  <martin@ximian.com>
2672
2673         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
2674         ctors; fixes #77250.
2675
2676 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2677
2678         This fixes the problem where we used ldfld instead of ldflda to
2679         load the "THIS" pointer on captured parameters, when THIS is a
2680         value type.  See bug #77205.
2681         
2682         * iterators.cs (CapturedThisReference.Emit): Pass false to
2683         EmitThis (we do not need the address).
2684
2685         * codegen.cs (EmitThis): it needs to know whether we need the
2686         address of `this' or not.  This is used by value types.  
2687
2688         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2689         every other call passes false.
2690
2691 2006-01-12  Raja R Harinath  <rharinath@novell.com>
2692
2693         Fix #77221.
2694         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2695         GetOverride.
2696         * expression.cs (Invocation.OverloadResolve): Update.
2697         (Invocation.DoResolve): Avoid double resolution of invocation.
2698
2699 2006-01-11  Raja R Harinath  <rharinath@novell.com>
2700
2701         Fix #77180.
2702         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2703         unary negation of floating point types as 0-expr; negation cannot
2704         overflow in floating point types.
2705
2706         Fix #77204.
2707         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2708         on operands of 'void' type.
2709
2710         Fix #77200.
2711         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2712         and ExclusiveOr for boolean constants too.
2713
2714 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
2715
2716         * expression.cs: Fix Console.WriteLine ((this = x).foo);
2717
2718 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2719
2720         * cs-tokenizer.cs (Position): New class used to save and restore
2721         the position state in the tokenizer.  Before this patch the save
2722         and restore was not complete enough so the line and columns would
2723         start to drift and the debugger and stack traces will get the
2724         wrong data.
2725
2726 2006-01-10  Martin Baulig  <martin@ximian.com>
2727
2728         * generic.cs
2729         (TypeParameter.InflateConstraints): New public method.
2730
2731         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
2732         constraints; fixes #77042.
2733
2734 2006-01-10  Martin Baulig  <martin@ximian.com>
2735
2736         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
2737         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
2738         #77061. 
2739
2740 2006-01-09  Raja R Harinath  <rharinath@novell.com>
2741
2742         Fix #75636.
2743         * expression.cs (Invocation.OverloadResolve): Replace reflected
2744         override methods with their base virtual methods, rather than
2745         skipping over them.
2746         * typemanager.cs (TypeManager.GetOverride): New.
2747
2748 2005-12-21  Miguel de Icaza  <miguel@novell.com>
2749
2750         * driver.cs: Report the case of no source files and no -out:
2751         argument provided.
2752
2753 2005-12-20  Raja R Harinath  <rharinath@novell.com>
2754
2755         Fix #77035.
2756         * expression.cs (ComposedCast.GetSignatureForError): Define.
2757
2758 2006-01-05  Jb Evain  <jbevain@gmail.com>
2759
2760         * class.cs (Property.Define, Indexer.Define): do not tag the
2761         properties as SpecialName | RTSpecialName.
2762
2763 2006-01-04  Miguel de Icaza  <miguel@novell.com>
2764
2765         * class.cs (MethodCore.IsDuplicateImplementation): This method was
2766         doing a low-level comparission of parameter types.  It was lacking
2767         a check for __argslist. 
2768
2769 2005-12-30  Miguel de Icaza  <miguel@novell.com>
2770
2771         * expression.cs (ParameterReference.DoResolveBase): Allow
2772         reference parameters if they are local to this block. 
2773
2774         This allows the ref and out parameters of a delegate to be used in
2775         an anonymous method, for example:
2776
2777         delegate void set (out int x);
2778
2779         set s = delegate (out int x){
2780                 x = 0;
2781         };
2782
2783         This is used by functionality introduced late in the C# language.
2784         
2785         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2786         method that take ref and out parameters. 
2787
2788         Fixes #77119 which was a late change in the spec.
2789
2790 2005-12-23  Miguel de Icaza  <miguel@novell.com>
2791
2792         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2793         parent if its the same scope.  Fixes #77060.
2794
2795 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
2796
2797         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
2798
2799 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2800
2801         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
2802         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
2803         that doesn't contain the full public key. This is a update of the
2804         friend assemblies in .Net 2.0 release.
2805         
2806 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2807
2808         Fix #76995
2809
2810         * namespace.cs (NamespaceEntry): Add extern_aliases as a
2811         ListDictionary, to contain the ExternAliasEntry entries (in
2812         addition to the NamespaceEntry.aliases hashtable). This field is
2813         shared between the original entry and its doppelganger (bodyless 
2814         copy of it).
2815         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2816         extern_aliases field.
2817         (NamespaceEntry.Lookup): Move the IsImplicit check after the
2818         lookup in extern_aliases.
2819
2820 2005-12-16  Raja R Harinath  <rharinath@novell.com>
2821
2822         Fix #77006.
2823         * class.cs (TypeContainer.Mark_HasEquals): New.
2824         (TypeContainer.Mark_HasGetHashCode): New.
2825         (ClassPart): Override them.
2826         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2827
2828         * generic.cs (GenericMethod.DefineMembers): Update to changes.
2829         (TypeParameter.TypeParameter): Change type of 'parent' argument to
2830         DeclSpace.
2831
2832         Fix #77008.
2833         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2834         'parent' argument to the base constructor.
2835
2836         Remove all mention of TypeContainer from decl.cs.
2837         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2838         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2839         (DeclSpace.DeclSpace): Likewise.
2840         (DeclSpace.DefineMembers): Remove unused argument.
2841         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
2842         debugging check -- we don't care if the debug code throws an
2843         InvalidCastException instead of an InternalErrorException.
2844         * class.cs (TypeContainer.DefineMembers): Update to changes.
2845         (TypeContainer.DoDefineMembers): Likewise.
2846         (TypeContainer.GetMethods): Likewise.
2847         (PropertyMember.Define): Likewise.
2848         (MemberBase.Parent): New property that forwards to
2849         MemberCore.Parent, but ensures that we get a TypeContainer.
2850         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2851         (RootContext.PopulateTypes): Likewise.  Remove special case code
2852         for !RootContext.StdLib: DefineMembers is idempotent.
2853
2854 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
2855
2856         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2857
2858 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
2859
2860         * doc.cs : The search for referenced namespace was insufficient to
2861           get global one as it used to do. Fixed bug #76965.
2862
2863 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
2864
2865         * doc.cs : check name in cref in the last phase that whether it is
2866           namespace or not.
2867
2868 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2869
2870         * cs-tokenizer.cs : reverted the latest change: it somehow broke
2871           Mono.C5.
2872
2873 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2874
2875         * doc.cs : so it turned out that we cannot skip override check for 
2876           interface members. Fixed bug #76954.
2877
2878 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2879
2880         * cs-tokenizer.cs : fixed bug #75984:
2881           - #warning and #error should not be handled when the source line
2882             is disabled.
2883           - #line is not checked strictly when the source line is disabled.
2884           - #define and #undef is on the other hand checked strictly at any
2885             state.
2886
2887 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
2888
2889         * cs-tokenizer.cs : missing Location (actually, filename) in one of
2890           CS1027 report.
2891
2892 2005-12-15  Raja R Harinath  <rharinath@novell.com>
2893
2894         * generic.cs (TypeManager.IsGeneric): Remove unused method.
2895
2896         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
2897         nested types.
2898
2899 2005-12-14  Martin Baulig  <martin@ximian.com>
2900
2901         * typemanager.cs (TypeManager.GetFullName): Make this public;
2902         `Type.Fullname' now never returns null.
2903
2904         * class.cs (Method.Define): Use TypeManager.GetFullName() for
2905         explicit interface implementations; we're now using the same
2906         naming convention than csc does.
2907
2908 2005-12-14  Miguel de Icaza  <miguel@novell.com>
2909
2910         * convert.cs (ExplicitConversionCore): Check the return value from
2911         ExplicitConversionCore which can return null on failure.  Fixes #76914
2912
2913 2005-12-09  Raja R Harinath  <rharinath@novell.com>
2914
2915         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
2916         instead of IsGenericInstance.
2917         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
2918         code that's now covered by the more general test.
2919         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
2920
2921         * generic.cs (DropGenericTypeArguments): New.  Captures the common
2922         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
2923         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
2924         * generic.cs, report.cs, typemanager.cs: Likewise.
2925
2926 2005-12-08  Martin Baulig  <martin@ximian.com>
2927
2928         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
2929
2930         * typemanager.cs (TypeManager.CSharpSignature): Include type
2931         arguments in the signature of a generic method.
2932
2933 2005-12-07  Martin Baulig  <martin@ximian.com>
2934
2935         Add support for custom attributes on type parameters.
2936
2937         * cs-parser.jay (type_arguments): Added `opt_attributes'.
2938
2939         * generic.cs (TypeParameterName): New public class; we use this
2940         instead of a `string' to store the name of a type parameter, so we
2941         can also have `Attributes'.
2942         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
2943         array instead of a `string[]' array.
2944         (TypeParameter.ctor): We now also take an `Attributes' argument.
2945         (TypeParameter.EmitAttributes): New public method; emit our
2946         `OptAttributes' here.
2947         (GenericMethod.EmitAttributes): New public method; emit the custom
2948         attributes on all our type parameters.
2949
2950         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
2951         our type parameters.
2952         (MethodData.Define): If we're a generic method, call
2953         EmitAttributes() on it.
2954
2955 2005-12-07  Martin Baulig  <martin@ximian.com>
2956
2957         * generic.cs
2958         (ConstraintChecker): New public abstract class; move the
2959         constraint checking here from `ConstructedType' and also do
2960         constraint checking for generic methods here.
2961
2962         * expression.cs (Invocation.OverloadResolve): Use
2963         ConstraintChecker.CheckConstraints() if we resolved to a generic
2964         method.  Fix #76806.
2965
2966 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2967
2968         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2969
2970         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2971         event initializers.
2972         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2973         (FieldBase.Initializer): Initializer is now optional.
2974         (EventField.Define): Only event field can have initializer.
2975
2976         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2977
2978         * const.cs (Const): Reuse initializer.
2979
2980         * cs-parser.jay: Updated after FieldBase changes.
2981         Added current_array_type to simplify array initializers.
2982
2983         * ecore.cs (NullCast.IsDefaultValue): Implemented.
2984
2985         * expression.cs, iterators.cs: Updated.
2986
2987         * namespace.cs (NamespaceEntry): Made UsingFound private.
2988
2989 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2990
2991         * parameterCollection.cs: Obsolete, removed.
2992         * parser.cs: Obsolete, removed.
2993
2994 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2995
2996         Fix #76849.
2997         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2998
2999         * enum.cs (Enum.Define): Set obsolete context here.
3000
3001 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
3002
3003         * doc.cs :
3004           - FindDocumentedMember() now expects 1) paramList as null
3005             when "we don't have to check the number of parameters" and
3006             2) Type.EmptyTypes when "there is no arguments".
3007           - Introduced FoundMember struct to hold the exact type which was
3008             used to find the documented member (the above change broke
3009             test-xml-044; it might be better just to use DeclaringType than
3010             what MS does, like this change does, but it depends on usage.)
3011
3012 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
3013
3014         * doc.cs : documented member might be from DeclaringType for nested
3015           types. Fixed bug #76782.
3016
3017 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
3018
3019         * anonymous.cs: Have the param code handle leaving copies on the
3020         stack etc. Allows anonymous params to take part in the assignment
3021         code (++, +=, etc). Fixes bug #76550
3022
3023         * expression.cs: Handle the prepare_for_load/leave_copy by passing
3024         it down to the anon code.
3025
3026         * iterators.cs: Use dummy var here
3027
3028         * codegen.cs: Handle new vars
3029
3030 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
3031
3032         Fix #76849.
3033         * class.cs (MethodData.Define): Set proper Obsolete context.
3034
3035         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
3036         obsolete context.
3037         (FieldExpr.DoResolve): Ditto.
3038
3039 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
3040
3041         Fix #76849.
3042         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
3043         parent is not obsolete.
3044
3045 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
3046
3047         * doc.cs : (FindDocumentedMember) find parameterless members first
3048           and get CS0419 in the early stage. Fixed first case of bug #76727.
3049
3050 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
3051
3052         Fix #76859.
3053         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
3054         no error was reported.
3055
3056         *expression.cs (Binary.DoResolve): left can be null.
3057
3058 2005-12-06  Raja R Harinath  <rharinath@novell.com>
3059
3060         * class.cs (MethodCore.CheckGenericOverride): Delete unused
3061         abstract method and all overrides.
3062         * support.cs (ParameterData.GenericConstraints): Delete.
3063         (ReflectionParameters.type_params): Delete.
3064         (ReflectionParameters.ReflectionParameters): Make private.
3065         (ReflectionParameters.GetConstaints): New factory method.
3066         * generic.cs (TypeParameterDefineType): Use it.
3067         (TypeManager.GetTypeParameterConstraints): Likewise.
3068
3069 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
3070
3071         Fix #76783.
3072         * class.cs (MethodData.Emit): Parameters should be labeled first.
3073
3074 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
3075
3076         Fix #76761.
3077         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
3078
3079 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
3080
3081         * attribute.cs (AreParametersCompliant): Moved to Parameter.
3082
3083         * class.cs (MethodCore): Parameter clean up.
3084         (IMethodData): Added ParameterInfo.
3085         (MethodData): Parameter clean up.
3086         (Indexer.Define): Parameter clean up.
3087
3088         * anonymous.cs,
3089         * codegen.cs,
3090         * cs-parser.jay,
3091         * decl.cs,
3092         * doc.cs,
3093         * ecore.cs,
3094         * flowanalysis.cs,
3095         * iterators.cs,
3096         * pending.cs,
3097         * statement.cs,
3098         * typemanager.cs: Parameter clean up.
3099
3100         * delegate.cs (Define): Get rid of duplicated code.
3101
3102         * expression.cs (ParameterReference): Removed useless parameters
3103         and simplified.
3104         (Invocation): Ditto.
3105
3106         * parameter.cs (ParamsParameter): New class, params specialization.
3107         (ArglistParameter): Attemp to separate arglist.
3108         (Parameter): Refactored to be reusable and faster.
3109         (Parameter.Modifier): Made understandable.
3110         (Parameters): Changed to be used as a class for `this' assembly
3111         parameters. Refactored to use new specialized classes.
3112
3113         * support.cs (ParameterData): Added Types property.
3114         (InternalParameters): Deleted.
3115
3116 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3117
3118         * doc.cs : the previous patch does not actually fix the bug.
3119           PropertyInfo override check is now implemented and really fixed it.
3120         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
3121
3122 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3123
3124         * doc.cs : apply "override filter" also to properties.
3125           Fixed bug #76730.
3126
3127 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3128
3129         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
3130           no need to check overrides. For classes, omit those results from 
3131           interfaces since they must exist in the class. Fixed bug #76726.
3132
3133 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3134
3135         * typemanager.cs : (GetFullNameSignature) differentiate indexers
3136           with different parameters. Fixed the second problem in #76685.
3137
3138 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3139
3140         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
3141           get expected 'protected' access in CheckValidFamilyAccess()).
3142           Fixed bug #76692.
3143
3144 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3145
3146         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
3147           Fixed bug #76705.  CS1569 was incorrectly commented out.
3148
3149 2005-11-23  Martin Baulig  <martin@ximian.com>
3150
3151         * generic.cs (Constraints.Define): Removed.
3152         (TypeParameter.DefineConstraints): Removed.
3153         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
3154         on the GenericTypeParameterBuilder here.
3155
3156 2005-11-23  Martin Baulig  <martin@ximian.com>
3157
3158         * typemanager.cs (TypeManager.GetProperty): Make this public.
3159
3160         * generic.cs (Nullable.NullableInfo.ctor): Use
3161         TypeManager.GetProperty() rather than using reflection directly.
3162
3163 2005-11-17  Martin Baulig  <martin@ximian.com>
3164
3165         * expression.cs (Indexers.GetIndexersForType): Added support for
3166         generic parameters; fixes #76587.
3167
3168 2005-11-17  Martin Baulig  <martin@ximian.com>
3169
3170         * anonymous.cs
3171         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
3172         inherit the scope from our parent.  Fixes #76653.
3173
3174 2005-11-15  Martin Baulig  <martin@ximian.com>
3175
3176         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
3177         instead of `ScopeTypeBuilder' to refer to the "current" type.
3178         (AnonymousMethod.CreateScopeType): Correctly create the helper
3179         class if we're inside a generic type definition.
3180
3181 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
3182
3183         * doc.cs : use Invocation.IsOverride() to do real override check.
3184         * expression.cs : made Invocation.IsOverride() internal.
3185
3186 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
3187
3188         * doc.cs : use TypeManager.FindMembers() instead of (possible)
3189           TypeBuilder.FindMembers() and filter overriden base members out.
3190           Fixed bug #76990.
3191
3192 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3193
3194         * doc.cs : ref/out parameters are represented as '@' (instead of
3195           '&' in type FullName). Fixed bug #76630 (additionally crefs).
3196
3197 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3198
3199         * doc.cs : when there was no '.' in cref to methods in doc comment,
3200           then parameters were missing in the output. Fixed bug #76691.
3201
3202 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3203
3204         * driver.cs : don't output docs when there is an error.
3205           Fixed bug #76693.
3206
3207 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3208
3209         * doc.cs :
3210           Now it should detect indexers. Fixed primary concern in bug #76685.
3211           Fixed CS0419 message to not show the identical member signature in
3212           the message.
3213
3214 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3215
3216         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
3217           instead of Type.FindMembers() since it does not handle events.
3218           Fixed bug #71604.
3219
3220 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
3221
3222         * codegen.cs: Fixed typo (speficied -> specified).
3223
3224 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3225
3226         Fix #76369.
3227         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3228
3229 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3230
3231         * attribute.cs: Changed error message.
3232
3233         * cs-tokenizer.cs: One more check.
3234
3235 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3236
3237         * statement.cs (Block.Resolve): Ignore empty statement.
3238
3239 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3240
3241         * report.cs: Made error/warning methods more strict to avoid
3242         their misuse.
3243
3244         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3245         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3246         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3247         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3248
3249 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3250
3251         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
3252         Use the more explicit AssemblyName.FullName instead of 
3253         AssemblyName.Name to report errors.
3254         
3255 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3256
3257         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
3258         with mcs.
3259
3260 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3261
3262         * class.cs,
3263         * convert.cs,
3264         * cs-parser.jay,
3265         * decl.cs,
3266         * enum.cs,
3267         * expression.cs,
3268         * generic.cs,
3269         * pending.cs,
3270         * report.cs: Fixed error reporting and typos.
3271
3272         * generic.cs (TypeParameter.GetSignatureForError): New method.
3273         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
3274
3275         * typemanager.cs (GetFullName): Refactored.
3276
3277 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
3278
3279         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3280         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3281
3282         * class.cs (TypeContainer.IsComImport): New property.
3283         (Constructor.Define): Create proper ctor for ComImport types.
3284
3285         * expression.cs (New.CheckComImport): Fixed.
3286
3287 2005-11-07  Miguel de Icaza  <miguel@novell.com>
3288
3289         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3290         that a parameter has been captured does not mean that we do not
3291         have to do the rest of the processing.  This fixes the second part
3292         of #76592.  If there was another anonymous method capturing
3293         values in the past, the Scope would never be set for the second
3294         method that captured the same parameter.
3295
3296         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3297         properly manipulate the stack.   Second part of fix for #76592.
3298
3299         * expression.cs (New): Add support for invoking "new" on
3300         interfaces that have been flagged with the ComImport attribute and
3301         the CoClass.  Fixes #76637 
3302
3303         * statement.cs (Try.DoEmit): When a variable is captured, do not
3304         try to emit the vi.LocalBuilder variable as it has been captured.
3305         Create a temporary variable and store the results on the
3306         FieldBuilder.  Fixes #76642
3307
3308 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3309
3310         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3311
3312         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3313
3314         * expression.cs (Binary.DoResolve): Added && optimalization.
3315     
3316         * typemanager.cs (AddUserType): Removed useless argument.
3317
3318 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
3319
3320         * statement.cs (Block.variables): Uses ListDictionary.
3321
3322 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3323
3324         Fix #75969.
3325         * class.cs (PartialContainer.EmitType): Customized to emit
3326         security attributes.
3327         (ClassPart.ApplyAttributeBuilder): Transform security attribute
3328         for partial classes.
3329
3330 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3331
3332         Fix #76599.
3333         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3334         access has to be fixed.
3335         
3336         * typemanager.cs (IsUnmanagedType): Wrong common field type.
3337
3338 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
3339
3340         Fix #76590.
3341         * ecore.cs (NullCast.Reduce): Implemented.
3342
3343         * expression.cs (ArrayCreation.CheckIndices): Correcly check
3344         constant type.
3345         
3346         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3347         properly.
3348         (Foreach.Resolve): Catch null properly.
3349
3350 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3351  
3352         * cs-tokenizer.cs: Warning text fix.
3353
3354         * driver.cs: AllWarningNumbers exposed on public interface.
3355
3356         * report.cs (): Reviewed warning numbers.
3357         (IsValidWarning): Use binary search.
3358
3359 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3360  
3361         * driver.cs: Implemeted resource visibility.
3362         (Resources): New class for code sharing between /res: and
3363         /linkres:
3364  
3365 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3366
3367         decl.cs (CurrentTypeParameters): Fixed to be public.
3368
3369 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3370
3371         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
3372
3373 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3374
3375         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
3376
3377 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
3378
3379         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
3380
3381 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3382
3383         Add friend assembly access support.
3384         * typemanager.cs: assembly_internals_vis_attrs
3385         cache for friend assembly access. 
3386         (TypeManager.IsFriendAssembly): New method for
3387         checking friend assembly access.
3388         (TypeManager.Error_FriendAccessNameNotMatching): New
3389         helper method.
3390         (TypeManager.CompareKeyTokens): Likewise.
3391         (TypeManager.Filter): Handle friend accessible
3392         members.
3393
3394         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
3395         friend accessible types.
3396
3397         * ecore.cs (Expression.IsAccessorAccessible): Handle
3398         friend accessible properties.
3399
3400         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
3401         accessible types.
3402         
3403 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
3404
3405         Fix #76568.
3406         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3407         folding.
3408         
3409         * convert (Convert.ImplicitReferenceConversion): NullCast holds
3410         contants only.
3411         
3412         * ecore.cs (NullCast): Child is contant only.
3413         
3414         * literal.cs (NullLiteral.Reduce): null can be converted to any
3415         reference type.
3416
3417 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
3418
3419         * driver.cs: Use Encoding.Default as default code page instead
3420           of ISO-28591.
3421
3422 2005-10-27  Raja R Harinath  <rharinath@novell.com>
3423
3424         Fix #76085.
3425         * expression.cs (Invocation.Error_InvalidArguments): Handle
3426         __arglist parameters.
3427         (Invocation.VerifyArgumentsCompat): Likewise.
3428         * support.cs (ReflectionParameters.GetSignatureForError): Print
3429         __arglist parameters.
3430         (InternalParamters.GetSignatureForError): Likewise.
3431         * parameter.cs (Parameters.GetSignatureForError): Likewise.
3432
3433 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
3434
3435         * attribute.cs (GetPropertyValue): Made public.
3436
3437         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3438         Resolve.
3439         Add new property WrapNonExceptionThrows to handle 2.0 assembly
3440         attribute.
3441         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3442         is not defined.
3443         
3444         * driver.cs: Reflect method name change.
3445         
3446         * statement.cs (Try.Resolve): Warn when try has both general
3447         exception handlers.
3448         
3449         * typemanager.cs: runtime_compatibility_attr_type new predefined
3450         type.
3451
3452 2005-10-26  Raja R Harinath  <harinath@gmail.com>
3453
3454         Fix #76419.
3455         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3456         treat it as an empty parameter list.
3457
3458 2005-10-26  Raja R Harinath  <rharinath@novell.com>
3459
3460         Fix #76271.     
3461         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
3462         ResolveAsTypeStep silent.
3463         * statement.cs (Block.AddConstant): Mark block as used.
3464         (Block.ResolveMeta): Avoid piling on error messages
3465         if a constant initializer resolution fails.
3466
3467 2005-10-25  Raja R Harinath  <rharinath@novell.com>
3468
3469         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3470         Remove.
3471         (NamespaceEntry.VerifyAllUsing): New.
3472         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
3473         behaviour.  Delegates actual resolution of alias to ...
3474         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
3475         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3476         Update.
3477         * driver.cs (Driver.MainDriver): Update.
3478         
3479         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3480         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3481         property.
3482         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3483         Remove.
3484         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3485         RootNamespace.DefineNamespacesForAll.
3486
3487 2005-10-24  Raja R Harinath  <harinath@gmail.com>
3488
3489         * typemanager.cs (assemblies, external_aliases, modules)
3490         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3491         (ComputeNamespaces, GetRootNamespace): Remove extra staging
3492         overhead.  Move resposibility ...
3493         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
3494         * driver.cs, attribute.cs, codegen.cs: Update to changes.
3495
3496 2005-10-23  Raja R Harinath  <harinath@gmail.com>
3497
3498         * namespace.cs (RootNamespace.all_namespaces): Renamed from
3499         cached_namespaces.  Improve usage.
3500         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3501         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3502         Move from GlobalRootNamespace and simplify.
3503         (RootNamespace.Global): Make instance variable.
3504         (RootNamespace.RootNamespace): Add "alias name" parameter.
3505         (GlobalRootNamespace): Simplify drastically.
3506         (Namespace.Lookup): Don't use GetNamespace.
3507         * typemanager.cs (GetRootNamespace): Rename from
3508         ComputeNamespaceForAlias.
3509         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3510
3511 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3512
3513         * anonymous.cs (AnonymousContainer): Don't crash when container
3514         doesn't exist.
3515
3516 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3517
3518         * expression.cs (Binary.DoResolve): Warn when comparing same
3519         values.
3520
3521 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3522
3523         Fix #76486.
3524         * expression.cs (Binary.DoResolve): It looks like there are no
3525         convetsion rules in enum context.
3526
3527 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3528
3529         Add support for extern alias qualifiers.
3530         * typemanager.cs: Move some LookupTypeReflection code
3531         to namespace.cs, to have cleaner code. Added some methods
3532         to help us keep track of the extern aliased references.
3533         * driver.cs: Add suport for extern alias assemblies on command
3534         line and check for their warnings/errors. Also keep track of the
3535         extern aliased assemblies.
3536         * namespace.cs: Move the global functionality of Namespace
3537         to GlobalRootNamespace/RootNamespace. Now the global namespace
3538         is GlobalRootNamespace.Globa. Also the code moved from 
3539         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
3540         Finally added LocalAliasEntry (AliasEntry before) and
3541         ExternAliasEntry, to handle alias statements.
3542         * cs-parser.jay: Add support in the grammar for extern alias
3543         statement.
3544         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
3545         Update callings to Namespace (now in GlobalRootNamespace).
3546
3547 2005-10-25  Martin Baulig  <martin@ximian.com>
3548
3549         * convert.cs (ImplicitTypeParameterConversion): Make base
3550         interfaces actually work; fixes #76557.
3551
3552 2005-10-25  Martin Baulig  <martin@ximian.com>
3553
3554         * generic.cs
3555         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
3556         all the type parameters; fixes #76551.
3557
3558 2005-10-25  Martin Baulig  <martin@ximian.com>
3559
3560         Fix #76472.
3561
3562         * generic.cs
3563         (GenericMethod.ctor): Added `Expression return_type' and
3564         `Parameters parameters' arguments.
3565         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
3566         parameter and return types to check their constraints if they're
3567         generic types.
3568
3569         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
3570         boolean field.
3571
3572         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3573         constraints of a generic type if `ec.ResolvingGenericMethod'.
3574
3575         * class.cs (MethodCore.DoDefineParameters): Set
3576         `ec.ResolvingGenericMethod' if we're a generic method.
3577         (MemberBase.MemberType): Likewise.
3578
3579 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3580
3581         * typemanager.cs (TypeManager): Added 
3582         TypeManager.internals_visible_attr_type to cache
3583         S.R.CompilerServices.InternalsVisibleToAttribute.
3584
3585         * codegen.cs (AssemblyClass): Added checks for 
3586         InternalsVisibleToAttribute in new method 
3587         CheckInternalsVisibleAttribute () and also cache the
3588         AssemblyName in AssemblyClass.Name.
3589         
3590 2005-10-24  Martin Baulig  <martin@ximian.com>
3591
3592         * typemanager.cs
3593         (TypeManager.ExpandInterfaces): Added overloaded version which
3594         just takes a `Type[]' array.
3595
3596         * generic.cs
3597         (Constraints.Resolve): Don't expand the interfaces here; ie. we
3598         just use the interfaces which were explicitly specified and not
3599         the interfaces they inherit.  Fixes #76482.
3600         (TypeParameter.FindMembers): Expand the interfaces here.
3601
3602 2005-10-21  Martin Baulig  <martin@ximian.com>
3603
3604         * generic.cs
3605         (Constraints.Resolve): Also resolve the actual types here.
3606         (Constraints.ResolveTypes): Just check the constraints here.
3607         Fixes #76363; see gtest-218.cs.
3608
3609 2005-10-21  Martin Baulig  <martin@ximian.com>
3610
3611         * convert.cs
3612         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
3613         instead of a `BoxedCast'; fixes gtest-217.cs.
3614
3615 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
3616
3617         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
3618           1) "new()" is specified as generic parameter constraint and 2) the
3619           type is TypeBuilder and 3) the type is abstract even if it has a
3620           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
3621
3622 2005-10-20  Martin Baulig  <martin@ximian.com>
3623
3624         * generic.cs
3625         (GenericConstraints.TypeParameter): New public property.
3626         (TypeParameter.ctor): Also take a `DeclSpace' argument.
3627         (TypeParameter.DeclSpace): New public property.
3628         (TypeParameter.DefineType): Inflate the constraints if our
3629         `DeclSpace' is an `Iterator'.   
3630
3631 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
3632
3633         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
3634           GenericMethod argument to compare methods' generic type arguments.
3635           Fixed bug #76382.
3636
3637 2005-10-19  Martin Baulig  <martin@ximian.com>
3638
3639         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
3640         not ResolveType() when resolving the base type, so we're not
3641         checking the constraints here.
3642         (TypeContainer.ResolveType): Call ResolveType() on our base_type
3643         if we have any.
3644
3645 2005-10-19  Martin Baulig  <martin@ximian.com>
3646
3647         * generic.cs (ConstructedType.CheckConstraints): Committing
3648         untested fix for #76441.
3649
3650 2005-10-18  Raja R Harinath  <rharinath@novell.com>
3651
3652         Fix #76371.
3653         * class.cs (TypeContainer.DefineType): Move updating of
3654         topological sort earlier in the code.
3655         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3656
3657 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
3658
3659         Fix #76273.
3660         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3661         
3662         * constant.cs (Constant.TryReduce): Moved from Cast class.
3663         (Reduce): Made little bit more OO and fixed missing conversions.
3664         
3665         * ecore.cs (Reduce): Implemented.
3666         (Binary.EnumLiftUp): New method to upgrade values to enum values.
3667         
3668         * literal.cs (Reduce): Implemented.
3669         
3670         * class.cs: Reverted Miguel's wrong commit.
3671
3672 2005-10-14  Miguel de Icaza  <miguel@novell.com>
3673
3674         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3675
3676 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
3677
3678         * cs-parser.jay, expression.cs : CS0214 was missing error location
3679           for constants. Fixed bug #76404.
3680
3681 2005-10-10  Raja R Harinath  <rharinath@novell.com>
3682
3683         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3684         InstanceExpression.
3685         (PropertyExpr.EmitCall): Likewise.
3686         * expression.cs (Invocation.EmitArguments): Handle case where
3687         arguments == null.
3688         (Invocation.EmitCall): Avoid allocating temporary variable if
3689         there are no arguments.
3690
3691 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
3692
3693         Fix #76370.
3694         * convert.cs (ExplicitConversionCore): Fixed object->enum
3695         conversion.
3696
3697 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3698
3699         Fix #76323.
3700         * convert.cs (ImplicitConversionStandard): Move conversion of
3701         void* to arbitrary pointer types ...
3702         (ExplicitConversionStandard): .. here.
3703         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3704         error to always print typenames.
3705
3706 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3707
3708         * convert.cs (GetConversionOperator): Rename from
3709         GetConversionOperators.  Move operator selection code from ...
3710         (UserDefinedConversion): ... here.
3711
3712 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
3713
3714         * convert.cs (ExplicitConversionCore): Removed duplicate enum
3715         conversion.
3716
3717 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
3718
3719         * assign.cs (Assign.DoResolve): Error method changed.
3720
3721         * cfold.cs (DoConstantNumericPromotions): Error method changed.
3722         
3723         * const.cs (ResolveValue): Reset in_transit immediately.
3724         
3725         * constant.cs: Error method changed.
3726         
3727         * convert.cs: Removed useless location parameter.
3728         (ExplicitNumericConversion): Don't do double enum check.
3729         (ExplicitConversionCore): Renamed from ExplicitConversion.
3730         (ExplicitUnsafe): Extracted from ExplicitConversion.
3731         (ExplicitConversion): Uses for error reporting.
3732         
3733         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3734         error messages.
3735         (ResolveBoolean): Uses common error method.
3736         (CastToDecimal): Get rid of ec.
3737         (CastFromDecimal): Optimized.
3738         (ConvCast): Get rid of ec.
3739         
3740         * enum.cs (ResolveValue): Reset in_transit immediately.
3741         (Emit): Return after first error.
3742         
3743         * expression.cs: Convert changes.
3744         
3745         * literal.cs: Error method changed.
3746         
3747         * statement.cs: Error method changed.
3748
3749 2005-10-06  Raja R Harinath  <rharinath@novell.com>
3750
3751         Fix gtest-131.cs and gtest-211.cs.
3752         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
3753         Only emit code for a label if it is used.  Unreachable code can
3754         violate ECMA evaluation stack invariants.
3755
3756 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3757
3758         * anonymous.cs: Implemented ExprClassName.
3759         
3760         * assign.cs (Assign.DoResolve): Don't chrash when type is not
3761         delegate.
3762         
3763         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3764         check.
3765         
3766         * class.cs (StaticClass.DefineContainerMembers): Report protected
3767         members as error.
3768         
3769         * codegen.cs: if(ed) PRODUCTION.
3770         
3771         * convert.cs (Error_CannotImplicitConversion): Better error
3772         distinction.
3773         
3774         * cs-parser.jay: More error checks.
3775         
3776         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3777         
3778         * driver.cs (CSCParseOption): Enabled wrong option check.
3779         
3780         * ecore.cs (Expression.ExprClassName): Turned to property.
3781         (MemberExpr.CheckIntermediateModification): For checking boxed
3782         value types     modification.
3783         
3784         * statement.cs (Fixed.Resolve): Expression type must be
3785         convertible to fixed type.
3786         (CollectionForeach.GetEnumeratorFilter,TryType):
3787         Small refactoring for easier error checking.
3788
3789 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
3790
3791         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3792         attributes.
3793         
3794         * class.cs (GeneratedBaseInitializer): New class for customization
3795         compiler generated initializers.
3796         (MemberBase.DoDefine): Check Obsolete attribute here.
3797         (FieldMember.DoDefine): Ditto.
3798         
3799         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3800         constants.
3801         
3802         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3803         (MemberCore.GetObsoleteAttribute): Removed argument.
3804         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3805         (MemberCore.CheckObsoleteType): New helper.
3806         
3807         * delegate.cs,
3808         * enum.cs,
3809         * statement.cs: Updates after MemberCore changes.
3810         
3811         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3812         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3813         
3814         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3815         obsolete attribute for compiler construct.
3816         (As.DoResolve): Cache result.
3817         
3818         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3819
3820 2005-10-01  Miguel de Icaza  <miguel@novell.com>
3821
3822         * expression.cs (Probe): instead of having a "Type probe_type"
3823         keep the extra information as a TypeExpr probe_type_expr since the
3824         "As" operator needs to perform some type checks.
3825
3826         * (As.DoResolve): If the type is a type parameter, ensure that it
3827         is constrained by a class.
3828
3829 2005-09-22  Miguel de Icaza  <miguel@novell.com>
3830
3831         * statement.cs (Lock): Use the TemporaryVariable class instead of
3832         manually using local variables as those do not work when variables
3833         are captured.
3834
3835         * ecore.cs: Moved the TemporaryVariable class from being a nested
3836         class inside Foreach to be a public class that can be employed in
3837         other places. 
3838
3839 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
3840
3841         * cs-parser.jay: interface_accessors replaced by
3842         accessor_declarations.
3843
3844         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3845         location.
3846         
3847         * statement.cs (GotoCase.Resolve): Convert null constant to
3848         null case.
3849         (SwitchLabel.ResolveAndReduce): Ditto.
3850         (SwitchLabel.NullStringCase): Custom null stamp.
3851         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3852         
3853         typemanager.cs (CSharpSignature): Don't skip first argument
3854         for full names.
3855
3856 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
3857
3858         * cfold.cs, constant.cs, convert.cs, ecore.cs,
3859         expression.cs, iterators.cs, literal.cs: Store constants and
3860         literals location.
3861         
3862         * class.cs (MemberBase.ShortName): Pass location.
3863         
3864         * cs-parser.jay: Some location fixes.
3865         
3866         * ecore.cs (Expression.Location): Made virtual.
3867
3868 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3869
3870         Fix #72930.
3871         * const.cs (Const.ResolveValue): Check for assigning non-null
3872         value to reference type.
3873
3874 2005-09-26  Raja R Harinath  <rharinath@novell.com>
3875
3876         Fix #76133.
3877         * expression.cs (This.VerifyFixed): In a value type T, the type of
3878         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
3879         value type R, 'this' is treated as a value parameter.
3880
3881 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3882
3883         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3884         if the underlying types are the same, otherwise we need to produce
3885         code that will do the proper cast.
3886
3887         This was exposed by Marek's constant rewrite which produced
3888         invalid code for the call site:
3889
3890         enum X : long { a }
3891         void Method (X v) {}
3892
3893         Method ((X) 5)
3894
3895         This fixes test-49.cs
3896
3897 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3898
3899         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3900           Type/Object should be allowed as well. Fixed bug #75968.
3901
3902 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3903
3904         * expression.cs : (Binary.DoResolve): when one is enum constant and
3905           another is constant 0, then return enum one *as enum type*.
3906           Fixed bug 74846.
3907
3908 2005-10-04  Martin Baulig  <martin@ximian.com>
3909
3910         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
3911         `SetMemberIsUsed()' work for generics, too.
3912
3913 2005-10-04  Martin Baulig  <martin@ximian.com>
3914
3915         * expression.cs (DelegateInvocation.EmitStatement): Make this work
3916         for corlib.  Fixes #75691.
3917
3918 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
3919
3920         Fix #76255.
3921         * driver.cs: Fix compilation files with full root path.
3922
3923 2005-09-25  Miguel de Icaza  <miguel@novell.com>
3924
3925         * report.cs (SymbolRelatedToPreviousError): Format the output so
3926         it does not use an open parenthesis that is never closed. 
3927
3928         * driver.cs: Follow coding guidelines
3929
3930 2005-09-18  Miguel de Icaza  <miguel@novell.com>
3931
3932         * driver.cs: Set InEmacs based on the environment variable EMACS. 
3933
3934         * location.cs (InEmacs): in this mode, do not report column
3935         location as it confuses Emacs.
3936
3937 2005-10-03  Raja R Harinath  <rharinath@novell.com>
3938
3939         * support.cs (SeekableStreamReader.Position): Don't error out when
3940         the requested position is just beyond the end of the current
3941         buffered data.
3942
3943 2005-09-28  Raja R Harinath  <rharinath@novell.com>
3944
3945         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
3946         try to keep in sync with the byte count of the underlying Stream.
3947         However, this limits us to a window size of 2048 characters: i.e.,
3948         the maximum lookahead of our lexer/parser can be 2048 characters.
3949
3950 2005-09-22  Martin Baulig  <martin@ximian.com>
3951
3952         * driver.cs: Removed a debugging FIXME.
3953
3954 2005-09-21  Raja R Harinath  <rharinath@novell.com>
3955
3956         * cs-parser.jay (type_arguments): Add CS1644 check.
3957         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
3958
3959 2005-09-15  Raja R Harinath  <rharinath@novell.com>
3960
3961         * Makefile (PROGRAM): Make profile specific.
3962         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
3963         the current directory.
3964
3965         Fix test-455.cs.
3966         * expression.cs (Invocation.EmitCall): Remove optimization on
3967         this_call since it doesn't handle 'this' being a value type.
3968
3969 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
3970
3971         * driver.cs: Ensure file handles are closed after parsing
3972
3973 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3974
3975         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3976         if the underlying types are the same, otherwise we need to produce
3977         code that will do the proper cast.
3978
3979         This was exposed by Marek's constant rewrite which produced
3980         invalid code for the call site:
3981
3982         enum X : long { a }
3983         void Method (X v) {}
3984
3985         Method ((X) 5)
3986
3987         This fixes test-49.cs
3988
3989 2005-09-05  Martin Baulig  <martin@ximian.com>
3990
3991         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
3992         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
3993
3994         * cs-parser.jay (delegate_declaration): Small fix for #75852.
3995
3996 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3997
3998         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
3999           to be a pointer type due to the spec 25.2, so check if declaring
4000           type is generic type definition. Fixed bug #75772.
4001
4002 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
4003
4004         Fixed bug #75957.
4005         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
4006           both types are not defined by methods.
4007         * expression.cs : (Invocation.IsApplicable): it should work when
4008           the argument type is equal to the parameter type, not only when
4009           ImplicitConversionExists() returns true.
4010
4011 2005-09-02  Raja R Harinath  <rharinath@novell.com>
4012
4013         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
4014         internal.
4015
4016         Fix #75941.
4017         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
4018         flow-branching for LocalVariableReferences in case we were invoked
4019         from a MemberAccess.
4020         * expression.cs (LocalVariableReference.VerifyAssigned): New.
4021         Carved out of ...
4022         (LocalVariableReference.DoResolveBase): ... this.
4023         (MemberAccess.Resolve): Do the check that was disabled during
4024         SimpleNameResolve.
4025
4026 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
4027
4028         * class.cs :
4029           (PartialContainer.Create): check abstract/sealed/static strictly
4030           but abstract/sealed can exist only at one side. Fixed bug #75883.
4031
4032 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
4033
4034         Fix #75945.
4035         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
4036         specified, don't default to UnmanagedType.I4.
4037
4038 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
4039
4040         * expression.cs : conditional operator should check possibly
4041           incorrect assign expression. Fixed bug #75946.
4042
4043 2005-08-30  Raja R Harinath  <rharinath@novell.com>
4044
4045         Fix #75934.
4046         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
4047         (ScopeInfo.EmitScopeType): Use it to construct field names from
4048         names of captured locals.
4049
4050         Fix #75929.
4051         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
4052         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
4053         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
4054         (ExplicitConversion): Remove enum cases already handled by
4055         implicit conversion.  Move implicit conversion check to the beginning.
4056         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
4057         * expression.cs (ArrayCreation.EmitDynamicInitializers):
4058         Don't treat System.Enum as a struct.
4059
4060 2005-08-30  Jb Evain  <jbevain@gmail.com>
4061
4062         * attribute.cs: handles as expression in parameters.
4063
4064 2005-08-30  Raja R Harinath  <rharinath@novell.com>
4065
4066         Fix #75802.
4067         * class.cs (TypeContainer.VerifyClsName): Don't use a
4068         PartialContainer when verifying CLS compliance.
4069         (AbstractPropertyEventMethod): Set Parent here, ...
4070         (PropertyMethod): ... not here.
4071
4072 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
4073
4074         * attribute.cs : escaped attribute name should not be allowed to be
4075           resolved (e.g. @class as classAttribute). Fixed bug #75930.
4076
4077 2005-08-29  Raja R Harinath  <rharinath@novell.com>
4078
4079         Fix #75927.
4080         * convert.cs (ImplicitStandardConversionExists): Allow zero also
4081         when converting a long constant to unsigned long.
4082         * expression.cs (Invocation.OverloadResolve): Add sanity check to
4083         detect where IsApplicable and VerifyArgumentsCompat disagree.
4084
4085 2005-08-29  Raja R Harinath  <rharinath@novell.com>
4086         and Carlos Alberto Cortez  <carlos@unixmexico.org>
4087
4088         Fix #75848.
4089         * class.cs (TypeContainer.CanElideInitializer): New helper.
4090         (TypeContainer.EmitFieldInitializers): Use it to determine if we
4091         can safely emitting the initializer of a field.
4092
4093 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4094
4095         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
4096           allowed inside a switch (without loop). Fixed bug #75433.
4097
4098 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
4099
4100         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4101         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4102
4103 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4104
4105         * driver.cs : kinda reverting the default encoding changes (not exact 
4106           revert since I noticed that "codepage:reset" might not work fine).
4107
4108 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4109
4110         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
4111           Location. Now getter and setter store location correctly.
4112           (errors/cs0111-12.cs now reports the expected location.)
4113
4114 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4115
4116         * driver.cs : Use default encoding on the environment.
4117           Removed (now that) extra parameter for SeekableStreamReader.
4118         * support.cs : (SeekableStreamReader) third .ctor() argument for
4119           StreamReader is not required (always true). preamble size could
4120           be acquired in simpler and safe way.
4121
4122 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
4123
4124         * cs-parser.jay: report CS0642 at warning level 3
4125           and report CS0642 for an if else statement also
4126           fixes bug #74745. Patch by John Luke (and a bit
4127           modified by me).
4128           Removed extra CS0642 warning check for "while",
4129           "for" and "fixed".
4130         * statement.cs: In Block.Resolve(), CS0642 check
4131           is reimplemented to check a sequence of an empty
4132           statement and a block.
4133
4134           Both fix bug #66777.
4135
4136 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
4137
4138         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
4139         detection until I fix it.
4140         
4141         * cs-tokenizer.cs: Changed error message.
4142         
4143         * cs-parser.jay: Fixed 2 error locations.
4144         
4145         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
4146         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
4147         properties.
4148         
4149         * enum.cs (GetSignatureForError): Fixed.
4150         
4151         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
4152         method detection.
4153         
4154         * class.cs,
4155         * typemanager.cs (RegisterProperty): Removed.
4156         
4157         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
4158
4159 2005-08-24  Raja R Harinath  <rharinath@novell.com>
4160
4161         Fix #75874.
4162         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
4163         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
4164
4165 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4166
4167         * expression.cs : tiny fix is required for not warning positive ulong.
4168           See test-441.cs.
4169
4170 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4171
4172         * expression.cs : add CS0652 check for constant and integral
4173           expression. Fixed bug #53974.
4174
4175 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4176
4177         * expression.cs : in DoNumericPromotions(), check if there is implicit
4178           conversion overload for string (to check CS0034). Fixed bug #52492.
4179
4180 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4181
4182         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
4183
4184 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4185
4186         * ecore.cs : report location when it is *not* Null.
4187
4188 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4189
4190         * codegen.cs,
4191           ecore.cs,
4192           flowanalysis.cs,
4193           expression.cs:
4194           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
4195           correctly. Fixed bug #75721.
4196
4197 2005-08-23  Raja R Harinath  <rharinath@novell.com>
4198
4199         * support.cs (SeekableStreamReader.Position): Avoid an expensive
4200         loop that performs 'min (pos, char_count)'.
4201
4202         Fix #75862.
4203         * expression.cs (Unary.ResolveOperator): Don't discard implicit
4204         converted value in Operator.OnesComplement.
4205
4206 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
4207
4208         * anonymous.cs: If the anon method is pulled into a helper class,
4209         it needs to be `internal' not `private'. Fixes runtime behavior on
4210         msft. bug #75704
4211
4212 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
4213
4214         Fix #75803
4215         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
4216         is a partial class.
4217
4218 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
4219
4220         The big constants rewrite
4221         Fix #75746, #75685 and more
4222         As a side effect saved 1MB for MWF ;-)
4223         
4224         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
4225         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
4226         enum based for corlib compilation.
4227         
4228         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
4229         subtractions.
4230         
4231         * class.cs (FixedField.Define): Use ResolveAsConstant.
4232         
4233         * const.cs (IConstant): Interface constants and enums.
4234         (Const.ResolveValue): New method for constant resolvning.
4235         (ExternalConstant): Constants from imported assemblies.
4236         
4237         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
4238         conversion; like enums.
4239         (Constant.ToType): Converts this constant to different type.
4240         (Constant.Increment): Adds 1.
4241         
4242         * convert.cs (ImplicitConversionRequired): Simplified.
4243         
4244         * cs-parser.jay: Create EnumMember directly.
4245         
4246         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
4247         
4248         * doc.cs (GenerateEnumDocComment): Removed.
4249         
4250         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
4251         (ConvertIntLiteral): Removed.
4252         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4253         
4254         * enum.cs (EnumMember): Implement IConstant.
4255         (Enum.IsValidEnumConstant): Removed.
4256         (Enum.GetNextDefaultValue): Removed.
4257         (Enum.FindMembers): Updated.
4258         (Enum.GenerateDocComment): Iterate enum members.
4259         
4260         * expression.cs (Cast.TryReduce): Handle enums correctly.
4261         (New.Constantify): Made public.
4262         (MemberAccess.DoResolve): Removed contant specific if(s).
4263         
4264         * literal.cs (NullLiteral): Implement new abstract methods.
4265         
4266         * statement.cs (GotoCase.Resolve): Use new constant methods.
4267         (SwitchLabel.ResolveAndReduce): Use new constant methods.
4268         
4269         * typemanager.cs (LookupEnum): Removed.
4270         (IsEnumType): Fixed to work with corlib.
4271         (RegisterConstant): Removed.
4272         (LookupConstant): Removed.
4273         (GetConstant): Changed to work with IConstant.
4274
4275 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
4276
4277         * location.cs : Fixed overflown (>255) column number.
4278
4279 2005-08-03  Raja R Harinath  <rharinath@novell.com>
4280
4281         First cut of the qualified-alias-member feature.
4282         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4283         token.
4284         * cs-parser.jay (DOUBLE_COLON): New token.
4285         (namespace_or_type_name): Add rule for recognizing
4286         qualified-alias-members.
4287         (primary_expression): Likewise.
4288         (element_access): Allow QualifiedAliasMember as a possible
4289         type-bearing expression.
4290         (local_variable_type, local_variable_pointer_type): Likewise.
4291         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
4292         aliases in the current and enclosing namespace declarations.
4293         (NamespaceEntry.UsingAlias): Add CS0440 warning.
4294         * decl.cs (MemberName.is_double_colon): New.
4295         (MemberName.MemberName): Add new constructor for alias-member.
4296         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4297         * expression.cs (QualifiedAliasMember): New expression type.
4298
4299 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4300
4301         * location.cs : it borked when no argument was specified.
4302
4303 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4304
4305         * location.cs : tiny ToString() format fix.
4306
4307 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4308
4309         * statement.cs : oops, it was missing.
4310
4311 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4312
4313         A set of fixes for precise line/column location.
4314
4315         * location.cs :
4316           "token" field now holds a file/line "delta", a line number offset 
4317           from the segment, and a column number. See also:
4318           http://lists.ximian.com/pipermail/mono-devel-list/2004-
4319           December/009508.html
4320           Removed static IsNull. Use instance IsNull property instead.
4321         * cs-tokenizer.cs :
4322           For some tokens it stores Location. For Identifier it stores
4323           LocatedToken which is a pair of string name and location.
4324           Column numbers are adjusted only at getChar().
4325         * report.cs :
4326           Use Location.ToString() for reporting (it now contains column).
4327         * cs-parser.jay :
4328           Largely modified to use LocatedToken instead of
4329           string (IDENTIFIER), and to acquire Location from some tokens.
4330         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4331           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4332           codegen.cs :
4333           Now MemberName holds Location. DeclSpace.ctor() receives Location
4334           as a parameter. Removed extra parameters to all derived classes.
4335           Replaced Location.IsNull() with instance property.
4336         * assign.cs, expression.cs :
4337           Added .ctor() overload that omits Location.
4338         * attribute.cs :
4339           Added "nameEscaped" flag that indicates the identifier was escaped
4340           in the source file. This fixes bug #57047.
4341
4342 2005-09-02  Martin Baulig  <martin@ximian.com>
4343
4344         * class.cs: Make CS3005 a warning, not an error.
4345
4346 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
4347
4348         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4349         New method, looking for lo-case imported cls type.
4350
4351         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4352         here.
4353
4354         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4355
4356         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4357
4358         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4359         all_imported_types.
4360         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4361
4362         Optimized to save 3.5 MB for SWF compilation.
4363
4364 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4365
4366         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4367         (PartialContainer.Create): Moved logic AddToContainer.
4368         (PartialContainer.MarkForDuplicationCheck): Shares name.
4369         
4370         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4371         place.
4372         
4373         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4374         initialization.
4375         (Namespace.GetSignatureForError): New method.
4376         
4377         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4378         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4379
4380 2005-08-01  Raja R Harinath  <rharinath@novell.com>
4381
4382         Fix #75669.
4383         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4384         member lookup rather than qualifier_type, since qualifier_type can
4385         be null.
4386
4387 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4388
4389         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4390         enum member.
4391
4392 2005-07-31  Miguel de Icaza  <miguel@novell.com>
4393
4394         * statement.cs: Copy the local exception into the exception
4395         captured local.  Fixes 75674
4396
4397 2005-07-31  Raja R Harinath  <harinath@gmail.com>
4398
4399         Fix #75658.
4400         * expression.cs (Invocation.OverloadResolve): Don't report error
4401         CS1501 if error CS1502 has been reported.
4402         (New.DoResolve): Delegate CS1501 reporting to
4403         Invocation.OverloadResolve.
4404
4405         Fix #75656.
4406         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4407         invariant-meaning-in-block property in an enclosing block if
4408         necessary.
4409
4410 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
4411
4412         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4413         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4414         (Switch.CheckSwitch): Just save 50kb for SWF.
4415
4416 2005-07-27  Martin Baulig  <martin@ximian.com>
4417
4418         * anonymous.cs (CaptureContext.AddField): Added
4419         `AnonymousContainer am' argument; compute its toplevel scope if
4420         it's not already computed.  Fixes #75649.
4421
4422 2005-07-26  Raja R Harinath  <rharinath@novell.com>
4423
4424         Fix #75628.
4425         * class.cs (Constructor.Emit): Reset block to null if the block
4426         resolve fails.
4427
4428 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4429
4430         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4431
4432 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4433
4434         * class.cs (MethodData.Define): Check whether accessor implementing
4435         interface is public.
4436
4437         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4438
4439 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
4440
4441         Fix #57245
4442         * namespace.cs (LookupType): Moved same type check to...
4443         
4444         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4445         with the same name.
4446
4447 2005-07-21  Raja R Harinath  <rharinath@novell.com>
4448
4449         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4450         already found a typebuilder.
4451         * class.cs (MethodCore.IsDuplicateImplementation): Compare
4452         MemberNames, not strings.
4453
4454         * const.cs (Error_ExpressionMustBeConst): 
4455         Rename from Error_EpressionMustBeConst.
4456         * const.cs, class.cs, statement.cd: Update.
4457
4458 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
4459
4460         Fix #65573
4461
4462         * const.cs (Const.LookupConstantValue): Report missing contant expression
4463         everytime.
4464         (Error_EpressionMustBeConstant): Only one error method.
4465
4466         * class.cs, statement.c: Updated.
4467
4468 2005-07-20  Raja R Harinath  <rharinath@novell.com>
4469
4470         * statement.cs (Block.Flags): Add back HasVarargs.
4471         (Block.flags): Make protected.
4472         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4473
4474         * typemanager.cs (types, typecontainers, user_types): Remove.
4475         (UserTypes, TypeContainers): Likewise.
4476         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4477         (CleanUp, Reset): Update.
4478         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
4479         (GetNestedType): Use Type.GetNestedType.
4480         (CoreLookupType): Take two arguments, the namespace and the
4481         basename of the type.  Update to use the Namespace.Lookup
4482         mechanism.
4483         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4484         (RealMemberLookup): Use IsNestedChildOf instead of playing with
4485         string concatenation and substring matches.
4486         * class.cs, enum.cs, delegate.cs: Update to changes.
4487
4488 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
4489
4490         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4491         Expression and made virtual.
4492
4493         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4494         (ImplicitStandardConversionExists): Fixed `byte' typo ?
4495
4496         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4497
4498         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4499         error message.
4500
4501         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4502         change.
4503
4504 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
4505
4506         Fix #57707
4507         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4508         AssemblyCultureAttribute is not used on executable.
4509
4510         * rootcontext.cs,
4511         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4512
4513 2005-07-16  Raja R Harinath  <rharinath@novell.com>
4514
4515         Fix #60638.
4516         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4517         New.  Reports CS0252/CS0253.
4518         Mostly taken from preliminary patch by Duncak Mak.
4519         (Binary.DoResolveOperator): Store results of operator lookup.
4520         Use them to detect if we need to warn about unintended reference
4521         comparisons.
4522
4523 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4524
4525         Fix #72969.
4526         * namespace.cs (Namespace.Lookup): Add back location parameter.
4527         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
4528         * delegate.cs, ecore.cs, expression.cs: Update to changes.
4529
4530         * codegen.cs (EmitContext.DeclSpace): Make readonly.
4531         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4532         (Namespace.LookupType): ... this.
4533         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4534         of namespaces.
4535         * typemanager.cs (LookupTypeReflection): Remove buggy code that
4536         purported to handle pointers.
4537         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4538         CoreLookupType.
4539
4540 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
4541
4542         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4543         type as namespace.
4544
4545 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4546
4547         * namespace.cs (Namespace.Lookup): Drop location parameter.
4548         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
4549         (NamespaceEntry.Lookup): ... this.
4550         (NamespaceEntry.Error_AmbiguousTypeReference):
4551         Move here from DeclSpace.
4552         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4553         names ...
4554         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4555         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4556         Move to NamespaceEntry.
4557         * delegate.cs, expression.cs: Update to changes.
4558
4559 2005-08-31  Martin Baulig  <martin@ximian.com>
4560
4561         Committing a patch from Atsushi Enomoto for #75850.
4562
4563         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
4564         Prefer a generic enumerator over a non-generic one.
4565
4566 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
4567
4568         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4569         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4570
4571 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4572
4573         * driver.cs : reverting default encoding change as well as mcs.
4574
4575 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4576
4577         * driver.cs, support.cs : merged r48826.
4578           Marek Safer wrote:
4579           > could you integrate your mcs changes to gmcs otherwise
4580           > gmcs cannot compile some files.
4581
4582 2005-08-20  Martin Baulig  <martin@ximian.com>
4583
4584         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4585         scope if we don't already have it.
4586
4587         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4588         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4589         fixes #75867.
4590
4591 2005-07-31  Miguel de Icaza  <miguel@novell.com>
4592
4593         * statement.cs: Copy the local exception into the exception
4594         captured local.  Fixes 75674
4595
4596 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
4597
4598         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4599         type as namespace.
4600
4601 2005-08-12  Martin Baulig  <martin@ximian.com>
4602
4603         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
4604         for nested types here to avoid hitting the cache too early.
4605
4606 2005-08-09  Miguel de Icaza  <miguel@novell.com>
4607
4608         * enum.cs: On the new compiler CLS error 3005 is now a warning not
4609         an error. 
4610
4611 2005-08-03  Martin Baulig  <martin@ximian.com>
4612
4613         Make iterators in generic methods work; see gtest-191.cs.
4614
4615         * generic.cs
4616         (Constraints.Resolve): Protect against being called twice.
4617
4618         * class.cs
4619         (TypeContainer.GetClassBases): Make this `protected virtual'.
4620
4621         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
4622         (Iterator.GetClassBases): Override this and compute the base
4623         classes here.
4624         (Iterator.DefineNestedTypes): If we're a generic method, all our
4625         method type parameters become class type parameters on the proxy
4626         class.
4627
4628         * statement.cs
4629         (ToplevelBlock.Parameters): Make this a property, not a field.
4630         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
4631
4632 2005-08-03  Martin Baulig  <martin@ximian.com>
4633
4634         * typemanager.cs (TypeManager.IsSubclassOf): Use
4635         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
4636         (TypeManager.GetFullName_recursed): Improved.
4637
4638 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4639
4640         Fix #75417
4641         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
4642         Private accessor case, using TypeManager.IsPrivateAccessible instead of
4643         invocation_type == mi.DeclaringType, since the first one also checks
4644         other condition used by generic instances.
4645         
4646 2005-07-27  Martin Baulig  <martin@ximian.com>
4647
4648         * anonymous.cs (CaptureContext.AddField): Added
4649         `AnonymousContainer am' argument; compute its toplevel scope if
4650         it's not already computed.  Fixes #75649.
4651
4652 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
4653
4654         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4655         CheckAttributeType and refactored.
4656         (Attribute.ResolvePossibleAttributeType): Changed to reuse
4657         ResolveAsTypeTerminal error handling.
4658         (ResolveAsTypeTerminal): Introduced because of global attributes extra
4659         handling.
4660         (GetSignatureForError): Print errors in same way.
4661
4662         * class.cs,
4663         * codegen.cs: Reflect attribute GetSignatureForError change.
4664
4665         * ecore.cs,
4666         * expression.cs: Add silent parameter to ResolveAsTypeStep.
4667
4668         * namespace.cs (UsingEntry): Refactored to make fields private.
4669
4670         * assign.cs,
4671         statement.cs: Error_UnexpectedKind has extra parameter.
4672
4673 2005-07-14  Raja R Harinath  <rharinath@novell.com>
4674
4675         * ecore.cs (IAlias): Remove.
4676         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
4677         that implement the interface.
4678         * namespace.cs (Namespace): Likewise.
4679         (Namespace.declspaces): Renamed from 'defined_names'.
4680         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
4681         DeclSpace instead of an IAlias.
4682         * tree.cs (Tree.AddDecl): Update.
4683
4684 2005-07-12  Raja R Harinath  <rharinath@novell.com>
4685
4686         * statement.cs (Block.Flags); Remove HasVarargs.
4687         (Block.HasVarargs): Move to ToplevelBlock.
4688         (Block.ThisVariable, Block.AddThisVariable): Likewise.
4689         (Block.Variables): Make protected.  Initialize variable hashtable
4690         if necessary.
4691         (Block.AddVariable): Update.
4692         (Block.Resolve): Update to changes.
4693         (ToplevelBlock.HasVarargs): New boolean.
4694         (ToplevelBlock.ThisVariable): Move here from Block.
4695         (ToplevelBlock.AddThisVariable): Likewise.
4696         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
4697         * expression.cs (This.ResolveBase): Update to changes.
4698         (ArglistAccess.DoResolve): Likewise.
4699
4700 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4701
4702         Fix #75321
4703         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4704
4705         * class.cs (TypeContainer.VerifyMembers): Distinguish between
4706         not used and not used & assigned.
4707         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4708
4709 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4710
4711         Fix #75053
4712         * expression.cs (Is.DoResolve): null is never provided type.
4713
4714 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
4715
4716         Fix #52496
4717         * cs-parser.jay: Less strict event error rule to catch more errors.
4718
4719 2005-07-11  Martin Baulig  <martin@ximian.com>
4720
4721         * generic.cs (ConstructedType.CheckConstraints): Improve the check
4722         for the constructor constraint: we do not only have to check
4723         whether the class has a public constructor, but also ensure that
4724         it's parameterless.  Fixes #75492.
4725
4726 2005-07-11  Martin Baulig  <martin@ximian.com>
4727
4728         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
4729         between type parameters if they either have the reference type
4730         constraint or the class constraint.
4731
4732 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
4733
4734         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
4735
4736 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
4737
4738         Fix #74975
4739         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4740         (ExtractSecurityPermissionSet): Cope with self referencing security
4741         attributes properly.
4742
4743         * driver.cs (SetOutputFile): Made public property OutputFile.
4744
4745 2005-07-07  Raja R Harinath  <rharinath@novell.com>
4746
4747         Fix #75486.
4748         * class.cs (TypeContainer.first_nonstatic_field): Rename from
4749         has_nonstatic_fields.  Make into a FieldBase pointer.
4750         (TypeContainer.AddField): Add CS0282 check.
4751         (TypeContainer.EmitType): Update.
4752
4753 2005-07-06  Miguel de Icaza  <miguel@novell.com>
4754
4755         * cs-tokenizer.cs (consume_identifier): Do not create strings to
4756         compare if they start with __.
4757
4758 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4759
4760         * statement.cs (Switch.SwitchGoverningType): Only look at
4761         UserCasts that don't need implicit standard conversions to one of
4762         the allowed switch types (Fixes test-322.cs).
4763         (LocalInfo.Resolve): Re-enable sanity-test.
4764
4765 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
4766
4767         * cs-tokenizer.cs (consume_identifier): Detect double undescores
4768         
4769         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4770         
4771         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4772
4773 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4774
4775         Fix #75472.
4776         * ecore.cs (SimpleName.GetSignatureForError): Add.
4777         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4778         (MemberAccess.GetSignatureForError): Add.
4779
4780 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
4781  
4782         The big error and warning messages review.
4783         
4784         * anonymous.cs,
4785         * assign.cs,
4786         * attribute.cs,
4787         * class.cs,
4788         * codegen.cs,
4789         * convert.cs,
4790         * cs-parser.jay,
4791         * cs-tokenizer.cs,
4792         * decl.cs,
4793         * delegate.cs,
4794         * doc.cs,
4795         * driver.cs,
4796         * ecore.cs,
4797         * enum.cs,
4798         * expression.cs,
4799         * flowanalysis.cs,
4800         * iterators.cs,
4801         * literal.cs,
4802         * location.cs,
4803         * modifiers.cs,
4804         * namespace.cs,
4805         * parameter.cs,
4806         * pending.cs,
4807         * report.cs,
4808         * rootcontext.cs,
4809         * statement.cs,
4810         * support.cs,
4811         * tree.cs,
4812         * typemanager.cs: Updated.
4813         
4814         * class.cs: (MethodCore.SetYields): Moved here to share.
4815         (PropertyMethod.Define): Moved iterator setup here.
4816         
4817         * iterators.cs: Add orig_method to have full access to parent
4818         container.
4819
4820 2005-07-05  Raja R Harinath  <rharinath@novell.com>
4821
4822         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4823         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4824         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4825         variable of struct type.
4826         * expression.cs (Unary.ResolveOperator): Update to change.
4827         (Indirection.VerifyFixed): Likewise.
4828         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4829         (ParameterReference.VerifyFixed): Value parameters are fixed.
4830         (This.VerifyFixed): Treat 'this' as a value parameter.
4831         * statement.cs (LocalInfo.IsFixed): Remove.
4832
4833 2005-07-01  Martin Baulig  <martin@ximian.com>
4834
4835         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4836         `ec.EmitThis ()' to get the correct scope.
4837
4838 2005-07-01  Martin Baulig  <martin@ximian.com>
4839
4840         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4841         instance is a ParameterReference; fixes #75299.
4842
4843 2005-06-30  Raja R Harinath  <rharinath@novell.com>
4844
4845         Fix #75412.
4846         * expression.cs (Indexers.map): Remove.
4847         (Indexers.Append): Filter out inaccessible setters and getters.
4848         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4849
4850         Fix #75283.
4851         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
4852         Refactored from ...
4853         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4854         (FieldExpr.Emit, PropertyExpr.Emit): Update.
4855         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4856         * expression.cs (Invocation.EmitCall): Add CS0120 check.
4857
4858 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
4859
4860         Fix #75322
4861         * class.cs (FieldBase.GetInitializerExpression): One more field
4862         for backup.
4863
4864 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4865
4866         * pending.cs: Do not define a proxy if the base method is virtual,
4867         it will be picked up by the runtime (bug 75270).
4868
4869 2005-07-08  Martin Baulig  <martin@ximian.com>
4870
4871         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4872         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4873
4874 2005-07-07  Martin Baulig  <martin@ximian.com>
4875
4876         * generic.cs (ConstructedType.CheckConstraint): Use
4877         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
4878         called recursively; fixes #75329.
4879
4880 2005-07-06  Martin Baulig  <martin@ximian.com>
4881
4882         * generic.cs (TypeManager.InferTypeArguments): Added support for
4883         anonymous methods; fixes #75461.
4884
4885 2005-07-01  Martin Baulig  <martin@ximian.com>
4886
4887         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4888         `ec.EmitThis ()' to get the correct scope.
4889
4890 2005-07-01  Martin Baulig  <martin@ximian.com>
4891
4892         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
4893         instance is `This'; fixes #75299.
4894
4895 2005-06-30  Martin Baulig  <martin@ximian.com>
4896
4897         * class.cs (Indexer): Implement IIteratorContainer; added support
4898         for iterators in indexers.
4899
4900         * codegen.cs
4901         (EmitContext.CurrentIterator): Make this a property, not a field.
4902
4903         * anonymous.cs (AnonymousContainer.Iterator): New public property.
4904
4905 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4906
4907         * pending.cs: Do not define a proxy if the base method is virtual,
4908         it will be picked up by the runtime (bug 75270).
4909
4910 2005-06-28  Martin Baulig  <martin@ximian.com>
4911
4912         * cs-parser.jay (interface_method_declaration): Avoid a
4913         reduce/reduce conflict by moving some of the code into a separate
4914         `interface_method_declaration_body' rule; fixes #75368.
4915
4916 2005-06-28  Martin Baulig  <martin@ximian.com>
4917
4918         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
4919         array check after the check for TypeBuilder's.
4920
4921 2005-06-21  Raja R Harinath  <rharinath@novell.com>
4922
4923         * convert.cs (FindMostEncompassedType): Add two trivial special
4924         cases (number_of_types == 0 || number_of_types == 1).
4925         (FindMostEncompasingType): Likewise.
4926
4927 2005-06-17  Raja R Harinath  <rharinath@novell.com>
4928
4929         Some cleanups preparing for the fix of #75283.
4930         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4931         error testing.
4932         (EventExpr.InstanceResolve): Likewise.
4933         (EventExpr.DoResolve): Remove redundant checks.
4934
4935 2005-06-08  Miguel de Icaza  <miguel@novell.com>
4936
4937         * class.cs: Small fix.
4938
4939 2005-06-08  Raja R Harinath  <rharinath@novell.com>
4940
4941         Fix #75160.
4942         * class.cs (GetPartialBases): Fix return value check of
4943         part.GetClassBases.
4944
4945 2005-06-07  Raja R Harinath  <rharinath@novell.com>
4946
4947         Ensure that partial classes are registered in their enclosing
4948         namespace.  Initial part of fix of #75160.
4949         * tree.cs (Tree.RecordDecl): Add new namespace argument.
4950         Register declspace with namespace here, not in
4951         DeclSpace.RecordDecl.
4952         * cs-parser.jay: Pass namespace to RecordDecl.
4953         * class.cs (PartialContainer.Create): Likewise.
4954         (ClassPart.DefineType): New sanity-check.  Throws an exception if
4955         called.
4956         * decl.cs (Declspace.RecordDecl): Remove.
4957         * namespace.cs (NamespaceEntry.DefineName): Remove.
4958
4959 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4960
4961         * rootcontext.cs: Reset TargetExt as well.
4962
4963 2005-06-03  Raja R Harinath  <rharinath@novell.com>
4964
4965         * ecore.cs (Expression.Resolve): Emit CS0654 error when
4966         -langversion:ISO-1.
4967
4968 2005-06-02  Raja R Harinath  <rharinath@novell.com>
4969
4970         Fix #75080, cs0119.cs.
4971         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
4972         of ...
4973         (Expression.Resolve): ... this.  Use it.  Remove bogus code
4974         allowing ExprClass.Type and ExprClass.Namespace for
4975         ResolveFlags.VariableOrValue.
4976         (Expression.Resolve) [1-argument variant]: Change default resolve
4977         flags based on language version.
4978         (Expression.Error_UnexpectedKind): Use a simple string array
4979         rather than an ArrayList.
4980         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4981         not ExprClass.Type.
4982         (TypeOfVoid.DoResolve): Likewise.
4983         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
4984         flags argument -- it always has the same value.
4985
4986 2005-05-31  Raja R Harinath  <rharinath@novell.com>
4987
4988         Fix #75081.
4989         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4990         Use it in the error message.
4991         * assign.cs, expression.cs, statement.cs: Update.
4992
4993 2005-05-30  Raja R Harinath  <rharinath@novell.com>
4994
4995         Fix #75088.
4996         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4997         the "almostMatchedMember" case too.
4998         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4999         that failed the accessibility checks to 'almost_match'.
5000
5001 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
5002
5003         * attribute.cs: Use internal MethodBuilder methods to set
5004         ExactSpelling and SetLastError on PInvoke methods, instead
5005         of passing them via charset.  Fixes #75060.
5006
5007 2005-05-27  Raja R Harinath  <rharinath@novell.com>
5008
5009         * parameter.cs (Parameter): Remove TODO comment.
5010         (Parameter.DefineParameter): Remove Location parameter.
5011         (Parameters.LabelParameters): Likewise.
5012         * class.cs (Constructor.Emit): Update to change.
5013         (MethodData.Emit): Likewise.
5014         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
5015         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
5016
5017 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
5018
5019         * parameter.cs,
5020           Removed Parameters.Location and added Parameter.Location instead.
5021           Removed Location parameter from Emit() and GetSignature().
5022         * anonymous.cs,
5023           class.cs,
5024           cs-parser.jay,
5025           delegate.cs,
5026           iterators.cs,
5027           statement.cs :
5028           Modified all related calls.
5029
5030 2005-06-21  Martin Baulig  <martin@ximian.com>
5031
5032         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
5033         left-hand side is not a nullable type; fixes #75328.
5034
5035 2005-06-21  Martin Baulig  <martin@ximian.com>
5036
5037         * typemanager.cs
5038         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
5039         (TypeManager.GetFullNameSignature): Likewise.
5040
5041         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
5042         `source.FullName' and `target.FullName' to check whether there are
5043         two conflicting definitions.
5044
5045 2005-06-21  Martin Baulig  <martin@ximian.com>
5046
5047         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
5048         a BoxedCast - also for reference types - to be compatible with csc.
5049
5050 2005-06-21  Martin Baulig  <martin@ximian.com>
5051
5052         * expression.cs (MemberAccess.DoResolve): Add support for nested
5053         types in a generic instance; fixes #75320.
5054
5055 2005-06-20  Martin Baulig  <martin@ximian.com>
5056
5057         * generic.cs (TypeManager.InferType): Also walk the class
5058         hierarchy for generic instances; fixes #75261.
5059
5060 2005-06-17  Martin Baulig  <martin@ximian.com>
5061
5062         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
5063         to make things work for corlib.
5064
5065 2005-06-15  Martin Baulig  <martin@ximian.com>
5066
5067         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
5068         obsolete `SecurityAction' values.
5069
5070 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
5071
5072         * rootcontext.cs: Reset TargetExt as well.
5073         
5074 2005-06-09  Martin Baulig  <martin@ximian.com>
5075
5076         * delegate.cs (Delegate.VerifyMethod): Added
5077         `MethodGroupExpr old_mg' argument; inherit its
5078         `HasTypeParameters'; fix #75085.
5079
5080 2005-06-09  Martin Baulig  <martin@ximian.com>
5081
5082         * expression.cs (Invocation.OverloadResolve): Correctly handle
5083         generic methods for the SetMemberIsUsed(); fix #75064.
5084
5085 2005-06-09  Martin Baulig  <martin@ximian.com>
5086
5087         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
5088         fixes #75062.
5089
5090 2005-06-08  Martin Baulig  <martin@ximian.com>
5091
5092         * cs-parser.jay (nullable_type_or_conditional): If we put the
5093         nullable back and our `type' is a `ComposedCast', remove the
5094         nullable from it.  Fixes #75156.
5095
5096         * expression.cs (ComposedCast.RemoveNullable): New public method.
5097
5098 2005-06-08  Martin Baulig  <martin@ximian.com>
5099
5100         The big Iterators rewrite :-)
5101
5102         * iterators.cs: Rewrite this to use the anonymous methods framework.
5103
5104         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
5105         before the TypeContainers; see 2test-21.cs.
5106
5107         * class.cs
5108         (TypeContainer.DefineType): Don't create a new EmitContext if we
5109         already have one (this only happens if we're an Iterator).
5110         (TypeContainer.Define): Also call Define() on all our iterators.
5111         (Method.CreateEmitContext): Added support for iterators.
5112
5113         * anonymous.cs
5114         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
5115         (AnonymousContainer.CreateMethodHost): Moved here from
5116         AnonymousMethod and made abstract.
5117         (AnonymousContainer.CreateScopeType): New abstract method.
5118         (AnonymousContainer.IsIterator): New public property.
5119         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
5120         get the ScopeTypeBuilder rather than manually defining it here. 
5121         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
5122         iterators here.
5123
5124         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
5125         before RootContext.DefineTypes().
5126
5127         * codegen.cs (EmitContext.RemapToProxy): Removed.
5128         (EmitContext.CurrentAnonymousMethod): Changed type from
5129         AnonymousMethod -> AnonymousContainer.
5130         (EmitContext.ResolveTopBlock): Protect from being called twice.
5131         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
5132         (EmitContext.EmitThis): Removed the iterators hacks; use the
5133         anonymous methods framework for that.
5134
5135         * statement.cs
5136         (ToplevelBlock.Container): Make this a property, not a field.
5137         (ToplevelBlock.ReParent): New public method; move the
5138         ToplevelBlock into a new container.
5139         (Foreach.TemporaryVariable): Simplify.
5140
5141 2005-06-05  Martin Baulig  <martin@ximian.com>
5142
5143         * statement.cs (LocalInfo.CompilerGenerated): New flag.
5144         (Block.AddTemporaryVariable): New public method; creates a new
5145         `LocalInfo' for a temporary variable.
5146         (Block.EmitMeta): Create the LocalBuilders for all the temporary
5147         variables here.
5148         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
5149         non-iterator variables.
5150
5151 2005-06-05  Martin Baulig  <martin@ximian.com>
5152
5153         * statement.cs (Foreach.TemporaryVariable): Create the
5154         LocalBuilder in the Emit phase and not in Resolve since in some
5155         situations, we don't have an ILGenerator during Resolve; see
5156         2test-19.cs for an example.
5157
5158 2005-06-04  Martin Baulig  <martin@ximian.com>
5159
5160         The big Foreach rewrite - Part II.
5161
5162         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
5163         with `PropertyInfo ienumerator_getcurrent'.
5164
5165         * codegen.cs (VariableStorage): Removed.
5166
5167         * statement.cs
5168         (Foreach): Derive from Statement, not ExceptionStatement.
5169         (Foreach.CollectionForeach): New nested class.  Moved all the code
5170         dealing with collection foreach here.
5171         (Foreach.ForeachHelperMethods): Removed.
5172         (Foreach.TemporaryVariable): Implement IMemoryLocation.
5173
5174 2005-05-23  Martin Baulig  <martin@ximian.com>
5175
5176         * statement.cs (Try.DoResolve): Don't create a `finally' if we
5177         don't need to.  Fix #75014.
5178
5179 2005-05-26  Raja R Harinath  <rharinath@novell.com>
5180
5181         Improve user-defined conversion handling.
5182         * convert.cs (GetConversionOperators): Rewrite.  Return only the
5183         applicable operators.
5184         (AddConversionOperators): New.  Helper for GetConversionOperators.
5185         (FindMostEncompassedType, FindMostEncompassingType): Verify that
5186         there is only one most encompassed/encompassing type.
5187         (FindMostSpecificSource, FindMostSpecificTarget): Remove
5188         "applicable operator" handling.
5189         (UserConversion): Move cache here from GetConversionOperators.
5190         Directly cache the chosen operator, rather than the whole
5191         MethodGroup.
5192         (ExplicitNumericConversion): Fix buggy implementation of Decimal
5193         case.  Allow conversion of decimal to sbyte and byte too.
5194         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5195         New static methods.  Used to avoid allocating EmptyExpressions in
5196         convert.cs.
5197
5198 2005-05-24  Duncan Mak  <duncan@novell.com>
5199
5200         * ecore.cs (CastFromDecimal): New class for casting a decimal to
5201         another class, used in Convert.ExplicitNumericConversion.
5202         (CastToDecimal): New class, similar to above, but casts to
5203         System.Decimal, used in Convert.ImplicitNumericConversion and also
5204         in explicit convesion from double/float to decimal.
5205
5206         * convert.cs (ImplicitNumericConversion): Handle implicit
5207         conversions to System.Decimal.
5208         (ExplicitNumericConversion): handle explicit conversions to
5209         System.Decimal.
5210
5211         This fixes #68711.
5212         
5213 2005-05-20  Miguel de Icaza  <miguel@novell.com>
5214
5215         * typemanager.cs: Do not throw an exception in the TypeBuilder
5216         case, we take care of it on the TypeCode.
5217
5218 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
5219         
5220         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
5221         is back.
5222         
5223         * cs-parser.jay: Catch more lexical errors.
5224         
5225         * report.cs: Add one more Error method.
5226         
5227         * rootcontext.cs,
5228         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
5229
5230 2005-05-20  Martin Baulig  <martin@ximian.com>
5231
5232         * class.cs (TypeContainer.CircularDepException): Removed.
5233         (TypeContainer.DefineType): Removed the `InTransit' stuff.
5234         (TypeContainer.CheckRecursiveDefinition): Check for circular class
5235         (CS0146) and interface (CS0529) dependencies here.
5236
5237 2005-05-20  Martin Baulig  <martin@ximian.com>
5238
5239         * expression.cs (New.DoResolve): Move the CS0712 check above the
5240         CS0144 check; otherwise it can never be reached.
5241
5242 2005-05-20  Martin Baulig  <martin@ximian.com>
5243
5244         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
5245
5246 2005-05-20  Martin Baulig  <martin@ximian.com>
5247
5248         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
5249
5250         * typemanager.cs (TypeManager.IsAttributeType): New public method.
5251
5252 2005-05-19  Martin Baulig  <martin@ximian.com>
5253
5254         * delegate.cs
5255         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
5256         to disable error reporting.
5257
5258         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
5259         here since we don't want to report an error; see the new test-336.cs.
5260
5261 2005-05-19  Raja R Harinath  <rharinath@novell.com>
5262
5263         * statement.cs (ToplevelBlock.GetParameterReference)
5264         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
5265         Move here from class Block.
5266         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
5267         * expression.cs (ParameterReference.DoResolveBase): Likewise.
5268
5269 2005-05-18  Martin Baulig  <martin@ximian.com>
5270
5271         Fix #74978.
5272
5273         * flowanalysis.cs
5274         (FlowBranching.Reachability): Add non-static public And() and Or()
5275         methods.
5276         (FlowBranchingSwitch): New class; do the `break_origins' thing
5277         like in FlowBranchingLoop.
5278         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5279         reachability, not just locals and parameters.
5280         (FlowBranching.MergeChild): Remove some of the hacks for loop and
5281         switch; MergeBreakOrigins() now takes care of that.
5282
5283 2005-05-18  Martin Baulig  <martin@ximian.com>
5284
5285         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5286         a loop and may leave it, reset the barrier; fixes #74974.
5287
5288 2005-05-16  Raja R Harinath  <rharinath@novell.com>
5289
5290         Fix test-382.cs.  Emit values of decimal constants.
5291         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5292         Carved out of ...
5293         (TypeContainer.AddField): ... this.
5294         (TypeContainer.EmitFieldInitializers): Allow the list of fields
5295         with initializers to include 'Const's.
5296         (ClassPart.RegisterFieldForInitialization): Forward to
5297         PartialContainer.
5298         * const.cs (Const.Const): Pass initializer to base class.
5299         (Const.Define): In case of decimal constants, register them for
5300         initialization in a static constructor.
5301
5302 2005-05-14  Martin Baulig  <martin@ximian.com>
5303
5304         * statement.cs (Block.Resolve): Correctly handle unreachable code;
5305         do not call ResolveUnreachable() on unreachable statements in
5306         here, see the comment in the source code.
5307
5308 2005-05-13  Raja R Harinath  <rharinath@novell.com>
5309
5310         Fix #74934.
5311         * expression.cs (BinaryResolveOperator): If one of the operands of
5312         an equality comparison is 'null' and the other is a pointer type,
5313         convert the null to a NullPointer.
5314         * convert.cs (ImplicitReferenceConversion): If the expression is a
5315         NullLiteral and the target type is a pointer type, return a
5316         NullPointer instead.
5317         (ImplicitConversionStandard): Likewise.
5318
5319 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
5320         
5321         * cs-parser.jay: Set readonly context based on special constructs.
5322         
5323         * expression.cs (LocalVariableReference.DoResolveBase): Improved
5324         readonly variable error handling.
5325         
5326         * rootcontext.cs (EmitCode): Don't verify members when error
5327         occurred.
5328         
5329         * statement.cs (LocalInfo): Add reaodnly context information.
5330         (SetReadOnlyContext, GetReadOnlyContext): New methods.
5331
5332 2005-05-17  Martin Baulig  <martin@ximian.com>
5333
5334         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5335         #70970. 
5336
5337 2005-05-13  Martin Baulig  <martin@ximian.com>
5338
5339         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
5340         handle unreachable blocks.
5341
5342 2005-05-13  Martin Baulig  <martin@ximian.com>
5343
5344         * class.cs
5345         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
5346         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
5347         #74905. 
5348
5349 2005-05-13  Martin Baulig  <martin@ximian.com>
5350
5351         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5352         instance variable, not a local.  Fix #74873.
5353         (Block.ResolveUnreachable): Set it to true here.
5354
5355 2005-05-12  Martin Baulig  <martin@ximian.com>
5356
5357         * cs-parser.jay (property_declaration): Pass the `current_class',
5358         not the `current_container' to Property's .ctor.  Fixes #74912.
5359
5360 2005-05-11  Martin Baulig  <martin@ximian.com>
5361
5362         * typemanager.cs (Closure): Copy this from MCS and merge all the
5363         GMCS-specific changes into it.
5364
5365 2005-05-12  Raja R Harinath  <harinath@gmail.com>
5366
5367         Fix #74920.
5368         * typemanager.cs (unmanaged_enclosing_types): New.
5369         (IsUnmanagedType): Avoid infloops by using
5370         'unmanaged_enclosing_types' to talk with recursive invocations.
5371
5372 2005-05-11  Duncan Mak  <duncan@novell.com>
5373
5374         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5375         continuing to process for 'arg'.
5376         (handle_preprocessing_directive): Check the argument of the #endif
5377         directive and report error CS1025 if there are any trailing
5378         characters.
5379
5380         According to the C# spec, having even whitespace after the #endif
5381         directive is illegal; however, because we call arg.TrimEnd ()
5382         beforehand, we have the same behavior as csc, allowing whitespace
5383         after the directive.
5384
5385         Fixes #74892.
5386
5387 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
5388
5389         Fix #74863.
5390         
5391         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5392         (Constructor.GetObsoleteAttribute): Implemented correctly.
5393
5394 2005-05-10  Martin Baulig  <martin@ximian.com>
5395
5396         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
5397         resolve the type; fixes #74864.
5398         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
5399         in DoResolve(); fixes #74862.
5400
5401 2005-05-10  Martin Baulig  <martin@ximian.com>
5402
5403         * support.cs (ReflectionParameters.ParameterModifier): Use
5404         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5405         and `ParameterAttributes.In'.  Fixes #74884.
5406
5407 2005-05-10  Martin Baulig  <martin@ximian.com>
5408
5409         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
5410         the cache if we're just looking for `MemberTypes.NestedType' in a
5411         generic instance.
5412
5413         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
5414         constraints if we're still resolving the type tree.
5415         (Expression.MemberLookup): If we're resolving the type tree, only
5416         look for `MemberTypes.NestedType' since we're only interested in
5417         getting types.
5418
5419         * class.cs (TypeContainer.DefineType): Don't resolve the type
5420         parameters here; do this later in ResolveType() after the type
5421         tree has been resolved.
5422         (TypeContainer.ResolveType): New public method; this is called
5423         after the type tree is resolved and before the types are being
5424         populated.  We resolve the generic constraints here.
5425         (TypeContainer.DoDefineMember): Check the constraints on our base
5426         class and interfaces.
5427
5428         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
5429         set the `ResolvingTypeTree' flag on the EmitContext.
5430
5431         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
5432
5433 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
5434
5435         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5436         
5437         * expression.cs (Argument.GetParameterModifier): Turned to property.
5438         (Invocation.Error_InvalidArguments): Add more descriptive errors.
5439         
5440         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5441         its C# equivalent.
5442         
5443 2005-05-09  Raja R Harinath  <rharinath@novell.com>
5444
5445         Fix #74852.
5446         * decl.cs (MemberCache.AddMethods): Register override methods,
5447         rather than non-override methods.
5448         * typemanager.cs (RegisterOverride): New.
5449         (IsOverride): Update.
5450
5451 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
5452
5453         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
5454
5455 2005-05-06  Martin Baulig  <martin@ximian.com>
5456
5457         * attribute.cs
5458         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
5459         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
5460
5461 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
5462
5463         Fix #73105.
5464         
5465         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5466         recursive declaration.
5467         
5468         * statement.cs (Block.ResolveMeta): Report any error in resolving.
5469         
5470 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
5471
5472         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5473         
5474         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5475
5476 2005-05-05  Raja R Harinath  <rharinath@novell.com>
5477
5478         Fix #74797.
5479         * decl.cs (DeclSpace.FamilyAccessible): 
5480         Use TypeManager.IsNestedFamilyAccessible.
5481
5482         Fix reopened #64812.
5483         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5484         internal'.
5485
5486 2005-05-04  Raja R Harinath  <rharinath@novell.com>
5487             Abin Thomas  <projectmonokochi@rediffmail.com>
5488             Anoob V E  <projectmonokochi@rediffmail.com>
5489             Harilal P R  <projectmonokochi@rediffmail.com>
5490
5491         Fix #64812.
5492         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5493         allow access to all static members.
5494
5495 2005-05-04  Martin Baulig  <martin@ximian.com>
5496
5497         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5498
5499 2005-05-04  Martin Baulig  <martin@ximian.com>
5500
5501         Fix #74655.
5502
5503         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5504         section at the end; make things work if `default' is not the last
5505         section.        
5506
5507 2005-05-04  Martin Baulig  <martin@ximian.com>
5508
5509         Fix #70400.
5510
5511         * statement.cs (Switch): Replaced the `got_default' field with a
5512         `default_section' one.
5513         (Switch.CheckSwitch): Set `default_section' here.
5514         (Switch.Resolve): If we're a constant switch and the constant is
5515         not found, use the default section.
5516
5517 2005-05-03  Martin Baulig  <martin@ximian.com>
5518
5519         * expression.cs (ArrayAccess.EmitGetLength): New public method.
5520
5521         * statement.cs (Foreach.ArrayForeach): New nested class.
5522         (Foreach.TemporaryVariable): New nested class.
5523         (Foreach.EmitArrayForeach): Removed; this is now in the new
5524         ArrayForeach class.
5525
5526 2005-05-03  Raja R Harinath  <rharinath@novell.com>
5527
5528         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
5529         more conservative.
5530         (VerifyPendingMethods): Revert change below.
5531
5532         * typemanager.cs (IsOverride, RegisterNonOverride): New.
5533         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5534         that used to trigger warning -28.  Remove warning -28.
5535         * expression.cs (Invocation.OverloadResolve): Use
5536         TypeManager.IsOverride to distinguish override methods.
5537
5538         Fix #74773.
5539         * pending.cs (VerifyPendingMethods): If a base type implements the
5540         requested interface, don't bother checking individual methods of
5541         the base type.  As a side-effect, this prevents the creation of
5542         unnecessary proxies.
5543
5544 2005-05-02  Martin Baulig  <martin@ximian.com>
5545
5546         Fix #70182.
5547
5548         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5549         Also `And' the locals if the old vector is null.
5550         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5551         null; in this case we basically reset all the variables.        
5552
5553 2005-05-02  Martin Baulig  <martin@ximian.com>
5554
5555         Fix #74529.
5556
5557         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5558         Added `FlowBranching branching' argument; always `and' the
5559         variables instead of `or'ing them unless we're an infinite loop.
5560
5561         * statement.cs (While.Resolve): Create a new sibling unless we're
5562         infinite.       
5563
5564 2005-05-02  Martin Baulig  <martin@ximian.com>
5565
5566         Fix #70140.
5567
5568         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5569         arguments; use it instead of creating a new TopLevelBlock.
5570         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5571         our ConstructorInitializer.
5572
5573         * statement.cs
5574         (TopLevelBlock.TopLevelBranching): New public property.
5575         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5576         and create our `TopLevelBranching'.
5577
5578         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5579         anonymous method host, use `block.TopLevelBranching' rather than
5580         creating a new branching.
5581
5582 2005-04-20  Miguel de Icaza  <miguel@novell.com>
5583
5584         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5585         a ScopeInfo, if any of the current children is a child of the new
5586         entry, move those children there.
5587
5588 2005-04-30  Martin Baulig  <martin@ximian.com>
5589
5590         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5591         at the beginning of a SwitchSection.  Fix #73335.
5592
5593 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
5594
5595         Fix #74378
5596         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5597         
5598         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5599         (FieldExpr.DoResolve): Obsolete members are ignored for field
5600         initializers.
5601         
5602 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
5603
5604         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5605         of arrays detection.
5606
5607         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5608         verification.
5609         (Field.VerifyClsCompliance): Volatile fields are not compliant.
5610
5611         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5612         arrays report.
5613
5614 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
5615
5616         * cs-parser.jay: Use the prefered version of -unsafe in error
5617         message.
5618
5619 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
5620
5621         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5622         circumstances.
5623
5624 2005-04-20  John Luke  <john.luke@gmail.com>
5625
5626         * driver.cs: fix typo in error message, --outout to --output
5627
5628 2005-04-30  Martin Baulig  <martin@ximian.com>
5629
5630         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
5631         handle the .NET 2.x security attributes.
5632
5633 2005-04-30  Martin Baulig  <martin@ximian.com>
5634
5635         * typemanager.cs
5636         (TypeManager.ExpandInterfaces): Don't add things twice.
5637
5638         * class.cs
5639         (TypeContainer.VerifyClsCompliance): Allow generic instances.
5640
5641 2005-04-29  Martin Baulig  <martin@ximian.com>
5642
5643         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
5644
5645         * anonymous.cs: Added support for anonymous generic methods.
5646
5647 2005-04-29  Martin Baulig  <martin@ximian.com>
5648
5649         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
5650         generic instances.
5651
5652 2005-04-29  Martin Baulig  <martin@ximian.com>
5653
5654         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
5655
5656         * expression.cs (New.DoResolve): Fix the CS0304 check.
5657
5658 2005-04-29  Martin Baulig  <martin@ximian.com>
5659
5660         * typemanager.cs (TypeManager.GetFullName): Updated to the new
5661         naming schema.
5662
5663         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
5664         explicit interface implementation, compare the interface types.
5665         (MethodData.Define): Use the new naming scheme from the latest
5666         .NET 2.x beta2.
5667         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
5668
5669         * decl.cs (MemberName.GetMemberName): Removed.
5670         (MemberName.MethodName, FullName): New properties.
5671
5672 2005-04-25  Raja R Harinath  <rharinath@novell.com>
5673
5674         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
5675
5676 2005-04-22  Martin Baulig  <martin@ximian.com>
5677
5678         * generic.cs (GenericMethod): Create the EmitContext in the
5679         `Define()'; in `Define(MethodBuilder)', create the type parameters
5680         before calling `Define()'.  Fixes #73933.
5681
5682 2005-04-22  Martin Baulig  <martin@ximian.com>
5683
5684         * generic.cs
5685         (Constraints.Resolve): Make things work wrt. the new type lookup system.
5686         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
5687
5688         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
5689         ConstructedType, check its constraints.
5690
5691 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
5692
5693         * codegen.cs (InRefOutArgumentResolving): New field.
5694         
5695         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5696         fields outside contructor.
5697         
5698         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5699         
5700 2005-04-19  Miguel de Icaza  <miguel@novell.com>
5701
5702         * anonymous.cs (CaptureContext.EmitParameterInstance): The
5703         parameter code was not completed ever, so it was not as up-to-date
5704         as local variables.  Must finish it.
5705
5706         The bug fix was to compare the Toplevel of the block, not the
5707         current block.  Thanks for Ben for pointing this out. 
5708
5709 2005-04-19  Raja R Harinath  <rharinath@novell.com>
5710
5711         * decl.cs (AddMethods): Use the declaring type of the problem
5712         method to determine if we want to squash a warning.
5713
5714 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
5715
5716         * attribute.cs: Removed debug output.
5717
5718         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5719         
5720         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5721         Report.Stderr.
5722         
5723 2005-04-18  Raja R Harinath  <rharinath@novell.com>
5724
5725         Fix #74481.
5726         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5727         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5728         all null comparisons against reference types.
5729
5730 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
5731
5732         Fix# 74565
5733         * class.cs (TypeContainer.CircularDepException) New nested
5734         exception class.
5735         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5736         (TypeContainer.DefineType): Removed error, reset InTransit before
5737         exit.
5738         (Class.DefineType): Throw exception when is in Transit.
5739         Catch exception and report error.
5740         (Struct.DefineType): Throw exception when is in Transit.
5741         Catch exception and report error.
5742         (Interface.DefineType): Throw exception when is in Transit.
5743         Catch exception and report error.
5744
5745         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5746         handle nested exception handlers.
5747
5748         * flowanalysis.cs (InTryWithCatch): New method, search for try with
5749         a catch.
5750
5751         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5752         InFinally and InCatch storage.
5753
5754         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5755         (Catch.Resolve): Set and Restore ec.InCatch.
5756         (Try.Resolve): Set and Restore ec.InFinally.
5757         (Try.HasCatch): True when try has catch.
5758
5759 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
5760
5761         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5762           for the same event member, so exclude such cases from warning 419.
5763           Fixed bug #74633.
5764
5765 2005-04-16  Miguel de Icaza  <miguel@novell.com>
5766
5767         * expression.cs (Binary.ResolveOperator): Apply patch from John
5768         Luke to fix bug 59864: operators &, | and ^ on enumerations
5769         require that the same enum type on both sides.
5770
5771         * driver.cs: Add warnings to old flag usage, this is to assist
5772         people who produce Makefiles and hope that the Makefiles will be
5773         used on Windows.
5774
5775         * class.cs (TypeContainer.EmitType): Moved the definition of the
5776         special $PRIVATE$ field from the resolve phase to the Emit phase.
5777         During resolve we do not know if we are a struct with
5778         HasExplicitLayout, we know this only after the attributes for the
5779         type are emitted.
5780
5781         Set the FieldOffset to zero on the dummy field that we create for
5782         the class.   Fixes 74590.
5783
5784 2005-04-16  Raja R Harinath  <rharinath@novell.com>
5785
5786         Fix #73834.
5787         * ecore.cs (PropertyExpr.resolved): New.
5788         (DoResolve): Use it to handle a case of double resolution here.
5789         Handle a case of identical-name-and-type-name.
5790         * expression.cs (ArrayCreation.CheckIndices): Avoid double
5791         resolution by storing the results of expression resolution back
5792         into the "probes" array.
5793
5794 2005-04-15  Raja R Harinath  <rharinath@novell.com>
5795
5796         Fix cs0208-7.cs and cs0208-8.cs.
5797         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5798         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
5799         error reporting to point out the reason a struct is not unmanaged.
5800
5801 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5802
5803         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
5804           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5805
5806 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5807
5808         Fix #74528.
5809         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5810         IdenticalNameAndTypeName here.
5811         (EventExpr.InstanceResolve): Likewise.
5812
5813 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
5814
5815         C# 2.0 DefaultCharSetAttribute implementation
5816         
5817         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5818         which allows us to set GlobalNamespace for every resolve.
5819         (Attribute.ResolveArguments): Cut from Resolve.
5820         (Attribute.GetCharSetValue): Returns CharSet named argument.
5821         (Attribute.DefinePInvokeMethod): Gets default charset from
5822         module settings.
5823         (GlobalAttribute.ResolveAsTypeStep): Override.
5824         (GlobalAttribute.ResolveArguments): Override.
5825         
5826         * class.cs (TypeAttr): Is protected.
5827         
5828         * codegen.cs (ModuleClass.DefaultCharSet): New member.
5829         (ModuleClass.DefaultCharSetType): New memeber.
5830         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5831         
5832         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5833         charset from module.
5834         
5835         * delegate.cs (TypeAttr): Override.
5836         (Delegate.DefineType): Use this TypeAttr.
5837         
5838         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5839         at very early stage (before types are defined) to resolve model
5840         module attributes. It will probably not work with corlib but it
5841         should be ok.
5842         
5843         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5844         charset from module.
5845         
5846         * typemanager.cs (default_charset_type): New type.
5847
5848 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5849
5850         * decl.cs (MemberCache.AddMethods): Don't warn if
5851         System.Object.Finalize has buggy MethodAttributes.
5852
5853         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5854         removed below.
5855
5856 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5857
5858         * doc.cs : detect ambiguous reference to overloaded members.
5859           Fixed bug #71603. MS 1.1 csc does not detect it.
5860
5861 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5862
5863         * doc.cs : delegates must not be referenced with parameters.
5864           Fixed bug #71605.
5865
5866 2005-04-12  Miguel de Icaza  <miguel@novell.com>
5867
5868         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5869
5870 2005-04-10  Miguel de Icaza  <miguel@novell.com>
5871
5872         * driver.cs (MainDriver): Stop processing if the CLS stage found
5873         errors. 
5874
5875         (CompilerCallableEntryPoint.InvokeCompiler): Always
5876         reset after execution;   Take a TextWriter argument for the
5877         output.
5878
5879         * report.cs: Use the error stream instead of hardcoding stderr. 
5880
5881 2005-04-09  Miguel de Icaza  <miguel@novell.com>
5882
5883         * class.cs: Reduce code paths to test, too small of an
5884         optimization to make it worth the extra testing.  Always perform
5885         it. 
5886
5887 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5888
5889         Fix #74510.
5890         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5891         operators that had errors reported on them.
5892
5893 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
5894
5895         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5896         argument types.
5897         (Attribute.Resolve): Add named argument type checking.
5898         
5899         * class.cs (FixedField.Define): Use IsPrimitiveType
5900         
5901         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5902         
5903         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5904         unsafe parameter types.
5905         
5906         * statement.cs (Using.ResolveExpression): Add better error description.
5907         
5908         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5909         
5910 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5911
5912         Fix #74484.
5913         * attribute.cs (Attribute.GetAttributeUsage): Resolve
5914         AttributeUsageAttribute in the emitcontext of the attribute class,
5915         not in the emitcontext of the attributable entity it was attached to.
5916         * cs-parser.jay: Use 'current_class', not 'current_container',
5917         when creating a GlobalAttribute.
5918
5919 2005-04-08  Alp Toker  <alp@atoker.com>
5920
5921         * pending.cs: The fix to #58413 failed to compile methods implementing
5922         interfaces with/without params modifiers and vice versa, even though
5923         params modifiers aren't part of the signature. Make the modifier check
5924         less strict as in csc.
5925
5926 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
5927             Anoob V E  <projectmonokochi@rediffmail.com>
5928             Harilal P R  <projectmonokochi@rediffmail.com>
5929
5930         Fix #58413.
5931         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
5932         modifiers of pending methods.
5933         (PendingImplementation.PendingImplementation): Initialize it.
5934         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5935         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5936         with ParameterData.  Add check for modifiers.
5937         * class.cs (MethodData.Define): Update to changes.
5938
5939 2005-04-07  Raja R Harinath  <rharinath@novell.com>
5940
5941         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5942
5943 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
5944
5945         * class.cs (PropertyMethod.Define): Check private accessor in abstract
5946         property.
5947         
5948         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5949         
5950         * rootcontext.cs,
5951         * typemanager.cs: Registered RequiredAttributeAttribute.
5952         
5953 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
5954
5955         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5956         Warning CS0169 is back at level 3.
5957         (IMethodData.SetMemberIsUsed): New method.
5958         
5959         * decl.cs (IsUsed): New value; moved from FieldBase.Status
5960         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5961         
5962         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5963
5964         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5965         contants.
5966         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5967         is used.
5968         
5969         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5970         is used.
5971         
5972         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5973         to avoid the problems with nested types.
5974
5975 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
5976             Anoob V.E  <projectmonokochi@rediffmail.com>
5977             Harilal P.R  <projectmonokochi@rediffmail.com>
5978             Raja R Harinath  <rharinath@novell.com>
5979
5980         Fix #73820.
5981         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5982         attribute.
5983         * typemanager (GetConstructor): Make public.
5984
5985 2005-04-05  John Luke  <john.luke@gmail.com>
5986             Raja R Harinath  <rharinath@novell.com>
5987
5988         Fix #62232.
5989         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5990         struct too.  Return false quicker in a few cases.
5991         (VerifyUnManaged): Use it.
5992
5993 2005-04-05  Raja R Harinath  <rharinath@novell.com>
5994
5995         Fix #74041.
5996         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5997         not 'unreachable_seen'.
5998
5999 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
6000
6001         * attribute.cs (Attribute.GetValue): Removed unused.
6002         
6003         * codegen.cs (CodeGen.TrimExt): Removed unused.
6004         
6005         * cs-parser.jay (output): Removed unused.
6006         
6007         * cs-tokenizer.cs (hex_digits): Removed unused.
6008         
6009         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
6010         
6011         * expression.cs (Indirection.LoadExprValue): Removed unused.
6012         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
6013         
6014         * iterators.cs (Iterator.param_types): Removed unused.
6015         
6016         * statement.cs (Goto.block): Removed unused.
6017         (ToplevelBlock.did): Removed unused.
6018         (Switch.ResolveConstantSwitch): Removed unused.
6019
6020 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
6021
6022         * rootcontext.cs: Allow mcs to bootstrap with the compilation
6023         resetting thingy.
6024
6025 2005-04-19  Martin Baulig  <martin@ximian.com>
6026
6027         Merged r42462 from MCS and made it work for GMCS.
6028
6029         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
6030
6031         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
6032
6033 2005-04-01  Raja R Harinath  <rharinath@novell.com>
6034
6035         Fix #74232 and cs0208-3.cs.
6036         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
6037         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
6038         unmanaged type.  Don't use FieldBuilders when 't' is a
6039         TypeBuilder.  Use ModFlags and MemberType fields.
6040         * class.cs (MemberBase.member_type): Rename from MemberType.
6041         (MemberBase.MemberType): New property.  Determines member_type on
6042         demand.
6043         (MemberBase.DoDefine): Don't initialize MemberType here.
6044         (FieldMember.Define): Likewise.
6045
6046 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
6047
6048         Fix #74241
6049         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
6050         Attributes are emitted there.
6051         
6052 2005-04-01  Raja R Harinath  <rharinath@novell.com>
6053
6054         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
6055         keyword in 'partial enum' too.
6056         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
6057         is not allowed).
6058         Report from Kamil Skalski <nazgul@omega.pl>.
6059
6060         Fix #74309.
6061         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
6062         have partial containers too.
6063
6064         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
6065         in block' checks to Block.CheckInvariantMeaningInBlock.
6066         * statement.cs (Block.GetKnownVariableInfo): Make private.
6067         (Block.IsVariableUsedInChildBlock): Remove.
6068         (Block.IsVariableUsedInBlock): Likewise.
6069         (Block.CheckInvariantMeaningInBlock): New.  Show location of
6070         conflicting declaration.
6071         (Block.AddVariable): Make error messages less long-winded and more
6072         specific.  Show location of conflicting declaration.
6073         * parameter.cs (Parameters.Location): New readonly property.
6074
6075 2005-03-31  Raja R Harinath  <rharinath@novell.com>
6076
6077         Clean up semantics of invoking ResolveMemberAccess.
6078         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
6079         can have an instance, ensure that we pass in a non-TypeExpression
6080         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
6081         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
6082         argument.  Update to changes and simplify.
6083         (FieldExpr.Emitinstance): Remove CS0120 check.
6084         (PropertyExpr.EmitInstance): Likewise.
6085         * expression.cs (Argument.Resolve): Likewise.
6086         (Invocation.DoResolve): Update to changes in semantics of
6087         InstanceExpression.
6088
6089 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
6090
6091         Fix #74241
6092         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
6093         customization.
6094         
6095         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
6096
6097 2005-03-31  Raja R Harinath  <rharinath@novell.com>
6098
6099         Fix difference in behaviour with commandline invocation.
6100         * driver.cs (Driver.Reset): New.
6101         (CompilerCallableEntryPoint): Call it.
6102
6103         * statement.cs (If.Resolve): Avoid spurious "uninitialized
6104         variable" warnings if the boolean expression failed to resolve.
6105
6106 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
6107
6108         * attribute.cs: Fix the union of several permissions when some of them
6109         are unrestricted (so the result isn't an unrestricted permission set).
6110         Fix #74036.
6111
6112 2005-03-30  Raja R Harinath  <rharinath@novell.com>
6113
6114         * ecore.cs (MemberExpr): New class.  Convert from interface
6115         IMemberExpr.
6116         (MemberExpr.ResolveMemberAccess): Refactor and move here from
6117         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
6118         error checks.
6119         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
6120         (MethodGroupExpr.IsExplicitImpl): Remove.
6121         (Expression.GetFieldFromEvent): Remove.
6122         (SimpleName.MemberStaticCheck): Remove.
6123         (SimpleName.DoSimpleNameResolve): Update to changes.
6124         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
6125         (MemberAccess.IdenticalNameAndTypeName): Remove.
6126         (MemberAccess.error176): Move to MemberExpr.
6127         (MemberAccess.DoResolve): Update to changes.
6128         (BaseAccess.DoResolve): Likewise.
6129
6130 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
6131
6132         C# 2.0 Conditional attribute class implementation
6133         
6134         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
6135         Analyzes class whether it has attribute which has ConditionalAttribute
6136         and its condition is not defined.
6137         
6138         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
6139         (Class.IsExcluded): New method. Search for at least one defined
6140         condition in ConditionalAttribute of attribute class.
6141
6142 2005-03-30  Raja R Harinath  <rharinath@novell.com>
6143
6144         * ecore.cs (PropertyExpr): Derive from Expression, not
6145         ExpressionStatement.
6146         (PropertyExpr.EmitStatement): Remove.
6147
6148 2005-03-29  Raja R Harinath  <rharinath@novell.com>
6149
6150         Fix #74060.
6151         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
6152         internal field "value__" of an enum be private.  The examples for
6153         "value__" that I found on MSDN all used FieldAttributes.Private.
6154
6155         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
6156         Don't mention IL method attribute names.
6157
6158         Fix #47991.  Remove a TODO.
6159         * statement.cs (Block.Toplevel): Make into a field.
6160         (Block.Parameters): Move into ToplevelBlock.
6161         (Block.known_variables): Rename from child_variable_names.
6162         (Block.Block): Remove variants that take Parameters.  Initialize
6163         'Toplevel' with the immediately surrounding toplevel block.
6164         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
6165         LocalInfo parameter.
6166         (Block.GetKnownVariableInfo): New.
6167         (Block.IsVariableNameUsedInChildBlock): Update.
6168         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
6169         the block, even though it may not be in scope.
6170         (Block.AddVariable): Remove Parameters parameter.  Use
6171         Toplevel.Parameters instead.
6172         (Block.AddConstant): Remove Parameters parameter.
6173         (Block.GetParameterReference): Update to use Toplevel.Parameters.
6174         (Block.IsParamaterReference): Likewise.
6175         (Block.IsLocalParameter): Likewise.  Simplify a lot.
6176         (ToplevelBlock.Parameters): New.  Moved from Block.
6177         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
6178         initialize Parameters to a non-null value.
6179         * cs-parser.jay: Update to changes.
6180         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
6181         simple names that mean different things in the same block.  Use
6182         Block.IsVariableNameUsedInBlock.
6183
6184 2005-03-28  Raja R Harinath  <rharinath@novell.com>
6185
6186         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
6187
6188 2005-03-26  Raja R Harinath  <harinath@acm.org>
6189
6190         Fix #73038.
6191         * assign.cs (Assign.DoResolve): When the RHS of an assignment
6192         fails to resolve, ensure that the LHS is still resolved as an
6193         lvalue.
6194
6195 2005-03-25  Raja R Harinath  <harinath@acm.org>
6196
6197         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
6198         ec.ContainerType.
6199         (Enum.current_ec): Remove.
6200         (Enum.LookupEnumValue): Remove EmitContext argument.
6201         Just uses the one created during DefineType.
6202         (Enum.FindMembers): Update.
6203         * expression.cs (MemberAccess.DoResolve): Update.
6204
6205 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
6206
6207         * assign.cs (Assign.DoResolve): Check for CS1717 when
6208         source and target are same (uses Equals).
6209
6210         * expression.cs (LocalVariableReference, ParameterReference,
6211         This): Implemented Equals, GetHashCode.
6212
6213         * statement.cs (Block.GetParameterReference): Removed useless
6214         local variable.
6215
6216 2005-03-22  Raja R Harinath  <rharinath@novell.com>
6217
6218         Fix cs0128.cs
6219         * statement.cs (Block.AddVariable): Ensure that we skip implicit
6220         blocks before deciding whether the error is cs0136 or cs0128.
6221
6222         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
6223         (using_alias_directive, using_namespace_directive): Pass
6224         MemberName, not an expression to Namespace.UsingAlias and
6225         Namespace.Using.
6226         (MakeName): Use the MemberName of the namespace.
6227         * namespace.cs (Namespace.MemberName): New.
6228         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
6229         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
6230         Likewise.
6231         * decl.cs (MemberName.Name): Make readonly.
6232         (MemberName.FromDotted): New "constructor".
6233         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
6234         (MemberCore.Name): Compute from MemberName on demand.
6235         (MemberCore.SetMemberName): Provide a way to change the
6236         MemberName.
6237         (MemberCore.AddToContainer): Don't take a fullname parameter.
6238         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
6239         fully qualified name of the container to the member name.
6240         (TypeContainer.AddToTypeContainer): Use a fully qualified name
6241         only if the type is a member of the root container.
6242         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
6243         MemberName.Left rather than searching for an embedded ".".
6244         (PartialContainer.CreatePart): Update to changes in RootContext.
6245         (MemberBase.ShortName): Turn into a property.  Use
6246         MemberCore.SetMemberName.
6247         (MemberBase.ExplicitInterfaceName): Remove.
6248         (MemberBase.UpdateMemberName): Remove.
6249         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
6250         (PropertyBase.SetMemberName): New override.
6251         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
6252         (Tree.GetDecl): New.
6253         (Tree.AllDecls): Rename from Decls.
6254         * attribute.cs, enum.cs, report.cs: Update to changes.
6255         * driver.cs (MainDriver): Use MemberName.FromDotted on
6256         RootContext.MainClass.
6257
6258 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
6259
6260         * class.cs (FixedField.Define): Check for CS1664 and more sanity
6261         checks.
6262
6263         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
6264
6265 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
6266
6267         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
6268         property accessor modifiers.
6269
6270         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
6271         fixed buffer attribute (CS1716).
6272         (PropertyMethod.HasCustomAccessModifier): When property accessor
6273         has custom modifier.
6274
6275         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6276         modifiers.
6277         (PropertyExpr.DoResolveLValue): Add CS0272.
6278
6279 2005-03-17  Miguel de Icaza  <miguel@novell.com>
6280
6281         * convert.cs: When converting to a pointer, use the proper Conv.U
6282         or Conv.I depending on the source data type.
6283
6284         * cs-tokenizer.cs: Make the size for large decimal constants,
6285         fixes #72957.
6286
6287 2005-03-17  Martin Baulig  <martin@ximian.com>
6288
6289         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6290         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
6291
6292 2005-03-17  Martin Baulig  <martin@ximian.com>
6293
6294         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6295         to bool so we can return an error condition.
6296         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6297         returned an error.
6298
6299 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
6300
6301         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6302         attributes.
6303
6304 2005-03-16  Raja R Harinath  <rharinath@novell.com>
6305
6306         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6307         Refactor to avoid traversing the list of assemblies, and to avoid
6308         string concatenation.
6309         * typemanager.cs (guid_attr_type): Remove.
6310         (negative_hits, pointers, references): Remove hashes.
6311         (type_hash): New.
6312         (GetConstructedType): New.  Uses type_hash to handle constructed
6313         types (arrays, references, pointers).
6314         (GetReferenceType, GetPointerType): Use it.
6315         (GetNestedType): New.  Uses type_hash to handle nested types of
6316         reflected types.
6317         (LookupType, LookupTypeDirect): Remove.
6318         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
6319         'types' hash and LookupTypeReflection directly.
6320         (params_string, params_object): Use GetConstructedType.
6321         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
6322         top-level types.
6323         (Namespace.Lookup): Use cached_types.
6324         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6325         provided by old TypeManager.LookupType.
6326         * rootcontext.cs (MakeFQN): Remove.
6327         * decl.cs (DeclSpace.MakeFQN): Likewise.
6328         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
6329         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6330         TypeManager.GetConstructedType.
6331         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
6332
6333 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
6334
6335         * cs-parser.jay: Fix build.
6336
6337 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
6338
6339         * class.cs (TypeContainer.CircularDepException) New nested
6340         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
6341
6342         * cs-parser.jay: Reports CS1527 for any namespace element.
6343
6344         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
6345         Added CS0407.
6346
6347         * expression.cs (ParameterReference.IsAssigned): Changed error to
6348         CS0269.
6349         (Error_WrongNumArguments): Moved CS0245 detection here.
6350
6351         * statement.cs (Return.Resolve): Add CS1622 report.
6352
6353 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
6354
6355         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
6356
6357 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
6358
6359         * attribute.cs expression.cs: Get rid of some allocations.
6360
6361 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
6362
6363         * doc.cs : just eliminate the latest change.
6364
6365 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6366
6367         * doc.cs : commented out the latest change. It breaks xml-030.cs
6368
6369 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6370
6371         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6372           fail. So invoke CreateType() in FindDocumentedType().
6373
6374 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6375
6376         * cs-tokenizer.cs : added IsKeyword().
6377         * doc.cs : Detect keyword incorrectly used as identifier.
6378           Allow identifiers prefixed by @.
6379
6380 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
6381
6382         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6383         It caused exception in namespace resolving (again!).
6384         
6385         * class.cs (Class.ctor): Removed exit.
6386         (PropertyMethod.ctor): ditto.
6387         
6388         * codegen.cs (Codegen.Reset): Reset static data.
6389         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6390         
6391         * cs-tokenizer.cs (Cleanup): Removed.
6392         
6393         * driver.cs (GetSystemDir): Rewrote to one line command.
6394         It caused problem with unloaded dynamic modules.
6395         (UnixParseOption): Removed Exit.
6396         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6397         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6398         Now can be mcs used as library.
6399         
6400         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6401         empty location.
6402         
6403         * location.cs (Reset): Reset static data.
6404         
6405         * namespace.cs (Reset): Reset static data.
6406         
6407         * report.cs (Report.Reset): Reset static data.
6408         
6409         * rootcontext.cs (RootContext.Reset): Reset static data.
6410         
6411         * tree.cs (RootTypes.ctor): Use Location.Null
6412         
6413         * typemanager.cs (TypeManager.Reset): Reset static data.
6414         (CoreLookupType): Removed Exit.
6415         (TypeHandle.Reset): Reset static data.
6416         
6417 2005-03-10  Raja R Harinath  <rharinath@novell.com>
6418
6419         Fix #73516.
6420         * typemanager.cs (ComputeNamespaces): Import namespaces from
6421         referenced modules too.
6422
6423 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6424
6425         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6426         than '.'.
6427
6428 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6429
6430         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6431         enclosing DeclSpace.  This ensures that a name-lookup populates
6432         more caches and there are fewer 'TypeExpression's.  Carve out
6433         nested type lookup into ...
6434         (LookupNestedTypeInHierarchy): ... this.
6435
6436 2005-04-15  Martin Baulig  <martin@ximian.com>
6437
6438         Merged r41590 from MCS and make it work in the generics land.
6439
6440         * generic.cs (TypeParameter.UpdateConstraints): Removed the
6441         `check' argument.
6442
6443         * class.cs (PartialContainer.UpdateConstraints): Removed.
6444         (PartialContainer.CheckConstraints): Removed.
6445         (PartialContainer.SetParameterInfo): Store the constraints here.
6446         (PartialContainer.DefineTypeParameters): New public method;
6447         resolve the type parameter's constraints here.  Note that the
6448         PartialContainer doesn't have an EmitContext anymore, so we must
6449         do this in the ClassPart.
6450
6451 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6452
6453         Clean up a few partial-class semantics.  
6454         Fixes test-357.cs and cs1618-2.cs.
6455         * cs-parser.jay (struct_declaration): Use 'current_class' as
6456         parent of newly-created struct.  Remove call to Register ().
6457         Use 'pop_current_class' to complete handing the current struct.
6458         (interface_declaration): Likewise.
6459         (class_declaration): Likewise.
6460         (enum_declaration): Use 'current_class' as parent of newly created
6461         enum.
6462         (delegate_declaration): Likewise.
6463         (pop_current_class): New function.  This is used to handle closing
6464         up the 'current_class' and 'current_container', and pointing them
6465         to the enclosing class/container.
6466         (CSharpParser): Initialize 'current_class' too.
6467         * decl.cs (MemberCore): Add check for invariant: a partial
6468         container is not a parsed entity, and thus does not enclose any
6469         parsed members.
6470         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6471         (DeclSpace.BaseTypeExpr): Use it.
6472         (DeclSpace.LookupType): Add check for invariant.
6473         * class.cs (TypeContainer): Add check for invariant: a nested
6474         class should have the same NamespaceEntry as its enclosing class.
6475         (TypeContainer.EmitFieldInitializers): Make virtual.
6476         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6477         MemberCore.
6478         (TypeContainer.Register): Remove.
6479         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6480         null.  Use TypeResolveEmitContext for resolving base types and
6481         interfaces.  Move initialization of Parts.TypeBuilder here from
6482         ...
6483         (TypeContainer.DefineNestedTypes): ... here.
6484         (PartialContainer): Take a Namespace not a NamespaceEntry.
6485         (PartialContainer.Create): Don't use Register.  Call the
6486         appropriate Add... function directly.
6487         (ClassPart): Take both the PartialContainer and the enclosing
6488         class as constructor arguments.
6489         (ClassPart.EmitFieldInitializers): Override.
6490         (ClassPart.PartFindNestedTypes): Remove.
6491         (FieldBase.GetInitializerExpression): Resolve the initializer
6492         expression in the emit context of the enclosing class.
6493         * tree.cs (RootTypes): Remove Register ().
6494         
6495 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
6496
6497         * cs-parser.jay: Removed CS0134.
6498         
6499         * driver.cs: Removed CS1901.
6500         
6501         * expression.cs (SizeOf.DoResolve): Don't report CS0233
6502         for predefined types.
6503
6504 2005-03-07  Duncan Mak  <duncan@novell.com>
6505
6506         * codegen.cs (Save):  Catch UnauthorizedAccessException as
6507         well. Fixes bug #73454.
6508
6509 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
6510
6511         * cs-tokenizer.cs (xtoken): Add CS1035.
6512         
6513         * class.cs (MethodData.Define): Add CS0683.
6514         (FieldMember.ctor): Add CS0681.
6515
6516 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6517
6518         * ecore.cs (SimpleName.DoResolve): Rename from
6519         SimpleName.DoResolveAllowStatic.
6520         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6521         Pass 'intermediate' flag to MemberStaticCheck.
6522         (SimpleName.MemberStaticCheck): Skip "static check" only in case
6523         of "intermediate" lookups via MemberAccess.
6524         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
6525         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6526
6527 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6528
6529         Fix #73394.
6530         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6531         slipped in because of variable names that are identical to a
6532         builtin type's BCL equivalent ('string String;', 'int Int32;').
6533         (PropertyExpr.EmitInstance): Likewise.
6534
6535 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
6536
6537         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6538         
6539         * report.cs (warning_ignore_table): Made public.
6540
6541 2005-03-04  Raja R Harinath  <rharinath@novell.com>
6542
6543         Fix #73282.
6544         * class.cs (MethodData.Emit): Pass 'container' to
6545         container.GetObsoleteAttribute instead of 'container.Parent'.
6546
6547 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
6548
6549         * cs-parser.jay: Add 1534 error test.
6550
6551         * iterators.cs (Yield.CheckContext): Add error 1629.
6552         (Iterator.ctor): Save unsafe modifier.
6553         (MoveNextMethod.DoEmit): Restore unsafe context.
6554
6555         * namespace.cs (UsingAlias): Better error message.
6556
6557 2005-03-03  Dan Winship  <danw@novell.com>
6558
6559         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6560         the warning message [#73219]
6561
6562 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6563
6564         Fix compile with MCS 1.0.0.0.
6565         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6566         w_restore to not depend on string constant folding.
6567
6568 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6569
6570         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
6571         CS0246 check to users who passed 'silent = false'.
6572         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6573         check.
6574         (SimpleName.SimpleNameResolve): Update.
6575         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6576         (MemberAccess.IdenticalNameAndTypeName): Update.
6577         * doc.cs (FindDocumentedTypeNonArray): Update.
6578
6579 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
6580
6581         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6582         * parameters.cs (ComputeAndDefineParameters): Remove.
6583         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6584         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6585         Use GetParameterInfo.
6586
6587 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
6588
6589         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6590
6591 2005-03-02  Raja R Harinath  <rharinath@novell.com>
6592
6593         Unify DeclSpace.LookupType and DeclSpace.FindType.
6594         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
6595         is in charge of defining nested types on demand.
6596         (DeclSpace.LookupType): Use it when the current_type is a
6597         TypeBuilder.  Use LookupTypeDirect for reflected types.
6598         (DeclSpace.FindType): Remove.
6599         (DeclSpace.LookupInterfaceOrClass): Likewise.
6600         (DeclSpace.DefineTypeAndParents): Likewise.
6601         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6602         DeclSpace.LookupType.
6603         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6604         * typemanager.cs (LookupType): Simplify.
6605         (AddUserType): Remove type from negative_hits.
6606         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6607         * class.cs (TypeContainer.FindMembers): Move handling of nested
6608         types ...
6609         (TypeContainer.FindMembers_NestedTypes): ... here.
6610         (TypeContainer.FindNestedType): Implement override.
6611         (ClassPart.FindNestedType): Delegate to PartialContainer.
6612         (ClassPart.PartFindNestedType): Looks up the nested types of the
6613         part alone.
6614
6615 2005-04-14  Martin Baulig  <martin@ximian.com>
6616
6617         * generic.cs (ConstructedType): Moved all the type lookup and
6618         nested class logic into SimpleName.
6619         (ConstructedType.ResolveConstructedType): Our underlying type is
6620         already fully resolved; all the type lookup stuff is in
6621         SimpleName.
6622
6623         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
6624         constructed types here instead of in ConstructedType.
6625
6626         * decl.cs (MemberName.GetTypeExpression): Always create a
6627         SimpleName, not a ConstructedType.
6628         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
6629
6630 2005-03-02  Martin Baulig  <martin@ximian.com>
6631
6632         * class.cs (TypeContainer.DoDefineMembers): We also need a default
6633         static constructor in static classes.
6634
6635 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
6636
6637         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6638         sizeParamIndex is not specified.
6639
6640 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
6641
6642         Fix #73117
6643         * report.cs (WarningMessage.IsEnabled): Missing null check.
6644
6645 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6646
6647         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6648         in the fields and not in the properties.
6649
6650 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
6651
6652         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
6653         fields as well.
6654
6655 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6656
6657         * attribute.cs: Small refactoring (improved robustness).
6658         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6659         (ValidateGuid): Removed.
6660         (Resolve): Removed referenced to above mentioned.
6661         (GetAttributeUsage): Made private and changed to work without
6662         class assistance.
6663         (GetIndexerAttributeValue): Don't crash.
6664         (GetConditionalAttributeValue): Ditto.
6665         (GetClsCompliantAttributeValue): Ditto.
6666         (ExtractSecurityPermissionSet): All attributes exceptions are
6667         error 648.
6668         (GetPropertyValue): New helper.
6669         (GetMethodImplOptions): New method.
6670         (DefinePInvokeMethod): Reuse common code. Implemented handling of
6671         some missing properties.
6672         
6673         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6674         (Method.ApplyAttributeBuilder): Updated.
6675         
6676         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6677         exception.
6678
6679 2005-02-28  Raja R Harinath  <rharinath@novell.com>
6680
6681         Fix #73052.
6682         * report.cs (Report.SymbolRelatedToPreviousError): Handle
6683         non-simple types (array, pointer, reference).
6684
6685 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6686
6687         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6688
6689         * class.cs (MethodCore.IsDuplicateImplementation): Special error
6690         for operators.
6691         (Method.CheckBase): Catch wrong destructor here.
6692         (MethodData.Define): Add errors 550, 668.
6693
6694         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6695
6696         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6697
6698         * pending.cs (VerifyPendingMethods): Add error 551.
6699
6700         * typemanager.cs (CSharpName): Next error report helper.
6701
6702 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
6703
6704         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6705         attributes. Removed useless attribute double check.
6706         It saves almost 2MBs for corlib.
6707
6708 2005-02-25  Raja R Harinath  <rharinath@novell.com>
6709
6710         Fix #72924.
6711         * statement.cs (ExpressionStatement.Resolve): Make robust to being
6712         called twice in case of error.
6713
6714 2005-02-23  Chris Toshok  <toshok@ximian.com>
6715
6716         Fix compiler portions of #72827.
6717         * statement.cs (Block.Emit): call Begin/EndScope on the
6718         EmitContext instead of the ILGenerator.
6719
6720         * codegen.cs (EmitContext.BeginScope): new method, call
6721         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6722         we have one.)
6723         (EmitContext.BeginScope): same, but EndScope and CloseScope
6724
6725         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6726         offset and call the superclass's OpenScope(int) with it.
6727         (SymbolWriter.CloseScope): get the current il
6728         offset and call superclass's CloseScope(int) with it.
6729
6730 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
6731
6732         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6733         CS1677 for out and ref as well.
6734
6735         * class.cs (Method.Define): Add error CS1599 detection.
6736         
6737         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6738         
6739         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6740         
6741         * delegate.cs (Delegate.Define): Add error CS1599 detection.
6742         
6743         * support.cs.cs (ModifierDesc): New helper method.
6744
6745 2005-02-23  Raja R Harinath  <rharinath@novell.com>
6746             Abin Thomas  <projectmonokochi@rediffmail.com>
6747             Anoob V E  <projectmonokochi@rediffmail.com>
6748             Harilal P R  <projectmonokochi@rediffmail.com>
6749
6750         Fix #57851, #72718.
6751         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6752         MemberLookup (used for error reporting) actually returns a result.
6753         Fix error report number (122, not 112).
6754
6755 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
6756             Anoob V E  <projectmonokochi@rediffmail.com>
6757             Harilal P R  <projectmonokochi@rediffmail.com>
6758
6759         Fix #71134.
6760         * pending.cs (PendingImplementation.GetAbstractMethods):
6761         Find NonPublic members too.
6762
6763 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
6764
6765         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6766         Fixed error 217.
6767         
6768         * class.cs (MethodCore.CheckMethodAgainstBase):
6769         Add error 239 report.
6770
6771 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6772
6773         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6774         
6775         * class.cs (Operator.Define): Add error 217 report.
6776         
6777 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6778
6779         Fix #68955.
6780         * expression.cs (Invocation.IsApplicable): Make public.
6781         (Invocation.IsParamsMethodApplicable): Likewise.
6782         * delegate.cs (Delegate.VerifyApplicability): Don't use
6783         Invocation.VerifyArgumentCompat for parameter applicability
6784         testing.  Use Invocation.IsApplicable and
6785         Invocation.IsParamsMethodApplicable.
6786
6787 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6788
6789         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6790         
6791         * class.cs (Operator.Define): Add error 217 report.
6792         
6793 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6794
6795         * namespace.cs (UsingEntry.Resolve): Undo change below.
6796
6797 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6798
6799         Fix #72756.
6800         * ecore.cs (Expression.MemberLookupFailed): Add argument to
6801         disable the error message when the extended MemberLookup also
6802         fails.
6803         (Expression.MemberLookupFinal): Update.
6804         (SimpleName.DoSimpleNameResolve): Update.
6805         * expression.cs (MemberAccess.ResolveNamespaceOrType):
6806         Don't use MemberLookupFinal.
6807         (New.DoResolve): Update.
6808         (BaseAccess.CommonResolve): Update.
6809
6810 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6811
6812         Fix #72732.
6813         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6814         occured previously, don't resolve again.
6815
6816 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6817
6818         Fix #69949
6819         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6820         argument. Call ResolveAttributeUsage for unresolved.
6821         when types doesn't match ctor arguments.
6822         
6823         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6824         for nested attribute classes.
6825         (Class.attribute_usage): Removed.
6826         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6827         for attribute class.
6828         
6829         * ecore.cs (IsAttribute): Removed.
6830         
6831         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6832         
6833         * rootcontext.cs (RegisterAttribute): Removed, attributes are
6834         now normal types.
6835         (attribute_types): Removed.
6836         (EmitCode): Global attributes are emited as the latest.
6837
6838 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
6839
6840         * class.cs (EmitFieldInitializers): Don't emit field initializer
6841         for default values when optimilization is on.
6842         
6843         * constant.cs (Constant.IsDefaultValue): New property.
6844         
6845         * driver.cs: Add /optimize handling.
6846         
6847         * constant.cs,
6848         * ecore.cs,
6849         * literal.cs: Implement new IsDefaultValue property.
6850         
6851         * rootcontext.cs (Optimize): New field, holds /optimize option.
6852
6853 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6854
6855         Fix crasher in re-opened #72347.
6856         * namespace.cs (Namespace.Lookup): Return null if
6857         DeclSpace.DefineType returns null.
6858
6859         Fix #72678.
6860         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6861
6862 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6863
6864         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
6865         now returns null if it cannot resolve to an lvalue.
6866         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6867         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6868         returned null.  Remove check for SimpleName.
6869         (EventExpr.DoResolveLValue): New.
6870         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6871         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
6872         error from ...
6873         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
6874         avoid CS0131 error.
6875         (Unary.ResolveOperator): Move CS0211 check ...
6876         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
6877         CS0131 error.
6878         (Unary.DoResolveLValue): Simplify.
6879         (AddressOf.DoResolveLValue): New.
6880         (ArrayAccess.DoResolveLValue): New.
6881
6882 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
6883
6884         * attribute.cs (Attribute.Resolve): Add arguments casting for
6885         when types doesn't match ctor arguments.
6886
6887 2005-02-16  Raja R Harinath  <rharinath@novell.com>
6888
6889         Fix parts of #63202.
6890         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6891         lookup of operator in base type.  Ensure that all checks happen
6892         when the operator resolves to an "op_..." method.
6893
6894 2005-02-15  Raja R Harinath  <rharinath@novell.com>
6895
6896         Fix #71992.
6897         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6898         'ignore_cs0104' parameter.  Pass it to ...
6899         (NamespaceEntry.Lookup): ... this.
6900         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6901         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6902         (TypeLookupExpression.DoResolveAsTypeStep): Update.
6903         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6904         Update.  Request that cs0104 errors be ignored.
6905         (ComposedCast.ResolveAsTypeStep): Update.
6906
6907 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6908
6909         Fix #59209.
6910         * expression.cs (Invocation.BetterFunction): Remove support for
6911         comparing virtual functions and their overrides.
6912         (Invocation.IsOverride): New.
6913         (Invocation.OverloadResolve): Don't consider 'override' functions
6914         during candidate selection.  Store them in a lookaside list.
6915         If the selected method is a 'virtual' function, use the list to
6916         find any overrides that are closer to the LHS type.
6917
6918 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
6919
6920         * expression.cs (New.DoResolve): Add complex core type reduction.
6921         (New.Constantify): Converts complex core type syntax like 'new int ()'
6922         to simple constant.
6923         
6924 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6925
6926         * decl.cs (EntryType.EntryType): New constructor to create an
6927         updated copy of a cache entry.
6928         (MemberCache.AddMethods): Use it.
6929         (MemberCache.ClearDeclaredOnly): Remove.
6930         (MemberCache.MemberCache): Update.
6931
6932 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6933
6934         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6935         variable.  This one is represents the actual low-level declaration
6936         of the method, as opposed to the semantic level `IsStatic'.   
6937
6938         An anonymous method which is hosted into a static method might be
6939         actually an instance method.  IsStatic would reflect the
6940         container, while MethodIsStatic represents the actual code
6941         generated.
6942
6943         * expression.cs (ParameterReference): Use the new MethodIsStatic
6944         instead of IsStatic.
6945
6946         * anonymous.cs (AnonymousMethod.Compatible): Pass the
6947         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6948         set on the current EmitContext. 
6949
6950         * expression.cs (Cast): Overload DoResolveLValue so we can pass
6951         resolve our casted expression as an LValue.  This triggers the
6952         proper LValue processing that is later required by Assign.
6953
6954         This fixes 72347.
6955
6956         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6957
6958 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
6959
6960         C# 2.0 Fixed buffer implementation
6961
6962         * anonymous.cs: Update after RegisterHelperClass renaming.
6963
6964         * attribute.cs (AttributeTester.fixed_buffer_cache):
6965         Cache of external fixed buffers.
6966         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6967         implementation if field is fixed buffer else null.
6968
6969         * class.cs
6970         (TypeContainer.AddField): Accept FieldMember instead of Field.
6971         (FieldBase.IsFieldClsCompliant): Extracted code from
6972         VerifyClsCompliance descendant customization.
6973         (FixedField): New class handles fixed buffer fields.
6974         (FixedFieldExternal): Keeps information about imported fixed
6975         buffer.
6976         (IFixedField): Make access to internal or external fixed buffer
6977         same.
6978
6979         * cs-parser.jay: Add fixed buffer parsing.
6980
6981         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6982         buffer.
6983
6984         * expression.cs (Indirection): Extended implementation to accept
6985         fixed buffer field.
6986         (PointerArithmetic.Emit): Get element from fixed buffer as well.
6987         (ElementAccess.MakePointerAccess): Get type as parameter.
6988         (DoResolve): Add fixed buffer field expression conversion.
6989         (DoResolveLValue): Ditto.
6990         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6991         (ArrayPtr): Derives from FixedBufferPtr.
6992         (ArrayPtr.Emit): Add extra emit for array elements.
6993
6994         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6995
6996         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6997         for compiler generated types.
6998         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6999
7000         * statement.cs (Fixed): Refactored to be easier add fixed buffer
7001         and consume less memory.
7002         (Fixed.Resolve): Add fixed buffer case.
7003
7004         * typemanager.cs (compiler_generated_attr_ctor,
7005         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
7006         (HasElementType): Add our own implementation to work on every
7007         runtime.
7008
7009 2005-02-11  Miguel de Icaza  <miguel@novell.com>
7010
7011         * anonymous.cs (CaptureContext): Track whether `this' has been
7012         referenced.   
7013
7014         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
7015         only captured `this' if it was implicitly done (instance
7016         methods/variables were used). 
7017
7018         * codegen.cs (EmitContext.CaptureThis): New method to flag that
7019         `this' must be captured.
7020
7021 2005-01-30  Miguel de Icaza  <miguel@novell.com>
7022  
7023         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
7024         is null it means that there has been no need to capture anything,
7025         so we just create a sibling.
7026
7027         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
7028
7029         Just a partial fix.  The other half is fairly elusive.
7030         
7031 2005-02-10  Raja R Harinath  <rharinath@novell.com>
7032
7033         Fix #52586, cs0121-4.cs.
7034         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
7035         and return a hashtable.
7036         (MemberCache.ClearDeclaredOnly): New.
7037         (MemberCache.MemberCache): Update to change.  Make a deep copy of
7038         the method_hash of a base type too.
7039         (MemberCache.AddMethods): Adapt to having a deep copy of the base
7040         type methods.  Overwrite entries with the same MethodHandle so
7041         that the ReflectedType is correct.  The process leaves in base
7042         virtual functions and their overrides as distinct entries.
7043         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
7044         matters since it was boxed in a ArrayList before.
7045         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
7046         modifier.
7047         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
7048         case of a virtual function and its override (choose the overload
7049         as better).
7050         (Invocation.OverloadResolve): Avoid 'override' members during
7051         'applicable_type' calculation.
7052
7053 2005-03-28  Raja R Harinath  <rharinath@novell.com>
7054
7055         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
7056         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
7057         GetTypeHandle.  It is possible for a reflected type to derive from
7058         a TypeBuilder (e.g., int[] derives from the TypeBuilder
7059         System.Array during mscorlib compilation).
7060         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
7061         contain a method_hash, don't create one either.  Don't create a
7062         deep copy of the base cache's method_hash.
7063         (MemberCache.SetupCache): Rename back from DeepCopy.
7064         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
7065         already initialized.  If we see an override function, add its
7066         underlying base virtual function to the member_hash too.
7067
7068 2005-02-09  Raja R Harinath  <rharinath@novell.com>
7069
7070         Combine two near-redundant caches.
7071         * typemanager.cs (method_params): Rename from method_internal_params.
7072         (TypeManager.GetParameterData): New.  Replace
7073         Invocation.GetParameterData.
7074         (TypeManager.LookupParametersByBuilder): Remove.
7075         * expression.cs (Invocation.method_parameter_cache): Remove.
7076         (Invocation.GetParameterData): Remove.
7077         Update to changes.
7078         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
7079         Update to changes.
7080
7081 2005-02-08  Raja R Harinath  <rharinath@novell.com>
7082
7083         Fix #72015.
7084         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
7085         TypeManager.multicast_delegate_type is null, resolve it by looking
7086         up "System.MulticastDelegate".
7087         * rootcontext.cs (RootContext.ResolveCore): Simplify.
7088
7089 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
7090             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
7091             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
7092
7093         Fix cs0164.cs.
7094         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
7095         (LabeledStatement.AddReference): New.  Set 'referenced'.
7096         (Goto.Resolve): Use it.
7097
7098 2005-02-05  John Luke  <john.luke@gmail.com>
7099
7100         * driver.cs: remove duplicate -doc line in Usage ()
7101
7102 2005-02-04  Raja R Harinath  <rharinath@novell.com>
7103
7104         * location.cs (Location.AddFile): Fix CS2002 error report.
7105
7106 2005-02-02  Martin Baulig  <martin@ximian.com>
7107
7108         * delegate.cs (Delegate.DefineType): Report an internal error if
7109         TypeManager.multicast_delegate_type is null.  See bug #72015 for
7110         details.        
7111
7112 2005-02-02  Raja R Harinath  <rharinath@novell.com>
7113
7114         Fix a crasher in a variant of #31984.
7115         * const.cs (Constant.CheckBase): New override that defers the
7116         new-or-override check in case the base type hasn't been populated
7117         yet.
7118         (Constant.Define): Ensure the new-or-override check is performed.
7119
7120 2005-02-01  Duncan Mak  <duncan@ximian.com>
7121
7122         * const.cs (LookupConstantValue): Check that `ce' is not null
7123         before calling GetValue ().
7124
7125 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7126
7127         Fix test-334.cs (#69519).
7128         * cs-parser.jay (using_alias_directive): Pass in an expression to
7129         NamespaceEntry.UsingAlias.
7130         (using_namespace_directive): Pass in an expression to
7131         NamespaceEntry.Using.
7132         (namespace_name): Don't flatten to a string.
7133         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
7134         (NamespaceEntry.AliasEntry.Resolve): Lookup using
7135         ResolveAsTypeStep.
7136         (NamespaceEntry.UsingEntry): Likewise.
7137         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
7138         changes.
7139         (NamespaceEntry.LookupForUsing): Remove.
7140         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
7141         names.
7142         (NamespaceEntry.Lookup): Remove support for dotted names.
7143
7144 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7145
7146         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
7147         split into two.
7148         (NamespaceEntry.ImplicitParent): Compute on demand.
7149         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
7150         parallels the current.
7151         (NamespaceEntry.LookupForUsing): Use it.
7152         (NamespaceEntry.Lookup): If the current namespace-entry is
7153         implicit, don't search aliases and using tables.
7154
7155 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7156
7157         Fix #31984.
7158         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
7159         BaseCache here.
7160         (TypeContainer.BaseCache): Compute on demand.
7161         (TypeContainer.FindMembers): Define constants and types if they're
7162         not already created.
7163         (FieldMember.Define): Move resetting of ec.InUnsafe before error
7164         check.
7165         * const.cs (Constant.Define): Make idempotent.
7166
7167 2005-01-29  Miguel de Icaza  <miguel@novell.com>
7168
7169         * pending.cs: Produce better code (no nops produced by using Ldarg
7170         + value).
7171         
7172         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7173         i - 1' it should be arg + 1.
7174
7175         Fixes bug #71819.
7176
7177 2005-01-28  Raja R Harinath  <rharinath@novell.com>
7178
7179         * attribute.cs (Attribute.CheckAttributeType): Make private
7180         non-virtual.
7181         (Attribute.ResolveType): Make virtual.
7182         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
7183         handling of RootContext.Tree.Types.
7184
7185 2005-01-27  Raja R Harinath  <rharinath@novell.com>
7186
7187         Update attribute-handling to use the SimpleName/MemberAccess
7188         mechanisms.
7189         * cs-parser.jay (attribute): Pass in an expression to the
7190         constructors of Attribute and GlobalAttribute.
7191         * attribute.cs (Attribute): Take an expression for the name.
7192         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
7193         passed in attribute name expression.
7194         (Attribute.CheckAttributeType): Use it.
7195         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
7196         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
7197         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
7198         argument to prevent error messages if the lookup fails.
7199
7200 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
7201
7202         * expression.cs (Indirection): Implemented IVariable interface
7203         to support indirection in AddressOf operator.
7204         (PointerArithmetic.Emit): Add optimalization for case where
7205         result can be precomputed.
7206
7207 2005-01-26  Martin Baulig  <martin@ximian.com>
7208
7209         * class.cs (TypeContainer.AttributeTargets): Return the correct
7210         AttributeTargets depending on our `Kind' instead of throwing an
7211         exception; fixes #71632.
7212
7213 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
7214
7215         Fix #71257
7216         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
7217         constant members.
7218
7219 2005-03-17  Martin Baulig  <martin@ximian.com>
7220
7221         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
7222         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
7223
7224 2005-03-17  Martin Baulig  <martin@ximian.com>
7225
7226         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
7227         to bool so we can return an error condition.
7228         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
7229         returned an error.
7230
7231 2005-03-17  Martin Baulig  <martin@ximian.com>
7232
7233         * generic.cs (TypeMananager.IsIEnumerable): New public method.
7234
7235         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
7236         converting from an array-type of T to `IEnumerable<T>'.
7237
7238 2005-03-16  Martin Baulig  <martin@ximian.com>
7239
7240         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
7241         (Nullable.LiftedUnaryMutator): New public class.
7242
7243         * expression.cs (UnaryMutator.DoResolve): Added support for
7244         Nullable Types.
7245
7246 2005-03-14  Martin Baulig  <martin@ximian.com>
7247
7248         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
7249
7250 2005-03-14  Martin Baulig  <martin@ximian.com>
7251
7252         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
7253         the comparision operators `<', `>', `<=' and `>='.
7254
7255 2005-03-13  Martin Baulig  <martin@ximian.com>
7256
7257         * generic.cs
7258         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
7259         avoid confusion with the `NullLiteral'.
7260         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
7261
7262 2005-03-13  Martin Baulig  <martin@ximian.com>
7263
7264         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
7265         comparing arbitrary types with the null literal.
7266
7267 2005-03-13  Martin Baulig  <martin@ximian.com>
7268
7269         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
7270         boolean operators '&&', '||', '&' and '|'.
7271         (Nullable.OperatorTrueOrFalse): New public class.
7272
7273         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
7274         instead of a `StaticCallExpr'; added support for nullables.
7275
7276 2005-03-10  Martin Baulig  <martin@ximian.com>
7277
7278         * expression.cs
7279         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
7280         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
7281
7282 2005-03-07  Martin Baulig  <martin@ximian.com>
7283
7284         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
7285         it work if `expr' is not an IMemoryLocation.
7286         (Nullable.Lifted): Implement IMemoryLocation.
7287         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
7288         target type.
7289
7290 2005-03-05  Martin Baulig  <martin@ximian.com>
7291
7292         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
7293         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
7294         (Nullable): Added support for lifted unary and binary operators.
7295
7296         * expression.cs (Unary.DoResolve): Added support for nullable types.
7297         (Binary.DoResolve): Likewise.
7298         (Conditional.DoResolve): Likewise.
7299
7300 2005-03-02  Martin Baulig  <martin@ximian.com>
7301
7302         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
7303
7304         * class.cs (ClassPart.SetParameterInfo): Override this.
7305         (PartialContainer.SetParameterInfo): Override this.
7306         (TypeContainer.CheckConstraints): New protected method.
7307         (PartialContainer.CheckConstraints): Override this and check
7308         whether the same contraints were specified in all parts of a
7309         partial generic type definition.
7310         (PartialContainer.UpdateConstraints): New public method.
7311
7312         * generic.cs (TypeParameter.UpdateConstraints): New public method.
7313
7314 2005-03-02  Martin Baulig  <martin@ximian.com>
7315
7316         Committing a patch from Carlos Alberto Cortez to fix #72887.
7317
7318         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
7319         casts from `T []' to `int []'.
7320
7321 2005-03-02  Martin Baulig  <martin@ximian.com>
7322
7323         * generic.cs (TypeManager.IsEqual): Make this symmetric.
7324
7325         * expression.cs (Binary.ResolveOperator): When resolving a
7326         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
7327         `=='.  Fixes #71866.  See gen-127.cs.
7328
7329 2005-03-02  Martin Baulig  <martin@ximian.com>
7330
7331         * class.cs (TypeContainer.DoDefineMembers): We also need a default
7332         static constructor in static classes.
7333
7334 2005-03-02  Martin Baulig  <martin@ximian.com>
7335
7336         * generic.cs
7337         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
7338         (Nullable.LiftedConversion): Added support for user-defined
7339         conversions.
7340
7341         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
7342
7343         * cs-parser.jay: Use ComposedCast everywhere instead of
7344         NullableType, so we don't need to check for NullableType
7345         everywhere.
7346         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
7347         case where we'll be resolved into a `parenthesized_expression_0'
7348         afterwards.
7349
7350         * convert.cs
7351         (Convert.UserDefinedConversion): Added nullable conversions.
7352
7353 2005-02-28  Martin Baulig  <martin@ximian.com>
7354
7355         * generic.cs (TypeManager.IsNullableType): New static method.
7356         (Nullable): New abstract class.
7357         (Nullable.NullLiteral): New public class.
7358         (Nullable.LiftedConversion): New public class.
7359
7360         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
7361         `builtin_types opt_nullable'.
7362
7363         * convert.cs
7364         (Convert.ImplicitConversionStandard): Added nullable conversions.
7365         (Convert.ExplicitConversionStandard): Likewise.
7366         (Convert.ExplicitConversion): Likewise.
7367
7368 2005-02-26  Martin Baulig  <martin@ximian.com>
7369
7370         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
7371         begin with a "?", for instance "?[]".  Don't do a type lookup if
7372         `dim' is empty.
7373
7374 2005-02-25  Martin Baulig  <martin@ximian.com>
7375
7376         The first part of Nullable Types :-)
7377
7378         * generic.cs (NullableType): New public class.
7379         (NullCoalescingOperator): New public class.
7380         (TypeArguments.Resolve): Add a CS0306 check.
7381
7382         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
7383         (opt_nullable): New rule.
7384         (type): Added `opt_nullable' to `namespace_or_type_name',
7385         `builtin_types' and `pointer_type'.
7386         (array_type): Added `opt_nullable'.
7387         (opt_rank_specifier_or_nullable): New rule; this is the
7388         combination of `opt_rank_specifier' and `opt_nullable'.
7389         (opt_error): New rule; catch errors here.
7390         (nullable_type_or_conditional): New rule; we use this to check for
7391         nullable and still detect the conditional operator.
7392         (local_variable_type): Use `opt_rank_specifier_or_nullable'
7393         instead `opt_rank_specifier'.
7394
7395         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
7396         for nullables.
7397
7398 2005-02-24  Martin Baulig  <martin@ximian.com>
7399
7400         * README, README.Changes: Removed; they're old and obsolete.
7401
7402 2005-02-22  Martin Baulig  <martin@ximian.com>
7403
7404         * generic.cs (TypeParameter.Resolve): If resolving the constraints
7405         returned an error, set `constraints' to null to avoid a crash
7406         later on.
7407         (TypeParameter.ResolveType): Likewise.
7408
7409 2005-02-22  Martin Baulig  <martin@ximian.com>
7410
7411         * generic.cs
7412         (Constraints.ResolveTypes): Protect against being called twice.
7413         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
7414         (TypeParameter.ResolveType): New public method; calls
7415         constraints.ResolveTypes().
7416         (TypeParameter.DefineType): Moved constraints.ResolveType() out
7417         into the new ResolveType().
7418         (GenericMethod.Define): Call ResolveType() on all our
7419         TypeParameter's.        
7420
7421 2005-02-21  Martin Baulig  <martin@ximian.com>
7422
7423         * generic.cs
7424         (TypeManager.generic_nullable_type): New static public field.
7425         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
7426
7427         * rootcontext.cs
7428         (RootContext.ResolveCore): Resolve "System.Nullable`1".
7429
7430 2005-02-15  Martin Baulig  <martin@ximian.com>
7431
7432         * generic.cs (ConstructedType.Constraints): Correctly check
7433         constraints if the argument type is a type parameter; fixes
7434         #72326. 
7435
7436 2005-02-02  Martin Baulig  <martin@ximian.com>
7437
7438         * delegate.cs (Delegate.DefineType): Report an internal error if
7439         TypeManager.multicast_delegate_type is null.  See bug #72015 for
7440         details.        
7441
7442 2005-01-29  Miguel de Icaza  <miguel@novell.com>
7443
7444         * pending.cs: Produce better code (no nops produced by using Ldarg
7445         + value).
7446         
7447         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7448         i - 1' it should be arg + 1.
7449
7450         Fixes bug #71819.
7451         
7452 2005-01-26  Martin Baulig  <martin@ximian.com>
7453
7454         * cs-parser.jay (indexer_declarator): Don't report an error if we
7455         have type parameters since we can be an explicit interface
7456         implementation; fixes #71449.
7457
7458 2005-01-26  Martin Baulig  <martin@ximian.com>
7459
7460         * class.cs (TypeContainer.AttributeTargets): Return the correct
7461         AttributeTargets depending on our `Kind' instead of throwing an
7462         exception; fixes #71632.
7463
7464 2005-01-26  Martin Baulig  <martin@ximian.com>
7465
7466         * delegate.cs (Delegate.DefineType): Correctly define our type
7467         parameters.  Fixes #71483.
7468
7469 2005-01-25  Raja R Harinath  <rharinath@novell.com>
7470
7471         Fix #71602.
7472         * expression.cs (MemberAccess.DoResolve): Don't complain with
7473         cs0572 when the LHS of a member access has identical name and type
7474         name.
7475
7476 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
7477
7478         Fix #71651, #71675
7479         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7480         CreatePermission.
7481         Create custom PermissionSet only for PermissionSetAttribute.
7482
7483 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
7484
7485         Fix #71649
7486         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7487         delegates in static class.
7488
7489 2005-01-24  Martin Baulig  <martin@ximian.com>
7490
7491         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7492         merging an implicit block, just use its reachability.
7493
7494         * statement.cs (Block.Resolve): Make the unreachable code check
7495         work wrt. implicit blocks; see test-337 from #63842.
7496
7497 2005-01-21  Alp Toker  <alp@atoker.com>
7498  
7499         * cs-parser.jay: destructor_declaration's container is PartialContainer
7500         not Class when partial types are used, so use Kind prop instead of
7501         'is'.
7502         
7503 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
7504
7505         * cs-parser.jay: Improve error reporting when an interface
7506         declares new types.
7507
7508 2005-01-20  Dick Porter  <dick@ximian.com>
7509
7510         * support.cs: SeekableStreamReader fix from Sandor Dobos
7511         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7512         chars are read.  Fixes bug 70369.
7513
7514 2005-01-20  Raja R Harinath  <rharinath@novell.com>
7515
7516         * cs-parser.jay (catch_clause): Simplify current_block handling
7517         somewhat.
7518
7519 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
7520
7521         * convert.cs (ImplicitStandardConversionExists): Synchronize the
7522         code with ImplicitStandardConversion to handle the implicit
7523         conversion of method groups into valid delegate invocations. 
7524
7525         The problem is that in parameter handling we were using this code
7526         path.  Fixes bug #64698
7527
7528 2005-01-19  Raja R Harinath  <rharinath@novell.com>
7529
7530         * cs-parser.jay: Fix several infelicities.
7531         - Avoid assigning to the parser value stack.  Code like 
7532           '$3 = null' is unclean.  Synthesize a value for the code block
7533           instead. 
7534         - Avoid using oob_stack for storing location information.  Use ...
7535         (_mark_): ... this.  New (empty) rule.  Saves the current location
7536         in $$.
7537         (foreach_statement): Avoid using oob_stack for current_block
7538         handling.  Use technique used in for_statement and
7539         using_statement.  Synthesize a value for the code block to store
7540         additional intermediate information.
7541
7542 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
7543
7544         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7545         of a different type is only allowed to private fields of a
7546         containing type, not on fields of a base class.
7547
7548         See test-174.cs and error cs0122-9.cs
7549
7550 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7551
7552         Fix test-335.cs (bug #58126).
7553         * cs-parser.jay (argument): Split out non-expression parts of the
7554         rule into 'non_simple_argument'.
7555         (invocation_expression): Support parenthesized invocations with
7556         multiple arguments, and with single non-simple arguments.
7557
7558 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7559
7560         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7561         places.
7562
7563 2005-01-12  Raja R Harinath  <rharinath@novell.com>
7564
7565         Fix cs0038-1.cs, cs1640-6.cs.
7566         * ecore.cs (Expression.Resolve): Remove special-case for
7567         SimpleName in error-handling.
7568         (Expression.almostMatchedMembers): Relax access permission to
7569         protected.
7570         (Expression.MemberLookupFailed): Handle duplicates in
7571         almostMatchedMembers list.
7572         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7573         * expression.cs (New.DoResolve): Report CS1540 for more cases.
7574         * typemanager.cs (GetFullNameSignature): Use the MethodBase
7575         overload if the passed in MemberInfo is a MethodBase.
7576
7577 2005-01-25  Martin Baulig  <martin@ximian.com>
7578
7579         * doc.cs
7580         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
7581
7582 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
7583
7584         Fix #70749
7585         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7586         for non-CAS & merge permission sets properly.
7587
7588 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7589
7590         Improve standard-compliance of simple name and member access 
7591         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
7592         * ecore.cs (FullNamedExpression): New abstract base class 
7593         for Namespaces and TypeExpressions.
7594         (ResolveFlags.SimpleName): Remove.
7595         (SimpleName): Remove support for dotted names.
7596         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
7597         DeclSpace.FindType and DeclSpace.LookupType.
7598         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7599         (Expression.ExprClassName): Make member function.
7600         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7601         a namespace.  Remove creation of dotted "SimpleName"s.
7602         (MemberAccess.DoResolve): Likewise.
7603         * decl.cs (DeclSpace.Cache): Make private.
7604         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7605         (DeclSpace.FindType): Update.
7606         (DeclSpace.LookupType): Move here from RootContext.  Return a 
7607         FullNamedExpression.
7608         * namespace.cs (Namespace): Derive from FullNamedExpression
7609         so that it can be part of expression resolution.
7610         (Namespace.Lookup): Return an FullNamedExpression.
7611         (NamespaceEntry.LookupAlias): Lookup aliases only in current
7612         namespace.
7613         * rootcontext.cs (NamespaceLookup): Remove.
7614         (LookupType): Move to DeclSpace.
7615         * attribute.cs (CheckAttributeType): Update.
7616         * doc.cs (FindDocumentedType): Remove allowAlias argument.
7617         (FindDocumentedTypeNonArray): Likewise.
7618
7619 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7620
7621         Fix cs0509.cs, cs1632.cs.
7622         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7623         is the same as IsInterface.
7624         (TypeContainer.GetClassBases): Likewise.
7625         * statement.cs (LabeledStatement.ig): New field.
7626         (LabeledStatement.LabelTarget): Save ILGenerator which created the
7627         label.
7628         (LabeledStatement.DoEmit): Check that the label was created with
7629         the same ILGenerator.
7630
7631 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7632
7633         Fix #71058
7634         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7635         accessors to its properties.
7636
7637         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
7638         from accessors to property.
7639         
7640 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7641
7642         Fix #70722
7643         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
7644         only for overrides.
7645         
7646 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
7647
7648         * attribute.cs: Check for null and empty strings.  
7649
7650         I have lost another battle to Paolo.
7651
7652 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
7653
7654         Fix #70942
7655         * class.cs (PropertyMethod): Set Parent field in ctors.
7656         (SetMethod.InternalParameters): Add unsafe switch hack.
7657         Override MarkForDuplicationCheck where it is appropriate.
7658
7659         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
7660         It says whether container allows members with the same name.
7661         Base default is no.
7662         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
7663         Removed is_method parameter.
7664
7665 2005-01-06  Duncan Mak  <duncan@ximian.com>
7666
7667         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
7668         because the previous change led to incorrect reporting of CS1032
7669         ("Cannot define/undefine preprocessor symbols after first token in
7670         file"). Instead of using `tokens_seen' as the only flag that
7671         triggers CS1040, introduce `comments_seen'. This new flag is used
7672         to signify having seen comments on the current line, so it is
7673         unset after a newline.
7674
7675 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7676
7677         * doc.cs : When searching for a type, find nested type too.
7678           This fixes bug #71040.
7679
7680 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7681
7682         * doc.cs :
7683           - Warn missing member comment on those classes which also does not
7684             have doc comments. Fixed bug #71041.
7685           - Don't warn missing doc comment on default constructor.
7686             Fixed bug #71042.
7687
7688 2005-01-06  Duncan Mak  <duncan@ximian.com>
7689
7690         * cs-tokenizer.cs (xtoken): After handling traditional C-style
7691         comments, set `tokens_seen' to true. This allows us to detect
7692         misplaced preprocessor directives (i.e. not at the beginning of
7693         the a line, nor after whitespaces). In that case, report error
7694         CS1040. This fixes bug #56460.
7695
7696         * cs-parser.jay (interface_member_declaration): Add checks for
7697         IsExplicitImpl, and report CS0541 error if an interface member is
7698         defined as an explicit interface declaration.
7699
7700 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
7701
7702         Fix #70817
7703         * class.cs (PropertyMethod): Set Parent field in ctors.
7704         (SetMethod.InternalParameters): Add unsafe switch hack.
7705         
7706         * decl.cs (MemberCore.Parent): Cannot be readonly.
7707
7708 2005-01-06  Raja R Harinath  <rharinath@novell.com>
7709
7710         * decl.cs (DeclSpace.ResolveType): Remove.
7711         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7712         Merge in code from ...
7713         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
7714         * class.cs, enum.cs: Update to changes.
7715
7716 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
7717
7718         * anonymous.cs: Ensure that we init the scope of our parent if it
7719         has not been initialized yet.
7720
7721 2004-12-30  Duncan Mak  <duncan@ximian.com>
7722
7723         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7724         if field.FieldBuilder is null. Fixes #70758.
7725
7726         * convert.cs: Fixed some typos and updated some of the comments.
7727         (ImplicitStandardConversionExists):
7728         (TryImplicitIntConversion): If `target_type' is an interface and
7729         the type of `ic' implements this interface, return true or a new
7730         BoxedCast instead of null. This fixes #70468.
7731
7732 2004-12-29  Duncan Mak  <duncan@ximian.com>
7733
7734         * expression.cs (Argument.Emit): Check that Expr is
7735         IMemoryLocation before casting to it, and report CS1510 otherwise.
7736
7737         This fixes #70402.
7738
7739 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
7740
7741         * statement.cs (Block.ThisVariable): remove the recursion here, to
7742         make the --profile more sane.
7743
7744 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
7745
7746         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7747         assembly, by JB Evain.
7748
7749 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7750
7751         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
7752           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7753         "parent" refers to enclosing type/class.  "base" refers to superclass.
7754
7755 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7756
7757         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7758         Ensure that we only have GlobalAttributes.
7759         * attribute.cs (Attribute.Emit): Make non-virtual.
7760         (GlobalAttribute.Emit): Remove.
7761         (Attribute.Resolve): Make virtual.
7762         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
7763         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7764         the argument. Don't create one.
7765         (Attribute.GetObsoleteAttribute): Likewise.
7766         (Attribute.GetClsCompliantAttributeValue): Likewise.
7767         * class.cs, decl.cs: Update to changes.
7768
7769 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
7770
7771         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7772         
7773         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7774         
7775         * statement.cs (Foreach.Resolve): Add error 186 report.
7776
7777 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
7778
7779         * expression.cs (Conditional.DoResolve): Add warning 429.
7780         
7781         * statement.cs (If.Resolve): Add warning 665.
7782
7783 2004-12-16  Raja R Harinath  <rharinath@novell.com>
7784
7785         New invariant: RootContext.Tree.Types.NamespaceEntry == null
7786         except when in the parser, and in GlobalAttribute.
7787         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7788         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7789         RootContext.Tree.Types.NamespaceEntry once work is done.
7790         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
7791         and resets RootContext.Tree.Types.NamespaceEntry.
7792
7793 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
7794
7795         * cs-parser.jay: Don't create a block for every variable.
7796
7797 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
7798
7799         * location.cs: Provide extra information.
7800
7801         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7802         variables from the captured environment, it is the ldarg_0.
7803
7804 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7805
7806         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7807         find a conclusion.
7808         
7809         * class.cs: Changed warning level for 169 to avoid developer
7810         displeasure from warning flooding. It will be changed back when they
7811         fix most of current BCL warnings.
7812         
7813         * RootContext.cs: Pushed default WarningLevel to 3.
7814         
7815         * statement.cs: Removed unused variable.
7816
7817 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7818
7819         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7820         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7821         Add error 502 report.
7822         (StaticClass.DefineType): Add error 441 report.
7823         (Class.AllowedModifiersProp): New virtual property as temporary
7824         extension to AllowedModifiers.
7825         (Class.DefineType): Add error 418 report. Moved ModFlags check here
7826         to share implementation with StaticClass and don't call virtual
7827         methods from ctor.
7828         
7829         * driver.cs (MainDriver): Add error 1558 test.
7830
7831         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7832         report. Moved error 36 test here.
7833
7834         * statement.cs (Throw.Resolve): Add error 724 report.
7835
7836         * typemanager.cs: Add out_attribute_type core type.
7837         
7838 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
7839
7840         * class.cs (TypeContainer.VerifyClsCompliance): Add error
7841         3018 report.
7842         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7843
7844         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7845         3017 report.
7846         
7847         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7848
7849         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
7850         Add error 3023 report.
7851         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7852
7853         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7854         implementation.
7855
7856 2004-12-12  John Luke  <john.luke@gmail.com>
7857
7858         * driver.cs (AddArgs): take -- into account when
7859         adding arguments, fixes bug 65710 
7860
7861 2004-12-12  Martin Baulig  <martin@ximian.com>
7862
7863         * expression.cs (Unary.TryReduceNegative): Added support for
7864         SByteConstant and ByteConstant.
7865         (Unary.Reduce): Check error values from TryReduceNegative().
7866
7867 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
7868
7869         * attributes.cs (Attribute.Resolve): Avoid multiple error report
7870         and report exception as error 182.
7871
7872 2004-12-10  Raja R Harinath  <rharinath@novell.com>
7873
7874         * driver.cs (Main): Fix message when there are warnings.
7875
7876 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
7877
7878         * delegate.cs: Fixed my fix from yesterday, sorry about that.
7879
7880 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
7881
7882         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
7883         Reduced number of warnings.
7884         
7885         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7886
7887 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
7888
7889         * driver.cs: Removed message.
7890
7891         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7892
7893 2004-12-08    <vargaz@freemail.hu>
7894
7895         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7896
7897 2004-12-08  Martin Baulig  <martin@ximian.com>
7898
7899         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7900         instead of a CS3002 for properties and indexer.
7901
7902 2004-12-08  Martin Baulig  <martin@ximian.com>
7903
7904         * decl.cs (MemberName.ToString): Make this work again.
7905
7906 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
7907
7908         * attribute.cs (Resolve): Add error 591 detection.
7909
7910         * class.cs (FieldMember.Define): Add error 1547 detection.
7911         (Indexer.Define): Add error 620 detection.
7912         (Operator.Define): Add error 590 detection.
7913
7914         * ecore.cs: Missing argument for error 79.
7915
7916         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7917         detection.
7918
7919 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
7920
7921         Fix #70106
7922         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7923         only.
7924
7925 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7926
7927         * cs-parser.jay : handle doc comments on implicit/explicit operators.
7928           Some operator comments were suppressed.
7929         * doc.cs : Implicit/explicit operator name in doc comments are like
7930           "op_Explicit(type)~returnType", so added suffix handling.
7931
7932 2005-01-21  Alp Toker  <alp@atoker.com>
7933
7934         * cs-parser.jay: destructor_declaration's container is PartialContainer
7935         not Class when partial types are used, so use Kind prop instead of 'is'.
7936
7937 2004-12-12  Martin Baulig  <martin@ximian.com>
7938
7939         * expression.cs (Unary.TryReduceNegative): Added support for
7940         SByteConstant and ByteConstant.
7941         (Unary.Reduce): Check error values from TryReduceNegative().
7942
7943 2004-12-11  Martin Baulig  <martin@ximian.com>
7944
7945         * support.cs (ReflectionParameters.ParameterName): If we have a
7946         `gpd', call `ParameterName' on it.
7947
7948         * parameter.cs (Parameter.GetParameterAttributes): New static method.
7949
7950         * pending.cs (PendingImplementation.DefineProxy): Call
7951         DefineParameter() for all of the MethodBuilder's arguments.
7952
7953 2004-12-09  Martin Baulig  <martin@ximian.com>
7954
7955         * doc.cs (DocUtil): Make this a static class.
7956
7957 2004-12-09  Martin Baulig  <martin@ximian.com>
7958
7959         * expression.cs (Invocation.InferType): Moved the type inference
7960         implementation into TypeManager.
7961
7962         * generics.cs (TypeManager): Moved the type inference
7963         implementation here.
7964
7965 2004-12-09  Martin Baulig  <martin@ximian.com>
7966
7967         * typemanager.cs (TypeManager): Make this a partial class.
7968
7969         * generics.cs
7970         (TypeManager): Move the generics part of `TypeManager' here.
7971
7972 2004-12-08  Martin Baulig  <martin@ximian.com>
7973
7974         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7975         instead of a CS3002 for properties and indexer.  Added CS3024
7976         check for generic interfaces.
7977
7978         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
7979         instances are not CLS-compliant.
7980
7981 2004-12-08  Martin Baulig  <martin@ximian.com>
7982
7983         * cs-parser.jay
7984         (void_pointer_expression): New rule for `void*', `void**' etc.
7985         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
7986
7987 2004-12-08  Martin Baulig  <martin@ximian.com>
7988
7989         * expression.cs (Invocation.InferType): Removed the hack for
7990         MethodCore.MayUnify().  
7991
7992         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
7993         this actually work.
7994
7995         * class.cs (MethodCore.MayUnify): Use
7996         TypeManager.MayBecomeEqualGenericTypes().       
7997
7998 2004-12-08  Martin Baulig  <martin@ximian.com>
7999
8000         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
8001         parameter, box it.  Fixes #69233.
8002
8003 2004-12-08  Martin Baulig  <martin@ximian.com>
8004
8005         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
8006         have the ctor constraint.  Fixes #68326.
8007
8008 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
8009
8010         * cs-parser.jay : interface comment was not consumed because of
8011           extra opt_semicolon before doc handling.
8012
8013 2004-12-03  Raja R Harinath  <rharinath@novell.com>
8014
8015         Fix test-327.cs, test-328.cs, and put in early infrastructure
8016         for eventually fixing #52697.
8017         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
8018         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
8019         from other methods.
8020         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
8021         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
8022         (VerifyUsing, error246): Update.
8023         * rootcontext.cs (RootContext.NamespaceLookup): Just use
8024         'NamespaceEntry.LookupNamespaceOrType'.
8025
8026 2004-12-07  Martin Baulig  <martin@ximian.com>
8027
8028         * driver.cs: Call it "BETA SOFTWARE" :-)
8029
8030 2004-12-06  Raja R Harinath  <rharinath@novell.com>
8031
8032         Fix crash on cs0657-17.cs.
8033         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8034         Use RootContext.Tree.Types, not 'new RootTypes ()'.
8035         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
8036         the case where the NamespaceEntry gets overwritten.
8037
8038 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
8039
8040         Fixed #69195, #56821
8041         * ecore.cs (ResolveBoolean): Tiny refactoring.
8042
8043         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
8044         of right expression resolving when left is false constant and
8045         operator is LogicalAnd OR true constant and operator is LogicalOr.
8046
8047         * statement.cs (ResolveUnreachable): Always reports warning.
8048
8049 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
8050
8051         * class.cs: Distinguish between 1721 and 1722 (just a little help
8052         for the programmer).
8053
8054 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
8055
8056         * delegate.cs: Only allow this on new versions of the language. 
8057
8058 2004-12-02  Duncan Mak  <duncan@ximian.com>
8059
8060         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
8061         Expression class.
8062         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
8063         here as a static method. Take an additional bool out parameter
8064         `must_do_cs1540_check' for signaling to InstanceResolve.
8065         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
8066         member field from PropertyExpr class and made it an argument of
8067         the method instead.
8068         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
8069         check for MarshalByRefObject, and report CS0122 instead of CS1540.
8070         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
8071         and `remove_accessor' as well as InstanceResolve: report CS0122
8072         where applicable.
8073
8074         Fixes #70129.
8075
8076 2004-12-07  Martin Baulig  <martin@ximian.com>
8077
8078         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
8079         and CS0692 where appropriate.
8080
8081 2004-12-06  Martin Baulig  <martin@ximian.com>
8082
8083         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
8084         IsDuplicateImplementation() and improved it.
8085
8086         * expression.cs (Invocation.InferTypeArguments): Added
8087         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
8088         and removed the "ref" modifier from `infered_types'.
8089
8090         * decl.cs (MemberName.ToString): Removed the exception.
8091
8092 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
8093
8094         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
8095           comments are allowed.
8096
8097 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8098
8099         * delegate.cs: Add checks for subtypes in paramaters and return values
8100         in VerifyMethod () to add support for Covariance/Contravariance
8101         in delegates.
8102         
8103 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
8104
8105         * report.cs: Remove extra closing parenthesis.
8106
8107         * convert.cs (Error_CannotImplicitConversion): If the name of the
8108         types are the same, provide some extra information.
8109
8110 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
8111
8112         Fix bug #70102
8113         * attribute.cs (Resolve): Improved implementation of params
8114         attribute arguments.
8115
8116         * support.cs (ParameterData): Add HasParams to be faster.
8117
8118 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
8119
8120         all things are for /doc support:
8121
8122         * doc.cs: new file that supports XML documentation generation.
8123         * mcs.exe.sources: added doc.cs.
8124         * driver.cs:
8125           Handle /doc command line option.
8126           Report error 2006 instead of 5 for missing file name for /doc.
8127           Generate XML documentation when required, after type resolution.
8128         * cs-tokenizer.cs:
8129           Added support for picking up documentation (/// and /** ... */),
8130           including a new XmlCommentState enumeration.
8131         * cs-parser.jay:
8132           Added lines to fill Documentation element for field, constant,
8133           property, indexer, method, constructor, destructor, operator, event
8134           and class, struct, interface, delegate, enum.
8135           Added lines to warn incorrect comment.
8136         * rootcontext.cs :
8137           Added Documentation field (passed only when /doc was specified).
8138         * decl.cs:
8139           Added DocComment, DocCommentHeader, GenerateDocComment() and
8140           OnGenerateDocComment() and some supporting private members for
8141           /doc feature to MemberCore.
8142         * class.cs:
8143           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
8144         * delegate.cs:
8145           Added overriden DocCommentHeader.
8146         * enum.cs:
8147           Added overriden DocCommentHeader and GenerateDocComment().
8148
8149 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
8150
8151         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
8152         unwrapping the enumeration values, chain to
8153         DoConstantNumericPromotions again, so we can promote things to the
8154         fundamental types (takes care of enums that are bytes, sbytes).
8155
8156         Fixes bug #62054.
8157
8158 2004-12-01  Raja R Harinath  <rharinath@novell.com>
8159
8160         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
8161         Fix long-standing bug in type-lookup.  Use FindType instead of
8162         LookupType when ec.ResolvingTypeTree.
8163         (Attribute.ResolveType, Attribute.Resolve)
8164         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
8165         Update to changes.
8166         (Attributes.Search): Remove internal version.  Update.
8167         (Attributes.SearchMulti): Update.
8168         (Attributes.GetClsCompliantAttribute): Remove.
8169         (Attributes.GetIndexerNameAttribute): Remove.
8170         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
8171         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
8172         * class.cs (Indexer.Define): Likewise.
8173
8174 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
8175
8176         Fix bug #68790
8177         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
8178         MarshallByReference members access.
8179
8180         * expression.cs: Use CheckMarshallByRefAccess;
8181         Better error CS0197 message.
8182
8183         * report.cs: Print whole related error message.
8184
8185 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8186
8187         * class (GetClassBases): Better error 60 report.
8188         (EventProperty): Disabled warning 67 detection.
8189
8190 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8191
8192         Fix bug #60324
8193         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
8194
8195         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
8196         precise values.
8197
8198 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8199
8200         Fix bug #49488
8201         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
8202
8203         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
8204
8205 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
8206
8207         * attribute.cs (Attribute.Resolve): Refine error reporting and
8208         report a cs0117 if the identifier does not exist, to distinguish
8209         from 0617 which is a miss-use of the actual identifier.
8210
8211         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
8212         between cs0070 and cs0079.
8213
8214         * class.cs (MemberBase.DoDefine): When reporting a wrong
8215         accessibility level, we use MethodCore to compare instead of
8216         Method (this was a regression in some refactoring effort).
8217
8218         So now we correctly report cs0056 again.
8219
8220         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
8221         testing the target_type (which was known to be object_type) and
8222         not the source type (which is anonymous_method).
8223
8224         Fixed reporting of error cs1660.
8225
8226         * expression.cs (UserCast.Source): Expose the underlying cast.
8227
8228         * statement.cs (Switch.SwitchGoverningType): Sort the list of
8229         allowed types to find a match to int32 first (most common).
8230
8231         In addition, it ignores any ImplicitUserConversions that did an
8232         internal implicit conversion (as the switch statement allows only
8233         one integral conversion to exist).
8234
8235         * class.cs (PartialContainer.Create): rename `name' to
8236         `member_name' for clarity.  Then replace the string calls with a
8237         call to MemberName.GetPartialName, as now using
8238         MemberName.ToString is an error (this is due to the side effects
8239         it had, that were fixed in the past).
8240
8241         This will restore the error reporting on a number of partial class
8242         errors that were missusing this (and getting an exception as a
8243         results, which is now just a plain textual warning, because
8244         yyparse debug output would crash otherwise).
8245
8246 2004-11-26  Raja R Harinath  <rharinath@novell.com>
8247
8248         * Makefile (PROGRAM_INSTALL_DIR): Remove.
8249
8250 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
8251
8252         * rootcontext.cs (LookupType): Make sure to cache lookups that
8253         don't give us a negative result. This saves about 5% of corlib
8254         compilation time.
8255
8256 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8257
8258         * report.cs (AbstractMessage.Print): messages are sent to stderr
8259
8260         * class.cs (TypeContainer.GetClassBases): It is an error to have a
8261         non-interface in the list of interfaces (at this point, either
8262         parent was properly set, or a base class is being listed in the
8263         interfaces section).
8264
8265         This flags error 1722, and resolves the crash from bug 69259.
8266
8267 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
8268
8269         * statement.cs (Using.EmitExpressionFinally): make this work right
8270         for valuetypes. Fixes 69926.
8271
8272 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8273
8274         * const.cs (Const.ChangeType): Cope with the "0 literal can be
8275         converted to an enum" here, before we try to change the underlying
8276         type.  This code exists, but it is a different code path than the
8277         one used while encoding constants.
8278
8279         (ImplicitReferenceConversionExists): In addition, resynchronized
8280         the code here, so it matches the same code in
8281         ImplicitReferenceConversionExists for the `from any class-type S
8282         to any interface-type T'.       
8283
8284 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
8285
8286         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
8287
8288 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
8289
8290         * cs-parser.jay: Use verbosity accordingly. 
8291
8292 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8293
8294         * expression.cs (Unary.ResolveOperator): Do not report warning;
8295         AddressOf reads from variable.
8296         
8297         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
8298
8299 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8300
8301         Fix bug #69462
8302
8303         * attribute.cs (Attributable): Removed CheckTargets.
8304         (Attributes.Emit): Explicit attribute targets are tested here.
8305
8306         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
8307         not enabled for interfaces.
8308
8309         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
8310         (GetAssemblyName): Ouch next bug there.
8311
8312 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8313
8314         * expression.cs: Error 275 added.
8315         
8316 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
8317
8318         Fix bug #69177 (Implemented decimal constant support)
8319
8320         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
8321         (BinaryFold): Add DecimalConstant.
8322
8323         * const.cs (Define): Decimal constant 
8324         (is not constant.
8325         (ChangeType): Add decimal type handling.
8326         (LookupConstantValue): Don't set value for decimal type but
8327         emit DecimalConstantAttribute. Needed for constant optimization.
8328
8329         * constant.cs (ToDecimal): New method.
8330         (ConvertToDecimal): New method.
8331         (IntConstant): Implemented ConvertToDecimal.
8332         (DecimalConstant.Emit): Emit optimized version for decimals in
8333         int range.
8334
8335         * expression.cs (ResolveOperator): Changed order of constant
8336         reduction to work correctly with native types which have
8337         overloaded operators.
8338         (ResolveMemberAccess): Extract constant value from attribute
8339         for decimal type.
8340
8341         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8342
8343         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8344         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8345         (ChangeType): Decimal is special.
8346         (TypeToCoreType): Add decimal type.
8347
8348 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8349
8350         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8351         decimal types.
8352
8353 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8354
8355         * class.cs (EventField.ApplyAttributeBuilder): Fix error
8356         test cs1667-5.cs.
8357
8358 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8359
8360         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8361
8362         * pending.cs (PendingImplementation): Grab only interfaces.
8363
8364 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8365
8366         * statement.cs (ForeachHelperMethods): Add location member and
8367         error 202 detection.
8368
8369 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
8370
8371         * expression.cs (DoResolveBase): Fixed wrong warning for out
8372         variables.
8373
8374 2004-12-04  Martin Baulig  <martin@ximian.com>
8375
8376         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
8377         to check whether the conversion is ok.
8378
8379         * typemanager.cs (TypeManager.GetTypeArguments): Just return
8380         `Type.EmptyTypes' if we're not a generic TypeContainer.
8381
8382 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8383
8384         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8385         old bug: when converting from the null literal to a pointer,
8386         return an EmptyCast, not the NullLiteral.
8387
8388         This fixes #69921, the recent null_type changes probably made this
8389         bug more prominent.
8390
8391 2004-12-03  Martin Baulig  <martin@ximian.com>
8392
8393         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8394         method as our child, call AnonymousMethod.Compatible() on it.
8395
8396 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
8397
8398         * class.cs (FieldBase): Use an unused bit field from the field to
8399         encode the `has_offset' property from the FieldMember.  This saves
8400         a couple of Ks on bootstrap compilation.
8401
8402         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8403         method as our child, return the AnonymousMethod resolved
8404         expression.
8405
8406         * expression.cs (New.DoResolve): Allow return values from
8407         NewDelegate to also include AnonymousMethods.
8408
8409         Fixes #70150.
8410
8411 2004-11-29  Raja R Harinath  <rharinath@novell.com>
8412
8413         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
8414         cs1648 report.
8415         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
8416         System.Runtime.InteropServices._Exception, since it's a base
8417         interface of the core type System.Exception in the net_2_0 profile.
8418
8419 2004-11-27  Martin Baulig  <martin@ximian.com>
8420
8421         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
8422
8423 2004-11-26  Raja R Harinath  <rharinath@novell.com>
8424
8425         * Makefile: Convert to use executable.make.
8426         * gmcs.exe.sources: New.
8427
8428 2004-11-25  Martin Baulig  <martin@ximian.com>
8429
8430         * expression.cs (Invocation.InferType): Added support for byref types.
8431
8432 2004-11-25  Martin Baulig  <martin@ximian.com>
8433
8434         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
8435         in TypeManager.TypeToCoreType().
8436
8437 2004-11-25  Martin Baulig  <martin@ximian.com>
8438
8439         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
8440         "Dispose" method from the `current_type'.
8441         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
8442         DoDefineMembers() instead of using the MethodBuilder; this is
8443         required for generic iterators.
8444
8445         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
8446
8447 2004-11-24  Martin Baulig  <martin@ximian.com>
8448
8449         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
8450
8451 2004-11-20  Martin Baulig  <martin@ximian.com>
8452
8453         * expression.cs (Invocation.InferType): Correctly infer generic
8454         instances; see gen-103.cs.
8455         (Invocation.InferTypeArguments): If a generic method doesn't have
8456         any unbound type parameters, we don't need to infer anything.
8457
8458 2004-11-19  Raja R Harinath  <rharinath@novell.com>
8459
8460         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
8461
8462 2004-11-17  Raja R Harinath  <rharinath@novell.com>
8463
8464         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8465         (TypeHandle.GetMemberCache): New.
8466         (TypeHandle.TypeHandle): Update.
8467         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8468         (TypeManager.LookupParentInterfacesCache):
8469         Rename from LookupInterfaceCache.  Optimize slightly.
8470         (TypeManager.MemberLookup_FindMembers): Update.
8471         * decl.cs (MemberCache.MemberCache): Set Container to null in the
8472         multi-type variant.
8473         (AddCacheContents): Rename from AddHashtable.
8474         * class.cs (TypeContainer.parent_container): Remove.
8475         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8476         (TypeContainer.DoDefineMembers): Don't initialize it.
8477         Update to name changes.
8478         
8479 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
8480
8481         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8482         that factors the code to check access modifiers on override.  
8483
8484         (PropertyBase): Use the code here.
8485
8486         Patch from Lluis S'anchez, fixes bug #69361.
8487
8488 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
8489
8490         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8491         routine that is used to report the use of a captured variable
8492         whose address has been taken.
8493
8494         There are two checks: one when variables are being captured and
8495         the other check is when the address of a variable is taken. 
8496         
8497         (because an anonymous methods might be resolved before *or* after
8498         the address has been taken) and 
8499
8500         * expression.cs (Conditional.DoResolve): Remove the special
8501         casing that Martin added to trueExpr and falseExpr being both
8502         NullLiteral.  We get the right behavior now just by introducing
8503         the null_type into the compiler. 
8504
8505         * convert.cs (ExplicitConversion): Change the code to use
8506         null_type instead of testing `expr is NullLiteral'.
8507         (ImplicitConversionStandard): use null_type too.
8508         (ImplicitReferenceConversionExists): use null_type too.
8509         (ImplicitReferenceConversion): use null_type too.
8510
8511         * literal.cs: The type of `NullLiteral' is now null_type instead
8512         of object_type. 
8513         (Resolve): Set the type here.
8514
8515         * typemanager.cs: Introduce null_type.
8516
8517 2004-11-18  Martin Baulig  <martin@ximian.com>
8518
8519         * rootcontext.cs
8520         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
8521
8522 2004-11-18  Martin Baulig  <martin@ximian.com>
8523
8524         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
8525
8526 2004-11-18  Martin Baulig  <martin@ximian.com>
8527
8528         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
8529         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
8530         call ResolveConstructedType() on it to resolve it without checking
8531         constraints.
8532         (Constraints.ResolveTypes): Check them here.
8533         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
8534         but don't check constraints.
8535         (ConstructedType.ResolveAsTypeTerminal): Override this and also
8536         check constraints here.
8537         (ConstructedType.ResolveConstructedType): New public method.  This
8538         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
8539         resolve ourselves without checking constraints.
8540
8541         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
8542
8543 2004-11-18  Martin Baulig  <martin@ximian.com>
8544
8545         * decl.cs
8546         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
8547
8548         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
8549
8550 2004-11-18  Martin Baulig  <martin@ximian.com>
8551
8552         * ecore.cs (TypeExpr.ResolveType): Removed.
8553         (Expression.ResolveAsTypeTerminal): We always return a fully
8554         resolved `TypeExpr', so we can just access its `Type'.
8555
8556         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
8557
8558 2004-11-17  Martin Baulig  <martin@ximian.com>
8559
8560         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
8561         sure we don't return any unresolved TypeExpr's.
8562         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
8563         a `TypeExpr'.
8564         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
8565
8566         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
8567         unresolved `ConstructedType's.
8568
8569 2004-11-17  Martin Baulig  <martin@ximian.com>
8570
8571         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
8572
8573 2004-11-17  Martin Baulig  <martin@ximian.com>
8574
8575         * ecore.cs
8576         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
8577
8578         * decl.cs (DeclSpace.ResolveType): Removed.
8579         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
8580
8581 2004-11-17  Martin Baulig  <martin@ximian.com>
8582
8583         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8584         direction, like FindMembers() does.  Fixes #69546, testcase is in
8585         test-315.cs.    
8586
8587 2004-11-16  Martin Baulig  <martin@ximian.com>
8588
8589         This is based on a patch from Marek Safar, see bug #69082.
8590         Fixes bugs #63705 and #67130.
8591
8592         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8593         method; create a MemberCache for an interface type and cache the
8594         result.
8595
8596         * decl.cs (IMemberContainer.ParentContainer): Removed.
8597         (IMemberContainer.ParentCache): New property.
8598         (MemberCache.SetupCacheForInterface): Removed.
8599         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8600         to create a cache for an interface's "parent".
8601
8602         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8603         interfaces too.
8604
8605 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
8606
8607         * statement.cs: Avoid adding bools to a hashtable.
8608
8609 2004-11-15  Martin Baulig  <martin@ximian.com>
8610
8611         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
8612
8613 2004-11-11  Martin Baulig  <martin@ximian.com>
8614
8615         * typemanager.cs (TypeManager.GetMethodName): New method.
8616
8617         * class.cs (MethodData.Define): Include the generic arity in the
8618         name of an explicit interface; also add it to the method name.
8619
8620         * pending.cs (PendingImplementation.InterfaceMethod): The method
8621         name now includes the generic arity.
8622
8623 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
8624
8625         * expression.cs (Invocation.OverloadResolve): Flag error if we are
8626         calling an unsafe method from a safe location.
8627
8628 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
8629
8630         Fix #69167
8631         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8632
8633 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
8634
8635         * namespace.cs (VerifyUsing): use GetPartialName instead of
8636         ToString. 
8637
8638 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
8639
8640         * statement.cs (Return.Resolve): Fix regression in typo: if
8641         `in_exc', we have to request a NeedReturnLabel, this was a typo
8642         introduced in the anonymous method check-in.  Fixes #69131.
8643
8644         * Indexers were using the ShortName when defining themselves,
8645         causing a regression in the compiler bootstrap when applying the
8646         patch from 2004-11-02 (first part), now they use their full name
8647         and the bug is gone.
8648
8649 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
8650
8651         * driver.cs: Strip the path from the names of embedded resources. Fixes
8652         #68519.
8653
8654 2004-11-04  Raja R Harinath  <rharinath@novell.com>
8655
8656         Fix error message regression: cs0104-2.cs.
8657         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8658         (AliasEntry.Resolve): Update.
8659         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
8660         'silent' flag.
8661         (RootContext.LookupType): Update.
8662
8663 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
8664
8665         * cs-parser.jay: Add support for handling accessor modifiers
8666         * class: Add support port accessor modifiers and error checking,
8667         define PropertyMethod.Define as virtual (not abstract anymore)
8668         * ecore.cs: Add checking for proeprties access with access modifiers
8669         * iterators.cs: Modify Accessor constructor call based in the modified
8670         constructor
8671 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
8672
8673         * expression.cs (StringConcat): Handle being called twice,
8674         as when we have a concat in a field init with more than two
8675         ctors in the class
8676
8677 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
8678
8679         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8680         special case explicit implementations, we should always produce
8681         the .property or .event declaration.
8682         
8683         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8684         since it will not return correct data if people use this
8685         unresolved in the presence of using statements (see test-313).
8686
8687         * class.cs (MethodData.Define): If we are an explicit interface
8688         implementation, set the method name to the full name of the
8689         interface plus the name of the method.  
8690
8691         Notice that using the method.MethodName.GetFullName() does not
8692         work, as it will only contain the name as declared on the source
8693         file (it can be a shorthand in the presence of using statements)
8694         and not the fully qualifed type name, for example:
8695
8696         using System;
8697
8698         class D : ICloneable {
8699                 object ICloneable.Clone ()  {
8700                 }
8701         }
8702
8703         Would produce a method called `ICloneable.Clone' instead of
8704         `System.ICloneable.Clone'.
8705
8706         * namespace.cs (Alias.Resolve): Use GetPartialName.
8707         
8708 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8709
8710         * cs-parser.jay: Add error 1055 report.
8711
8712 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
8713
8714         * assign.cs (Assign.DoResolve): Only do the transform of
8715         assignment into a New if the types are compatible, if not, fall
8716         through and let the implicit code deal with the errors and with
8717         the necessary conversions. 
8718
8719 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8720
8721         * cs-parser.jay: Add error 1031 report.
8722
8723         * cs-tokenizer.cs: Add location for error 1038.
8724
8725 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8726
8727         * cs-parser.jay: Add error 1016 report.
8728
8729 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8730
8731         * cs-parser.jay: Add errors 1575,1611 report.
8732
8733 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8734
8735         * cs-parser.jay: Add error 1001 report.
8736
8737 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8738
8739         Fix #68850
8740         * attribute.cs (GetMarshal): Add method argument for
8741         caller identification.
8742
8743         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8744         agument for GetMarshal and RuntimeMissingSupport.
8745
8746 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8747
8748         * attribute.cs (ExtractSecurityPermissionSet): Removed
8749         TypeManager.code_access_permission_type.
8750
8751         * typemanager.cs: Removed TypeManager.code_access_permission_type.
8752
8753 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
8754
8755         * expression.cs (LocalVariableReference.DoResolveLValue): Check
8756         for obsolete use of a variable here.   Fixes regression on errors
8757         cs0619-25 and cs0619-26.
8758
8759 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
8760
8761         Fix #62358, implemented security attribute encoding.
8762
8763         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8764         Tests permitted SecurityAction for assembly or other types.
8765         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8766         data from SecurityPermissionAttribute to PermisionSet class.
8767
8768         * class.cs (ApplyAttributeBuilder): Added special handling
8769         for System.Security.Permissions.SecurityAttribute based types.
8770
8771         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8772         special handling for System.Security.Permissions.SecurityAttribute
8773         based types.
8774
8775         * enum.cs (ApplyAttributeBuilder): Added special handling
8776         for System.Security.Permissions.SecurityAttribute based types.
8777
8778         * parameter.cs (ApplyAttributeBuilder): Added special handling
8779         for System.Security.Permissions.SecurityAttribute based types.
8780
8781         * rootcontext.cs: Next 2 core types.
8782
8783         * typemanager.cs (TypeManager.security_permission_attr_type):
8784         Built in type for the SecurityPermission Attribute.
8785         (code_access_permission_type): Build in type.
8786
8787 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
8788
8789         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8790         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8791         all of this information into
8792         EmitContext.EmitCapturedVariableInstance.
8793         
8794         * codegen.cs (EmitCapturedVariableInstance): move here the
8795         funcionality of emitting an ldarg.0 in the presence of a
8796         remapping.   This centralizes the instance emit code.
8797
8798         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8799         then emit a load of this: it means that we have reached the
8800         topmost ScopeInfo: the one that contains the pointer to the
8801         instance of the class hosting the anonymous method.
8802
8803         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8804         captures to the topmost CaptureContext.
8805
8806 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
8807
8808         * expression.cs (LocalVariableReference): Move the knowledge about
8809         the iterators into codegen's EmitCapturedVariableInstance.
8810
8811 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
8812
8813         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8814         all code paths return a value from an anonymous method (it is the
8815         same as the 161 error, but for anonymous methods).
8816
8817 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
8818
8819         The introduction of anonymous methods in the compiler changed
8820         various ways of doing things in the compiler.  The most
8821         significant one is the hard split between the resolution phase
8822         and the emission phases of the compiler.
8823
8824         For instance, routines that referenced local variables no
8825         longer can safely create temporary variables during the
8826         resolution phase: they must do so from the emission phase,
8827         since the variable might have been "captured", hence access to
8828         it can not be done with the local-variable operations from the runtime.
8829         
8830         * statement.cs 
8831
8832         (Block.Flags): New flag `IsTopLevel' to indicate that this block
8833         is a toplevel block.
8834
8835         (ToplevelBlock): A new kind of Block, these are the blocks that
8836         are created by the parser for all toplevel method bodies.  These
8837         include methods, accessors and anonymous methods.
8838
8839         These contain some extra information not found in regular blocks:
8840         A pointer to an optional CaptureContext (for tracking captured
8841         local variables and parameters).  A pointer to the parent
8842         ToplevelBlock.
8843         
8844         (Return.Resolve): Catch missmatches when returning a value from an
8845         anonymous method (error 1662).
8846         Invoke NeedReturnLabel from the Resolve phase instead of the emit
8847         phase.
8848
8849         (Break.Resolve): ditto.
8850
8851         (SwitchLabel): instead of defining the labels during the
8852         resolution phase, we now turned the public ILLabel and ILLabelCode
8853         labels into methods called GetILLabelCode() and GetILLabel() that
8854         only define the label during the Emit phase.
8855
8856         (GotoCase): Track the SwitchLabel instead of the computed label
8857         (its contained therein).  Emit the code by using
8858         SwitchLabel.GetILLabelCode ().
8859
8860         (LocalInfo.Flags.Captured): A new flag has been introduce to track
8861         whether the Local has been captured or not.
8862
8863         (LocalInfo.IsCaptured): New property, used to tell whether the
8864         local has been captured.
8865         
8866         * anonymous.cs: Vastly updated to contain the anonymous method
8867         support.
8868
8869         The main classes here are: CaptureContext which tracks any
8870         captured information for a toplevel block and ScopeInfo used to
8871         track the activation frames for various local variables.   
8872
8873         Each toplevel block has an optional capture context associated
8874         with it.  When a method contains an anonymous method both the
8875         toplevel method and the anonymous method will create a capture
8876         context.   When variables or parameters are captured, they are
8877         recorded on the CaptureContext that owns them, for example:
8878
8879         void Demo () {
8880              int a;
8881              MyDelegate d = delegate {
8882                  a = 1;
8883              }
8884         }
8885
8886         Here `a' will be recorded as captured on the toplevel
8887         CapturedContext, the inner captured context will not have anything
8888         (it will only have data if local variables or parameters from it
8889         are captured in a nested anonymous method.
8890
8891         The ScopeInfo is used to track the activation frames for local
8892         variables, for example:
8893
8894         for (int i = 0; i < 10; i++)
8895                 for (int j = 0; j < 10; j++){
8896                    MyDelegate d = delegate {
8897                         call (i, j);
8898                    }
8899                 }
8900
8901         At runtime this captures a single captured variable `i', but it
8902         captures 10 different versions of the variable `j'.  The variable
8903         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8904         recorded on a child.  
8905
8906         The toplevel ScopeInfo will also track information like the `this'
8907         pointer if instance variables were referenced (this is necessary
8908         as the anonymous method lives inside a nested class in the host
8909         type of the method). 
8910
8911         (AnonymousMethod): Expanded to track the Toplevel, implement
8912         `AnonymousMethod.Compatible' to tell whether an anonymous method
8913         can be converted to a target delegate type. 
8914
8915         The routine now also produces the anonymous method content
8916
8917         (AnonymousDelegate): A helper class that derives from
8918         DelegateCreation, this is used to generate the code necessary to
8919         produce the delegate for the anonymous method that was created. 
8920
8921         * assign.cs: API adjustments for new changes in
8922         Convert.ImplicitStandardConversionExists.
8923
8924         * class.cs: Adjustments to cope with the fact that now toplevel
8925         blocks are of type `ToplevelBlock'. 
8926
8927         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8928         insteda of standard blocks.
8929
8930         Flag errors if params arguments are passed to anonymous methods.
8931
8932         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8933         `CurrentAnonymousMethod' which points to the current Anonymous
8934         Method.  The variable points to the AnonymousMethod class that
8935         holds the code being compiled.  It is set in the new EmitContext
8936         created for the anonymous method.
8937
8938         (EmitContext.Phase): Introduce a variable and an enumeration to
8939         assist in enforcing some rules about when and where we are allowed
8940         to invoke certain methods (EmitContext.NeedsReturnLabel is the
8941         only one that enfonces this right now).
8942
8943         (EmitContext.HaveCaptureInfo): new helper method that returns
8944         whether we have a CapturedContext initialized.
8945
8946         (EmitContext.CaptureVariable): New method used to register that a
8947         LocalInfo must be flagged for capturing. 
8948
8949         (EmitContext.CapturedParameter): New method used to register that a
8950         parameters must be flagged for capturing. 
8951         
8952         (EmitContext.CapturedField): New method used to register that a
8953         field must be flagged for capturing. 
8954
8955         (EmitContext.HaveCapturedVariables,
8956         EmitContext.HaveCapturedFields): Return whether there are captured
8957         variables or fields. 
8958
8959         (EmitContext.EmitMethodHostInstance): This is used to emit the
8960         instance for the anonymous method.  The instance might be null
8961         (static methods), this (for anonymous methods that capture nothing
8962         and happen to live side-by-side with the current method body) or a
8963         more complicated expression if the method has a CaptureContext.
8964
8965         (EmitContext.EmitTopBlock): Routine that drives the emission of
8966         code: it will first resolve the top block, then emit any metadata
8967         and then emit the code.  The split is done so that we can extract
8968         any anonymous methods and flag any captured variables/parameters.
8969         
8970         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8971         during this phase, the ILGenerator should not be used as labels
8972         and local variables declared here might not be accessible to any
8973         code that is part of an anonymous method.  
8974
8975         Exceptions to this include the temporary variables that are
8976         created by some statements internally for holding temporary
8977         variables. 
8978         
8979         (EmitContext.EmitMeta): New routine, in charge of emitting all the
8980         metadata for a cb
8981
8982         (EmitContext.TemporaryReturn): This method is typically called
8983         from the Emit phase, and its the only place where we allow the
8984         ReturnLabel to be defined other than the EmitMeta.  The reason is
8985         that otherwise we would have to duplicate a lot of logic in the
8986         Resolve phases of various methods that today is on the Emit
8987         phase. 
8988
8989         (EmitContext.NeedReturnLabel): This no longer creates the label,
8990         as the ILGenerator is not valid during the resolve phase.
8991
8992         (EmitContext.EmitThis): Extended the knowledge in this class to
8993         work in anonymous methods in addition to iterators. 
8994
8995         (EmitContext.EmitCapturedVariableInstance): This emits whatever
8996         code is necessary on the stack to access the instance to a local
8997         variable (the variable will be accessed as a field).
8998
8999         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
9000         EmitContext.EmitAddressOfParameter): Routines to support
9001         parameters (not completed at this point). 
9002         
9003         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
9004         will also remove the parameters.
9005
9006         * convert.cs (Convert): Define a `ConstantEC' which points to a
9007         null.  This is just to prefity some code that uses
9008         ImplicitStandardConversion code and do not have an EmitContext
9009         handy.
9010
9011         The idea is to flag explicitly that at that point in time, it is
9012         known that the conversion will not trigger the delegate checking
9013         code in implicit conversions (which requires a valid
9014         EmitContext). 
9015
9016         Everywhere: pass new EmitContext parameter since
9017         ImplicitStandardConversionExists now requires it to check for
9018         anonymous method conversions. 
9019
9020         (Convert.ImplicitStandardConversionExists): If the type of an
9021         expression is the anonymous_method_type, and the type is a
9022         delegate, we invoke the AnonymousMethod.Compatible method to check
9023         whether an implicit conversion is possible. 
9024
9025         (Convert.ImplicitConversionStandard): Only do implicit method
9026         group conversions if the language level is not ISO_1.
9027
9028         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
9029         MethodInfo for the Invoke method.  used by Delegate and
9030         AnonymousDelegate.
9031
9032         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
9033         method conversions if the target type is a delegate.
9034
9035         Removed extra debugging nops.
9036
9037         (LocalVariableReference): Turn the `local_info' into a public
9038         field. 
9039
9040         Add `prepared' field, the same hack used for FieldExprs to cope
9041         with composed assignments, as Local variables do not necessarily
9042         operate purely on the stack as they used to: they can be captured
9043         fields. 
9044
9045         Add `temp' for a temporary result, like fields.
9046
9047         Refactor DoResolve and DoResolveLValue into DoResolveBase.
9048
9049         It now copes with Local variables that are captured and emits the
9050         proper instance variable to load it from a field in the captured
9051         case. 
9052
9053         (ParameterReference.DoResolveBase): During the resolve phase,
9054         capture parameters if we are in an anonymous method.
9055
9056         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
9057         anonymous method, use the EmitContext helper routines to emit the
9058         parameter reference.
9059
9060         * iterators.cs: Set RemapToProxy to true/false during the
9061         EmitDispose class.
9062
9063         * parameters.cs (GetParameterByName): New helper method. 
9064
9065         * typemanager.cs (anonymous_method_type) a new type that
9066         represents an anonyous method.  This is always an internal type,
9067         used as a fencepost to test against the anonymous-methodness of an
9068         expression. 
9069         
9070 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
9071
9072         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
9073         561 report.
9074         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
9075
9076 2004-11-10  Martin Baulig  <martin@ximian.com>
9077
9078         * expression.cs (Invocation.BetterFunction): If two methods have
9079         equal parameter types, but only one of them is generic, the
9080         non-generic one wins.
9081         (New.DoResolve): Don't set `is_struct' to false if we're a generic
9082         instance; just use `Type.IsValueType' to determine whether
9083         something is a struct or not.
9084         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
9085         so we can be called multiple times.
9086
9087 2004-11-10  Martin Baulig  <martin@ximian.com>
9088
9089         * generic.cs (TypeParameter.DefineConstraints): New public method.
9090         (TypeParameter.CheckAccessLevel): Override this and return true.
9091         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
9092         override ResolveType() anymore.
9093         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
9094
9095 2004-11-10  Martin Baulig  <martin@ximian.com>
9096
9097         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
9098         call DeclSpace.ResolveNestedType() on it.
9099
9100 2004-11-10  Martin Baulig  <martin@ximian.com>
9101
9102         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
9103         non-null, call ParameterModifier() on it.
9104
9105 2004-11-10  Martin Baulig  <martin@ximian.com>
9106
9107         * iterators.cs
9108         (Iterators): Added `current_type' and `this_type' fields.
9109         (Iterators.DefineIterator): Create a new EmitContext and store it
9110         in `ec'; compute `this_type'.
9111
9112 2004-11-10  Martin Baulig  <martin@ximian.com>
9113
9114         * typemanager.cs
9115         (TypeManager.IsPrivateAccessible): New public method.
9116         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
9117
9118 2004-11-10  Martin Baulig  <martin@ximian.com>
9119
9120         * class.cs (TypeContainer.DefineType): Call
9121         TypeBuilder.DefineGenericParameters() before resolving the type
9122         parameters.
9123         (MethodData.parent_method): New protected field.
9124         (MethodData..ctor): Added `MethodInfo parent_method' argument.
9125         (MethodData.Define): Compute `parent_method'.
9126
9127         * decl.cs
9128         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
9129         (MemberCore.GetClsCompliantAttributeValue): Likewise.
9130         (DeclSpace.ec): New protected field; store the EmitContext here.
9131         (DeclSpace.EmitContext): New public property.
9132         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
9133         (DeclSpace.ResolveNestedType): New public method.
9134         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
9135         (DeclSpace.NestedAccessible): Added `Type tb' argument.
9136         (DeclSpace.FamilyAccessible): Likewise.
9137         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
9138         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
9139         EmitContext.
9140
9141         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
9142         field.
9143
9144         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
9145         (Enum.Emit): Don't create a new EmitContext.
9146
9147 2004-10-18  Martin Baulig  <martin@ximian.com>
9148
9149         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
9150         `Type' directly, but call ResolveType() on it.
9151         (Catch.Resolve): Likewise.
9152         (Foreach.Resolve): Likewise.
9153
9154 2004-10-18  Martin Baulig  <martin@ximian.com>
9155
9156         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
9157         `Type' directly, but call ResolveType() on it.
9158         (Probe.DoResolve): Likewise.
9159         (ArrayCreation.LookupType): Likewise.
9160         (TypeOf.DoResolve): Likewise.
9161         (SizeOf.DoResolve): Likewise.
9162
9163 2004-10-18  Raja R Harinath  <rharinath@novell.com>
9164
9165         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
9166         the ResolveType.
9167
9168 2004-10-17  John Luke  <john.luke@gmail.com>
9169
9170         * class.cs (Operator.GetSignatureForError): use CSharpName
9171
9172         * parameter.cs (Parameter.GetSignatureForError): Returns
9173         correct name even if was not defined.
9174
9175 2004-10-13  Raja R Harinath  <rharinath@novell.com>
9176
9177         Fix #65816.
9178         * class.cs (TypeContainer.EmitContext): New property.
9179         (DefineNestedTypes): Create an emitcontext for each part.
9180         (MethodCore.DoDefineParameters): Use container's emitcontext.
9181         Pass type array to InternalParameters.
9182         (MemberBase.DoDefine): Use container's emitcontext.
9183         (FieldMember.Define): Likewise.
9184         (Event.Define): Likewise.
9185         (SetMethod.GetParameterInfo): Change argument to EmitContext.
9186         Pass type array to InternalParameters.
9187         (SetIndexerMethod.GetParameterInfo): Likewise.
9188         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9189         * delegate.cs (Define): Pass emitcontext to
9190         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
9191         array to InternalParameters.
9192         * expression.cs (ParameterReference.DoResolveBase): Pass
9193         emitcontext to GetParameterInfo.
9194         (ComposedCast.DoResolveAsTypeStep): Remove check on
9195         ec.ResolvingTypeTree.
9196         * parameter.cs (Parameter.Resolve): Change argument to
9197         EmitContext.  Use ResolveAsTypeTerminal.
9198         (Parameter.GetSignature): Change argument to EmitContext.
9199         (Parameters.ComputeSignature): Likewise.
9200         (Parameters.ComputeParameterTypes): Likewise.
9201         (Parameters.GetParameterInfo): Likewise.
9202         (Parameters.ComputeAndDefineParameterTypes): Likewise.
9203         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
9204         * support.cs (InternalParameters..ctor): Remove variant that takes
9205         a DeclSpace.
9206         * typemanager.cs (system_intptr_expr): New.
9207         (InitExpressionTypes): Initialize it.
9208
9209 2004-10-12  Chris Toshok  <toshok@ximian.com>
9210
9211         * cs-parser.jay: fix location for try_statement and catch_clause.
9212
9213 2004-10-18  Martin Baulig  <martin@ximian.com>
9214
9215         * class.cs (FieldMember.Define): Don't access the TypeExpr's
9216         `Type' directly, but call ResolveType() on it.
9217         (MemberBase.DoDefine): Likewise.
9218
9219         * expression.cs (New.DoResolve): Don't access the TypeExpr's
9220         `Type' directly, but call ResolveType() on it.
9221         (ComposedCast.DoResolveAsTypeStep): Likewise.
9222
9223         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
9224         `Type' directly, but call ResolveType() on it.
9225
9226 2004-10-17  John Luke  <john.luke@gmail.com>
9227
9228         * class.cs (Operator.GetSignatureForError): use CSharpName
9229
9230         * parameter.cs (Parameter.GetSignatureForError): Returns
9231         correct name even if was not defined.
9232
9233 2004-10-13  Raja R Harinath  <rharinath@novell.com>
9234
9235         Fix #65816.
9236         * class.cs (TypeContainer.EmitContext): New property.
9237         (DefineNestedTypes): Create an emitcontext for each part.
9238         (MethodCore.DoDefineParameters): Use container's emitcontext.
9239         Pass type array to InternalParameters.
9240         (MemberBase.DoDefine): Use container's emitcontext.
9241         (FieldMember.Define): Likewise.
9242         (Event.Define): Likewise.
9243         (SetMethod.GetParameterInfo): Change argument to EmitContext.
9244         Pass type array to InternalParameters.
9245         (SetIndexerMethod.GetParameterInfo): Likewise.
9246         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9247         * delegate.cs (Define): Pass emitcontext to
9248         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
9249         array to InternalParameters.
9250         * expression.cs (ParameterReference.DoResolveBase): Pass
9251         emitcontext to GetParameterInfo.
9252         (ComposedCast.DoResolveAsTypeStep): Remove check on
9253         ec.ResolvingTypeTree.
9254         * parameter.cs (Parameter.Resolve): Change argument to
9255         EmitContext.  Use ResolveAsTypeTerminal.
9256         (Parameter.GetSignature): Change argument to EmitContext.
9257         (Parameters.ComputeSignature): Likewise.
9258         (Parameters.ComputeParameterTypes): Likewise.
9259         (Parameters.GetParameterInfo): Likewise.
9260         (Parameters.ComputeAndDefineParameterTypes): Likewise.
9261         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
9262         * support.cs (InternalParameters..ctor): Remove variant that takes
9263         a DeclSpace.
9264         * typemanager.cs (system_intptr_expr): New.
9265         (InitExpressionTypes): Initialize it.
9266
9267 2004-10-12  Chris Toshok  <toshok@ximian.com>
9268
9269         * cs-parser.jay: fix location for try_statement and catch_clause.
9270
9271 2004-10-07  Raja R Harinath  <rharinath@novell.com>
9272
9273         More DeclSpace.ResolveType avoidance.
9274         * decl.cs (MemberCore.InUnsafe): New property.
9275         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
9276         with newly created EmitContext.
9277         (FieldMember.Define): Likewise.
9278         * delegate.cs (Delegate.Define): Likewise.
9279         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
9280         only if normal name-lookup fails.
9281         (TypeExpr.DoResolve): Enable error-checking.
9282         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
9283         (SizeOf.DoResolve): Likewise.
9284         (ComposedCast.DoResolveAsTypeStep): Likewise.
9285         (StackAlloc.DoResolve): Likewise.
9286         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
9287         (Block.Unsafe): New property.
9288         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
9289         (Unsafe): Set 'unsafe' flag of contained block.
9290         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
9291         (Fixed.Resolve): Likewise.
9292         (Catch.Resolve): Likewise.
9293         (Using.ResolveLocalVariableDecls): Likewise.
9294         (Foreach.Resolve): Likewise.
9295
9296 2004-10-05  John Luke <john.luke@gmail.com>
9297
9298         * cs-parser.jay: add location to error CS0175
9299
9300 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
9301
9302         * ecore.cs (Expression.Constantity): Add support for turning null
9303         into a constant.
9304
9305         * const.cs (Const.Define): Allow constants to be reference types
9306         as long as the value is Null.
9307
9308 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
9309
9310         * namespace.cs (NamespaceEntry.Using): No matter which warning
9311         level is set, check if this namespace name has already been added.
9312
9313 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
9314
9315         * expression.cs: reftype [!=]= null should always use br[true,false].
9316         # 67410
9317
9318 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
9319
9320         Fix #67108
9321         * attribute.cs: Enum conversion moved to 
9322         GetAttributeArgumentExpression to be applied to the all
9323         expressions.
9324
9325 2004-10-01  Raja R Harinath  <rharinath@novell.com>
9326
9327         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
9328         * class.c (TypeContainer.DefineType): Flag error if
9329         base types aren't accessible due to access permissions.
9330         * decl.cs (DeclSpace.ResolveType): Move logic to
9331         Expression.ResolveAsTypeTerminal.
9332         (DeclSpace.ResolveTypeExpr): Thin layer over
9333         Expression.ResolveAsTypeTerminal.
9334         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
9335         Refactor code into NestedAccess.  Use it.
9336         (DeclSpace.NestedAccess): New.
9337         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
9338         argument to silence errors.  Check access permissions.
9339         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
9340         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
9341         (Cast.DoResolve): Likewise.
9342         (New.DoResolve): Likewise.
9343         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
9344         (TypeOf.DoResolve): Likewise.
9345
9346         * expression.cs (Invocation.BetterConversion): Return the Type of
9347         the better conversion.  Implement section 14.4.2.3 more faithfully.
9348         (Invocation.BetterFunction): Make boolean.  Make correspondence to
9349         section 14.4.2.2 explicit.
9350         (Invocation.OverloadResolve): Update.
9351         (Invocation): Remove is_base field.
9352         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
9353         (Invocation.Emit): Likewise.
9354
9355 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
9356
9357         * cs-parser.jay: Reverted 642 warning fix.
9358
9359 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9360
9361         Fix bug #66615
9362         * decl.cs (FindMemberWithSameName): Indexer can have more than
9363         1 argument.
9364
9365 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9366
9367         * expression.cs (LocalVariableReference.DoResolveLValue):
9368         Do not report warning 219 for out values.
9369         (EmptyExpression.Null): New member to avoid extra allocations.
9370
9371 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9372
9373         * cs-parser.jay: Fix wrong warning 642 report.
9374
9375         * cs-tokenizer.cs (CheckNextToken): New helper;
9376         Inspect next character if is same as expected.
9377
9378 2004-09-23  Martin Baulig  <martin@ximian.com>
9379
9380         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9381         (Convert.ImplicitReferenceConversionExists): Likewise.
9382
9383 2004-11-09  Raja R Harinath  <rharinath@novell.com>
9384
9385         * Makefile (DISTFILES): Comment out a few missing files.
9386
9387 2004-10-29  Raja R Harinath  <rharinath@novell.com>
9388
9389         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
9390         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
9391         (gmcs.exe): Invoke bootstrap-libs.
9392         (clean-local): Clean the net_2_0_bootstrap profile too.
9393         (PROGRAM_INSTALL_DIR): New.
9394         (install-local): Use it.
9395
9396 2004-10-13  Martin Baulig  <martin@ximian.com>
9397
9398         * generic.cs (TypeManager.InflatedConstraints): New nested class.
9399         (TypeParameter.DefineType): If we're a method type parameter and
9400         that method is overriding something, "inflate" its constraints.
9401
9402 2004-10-12  Martin Baulig  <martin@ximian.com>
9403
9404         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
9405         and have type arguments, create and resolve a ConstructedType.
9406
9407 2004-10-12  Martin Baulig  <martin@ximian.com>
9408
9409         * decl.cs (MemberCache.FindMemberToOverride): Use
9410         TypeManager.IsEqual() to compare the parameters and Type.Equals()
9411         to compare the invocationType.
9412
9413         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
9414         When comparing two type parameters, only do the signature-only
9415         comparision for method type parameters.
9416
9417 2004-10-11  Martin Baulig  <martin@ximian.com>
9418
9419         * report.cs: Don't make --fatal abort on warnings, we have
9420         -warnaserror for that.
9421
9422 2004-10-11  Martin Baulig  <martin@ximian.com>
9423
9424         * typemanager.cs
9425         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
9426         (TypeManager.IsEqual): Call ourself recursively instead of using
9427         Type.IsEqual(). 
9428
9429 2004-10-11  Martin Baulig  <martin@ximian.com>
9430
9431         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
9432         on our own type parameters, not on the ones we inherit from a containing
9433         class.
9434
9435         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
9436         the comparision.
9437
9438         * generic.cs (TypeParameter.Define): We may only be called once.
9439
9440         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
9441         instead of TypeManager.IsEqual().
9442
9443 2004-09-28  Martin Baulig  <martin@ximian.com>
9444
9445         * generic.cs
9446         (GenericConstraints.EffectiveBaseClass): New public property.
9447         (TypeParameter.GenericConstraints): New public property.
9448         (ConstructedType.CheckConstraints): Improved.
9449
9450         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
9451         (Convert.TypeParameterConversion): New private method; use this in
9452         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
9453         for all conversions related to type parameters.
9454
9455 2004-09-24  Martin Baulig  <martin@ximian.com>
9456
9457         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
9458         type parameter conversions for type parameters which are known to
9459         be reference types.
9460
9461 2004-09-24  Martin Baulig  <martin@ximian.com>
9462
9463         * generic.cs (GenericConstraints): Added `IsReferenceType' and
9464         `IsValueType' properties.
9465
9466         * support.cs (ReflectionConstraints): Use
9467         Type.GetGenericParameterConstraints() instead of the old hack.
9468
9469 2004-09-24  Martin Baulig  <martin@ximian.com>
9470
9471         * generic.cs (GenericConstraints): Moved here and made it an
9472         abstract class.
9473
9474         * support.cs (GenericConstraints): Moved to generic.cs.
9475
9476 2004-09-24  Martin Baulig  <martin@ximian.com>
9477
9478         * support.cs
9479         (ReflectionConstraints): Un-nested this class and made it public.
9480
9481         * typemanager.cs
9482         (TypeManager.GetTypeParameterConstraints): New public method.
9483         (TypeManager.HasConstructorConstraint): Use the attributes.
9484
9485 2004-09-24  Martin Baulig  <martin@ximian.com>
9486
9487         * support.cs (GenericConstraints): Replaced `HasConstructor',
9488         `IsReferenceType' and `IsValueType' with `Attributes'.
9489         (ReflectionParameters.ReflectionConstraints): Removed the Create()
9490         method and made the .ctor public.
9491
9492         * generic.cs (Constraints.Attributes): New public property.
9493         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
9494         `IsReferenceType' -> `HasReferenceTypeConstraint' and
9495         `IsValueType' -> `HasValueTypeConstraint'.
9496
9497 2004-09-23  Martin Baulig  <martin@ximian.com>
9498
9499         * generic.cs (Constraints): Reflect latest runtime changes.
9500
9501 2004-09-23  Martin Baulig  <martin@ximian.com>
9502
9503         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9504         (Convert.ImplicitReferenceConversionExists): Likewise.
9505
9506 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9507
9508         * class.cs (Operator.Define): Add error 448 and 559 report.
9509         
9510 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9511
9512         * class.cs (MemberBase.IsTypePermitted): New protected
9513         method for checking error CS0610.
9514
9515 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9516
9517         * class.cs (TypeContainer.HasExplicitLayout): New property
9518         Returns whether container has StructLayout attribute set Explicit.
9519         (FieldMember): New abstract class for consts and fields.
9520         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
9521         (Field): Reuse FieldMember.
9522
9523         * const.cs (Const): Reuse FieldMember.
9524
9525         * rootcontext.cs: EmitConstants call moved to class.
9526
9527 2004-09-22  Martin Baulig  <martin@ximian.com>
9528
9529         Marek and me just fixed one of our oldest bugs: #28562 :-)
9530
9531         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
9532
9533         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
9534         we're an EnumConstant, just return that.
9535         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
9536         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
9537         to get the value which'll actually be written into the attribute.
9538         However, we have to use GetValue() to access the attribute's value
9539         in the compiler.        
9540
9541 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9542
9543         * constant.cs (Constant.IsNegative): New abstract property
9544         IsNegative.
9545
9546         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
9547         (StackAlloc.DoResolve): Reused IsNegative.
9548
9549 2004-09-22  Martin Baulig  <martin@ximian.com>
9550
9551         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
9552         public method; like LookupTypeContainer, but also works for
9553         generic instances.
9554
9555         * report.cs (Report.SymbolRelatedToPreviousError): Use
9556         TypeManager.LookupGenericTypeContainer().       
9557
9558 2004-09-22  Martin Baulig  <martin@ximian.com>
9559
9560         Thanks to Peter Sestoft for this bug report.
9561
9562         * expression.cs (Conditional): If both the `trueExpr' and the
9563         `falseExpr' is a NullLiteral, return a NullLiteral.
9564
9565 2004-09-22  Martin Baulig  <martin@ximian.com>
9566
9567         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
9568         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
9569         for the "get_Current" call.
9570
9571 2004-09-21  Martin Baulig  <martin@ximian.com>
9572
9573         * convert.cs (Convert.ImplicitReferenceConversion): When
9574         converting to an interface type, first check whether we're
9575         converting from a reference type.
9576
9577 2004-09-14  Martin Baulig  <martin@ximian.com>
9578
9579         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
9580
9581 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
9582
9583         Fixed bug #61902
9584         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
9585         called and is obsolete then this member suppress message
9586         when call is inside next [Obsolete] method or type.
9587
9588         * expression.cs: Use TestObsoleteMethodUsage member.
9589
9590 2004-09-14  Martin Baulig  <martin@ximian.com>
9591
9592         * genericparser.cs: Removed.
9593
9594 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
9595
9596         * class.cs (MethodCore.CheckBase): Fix bug #65757.
9597
9598 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
9599
9600         * attribute.cs (Attribute.Resolve): Add error 653 report.
9601
9602         * class.cs (Class.ApplyAttributeBuilder): Add error 641
9603         report.
9604         (Method.ApplyAttributeBuilder): Add error 685 report.
9605         (Operator.Define): Add error 564 report.
9606
9607         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9608
9609         * expression.cs (Invocation.DoResolve): Add error
9610         245 and 250 report.
9611
9612         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9613         error 674 report.
9614
9615 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9616
9617         * class.cs (ConstructorInitializer.Resolve):
9618         Wrong error number (515->516).
9619
9620 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9621
9622         * class.cs (Indexer.Define): Add error 631 report.
9623
9624 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9625
9626         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9627
9628 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9629
9630         * expression.cs (Probe.DoResolve): Add error CS0241 report.
9631
9632 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
9633
9634         * cs-parser.jay: Added error CS0241 report.
9635
9636 2004-09-10  Raja R Harinath  <rharinath@novell.com>
9637
9638         * cs-parser.jay (fixed_statement): Introduce a scope for the
9639         declaration in the 'fixed' statement.
9640
9641 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9642
9643         * cs-parser.jay: Added CS0230 error report.
9644
9645 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9646
9647         * cs-parser.jay: Added errors CS0231 and CS0257 report.
9648
9649 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9650
9651         * expression.cs (Argument.Resolve): Added error CS0192 and
9652         CS0199 report.
9653
9654 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9655
9656         C# 2.0 #pragma warning feature
9657
9658         * cs-tokenizer.cs (PreProcessPragma): New method; 
9659         Handles #pragma directive.
9660
9661         * report.cs (WarningRegions): New class; Support
9662         class for #pragma warning directive. It tests whether
9663         warning is enabled for a given line.
9664
9665 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
9666
9667         * const.cs: Add more descriptive error report, tahnks to
9668         Sebastien. 
9669
9670 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
9671
9672         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9673
9674 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
9675
9676         * expression.cs: Apply patch from Ben: Remove dead code from
9677         ArrayCreation, and remove the TurnintoConstant call in const.cs,
9678         as that code just threw an exception anwyays.
9679
9680         * const.cs: Remove the call to the turnintoconstant, for details
9681         see bug: #63144
9682         
9683         * literal.cs: The type of the null-literal is the null type;  So
9684         we use a placeholder type (literal.cs:System.Null, defined here)
9685         for it.
9686
9687         * expression.cs (Conditional.DoResolve): Remove some old code that
9688         is no longer needed, conversions have been fixed.
9689
9690         (ArrayCreationExpression.DoResolve): Return false if we fail to
9691         resolve the inner expression.
9692
9693 2004-09-07  Raja R Harinath  <rharinath@novell.com>
9694
9695         Fix test-290.cs.
9696         * cs-parser.jay (delegate_declaration): Record a delegate
9697         declaration as a type declaration.
9698         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9699
9700 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
9701
9702         * parameter.cs: Do not crash if the type can not be resolved. 
9703
9704         * expression.cs: Report errors with unsafe pointers, fixes #64896
9705
9706 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9707
9708         * expression.cs: Pointer arith always needs to do a conv.i
9709         if the operand is a long. fix 65320
9710
9711 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9712
9713         Fixed cs0619-37.cs, cs0619-38.cs
9714
9715         * enum.cs (GetObsoleteAttribute): Removed.
9716
9717         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9718         on Enum member is double staged. The first is tested member
9719         and then enum.
9720
9721 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9722
9723         Fixed #56986, #63631, #65231
9724
9725         * class.cs: (TypeContainer.AddToMemberContainer): New method,
9726         adds member to name container.
9727         (TypeContainer.AddToTypeContainer): New method, adds type to
9728         name container.
9729         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9730         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9731         AddOperator): Simplified by reusing AddToMemberContainer.
9732         (TypeContainer.UserDefinedStaticConstructor): Changed to property
9733         instead of field.
9734         (Method.CheckForDuplications): Fixed implementation to test all
9735         possibilities.
9736         (MemberBase): Detection whether member is explicit interface
9737         implementation is now in constructor.
9738         (MemberBase.UpdateMemberName): Handles IndexerName.
9739         (Accessor): Changed to keep also location information.
9740         (AbstractPropertyEventMethod): Is derived from MemberCore.
9741         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9742         will be emited or not.
9743         (PropertyBase.AreAccessorsDuplicateImplementation):
9744         Tests whether accessors are not in collision with some method.
9745         (Operator): Is derived from MethodCore to simplify common
9746         operations.
9747
9748         * decl.cs (Flags.TestMethodDuplication): Test for duplication
9749         must be performed.
9750         (DeclSpace.AddToContainer): Adds the member to defined_names
9751         table. It tests for duplications and enclosing name conflicts.
9752
9753         * enum.cs (EnumMember): Clean up to reuse the base structures
9754
9755 2004-09-03  Martin Baulig  <martin@ximian.com>
9756
9757         Merged latest changes into gmcs.  Please keep this comment in
9758         here, it makes it easier for me to see what changed in MCS since
9759         the last time I merged.
9760
9761 2004-09-03  Martin Baulig  <martin@ximian.com>
9762
9763         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9764         into TypeContainer, to make partial classes work again.
9765
9766 2004-09-03  Martin Baulig  <martin@ximian.com>
9767
9768         * rootcontext.cs (RootContext.V2): Removed.
9769
9770 2004-03-23  Martin Baulig  <martin@ximian.com>
9771
9772         * expression.cs (Invocation.OverloadResolve): Added `bool
9773         may_fail' argument and use it instead of the Location.IsNull() hack.
9774
9775 2004-09-09  Martin Baulig  <martin@ximian.com>
9776
9777         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
9778
9779 2004-09-09  Martin Baulig  <martin@ximian.com>
9780
9781         * generic.cs (TypeParameter.DefineType): Added support for
9782         explicit interface methods.
9783
9784 2004-09-09  Martin Baulig  <martin@ximian.com>
9785
9786         * README.Changes: New document.  Started to list important changes
9787         between MCS and GMCS here.
9788
9789 2004-09-08  Martin Baulig  <martin@ximian.com>
9790
9791         * class.cs
9792         (TypeContainer.CheckRecursiveDefinition): New protected method.
9793         (TypeContainer.DefineType): Move the CS0146 check into
9794         CheckRecursiveDefinition().     
9795
9796 2004-09-06  Martin Baulig  <martin@ximian.com>
9797
9798         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
9799         types for the constructor constraint.
9800
9801 2004-09-03  Martin Baulig  <martin@ximian.com>
9802
9803         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9804         into TypeContainer, to make partial classes work again.
9805
9806 2004-09-03  Martin Baulig  <martin@ximian.com>
9807
9808         * rootcontext.cs (RootContext.V2): Removed.
9809
9810 2004-03-23  Martin Baulig  <martin@ximian.com>
9811
9812         * expression.cs (Invocation.OverloadResolve): Added `bool
9813         may_fail' argument and use it instead of the Location.IsNull() hack.
9814
9815 2004-09-03  Martin Baulig  <martin@ximian.com>
9816
9817         Merged latest changes into gmcs.  Please keep this comment in
9818         here, it makes it easier for me to see what changed in MCS since
9819         the last time I merged.
9820
9821 2004-09-03  Raja R Harinath  <rharinath@novell.com>
9822
9823         Fix #61128.
9824         * expression.cs (BetterConversion): Don't allow either conversion 
9825         to be null.  Remove redundant implicit conversion test when 'q ==
9826         null' -- when this function is invoked, we already know that the
9827         implicit conversion exists.
9828         (BetterFunction): Assume that 'best' is non-null.  Remove
9829         redundant reimplementation of IsApplicable when 'best' is null.
9830         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9831         number of arguments.
9832         (IsAncestralType): Extract from OverloadResolve.
9833         (OverloadResolve): Make robust to the MethodGroupExpr being
9834         unsorted.  Implement all the logic of Section 14.5.5.1, and
9835         support overloading of methods from multiple applicable types.
9836         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
9837
9838         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9839         (RealError, Warning): Append type of report to related symbol.
9840
9841 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
9842
9843         * enum.cs: Fixed CLS-Compliance checks for enum members.
9844         Error tests cs3008-8.cs, cs3014-8.cs
9845
9846 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9847
9848         Fixed bug #62342, #63102
9849         * class.cs: ImplementIndexer uses member.IsExplicitImpl
9850         like ImplementMethod.
9851
9852 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9853
9854         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9855         Fixed bug #65170.
9856
9857 2004-09-02  Martin Baulig  <martin@ximian.com>
9858
9859         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9860         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9861         on the MethodBase.
9862
9863 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
9864
9865         C# 2.0 Static classes implemented
9866
9867         * class.cs (TypeContainer): instance_constructors,
9868         initialized_fields, initialized_static_fields,
9869         default_constructor, base_inteface_types are protected to be
9870         accessible from StaticClass.
9871         (TypeContainer.DefineDefaultConstructor): New virtual method
9872         for custom default constructor generating
9873         (StaticClass): New class to handle "Static classes" feature.
9874
9875         * cs-parser.jay: Handle static keyword on class like instance
9876         of StaticClass.
9877
9878         * driver.cs: Added "/langversion" command line switch with two
9879         options (iso-1, default).
9880
9881 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
9882
9883         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9884
9885 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
9886
9887         * delegate.cs: Style.
9888
9889 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9890
9891         * delegate.cs: Add seperate instance expr field for miguel.
9892
9893 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9894
9895         * PointerArithmetic (Resolve): make sure we are not doing
9896         pointer arith on void*. Also, make sure we are resolved
9897         by not setting eclass until resolve.
9898
9899         All callers: Make sure that PointerArithmetic gets resolved.
9900
9901 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9902
9903         * ArrayCreation (LookupType): If the type does not resolve 
9904         to an array, give an error.
9905
9906 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
9907
9908         * statement.cs (Try.Resolve): Fixed bug #64222
9909
9910 2004-08-27  Martin Baulig  <martin@ximian.com>
9911
9912         * class.cs
9913         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9914         crash here.     
9915
9916 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9917
9918         * ecore.cs (Constantify): Get underlying type via
9919         System.Enum.GetUnderlyingType to avoid StackOverflow on the
9920         Windows in special cases.
9921
9922 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9923
9924         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9925         for obtaining also private methods.
9926         (GetRemoveMethod): Used GetRemoveMethod (true)
9927         for obtaining also private methods.
9928
9929 2004-09-02  Martin Baulig  <martin@ximian.com>
9930
9931         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9932         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9933         on the MethodBase.
9934
9935 2004-08-27  Martin Baulig  <martin@ximian.com>
9936
9937         * class.cs
9938         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9939         crash here.     
9940
9941 2004-08-25  Martin Baulig  <martin@ximian.com>
9942
9943         * support.cs (ReflectionParameters..ctor): If this is a generic
9944         method, retrieve and store its type parameters.
9945         (InternalParameters..ctor): Added `TypeParameter[]' argument.
9946         (ReflectionParameters.GenericConstraints): The argument specifies
9947         the type parameter, not the method parameter.
9948         (InternalParameters.GenericConstraints): Likewise.
9949
9950         * generic.cs (TypeParameter.DefineType): Correctly handle
9951         constraints wrt. generic methods in interfaces and their
9952         implementations.        
9953
9954 2004-08-24  Martin Baulig  <martin@ximian.com>
9955
9956         * generic.cs (TypeParameter.IsSubclassOf): New public method.
9957         (Constraints.IsSubclassOf): New internal method.
9958
9959         * typemanager.cs (TypeManager.FindMembers): Added special support
9960         for GenericTypeParameterBuilder's.      
9961         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
9962         type parameters.
9963
9964 2004-08-24  Martin Baulig  <martin@ximian.com>
9965
9966         * typemanager.cs
9967         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
9968         this for accessibility checks.
9969         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
9970         IsNestedFamilyAccessible.
9971         (TypeManager.IsSubclassOf): New method, do what the name actually
9972         says.   
9973
9974 2004-08-24  Martin Baulig  <martin@ximian.com>
9975
9976         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
9977         as a SimpleName, include the generic arity.
9978
9979 2004-08-24  Martin Baulig  <martin@ximian.com>
9980
9981         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9982         MethodAttributes.HideBySig for operators.
9983
9984 2004-08-23  Martin Baulig  <martin@ximian.com>
9985
9986         Back to the old error reporting system :-)
9987
9988         * report.cs (Message): Removed.
9989         (Report.MessageData, ErrorData, WarningData): Removed.
9990         (Report.Error, Warning): Back to the old system.
9991
9992 2004-08-23  Martin Baulig  <martin@ximian.com>
9993
9994         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9995
9996         * class.cs (TypeContainer.ParentContainer): New public virtual
9997         method; replaces the explicit interface implementation.
9998         (ClassPart.ParentContainer): Override.
9999
10000 2004-08-23  Martin Baulig  <martin@ximian.com>
10001
10002         * statement.cs (Switch): Added support for constant switches; see
10003         #59428 or test-285.cs.
10004
10005 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
10006
10007         Fixed bug #62740.
10008         * statement.cs (GetEnumeratorFilter): Removed useless
10009         logic because C# specs is strict. GetEnumerator must be
10010         public.
10011
10012 2004-08-22  Martin Baulig  <martin@ximian.com>
10013
10014         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10015         a switch and may break, reset the barrier.  Fixes #59867.
10016
10017 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
10018
10019         CLS-Compliance speed up (~5% for corlib)
10020
10021         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
10022         New method. Tests container for CLS-Compliant names
10023
10024         * class.cs (TypeContainer.VerifyClsName): New method.
10025         Checks whether container name is CLS Compliant.
10026         (Constructor): Implements IMethodData.
10027
10028         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
10029         low-case table for CLS Compliance test.
10030         (MemberCache.VerifyClsParameterConflict): New method.
10031         Checks method parameters for CS3006 error.
10032
10033         * enum.cs (EnumMember): Is derived from MemberCore.
10034         (Enum.VerifyClsName): Optimized for better performance.
10035
10036 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
10037
10038         * report.cs: Renamed Error_T to Error and changed all
10039         references.
10040
10041 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
10042
10043         * class.cs (TypeContainer.IndexerArrayList): New inner class
10044         container for indexers.
10045         (TypeContainer.DefaultIndexerName): New constant for default
10046         indexer name. Replaced all "Item" with this constant.
10047         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
10048
10049         * typemanager.cs (TypeManager.default_member_ctor): Cache here
10050         DefaultMemberAttribute constructor.
10051
10052 2004-08-05  Martin Baulig  <martin@ximian.com>
10053
10054         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
10055         Fix bug #59429.
10056
10057 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
10058
10059         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
10060         multi platforms problem.
10061
10062         * compiler.csproj: Included shared files.
10063
10064 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10065
10066         Fix bug 60333, 55971 in the more general way
10067         * attribute.cs (Attribute.GetAttributeArgumentExpression):
10068         Added arg_type argument for constant conversion.
10069         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
10070
10071 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10072
10073         Fix bug #59760
10074         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
10075         OperatorArrayList, MethodCoreArrayList for typecontainer
10076         containers. Changed class member types to these new types.
10077         (MethodArrayList.DefineMembers): Added test for CS0659.
10078
10079 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
10080
10081         * cfold.cs: Synchronize the folding with the code in expression.cs
10082         Binary.DoNumericPromotions for uint operands.
10083
10084         * attribute.cs: Revert patch from Raja, it introduced a regression
10085         while building Blam-1.2.1 (hard to isolate a test case).
10086
10087 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10088
10089         Fix for #55382
10090         * class.cs:
10091         (TypeContainer.Define): Renamed to DefineContainerMembers because of
10092         name collision.
10093         (MethodCore.parent_method): New member. The method we're overriding
10094         if this is an override method.
10095         (MethodCore.CheckBase): Moved from Method class and made common.
10096         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
10097         private.
10098         (MethodCore.CheckForDuplications): New abstract method. For custom
10099         member duplication search in a container
10100         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
10101         method and its return type.
10102         (Event.conflict_symbol): New member. Symbol with same name in the
10103         parent class.
10104
10105         * decl.cs:
10106         (MemberCache.FindMemberWithSameName): New method. The method
10107         is looking for conflict with inherited symbols.
10108
10109 2004-08-04  Martin Baulig  <martin@ximian.com>
10110
10111         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10112
10113         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10114
10115 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10116
10117         * report.cs (Message): New enum for better error, warning reference in
10118         the code.
10119         (MessageData): New inner abstract class. It generally handles printing of
10120         error and warning messages.
10121         Removed unused Error, Warning, Message methods.
10122
10123 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10124
10125         Fix for cs0592-8.cs test
10126         * attribute.cs
10127         (Attributable.ValidAttributeTargets): Made public.
10128         (Attribute.ExplicitTarget): New member for explicit target value.
10129         (Attribute.CheckTargets): Now we translate explicit attribute
10130         target to Target here.
10131
10132 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
10133
10134         * ecore.cs (MethodGroupExpr): new IsBase property.
10135
10136         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
10137
10138         * delegate.cs (DelegateCreation): store a MethodGroupExpr
10139         rather than an instance expr.
10140
10141         (DelegateCreation.Emit): Use the method group rather than
10142         the instance expression. Also, if you have base.Foo as the
10143         method for a delegate, make sure to emit ldftn, not ldftnvirt.
10144
10145         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
10146
10147         (NewDelegate.DoResolve): Only check for the existance of Invoke
10148         if the method is going to be needed. Use MethodGroupExpr.
10149
10150         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
10151
10152         * expression.cs: For pointer arith., make sure to use
10153         the size of the type, not the size of the pointer to
10154         the type.
10155
10156 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10157
10158         Fix for #60722
10159         * class.cs (Class): Added error CS0502 test.
10160
10161 2004-08-03  John Luke  <jluke@cfl.rr.com>
10162             Raja R Harinath  <rharinath@novell.com>
10163
10164         Fix for #60997.
10165         * attribute.cs (Attribute.complained_before): New flag.
10166         (Attribute.ResolveType, Attribute.Resolve),
10167         (Attribute.DefinePInvokeMethod): Set it.
10168         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
10169         
10170 2004-08-03  Martin Baulig  <martin@ximian.com>
10171
10172         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10173         use a user-defined operator; we still need to do numeric
10174         promotions in case one argument is a builtin type and the other
10175         one has an implicit conversion to that type.  Fixes #62322.
10176
10177 2004-08-18  Martin Baulig  <martin@ximian.com>
10178
10179         * class.cs (Method.Define): Use the correct method name when
10180         creating the MethodBuilder for a generic method.
10181
10182 2004-08-17  Martin Baulig  <martin@ximian.com>
10183
10184         * generic.cs (Constraints): Support type parameter constraints.
10185
10186 2004-08-16  Martin Baulig  <martin@ximian.com>
10187
10188         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
10189         (Token.GENERIC_DIMENSION): New token; this is returned if we
10190         encounter an unbound generic type in a typeof() expression.
10191
10192         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
10193         this token is only generated while parsing a typeof() expression.
10194         (typeof_expression): Removed the old unbound_type hack.
10195
10196         * generic.cs (TypeArguments.IsUnbound): New public property.
10197
10198         * decl.cs (MemberName): Added support for unbound types.
10199
10200 2004-08-14  Martin Baulig  <martin@ximian.com>
10201
10202         * typemanager.cs
10203         (TypeManager.IsEqualGenericInstance): New static method.
10204         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
10205         just used to check accessibility, so follow the rules of 26.1.6.        
10206
10207         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
10208         ConstructedType instead of a TypeExpression if we have type arguments.
10209
10210         * cs-parser.jay (typeof_expression): Support unbound generic types.
10211
10212         * ecore.cs (UnboundTypeExpression): New public class.
10213
10214 2004-08-12  Martin Baulig  <martin@ximian.com>
10215
10216         * typemanager.cs (TypeManager.IsNestedChildOf): Use
10217         TypeManager.IsEqual() rather than `=='.
10218
10219         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
10220         generic instances as well.
10221
10222 2004-08-12  Martin Baulig  <martin@ximian.com>
10223
10224         * expression.cs (Invocation.InferType): We can only infer method
10225         type parameters.  Fixes #62647.
10226
10227 2004-08-11  Martin Baulig  <martin@ximian.com>
10228
10229         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
10230         before resolving the base classes.
10231
10232 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10233
10234         * Makefile: install .mdb file too.
10235
10236 2004-08-05  Martin Baulig  <martin@ximian.com>
10237
10238         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
10239         initializer, the current type is just the TypeBuilder, not the
10240         instantiated generic type.
10241         (FieldExpr.IsFieldInitializer): New public property.
10242
10243 2004-08-04  Martin Baulig  <martin@ximian.com>
10244
10245         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10246
10247         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10248
10249 2004-08-03  Martin Baulig  <martin@ximian.com>
10250
10251         * class.cs (MethodData.Define): If we're an explicit
10252         implementation, remove the generic arity from the type name.
10253
10254 2004-08-03  Martin Baulig  <martin@ximian.com>
10255
10256         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10257         use a user-defined operator; we still need to do numeric
10258         promotions in case one argument is a builtin type and the other
10259         one has an implicit conversion to that type.  Fixes #62322.
10260
10261 2004-08-02  Martin Baulig  <martin@ximian.com>
10262
10263         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
10264         `TypeExpr[]' array.
10265         (TypeContainer.GetClassBases): Return the unexpanded list of
10266         interfaces; we expand them later.
10267         (TypeContainer.DefineType): After creating the TypeBuilder, call
10268         TypeManager.ExpandInterfaces() to get an expanded and resolved
10269         list of interfaces.
10270
10271         * ecore.cs (TypeExpr.GetInterfaces): Removed
10272
10273         * generics.cs (Constraints.InterfaceConstraints): Remove.
10274         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
10275         register the interface constraints.
10276
10277         * typemanager.cs
10278         (TypeManager.AddUserType): Removed the `ifaces' argument.
10279         (TypeManager.AddTypeParameter): Likewise.
10280         (TypeManager.AddUserInterface): Removed, was unused.
10281         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
10282         `TypeExpr[]' array for the interfaces.
10283         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
10284         has been defined, returns a list of the resolved interfaces types.
10285         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
10286         (TypeManager.GetExplicitInterfaces): Likewise.  
10287
10288 2004-08-02  Martin Baulig  <martin@ximian.com>
10289
10290         * expression.cs (Invocation.EmitCall): If we're invoking a method
10291         on a type parameter, use the new `Constrained' prefix opcode.
10292
10293 2004-08-02  Martin Baulig  <martin@ximian.com>
10294
10295         * statement.cs (LocalInfo.Flags): Added `IsThis'.
10296         (LocalInfo.IsThis): New public property.
10297         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10298
10299 2004-08-01  Martin Baulig  <martin@ximian.com>
10300
10301         * class.cs (TypeContainer.GetClassBases): Don't set the default
10302         here since we may get called from GetPartialBases().
10303         (TypeContainer.DefineType): If GetClassBases() didn't return a
10304         parent, use the default one.
10305
10306 2004-07-30  Martin Baulig  <martin@ximian.com>
10307
10308         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10309
10310         * class.cs (SourceMethod): New public class, derive from the
10311         symbol writer's ISourceMethod.
10312         (Method): Use the new symbol writer API.
10313
10314         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10315         as argument and use the new symbol writer.
10316
10317         * location.cs
10318         (SourceFile): Implement the symbol writer's ISourceFile.
10319         (Location.SymbolDocument): Removed.
10320         (Location.SourceFile): New public property.
10321
10322         * symbolwriter.cs: Use the new symbol writer API.
10323
10324 2004-07-30  Raja R Harinath  <rharinath@novell.com>
10325
10326         * Makefile (install-local): Remove.  Functionality moved to
10327         executable.make.
10328
10329 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
10330
10331         * Makefile: Install mcs.exe.config file together with mcs.exe.
10332         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10333         correct runtime version.
10334         
10335 2004-07-25  Martin Baulig  <martin@ximian.com>
10336
10337         * class.cs
10338         (TypeContainer.RegisterOrder): Removed, this was unused.
10339         (TypeContainer, interface_order): Removed.
10340         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10341         TypeContainer as argument since we can also be called with a
10342         `PartialContainer' for a partial class/struct/interface.
10343         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10344         of checking whether we're an `Interface' - we could be a
10345         `PartialContainer'.
10346         (PartialContainer.Register): Override; call
10347         AddClass()/AddStruct()/AddInterface() on our parent.
10348
10349         * cs-parser.jay (interface_member_declaration): Add things to the
10350         `current_container', not the `current_class'.
10351
10352         * rootcontext.cs (RegisterOrder): The overloaded version which
10353         takes an `Interface' was unused, removed.
10354
10355         * typemanager.cs (TypeManager.LookupInterface): Return a
10356         `TypeContainer', not an `Interface'.
10357         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10358         contain a `PartialContainer' for an interface, so check it's
10359         `Kind' to figure out what it is.
10360
10361 2004-07-25  Martin Baulig  <martin@ximian.com>
10362
10363         * class.cs (Class.DefaultTypeAttributes): New public constant.
10364         (Struct.DefaultTypeAttributes): Likewise.
10365         (Interface.DefaultTypeAttributes): Likewise.
10366         (PartialContainer.TypeAttr): Override this and add the
10367         DefaultTypeAttributes.
10368
10369 2004-07-25  Martin Baulig  <martin@ximian.com>
10370
10371         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10372         we can just use the `Parent' field instead.
10373
10374 2004-07-25  Martin Baulig  <martin@ximian.com>
10375
10376         * class.cs (TypeContainer.Emit): Renamed to EmitType().
10377
10378 2004-07-25  Martin Baulig  <martin@ximian.com>
10379
10380         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10381         our parts before defining any methods.
10382         (TypeContainer.VerifyImplements): Make this virtual.
10383         (ClassPart.VerifyImplements): Override and call VerifyImplements()
10384         on our PartialContainer.
10385
10386 2004-07-25  Martin Baulig  <martin@ximian.com>
10387
10388         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10389
10390         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10391         argument, we can just use the `Parent' field instead.
10392
10393         * class.cs
10394         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
10395         (MemberBase.DoDefine): Likewise.
10396
10397 2004-07-24  Martin Baulig  <martin@ximian.com>
10398
10399         * decl.cs (MemberCore.Parent): New public field.
10400         (DeclSpace.Parent): Moved to MemberCore.
10401
10402         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10403         (MemberBase.ctor): Added TypeContainer argument, pass it to our
10404         parent's .ctor.
10405         (FieldBase, Field, Operator): Likewise.
10406         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10407         (EventField, Event): Likewise.
10408
10409 2004-07-23  Martin Baulig  <martin@ximian.com>
10410
10411         * class.cs (PartialContainer): New public class.
10412         (ClassPart): New public class.
10413         (TypeContainer): Added support for partial classes.
10414         (TypeContainer.GetClassBases): Splitted some of the functionality
10415         out into GetNormalBases() and GetPartialBases().
10416
10417         * cs-tokenizer.cs (Token.PARTIAL): New token.
10418         (Tokenizer.consume_identifier): Added some hacks to recognize
10419         `partial', but only if it's immediately followed by `class',
10420         `struct' or `interface'.
10421
10422         * cs-parser.jay: Added support for partial clases.
10423
10424 2004-07-23  Martin Baulig  <martin@ximian.com>
10425
10426         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10427         a `DeclSpace' and also made it readonly.
10428         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10429         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10430         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10431
10432         * cs-parser.jay: Pass the `current_class', not the
10433         `current_container' (at the moment, this is still the same thing)
10434         to a new Method, Property, Event, Indexer or Constructor.
10435
10436 2004-07-23  Martin Baulig  <martin@ximian.com>
10437
10438         * cs-parser.jay (CSharpParser): Added a new `current_class' field
10439         and removed the `current_interface' one.
10440         (struct_declaration, class_declaration, interface_declaration):
10441         Set `current_class' to the newly created class/struct/interface;
10442         set their `Bases' and call Register() before parsing their body.
10443
10444 2004-07-23  Martin Baulig  <martin@ximian.com>
10445
10446         * class.cs (Kind): New public enum.
10447         (TypeContainer): Made this class abstract.
10448         (TypeContainer.Kind): New public readonly field.
10449         (TypeContainer.CheckDef): New public method; moved here from
10450         cs-parser.jay.
10451         (TypeContainer.Register): New public abstract method.
10452         (TypeContainer.GetPendingImplementations): New public abstract
10453         method.
10454         (TypeContainer.GetClassBases): Removed the `is_class' and
10455         `is_iface' parameters.
10456         (TypeContainer.DefineNestedTypes): Formerly known as
10457         DoDefineType().
10458         (ClassOrStruct): Made this class abstract.
10459
10460         * tree.cs (RootTypes): New public type. 
10461
10462 2004-07-20  Martin Baulig  <martin@ximian.com>
10463
10464         * tree.cs (Tree.RecordNamespace): Removed.
10465         (Tree.Namespaces): Removed.
10466
10467         * rootcontext.cs (RootContext.IsNamespace): Removed.
10468
10469         * cs-parser.jay (namespace_declaration): Just create a new
10470         NamespaceEntry here.
10471
10472 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
10473
10474         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
10475         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
10476         entry to make sure it runs in the correct runtime version.
10477         
10478 2004-07-18  Martin Baulig  <martin@ximian.com>
10479
10480         * generic.cs (ConstructedType.CheckConstraints): Improved
10481         constraints checking.
10482
10483 2004-07-18  Martin Baulig  <martin@ximian.com>
10484
10485         * expression.cs (Invocation.BetterMethod): Call
10486         TypeManager.TypeToCoreType() on all types and removed my previous
10487         hack; we're already doig the right thing here.
10488
10489 2004-07-17  Martin Baulig  <martin@ximian.com>
10490
10491         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
10492
10493 2004-07-16  Martin Baulig  <martin@ximian.com>
10494
10495         * iterators.cs: Added generics support.
10496
10497 2004-07-16  Martin Baulig  <martin@ximian.com>
10498
10499         * iterators.cs: Rewrote this.  We're now using one single Proxy
10500         class for both the IEnumerable and the IEnumerator interface and
10501         `Iterator' derives from Class so we can use the high-level API.
10502
10503         * class.cs (TypeContainer.AddIterator): New method.
10504         (TypeContainer.DoDefineType): New protected virtual method, which
10505         is called from DefineType().
10506         (TypeContainer.DoDefineMembers): Call DefineType() and
10507         DefineMembers() on all our iterators.
10508         (TypeContainer.Emit): Call Emit() on all our iterators.
10509         (TypeContainer.CloseType): Call CloseType() on all our iterators.
10510
10511         * codegen.cs (EmitContext.CurrentIterator): New public field.
10512
10513 2004-07-15  Martin Baulig  <martin@ximian.com>
10514
10515         * typemanager.cs
10516         (TypeManager.not_supported_exception_type): New type.   
10517
10518 2004-07-14  Martin Baulig  <martin@ximian.com>
10519
10520         * typemanager.cs
10521         (TypeManager.generic_ienumerable_type): New type.
10522         (TypeManager.generic_ienumerator_type): New type.
10523
10524         * rootcontext.cs
10525         (RootContext.interfaces_first_stage): Added
10526         "System.Collections.Generic.IEnumerator`1" and
10527         "System.Collections.Generic.IEnumerable`1".     
10528
10529 2004-07-14  Martin Baulig  <martin@ximian.com>
10530
10531         * iterators.cs: Use real error numbers.
10532
10533 2004-07-14  Martin Baulig  <martin@ximian.com>
10534
10535         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
10536         requires this to be a System.Collection.IEnumerable and not a
10537         class implementing that interface.
10538         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
10539
10540 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
10541
10542         * class.cs: Fixed previous fix, it broke some error tests.
10543
10544 2004-07-12  Martin Baulig  <martin@ximian.com>
10545
10546         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
10547         Fixes #61293.
10548
10549 2004-07-14  Martin Baulig  <martin@ximian.com>
10550
10551         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
10552         an exclamation mark (!) for the generic arity to reflect the
10553         latest spec changes; ie. use "System.Collections.Generic.IList`1".
10554
10555 2004-07-13  Martin Baulig  <martin@ximian.com>
10556
10557         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
10558         specifiers being part of a type argument.
10559
10560 2004-07-13  Martin Baulig  <martin@ximian.com>
10561
10562         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
10563         name for generic types.
10564
10565 2004-07-13  Martin Baulig  <martin@ximian.com>
10566
10567         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
10568         bit to fix #60119.
10569
10570 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
10571
10572         * assign.cs (LocalTemporary): Add new argument: is_address,If
10573         `is_address' is true, then the value that we store is the address
10574         to the real value, and not the value itself.
10575         
10576         * ecore.cs (PropertyExpr): use the new local temporary
10577         stuff to allow us to handle X.Y += z (where X is a struct)
10578
10579 2004-07-08  Martin Baulig  <martin@ximian.com>
10580
10581         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
10582         not always return, just like we're doing in Using.Resolve().
10583
10584 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
10585
10586         * cs-parser.jay (fixed_statement): flag this as Pinned.
10587
10588 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
10589
10590         * typemanager.cs (TypeManager): Removed MakePinned method, this
10591         mechanism is replaced with the .NET 2.x compatible mechanism of
10592         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
10593
10594         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
10595         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
10596         `IsFixed' property which has a different meaning.
10597
10598 2004-07-02  Raja R Harinath  <rharinath@novell.com>
10599
10600         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
10601         visible from inside a nested class, not just the names of the
10602         immediately enclosing class.
10603         Fix for bug #60730.
10604
10605 2004-06-24  Raja R Harinath  <rharinath@novell.com>
10606
10607         * expression.cs (BetterConversion): Remove buggy special-case
10608         handling of "implicit constant expression conversions".  At this
10609         point, we already know that the conversion is possible -- we're
10610         only checking to see which is better.
10611
10612 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10613
10614         * cs-parser.jay: Added error CS0210 test.
10615
10616 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10617
10618         * cs-parser.jay: Added error CS0134 test.
10619
10620 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10621
10622         Fix bug #52507
10623         * cs-parser.jay: Added error CS0145 test.
10624
10625 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10626
10627         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
10628
10629 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
10630         
10631         * expression.cs (StackAlloc.Resolve): The argument may not
10632         be a constant; deal with this case.
10633         
10634 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
10635
10636         * attribute.cs (IndexerName_GetIndexerName): Renamed to
10637         GetIndexerAttributeValue.
10638         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10639
10640         * class.cs (Indexer.Define): Added error tests for CS0415,
10641         CS0609.
10642
10643 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
10644
10645         * attribute.cs (Attribute.Resolve): Keep field code in sync with
10646         property code.
10647
10648 2004-06-23  Martin Baulig  <martin@ximian.com>
10649
10650         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
10651         neither return nor throw, reset the barrier as well.  Fixes #60457.
10652
10653 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
10654
10655         * class.cs : EventAttributes is now set to None by default.
10656           This fixes bug #60459.
10657
10658 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10659
10660         Fix bug #60219
10661         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10662         Don't throw exception but return null (it's sufficient now).
10663
10664 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10665
10666         * typemanager.cs (GetArgumentTypes): Faster implementation.
10667
10668 2004-06-18  Martin Baulig  <martin@ximian.com>
10669
10670         * attribute.cs (Attribute.Resolve): Check whether we're an
10671         EmptyCast which a Constant child.  Fixes #60333.
10672
10673 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
10674
10675         * statement.cs (EmitCollectionForeach): Account for the fact that
10676         not all valuetypes are in areas which we can take the address of.
10677         For these variables, we store to a temporary variable. Also, make
10678         sure that we dont emit a `callvirt' on a valuetype method.
10679
10680 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10681
10682         * expression.cs (StackAlloc.DoReSolve): Added test for
10683         negative parameter (CS0247).
10684
10685 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10686
10687         Fix bug #59792
10688         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
10689
10690 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10691
10692         Fix bug #59781
10693         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10694         ulong.
10695
10696 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10697
10698         Fix bug #58254 & cs1555.cs, cs1556.cs
10699         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10700
10701 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10702
10703         * cs-parser.jay: Added error CS1669 test for indexers.
10704
10705 2004-06-18  Martin Baulig  <martin@ximian.com>
10706
10707         * generics.cs (GenericMethod.ctor): Don't take an Attributes
10708         argument.  Fixes #60441.
10709
10710 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
10711         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
10712         The name needs to have the actual name of the method in order
10713         for other tests (such as the one in OverloadResolve for Invoke
10714         on a delegate) to work. As well, it does not really help
10715         error reporting because the method group had multiple methods.
10716         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
10717         Make profiling work.
10718         
10719 2004-06-13  Martin Baulig  <martin@ximian.com>
10720
10721         * cs-parser.jay: Don't allow generic attributes.
10722
10723 2004-06-13  Martin Baulig  <martin@ximian.com>
10724
10725         * class.cs (MemberBase.DoDefineBase): New protected method.
10726         (MemberBase.DoDefine): Compute the `flags' in the new
10727         DoDefineBase() which must be called first.
10728         (Method.Define): Call DoDefineBase() first so we have the flags
10729         when defining the generic method.
10730
10731         * cs-parser.jay (interface_method_declaration): Support generic methods.
10732
10733 2004-06-13  Martin Baulig  <martin@ximian.com>
10734
10735         * decl.cs (TypeName): Removed.
10736         (MemberName): Removed TypeName and MemberNow; now we just have
10737         MemberName.
10738
10739         * cs-parser.jay: Don't distinguish between type arguments and type
10740         parameters in the grammar and simplified the rules a bit.  The
10741         reduce/reduce conflicts are now gone (except the one we inherited
10742         from mcs).
10743
10744 2004-06-11  Martin Baulig  <martin@ximian.com>
10745
10746         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10747         call this twice: for params and varargs methods.
10748
10749 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10750
10751         * class.cs:
10752         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10753
10754 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10755
10756         * attribute.cs (Attribute.GetValidTargets): Made public.
10757
10758         * class.cs: 
10759         (AbstractPropertyEventMethod): New class for better code sharing.
10760         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10761         CS1667 report.
10762         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10763
10764 2004-06-09  Martin Baulig  <martin@ximian.com>
10765
10766         * cs-parser.jay: Removed a reduce/reduce conflict.
10767
10768 2004-06-03  Martin Baulig  <martin@ximian.com>
10769
10770         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
10771         GetSimpleName() and return a SimpleName.
10772
10773         * ecore.cs (SimpleName.Arguments): New public field.
10774         (SimpleName): Added overloaded ctor which takes an additional
10775         TypeArguments argument.
10776         (SimpleName.SimpleNameResolve): Added support for generic methods.
10777         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
10778         formerly in MemberAccess.DoResolve(), but we also need it in
10779         SimpleNameResolve().
10780
10781         * expression.cs (MemberAccess.DoResolve): Use the new
10782         MethodGroupExpr.ResolveGeneric().       
10783
10784 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10785
10786         * decl.cs: If possible, use lookuptypedirect here. We can only do
10787         this if there is no `.' after the namespace. Avoids using
10788         LookupType, which does lots of slow processing.
10789         (FindNestedType) New method, does what it says :-).
10790         * namespace.cs: use LookupTypeDirect.
10791         * rootcontext.cs: use membercache, if possible.
10792         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10793
10794 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10795
10796         * expression.cs:
10797         According to the spec, 
10798
10799         In a member access of the form E.I, if E is a single identifier,
10800         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10801         field, property, localvariable, or parameter with the same type as
10802         the meaning of E as a type-name (§3.8), then both possible
10803         meanings of E are permitted.
10804
10805         We did not check that E as a simple-name had the same type as E as
10806         a type name.
10807
10808         This trivial check gives us 5-7% on bootstrap time.
10809
10810 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10811
10812         * expression.cs (Invocation.OverloadResolve): Avoid the
10813         use of hashtables and boxing here by allocating on demand.
10814
10815 2004-05-30  Martin Baulig  <martin@ximian.com>
10816
10817         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10818         we're doing a silent lookup.  Don't try to lookup nested types in
10819         TypeManager.object_type (thanks to Ben Maurer).
10820
10821 2004-05-30  Martin Baulig  <martin@ximian.com>
10822
10823         Committing a patch from Ben Maurer.
10824
10825         * rootcontext.cs (RootContext.LookupType): Cache negative results.
10826
10827 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10828
10829         * convert.cs: add a trivial cache for overload operator resolution.
10830
10831 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
10832
10833         * attribute.cs
10834         (AttributeTester.GetObsoleteAttribute): Returns instance of
10835         ObsoleteAttribute when type is obsolete.
10836
10837         * class.cs
10838         (TypeContainer.VerifyObsoleteAttribute): Override.
10839         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10840         (MethodCode.VerifyObsoleteAttribute): Override.
10841         (MemberBase.VerifyObsoleteAttribute): Override.
10842
10843         * decl.cs
10844         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10845         and report proper error.
10846
10847         *delegate.cs
10848         (Delegate.VerifyObsoleteAttribute): Override.
10849
10850         * ecore.cs
10851         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10852         and report proper error.
10853         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10854
10855         * enum.cs
10856         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10857         and enum member.
10858
10859         * expression.cs
10860         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10861         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10862         Added test for ObsoleteAttribute.
10863
10864         * statement.cs
10865         (Catch): Derived from Statement.
10866
10867 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10868
10869         * decl.cs: If possible, use lookuptypedirect here. We can only do
10870         this if there is no `.' after the namespace. Avoids using
10871         LookupType, which does lots of slow processing.
10872         (FindNestedType) New method, does what it says :-).
10873         * namespace.cs: use LookupTypeDirect.
10874         * rootcontext.cs: use membercache, if possible.
10875         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10876
10877 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10878
10879         * expression.cs:
10880         According to the spec, 
10881
10882         In a member access of the form E.I, if E is a single identifier,
10883         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10884         field, property, localvariable, or parameter with the same type as
10885         the meaning of E as a type-name (§3.8), then both possible
10886         meanings of E are permitted.
10887
10888         We did not check that E as a simple-name had the same type as E as
10889         a type name.
10890
10891         This trivial check gives us 5-7% on bootstrap time.
10892
10893 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
10894
10895         Fixed bug #59071 & cs0160.cs
10896         * statement.cs (Try.Resolve): Check here whether order of catch
10897         clauses matches their dependencies.
10898
10899 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
10900
10901         Fixed bug #58624
10902         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
10903         unsafe type.
10904
10905 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10906
10907         * expression.cs (Invocation.OverloadResolve): Avoid the
10908         use of hashtables and boxing here by allocating on demand.
10909
10910 2004-05-30  Martin Baulig  <martin@ximian.com>
10911
10912         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10913         we're doing a silent lookup.  Don't try to lookup nested types in
10914         TypeManager.object_type (thanks to Ben Maurer).
10915
10916 2004-05-30  Martin Baulig  <martin@ximian.com>
10917
10918         Committing a patch from Ben Maurer.
10919
10920         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
10921
10922 2004-05-29  Martin Baulig  <martin@ximian.com>
10923
10924         * class.cs (IMethodData.ShouldIgnore): New method.
10925
10926         * typemanager.cs (TypeManager.MethodFlags): Don't take a
10927         `Location' argument, we don't need it anywhere.  Use
10928         `IMethodData.ShouldIgnore ()' instead of
10929         `MethodData.GetMethodFlags ()'.
10930         (TypeManager.AddMethod): Removed.
10931         (TypeManager.AddMethod2): Renamed to AddMethod.
10932
10933 2004-05-29  Martin Baulig  <martin@ximian.com>
10934
10935         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10936
10937         * convert.cs (Convert.ImplicitReferenceConversion): If we're
10938         converting from a class type S to an interface type and we already
10939         have an object on the stack, don't box it again.  Fixes #52578.
10940
10941 2004-05-29  Martin Baulig  <martin@ximian.com>
10942
10943         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10944         Added support for `params' parameters.  Fixes #59267.
10945
10946 2004-05-29  Martin Baulig  <martin@ximian.com>
10947
10948         * literal.cs (NullPointer): Provide a private .ctor which sets
10949         `type' to TypeManager.object_type.  Fixes #59048.
10950
10951 2004-05-29  Martin Baulig  <martin@ximian.com>
10952
10953         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10954         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
10955
10956         * ecore.cs (EventExpr.instance_expr): Make the field private.
10957
10958 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
10959
10960         Fixed bug #50080 & cs0214-2.cs
10961         * expression.cs (Cast.DoResolve): Check unsafe context here.
10962         
10963         * statement.cs (Resolve.DoResolve): Likewise.
10964
10965 2004-05-26  Martin Baulig  <martin@ximian.com>
10966
10967         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10968
10969         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10970         (RootContext.LookupType): Pass down the `silent' flag.
10971
10972 2004-05-25  Martin Baulig  <martin@ximian.com>
10973
10974         * expression.cs
10975         (MethodGroupExpr.IdenticalTypeName): New public property.
10976         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10977         expression actually refers to a type.
10978
10979 2004-05-25  Martin Baulig  <martin@ximian.com>
10980
10981         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10982         for #56176 and made it actually work.
10983
10984 2004-05-25  Martin Baulig  <martin@ximian.com>
10985
10986         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10987         (FieldExpr, PropertyExpr): Override and implement
10988         CacheTemporaries.  Fixes #52279.
10989
10990 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
10991
10992         * location.cs: In the new compiler listing a file twice is a
10993         warning, not an error.
10994
10995 2004-05-24  Martin Baulig  <martin@ximian.com>
10996
10997         * enum.cs (Enum.DefineType): For the `BaseType' to be a
10998         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
10999
11000 2004-05-24  Martin Baulig  <martin@ximian.com>
11001
11002         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
11003         walking the `using' list.  Fixes #53921.
11004
11005 2004-05-24  Martin Baulig  <martin@ximian.com>
11006
11007         * const.cs (Const.LookupConstantValue): Added support for
11008         EmptyCast's; fixes #55251.
11009
11010 2004-05-24  Martin Baulig  <martin@ximian.com>
11011
11012         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
11013         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
11014         which does the CS0135 check.  The reason is that we first need to
11015         check whether the variable actually exists.
11016
11017 2004-05-24  Martin Baulig  <martin@ximian.com>
11018
11019         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
11020         than RootContext.LookupType() to find the explicit interface
11021         type.  Fixes #58584.
11022
11023 2004-05-24  Raja R Harinath  <rharinath@novell.com>
11024
11025         * Makefile: Simplify.  Use executable.make.
11026         * mcs.exe.sources: New file.  List of sources of mcs.exe.
11027
11028 2004-05-24  Anders Carlsson  <andersca@gnome.org>
11029
11030         * decl.cs:
11031         * enum.cs:
11032         Use the invariant culture when doing String.Compare for CLS case
11033         sensitivity.
11034         
11035 2004-05-23  Martin Baulig  <martin@ximian.com>
11036
11037         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
11038         don't have any dots.  Fixes #52622, added cs0246-8.cs.
11039
11040         * namespace.cs (NamespaceEntry.Lookup): Likewise.
11041
11042 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
11043
11044         * class.cs (MemberBase.Define): Reuse MemberType member for 
11045         resolved type. Other methods can use it too.
11046
11047 2004-05-23  Martin Baulig  <martin@ximian.com>
11048
11049         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
11050         the variable also exists in the current block (otherwise, we need
11051         to report a CS0103).  Fixes #58670.
11052
11053 2004-05-23  Martin Baulig  <martin@ximian.com>
11054
11055         * flowanalysis.cs (Reachability.Reachable): Compute this
11056         on-the-fly rather than storing it as a field.
11057
11058 2004-05-23  Martin Baulig  <martin@ximian.com>
11059
11060         * flowanalysis.cs (Reachability.And): Manually compute the
11061         resulting `barrier' from the reachability.      
11062        
11063 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
11064
11065         Fix bug #57835
11066         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
11067         instance of ObsoleteAttribute when symbol is obsolete.
11068
11069         * class.cs
11070         (IMethodData): Extended interface for ObsoleteAttribute support.
11071
11072 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
11073
11074         * attribute.cs: Fix bug #55970
11075
11076 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
11077
11078         Fix bug #52705
11079         * attribute.cs
11080         (GetObsoleteAttribute): New method. Creates the instance of
11081         ObsoleteAttribute.
11082         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
11083         ObsoleteAttribute when member is obsolete.
11084         (AttributeTester.Report_ObsoleteMessage): Common method for
11085         Obsolete error/warning reporting.
11086
11087         * class.cs
11088         (TypeContainer.base_classs_type): New member for storing parent type.
11089
11090         * decl.cs
11091         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
11092         for this MemberCore.
11093
11094 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11095
11096         * attribute.cs, const.cs: Fix bug #58590
11097
11098 2004-05-21  Martin Baulig  <martin@ximian.com>
11099
11100         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
11101         out parameters if the end of the method is unreachable.  Fixes
11102         #58098. 
11103
11104 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11105
11106         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
11107         Hari was right, why extra method.
11108
11109 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11110
11111         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
11112
11113 2004-05-20  Martin Baulig  <martin@ximian.com>
11114
11115         * delegate.cs: Convert this file to Unix mode - like the original
11116         version in mcs is.
11117
11118 2004-05-20  Martin Baulig  <martin@ximian.com>
11119
11120         * attribute.cs: Convert this file to Unix mode - like the original
11121         version in mcs is.
11122
11123 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
11124
11125        Fix bug #58688 (MCS does not report error when the same attribute
11126        is assigned twice)
11127
11128        * attribute.cs (Attribute.Emit): Distinction between null and default.
11129
11130 2004-05-19  Raja R Harinath  <rharinath@novell.com>
11131
11132        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
11133        of a top-level attribute without an attribute target.
11134        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
11135        Make non-static.
11136        (Attribute.Conditional_GetConditionName), 
11137        (Attribute.Obsolete_GetObsoleteMessage): Update.
11138        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
11139        part of ScanForIndexerName.
11140        (Attribute.CanIgnoreInvalidAttribute): New function.
11141        (Attribute.ScanForIndexerName): Move to ...
11142        (Attributes.ScanForIndexerName): ... here.
11143        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
11144        (Attributes.Search): New internal variant that can choose not to
11145        complain if types aren't resolved.  The original signature now
11146        complains.
11147        (Attributes.GetClsCompliantAttribute): Use internal variant, with
11148        complaints suppressed.
11149        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
11150        only if it not useful.
11151        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
11152        top-level for attributes that are shared between the assembly
11153        and a top-level class.
11154        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
11155        * class.cs: Update to reflect changes.
11156        (DefineIndexers): Fuse loops.
11157        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
11158        a couple more variants of attribute names.
11159
11160 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
11161
11162         Fix bug #52585 (Implemented explicit attribute declaration)
11163
11164         * attribute.cs:
11165         (Attributable.ValidAttributeTargets): New abstract method. It gets
11166         list of valid attribute targets for explicit target declaration.
11167         (Attribute.Target): It holds target itself.
11168         (AttributeSection): Removed.
11169         (Attribute.CheckTargets): New method. It checks whether attribute
11170         target is valid for the current element.
11171
11172         * class.cs:
11173         (EventProperty): New class. For events that are declared like
11174         property (with add and remove accessors).
11175         (EventField): New class. For events that are declared like field.
11176         class.cs
11177
11178         * cs-parser.jay: Implemented explicit attribute target declaration.
11179
11180         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
11181         Override ValidAttributeTargets.
11182
11183         * parameter.cs:
11184         (ReturnParameter): Class for applying custom attributes on 
11185         the return type.
11186         (ParameterAtribute): New class. Class for applying custom
11187         attributes on the parameter type.
11188
11189 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
11190
11191         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
11192         definitions. 
11193
11194         (Method): Allow UNSAFE here.
11195
11196         * modifiers.cs: Support unsafe reporting.
11197
11198 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
11199
11200         * decl.cs: Fix bug #58478.
11201
11202 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11203
11204         * statement.cs: When checking for unreachable code on an EmptyStatement,
11205         set the location. Fixes bug #58488.
11206
11207 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
11208
11209         * driver.cs: Add -pkg handling.
11210
11211         From Gonzalo: UseShelLExecute=false
11212
11213 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
11214
11215         * attribute.cs:
11216         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
11217         for attribute.
11218         (Attribute.IsClsCompliaceRequired): Moved to base for better
11219         accesibility.
11220         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
11221         when attribute is AttributeUsageAttribute.
11222         (Attribute.GetValidTargets): Simplified.
11223         (Attribute.GetAttributeUsage): New method returns AttributeUsage
11224         attribute for this type.
11225         (Attribute.ApplyAttributes): Method renamed to Emit and make
11226         non-static.
11227         (GlobalAttributeSection): New class for special handling of global
11228         attributes (assembly, module).
11229         (AttributeSection.Emit): New method.
11230
11231         * class.cs: Implemented Attributable abstract methods.
11232         (MethodCore.LabelParameters): Moved to Parameter class.
11233         (Accessor): Is back simple class.
11234         (PropertyMethod): Implemented Attributable abstract class.
11235         (DelegateMethod): Implemented Attributable abstract class.
11236         (Event): New constructor for disctintion between normal Event
11237         and Event with accessors.
11238
11239         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
11240
11241         * codegen.cs, const.cs, decl.cs, delegate.cs:
11242         (CommonAssemblyModulClass): Implemented Attributable abstract class
11243         and simplified.
11244
11245         * enum.cs: Implement IAttributeSupport interface.
11246         (EnumMember): New class for emum members. Implemented Attributable
11247         abstract class
11248
11249         * parameter.cs:
11250         (ParameterBase): Is abstract.
11251         (ReturnParameter): New class for easier [return:] attribute handling.
11252
11253         * typemanager.cs: Removed builder_to_attr.
11254
11255 2004-05-11  Raja R Harinath  <rharinath@novell.com>
11256
11257         Fix bug #57151.
11258         * attribute.cs (Attribute.GetPositionalValue): New function.
11259         * class.cs (TypeContainer.VerifyMembers): New function.
11260         (TypeContainer.Emit): Use it.
11261         (ClassOrStruct): New base class for Class and Struct.
11262         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
11263         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
11264         class.
11265         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
11266         then each non-static field should have a FieldOffset attribute.
11267         Otherwise, none of the fields should have a FieldOffset attribute.
11268         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
11269         and FieldOffset attributes.
11270         * typemanager.cs (TypeManager.struct_layout_attribute_type)
11271         (TypeManager.field_offset_attribute_type): New core types.
11272         (TypeManager.InitCoreTypes): Initialize them.
11273
11274 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
11275
11276         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11277         Return correct type.
11278         From bug #58270.
11279
11280 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
11281
11282         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11283         be implicitly converted to ulong.
11284         
11285         * expression.cs: The logic for allowing operator &, | and ^ worked
11286         was wrong, it worked before because we did not report an error in
11287         an else branch.  Fixes 57895.
11288
11289         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11290         allow volatile fields to be reference types.
11291
11292 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
11293
11294         * driver.cs: Add support for /debug-
11295
11296 2004-05-07  Raja R Harinath  <rharinath@novell.com>
11297
11298         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
11299         Add a 'complain' parameter to silence errors.
11300         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
11301         silently overlooked type-resolutions.
11302         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11303         to reflect changes.
11304         (Attributes.Search): New function.
11305         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11306         (Attributes.GetAttributeFullName): Remove hack.
11307         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
11308         Update to reflect changes.
11309         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11310         Use Attributes.Search instead of nested loops.
11311
11312 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
11313
11314         * decl.cs:
11315         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11316         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11317         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11318
11319         * report.cs: (Report.Warning): Renamed to Warning_T because of
11320         parameter collision.
11321
11322 2004-05-05  Raja R Harinath  <rharinath@novell.com>
11323
11324         * expression.cs (MemberAccess.ResolveMemberAccess):
11325         Exit with non-zero status after Report.Error.
11326         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
11327         Likewise.
11328         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
11329
11330 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11331
11332         * support.cs: Don't hang when the file is empty.
11333
11334 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11335
11336         * support.cs: In SeekableStreamReader, compute the preamble size of the
11337           underlying stream. Position changes should take into account that initial
11338           count of bytes.
11339
11340 2004-05-03  Todd Berman  <tberman@sevenl.net>
11341
11342         * driver.cs: remove unused GetSysVersion function.
11343
11344 2004-05-03  Todd Berman  <tberman@sevenl.net>
11345
11346         * driver.cs: Remove the hack from saturday, as well as the hack
11347         from jackson (LoadAssemblyFromGac), also adds the CWD to the
11348         link_paths to get that bit proper.
11349
11350 2004-05-01  Todd Berman  <tberman@sevenl.net>
11351
11352         * driver.cs: Try a LoadFrom before a Load, this checks the current
11353         path. This is currently a bug in mono that is be fixed, however, this
11354         provides a workaround for now. This will be removed when the bug
11355         is fixed.
11356
11357 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
11358
11359         * CryptoConvert.cs: Updated to latest version. Fix issue with 
11360         incomplete key pairs (#57941).
11361
11362 2004-05-01  Todd Berman  <tberman@sevenl.net>
11363
11364         * driver.cs: Remove '.' from path_chars, now System.* loads properly
11365         from the GAC
11366
11367 2004-04-30  Jackson Harper  <jackson@ximian.com>
11368
11369         * codegen.cs: Open keys readonly.
11370         
11371 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11372
11373         * typemanager.cs: don't report cyclic struct layout when a struct
11374         contains 2 or more fields of the same type. Failed for Pango.AttrShape
11375         which has 2 Pango.Rectangle fields.
11376
11377 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11378
11379         * expression.cs: Handle IntPtr comparisons with IL code
11380         rather than a method call.
11381
11382 2004-04-29  Martin Baulig  <martin@ximian.com>
11383
11384         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
11385         the list of PropertyInfo's in class hierarchy and find the
11386         accessor.  Fixes #56013.
11387
11388 2004-04-29  Martin Baulig  <martin@ximian.com>
11389
11390         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
11391
11392 2004-04-29  Martin Baulig  <martin@ximian.com>
11393
11394         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11395
11396         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
11397
11398 2004-04-29  Martin Baulig  <martin@ximian.com>
11399
11400         * class.cs (ConstructorInitializer.Resolve): Check whether the
11401         parent .ctor is accessible.  Fixes #52146.
11402
11403 2004-04-29  Martin Baulig  <martin@ximian.com>
11404
11405         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11406
11407         * statement.cs (Using.EmitLocalVariableDecls): Use
11408         TypeManager.idisposable_type, not typeof (IDisposable).
11409         (Foreach.EmitCollectionForeach): Added support for valuetypes.
11410
11411 2004-04-29  Martin Baulig  <martin@ximian.com>
11412
11413         * class.cs (Event.Define): Don't emit the field and don't set
11414         RTSpecialName and SpecialName for events on interfaces.  Fixes
11415         #57703. 
11416
11417 2004-04-29  Raja R Harinath  <rharinath@novell.com>
11418
11419         Refactor Attribute.ApplyAttributes.
11420         * attribute.cs (Attributable): New base class for objects that can
11421         have Attributes applied on them.
11422         (Attribute): Make AttributeUsage fields public.
11423         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
11424         (Attribute.IsInternalCall): New property.
11425         (Attribute.UsageAttr): Convert to a public read-only property.
11426         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
11427         (Attribute.ResolveType, Attribute.Resolve)
11428         (Attribute.ScanForIndexerName): Update to reflect changes.
11429         (Attribute.CheckAttributeTarget): Re-format.
11430         (Attribute.ApplyAttributes): Refactor, to various
11431         Attributable.ApplyAttributeBuilder methods.
11432         * decl.cs (MemberCore): Make Attributable.
11433         * class.cs (Accessor): Make Attributable.
11434         (MethodData.ApplyAttributes): Use proper attribute types, not
11435         attribute names.
11436         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
11437         (TypeContainer.ApplyAttributeBuilder)
11438         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
11439         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
11440         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
11441         (Operator.ApplyAttributeBuilder): New factored-out methods.
11442         * const.cs (Const.ApplyAttributeBuilder): Likewise.
11443         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
11444         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
11445         * parameter.cs (ParameterBase): New Attributable base class
11446         that can also represent Return types.
11447         (Parameter): Update to the changes.
11448
11449 2004-04-29  Jackson Harper  <jackson@ximian.com>
11450
11451         * driver.cs: Prefer the corlib system version when looking for
11452         assemblies in the GAC. This is still a hack, but its a better hack
11453         now.
11454         
11455 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
11456
11457         * decl.cs, enum.cs: Improved error 3005 reporting.
11458   
11459         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
11460         (related_symbols): New private member for list of symbols
11461         related to reported error/warning.
11462         
11463         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
11464
11465 2004-04-29  Martin Baulig  <martin@ximian.com>
11466
11467         * ecore.cs (Expression.Constantify): If we're an enum and
11468         TypeManager.TypeToCoreType() doesn't give us another type, use
11469         t.UnderlyingSystemType.  Fixes #56178.  
11470
11471 2004-04-29  Martin Baulig  <martin@ximian.com>
11472
11473         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
11474         interfaces and for each interface, only add members directly
11475         declared in that interface.  Fixes #53255.
11476
11477 2004-04-28  Martin Baulig  <martin@ximian.com>
11478
11479         * expression.cs (ConditionalLogicalOperator): Use a temporary
11480         variable for `left' to avoid that we evaluate it more than once;
11481         bug #52588.
11482
11483 2004-04-28  Martin Baulig  <martin@ximian.com>
11484
11485         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
11486         `void[]' (CS1547).
11487
11488 2004-04-28  Martin Baulig  <martin@ximian.com>
11489
11490         * statement.cs (LocalInfo.Resolve): Check whether the type is not
11491         void (CS1547).
11492
11493         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
11494         whether the type is not void (CS1547).
11495
11496 2004-04-28  Martin Baulig  <martin@ximian.com>
11497
11498         * expression.cs (Unary.DoResolveLValue): Override this and report
11499         CS0131 for anything but Operator.Indirection.
11500
11501 2004-04-28  Martin Baulig  <martin@ximian.com>
11502
11503         Committing a patch from Ben Maurer; see bug #50820.
11504
11505         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11506         check for classes.
11507
11508         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11509         classes.        
11510
11511 2004-04-28  Martin Baulig  <martin@ximian.com>
11512
11513         Committing a patch from Ben Maurer; see bug #50820.
11514
11515         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11516         check for classes.
11517
11518         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11519         classes.        
11520
11521 2004-04-28  Martin Baulig  <martin@ximian.com>
11522
11523         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
11524         (Block.AddLabel): Call DoLookupLabel() to only search in the
11525         current block.
11526
11527 2004-04-28  Martin Baulig  <martin@ximian.com>
11528
11529         * cfold.cs (ConstantFold.BinaryFold): Added special support for
11530         comparing StringConstants and NullLiterals in Equality and Inequality.
11531
11532 2004-04-28  Jackson Harper  <jackson@ximian.com>
11533
11534         * driver.cs: Attempt to load referenced assemblies from the
11535         GAC. This is the quick and dirty version of this method that
11536         doesnt take into account versions and just takes the first
11537         canidate found. Will be good enough for now as we will not have more
11538         then one version installed into the GAC until I update this method.
11539
11540 2004-04-28  Martin Baulig  <martin@ximian.com>
11541
11542         * typemanager.cs (TypeManager.CheckStructCycles): New public
11543         static method to check for cycles in the struct layout.
11544
11545         * rootcontext.cs (RootContext.PopulateTypes): Call
11546         TypeManager.CheckStructCycles() for each TypeContainer.
11547         [Note: We only need to visit each type once.]
11548
11549 2004-04-28  Martin Baulig  <martin@ximian.com>
11550
11551         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11552
11553         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11554         success and added `out object value'.  Use a `bool resolved' field
11555         to check whether we've already been called rather than
11556         `ConstantValue != null' since this breaks for NullLiterals.
11557
11558 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11559
11560         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11561         setting of this flag, since the 'set' method may be non-public.
11562
11563 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11564
11565         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
11566         check on current_vector.Block.
11567
11568 2004-04-27  Martin Baulig  <martin@ximian.com>
11569
11570         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
11571         a field initializer.  Fixes #56459.
11572
11573 2004-04-27  Martin Baulig  <martin@ximian.com>
11574
11575         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
11576         we're not attempting to use an indexer.  Fixes #52154.
11577
11578 2004-04-27  Martin Baulig  <martin@ximian.com>
11579
11580         * statement.cs (Return): Don't create a return label if we don't
11581         need it; reverts my change from January 20th.  Thanks to Ben
11582         Maurer for this.
11583
11584 2004-04-27  Martin Baulig  <martin@ximian.com>
11585
11586         According to the spec, `goto' can only leave a nested scope, but
11587         never enter it.
11588
11589         * statement.cs (Block.LookupLabel): Only lookup in the current
11590         block, don't recurse into parent or child blocks.
11591         (Block.AddLabel): Check in parent and child blocks, report
11592         CS0140/CS0158 if we find a duplicate.
11593         (Block): Removed this indexer for label lookups.
11594         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
11595         this already does the error reporting for us.
11596
11597         * flowanalysis.cs
11598         (FlowBranching.UsageVector.Block): New public variable; may be null.
11599         (FlowBranching.CreateSibling): Added `Block' argument.
11600         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
11601         label for the target of a `goto' and check whether we're not
11602         leaving a `finally'.
11603
11604 2004-04-27  Martin Baulig  <martin@ximian.com>
11605
11606         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11607         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
11608         just for returns).
11609
11610 2004-04-27  Martin Baulig  <martin@ximian.com>
11611
11612         * statement.cs (Block.AddLabel): Also check for implicit blocks
11613         and added a CS0158 check.
11614
11615 2004-04-27  Martin Baulig  <martin@ximian.com>
11616
11617         * flowanalysis.cs (FlowBranchingLoop): New class.
11618         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11619         UsageVector's instead of an ArrayList.
11620         (FlowBranching.Label): Likewise.
11621         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11622         (FlowBranching.AddBreakVector): New method.
11623
11624 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
11625
11626         * attribute.cs: Small regression fix: only convert the type if we
11627         the type is different, fixes System.Drawing build.
11628
11629 2004-04-27  Martin Baulig  <martin@ximian.com>
11630
11631         * attribute.cs (Attribute.Resolve): If we have a constant value
11632         for a named field or property, implicity convert it to the correct
11633         type.
11634
11635 2004-04-27  Raja R Harinath  <rharinath@novell.com>
11636
11637         * statement.cs (Block.Block): Implicit blocks share
11638         'child_variable_names' fields with parent blocks.
11639         (Block.AddChildVariableNames): Remove.
11640         (Block.AddVariable): Mark variable as "used by a child block" in
11641         every surrounding block.
11642         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11643         been used in a child block, complain about violation of "Invariant
11644         meaning in blocks" rule.
11645         * cs-parser.jay (declare_local_variables): Don't use
11646         AddChildVariableNames.
11647         (foreach_statement): Don't create an implicit block: 'foreach'
11648         introduces a scope.
11649
11650 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
11651
11652         * convert.cs (ImplicitNumericConversion): 0 is also positive when
11653         converting from 0L to ulong.  Fixes 57522.
11654
11655 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11656
11657         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11658         derived class hides via 'new' keyword field from base class (test-242.cs).
11659         TODO: Handle this in the more general way.
11660         
11661         * class.cs (CheckBase): Ditto.
11662
11663 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11664
11665         * decl.cs (caching_flags): New member for storing cached values
11666         as bit flags.
11667         (MemberCore.Flags): New enum where bit flags for caching_flags
11668         are defined.
11669         (MemberCore.cls_compliance): Moved to caching_flags.
11670         (DeclSpace.Created): Moved to caching_flags.
11671
11672         * class.cs: Use caching_flags instead of DeclSpace.Created
11673         
11674 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
11675
11676         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11677         if we are only a derived class, not a nested class.
11678
11679         * typemanager.cs: Same as above, but do this at the MemberLookup
11680         level (used by field and methods, properties are handled in
11681         PropertyExpr).   Allow for the qualified access if we are a nested
11682         method. 
11683
11684 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
11685
11686         * class.cs: Refactoring.
11687         (IMethodData): New inteface; Holds links to parent members
11688         to avoid member duplication (reduced memory allocation).
11689         (Method): Implemented IMethodData interface.
11690         (PropertyBase): New inner classes for get/set methods.
11691         (PropertyBase.PropertyMethod): Implemented IMethodData interface
11692         (Event): New inner classes for add/remove methods.
11693         (Event.DelegateMethod): Implemented IMethodData interface.
11694
11695         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11696         EmitContext (related to class.cs refactoring).
11697
11698 2004-04-21  Raja R Harinath  <rharinath@novell.com>
11699
11700         * delegate.cs (Delegate.VerifyApplicability): If the number of
11701         arguments are the same as the number of parameters, first try to
11702         verify applicability ignoring  any 'params' modifier on the last
11703         parameter.
11704         Fixes #56442.
11705
11706 2004-04-08  Martin Baulig  <martin@ximian.com>
11707
11708         Merged latest changes into gmcs.  Please keep this comment in
11709         here, it makes it easier for me to see what changed in MCS since
11710         the last time I merged.
11711
11712 2004-04-16  Raja R Harinath  <rharinath@novell.com>
11713
11714         * class.cs (TypeContainer.AddIndexer): Use
11715         'ExplicitInterfaceName' to determine if interface name was
11716         explicitly specified.  'InterfaceType' is not initialized at this time.
11717         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
11718         Indexers array is already in the required order.  Initialize
11719         'IndexerName' only if there are normal indexers.
11720         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11721         (TypeContainer.Emit): Emit DefaultMember attribute only if
11722         IndexerName is initialized.
11723         Fixes #56300.
11724
11725 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
11726
11727         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11728         Fixes #57007
11729
11730 2004-04-15  Raja R Harinath  <rharinath@novell.com>
11731
11732         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11733         attributes.
11734         Fix for #56456.
11735
11736         * attribute.cs (Attribute.Resolve): Check for duplicate named
11737         attributes.
11738         Fix for #56463.
11739
11740 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
11741
11742         * iterators.cs (MarkYield): track whether we are in an exception,
11743         and generate code accordingly.  Use a temporary value to store the
11744         result for our state.
11745
11746         I had ignored a bit the interaction of try/catch with iterators
11747         since their behavior was not entirely obvious, but now it is
11748         possible to verify that our behavior is the same as MS .NET 2.0
11749
11750         Fixes 54814
11751
11752 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
11753
11754         * iterators.cs: Avoid creating temporaries if there is no work to
11755         do. 
11756
11757         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11758         Enumerations, use TypeManager.EnumToUnderlying and call
11759         recursively. 
11760
11761         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11762         bug #57013
11763
11764         (This.Emit): Use EmitContext.EmitThis to emit our
11765         instance variable.
11766
11767         (This.EmitAssign): Ditto.
11768
11769         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11770         codepaths, we will move all the functionality into
11771         Mono.CSharp.This 
11772
11773         (FieldExpr.EmitAssign): Ditto.
11774
11775         This fixes several hidden bugs that I uncovered while doing a code
11776         review of this today.
11777
11778         * codegen.cs (EmitThis): reworked so the semantics are more clear
11779         and also support value types "this" instances.
11780
11781         * iterators.cs: Changed so that for iterators in value types, we
11782         do not pass the value type as a parameter.  
11783
11784         Initialization of the enumerator helpers is now done in the caller
11785         instead of passing the parameters to the constructors and having
11786         the constructor set the fields.
11787
11788         The fields have now `assembly' visibility instead of private.
11789
11790 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
11791
11792         * expression.cs (Argument.Resolve): Check if fields passed as ref
11793         or out are contained in a MarshalByRefObject.
11794
11795         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11796         another compiler type.
11797
11798 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
11799
11800         * class.cs (Indexer.Define): use the new name checking method.
11801         Also, return false on an error.
11802         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11803         (is_identifier_[start/part]_character): make static.
11804
11805 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
11806
11807         * expression.cs (Binary.ResolveOperator): Do no append strings
11808         twice: since we can be invoked more than once (array evaluation)
11809         on the same concatenation, take care of this here.  Based on a fix
11810         from Ben (bug #56454)
11811
11812 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11813
11814         * codegen.cs: Fix another case where CS1548 must be reported (when 
11815         delay-sign isn't specified and no private is available #56564). Fix
11816         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11817         error when MCS is used on the MS runtime and we need to delay-sign 
11818         (which seems unsupported by AssemblyBuilder - see #56621).
11819
11820 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
11821
11822         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11823         (TypeManager.ComputeNamespaces): Faster implementation for
11824         Microsoft runtime.
11825
11826         * compiler.csproj: Updated AssemblyName to mcs.
11827
11828 2004-05-11  Jackson Harper  <jackson@ximian.com>
11829
11830         * Makefile: Preserve MONO_PATH
11831         
11832 2004-05-11  Jackson Harper  <jackson@ximian.com>
11833
11834         * Makefile: Use mono and mcs to build gmcs
11835         
11836 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
11837
11838         * codegen.cs: Add patch from Robert Shade
11839         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
11840         sync with mcs.
11841
11842 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
11843
11844         * CryptoConvert.cs: Updated to latest version. Fix issue with 
11845         incomplete key pairs (#57941).
11846
11847 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11848
11849         * codegen.cs: Fix another case where CS1548 must be reported (when 
11850         delay-sign isn't specified and no private is available #56564). Fix
11851         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11852         error when MCS is used on the MS runtime and we need to delay-sign 
11853         (which seems unsupported by AssemblyBuilder - see #56621).
11854
11855 2004-04-29  Jackson Harper  <jackson@ximian.com>
11856
11857         * Makefile: Set MONO_PATH to use the bootstrap corlib
11858         * driver.cs: Check the GAC for referenced assemblies.
11859                 
11860 2004-04-29  Martin Baulig  <martin@ximian.com>
11861
11862         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
11863
11864 2004-04-07  Martin Baulig  <martin@ximian.com>
11865
11866         * expression.cs (Binary.ResolveOperator): Added special case for
11867         Equality/Inequality between a type parameter and a null literal.
11868
11869 2004-04-07  Martin Baulig  <martin@ximian.com>
11870
11871         * convert.cs: Check null literal -> type parameter conversions.
11872
11873 2004-04-07  Martin Baulig  <martin@ximian.com>
11874
11875         * generic.cs (ConstructedType.CheckConstraints): Enforce the
11876         `class' and `struct' constraints.
11877
11878 2004-04-07  Martin Baulig  <martin@ximian.com>
11879
11880         * generic.cs (SpecialConstraint): New public enum.
11881         (Constraints.Resolve): Added support for the `class' and `struct'
11882         constraints.
11883
11884         * cs-parser.jay (type_parameter_constraint): Added support for the
11885         `class' and `struct' constraints.
11886
11887 2004-04-07  Martin Baulig  <martin@ximian.com>
11888
11889         * support.cs (GenericConstraints): Replaced `Types' by
11890         `ClassConstraint' and `InterfaceConstraints'; added
11891         `HasClassConstraint'.   
11892
11893 2004-04-07  Martin Baulig  <martin@ximian.com>
11894
11895         * generic.cs
11896         (Constraints.InterfaceConstraints): New public property.
11897         (Constraints.Types): Make this property public
11898         (TypeParameter): Implement IMemberContainer.
11899         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
11900         instead of a TypeBuilder/MethodBuilder; pass the interface
11901         constraints to TypeManager.AddTypeParameter().
11902         (TypeParameter.DefineType): Just take an EmitContext and no
11903         TypeBuilder/MethodBuilder.  Use the new public API.
11904
11905         * typemanager.cs (TypeManager.AddTypeParameter): Added
11906         `TypeExpr[]' argument; add the interfaces to the
11907         `builder_to_ifaces' hash.
11908         (TypeManager.LookupMemberContainer): For
11909         GenericTypeParameterBuilders, get the TypeParameter from the
11910         `builder_to_type_param'.
11911         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
11912         the TypeParameter and call FindMembers on it.
11913
11914 2004-04-07  Martin Baulig  <martin@ximian.com>
11915
11916         * class.cs
11917         (MethodCore.GenericMethod): Moved this field here from Method.
11918         (MethodCore.IsDuplicateImplementation): Take the number of type
11919         parameters into account if we're a generic method.
11920
11921         * expression.cs (Invocation.InferTypeArguments): Don't return true
11922         if `arguments' is null; we still need to check whether we actually
11923         don't need to infer anything in this case.
11924         (MemberAccess): Merged the functionality from GenericMemberAccess
11925         into this class.
11926
11927         * generic.cs (GenericMemberAccess): Removed.
11928
11929 2004-04-05  Martin Baulig  <martin@ximian.com>
11930
11931         * decl.cs (MemberCore): For generic classes, interfaces and
11932         structs, `Name' now includes the number of type parameters
11933         ("Stack!1.Node!1").
11934         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
11935         encode the number of type arguments in the type name.
11936
11937         * expression.cs (Expression.MemberLookup): Removed the
11938         `num_type_args' argument; we now encode the number of type
11939         arguments in the type name.
11940
11941         * ecore.cs (SimpleName): Encode the number of type arguments in
11942         the type name itself.
11943
11944         * generic.cs (ConstructedType): Likewise.
11945
11946         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
11947         `MemberName'; we now include the number of type parameters in the
11948         type name.
11949
11950         * typemanager.cs (TypeManager.CheckGeneric): Removed.
11951         (TypeManager.MemberLookup): Removed the
11952         `num_type_args' argument; we now encode the number of type
11953         arguments in the type name.     
11954
11955 2004-04-03  Martin Baulig  <martin@ximian.com>
11956
11957         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
11958         (MemberCore.MemberName): Moved here from MemberBase.
11959         (DeclSpace.SetParameterInfo): Just take the constraints as an
11960         ArrayList; we already have the type parameters in our
11961         `MemberName'; also do the CS0080 reporting here.
11962
11963         * cs-parser.jay (struct_declaration): Use `member_name' instead of
11964         `IDENTIFIER opt_type_parameter_list'; when constructing our
11965         `MemberName', it'll already include our type parameters.
11966         (class_declaration, interface_declaration): Likewise.
11967         (delegate_declaration): Likewise.
11968         (MakeName): Take a MemberName and return a MemberName.
11969         The following two changes are required to avoid shift/reduce conflicts:
11970         (member_name): Don't include a TypeName anymore; ie. this is now
11971         just 'IDENTIFIER opt_type_parameter_list'.
11972         (property_declaration, event_declaration): Use a
11973         `namespace_or_type_name' instead of a `member_name'.            
11974
11975 2004-04-03  Martin Baulig  <martin@ximian.com>
11976
11977         * decl.cs (MemberName): Renamed to `TypeName' and created a new
11978         `MemberName' class.
11979         (TypeName): Formerly known as MemberName.
11980
11981         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
11982         instead of a `MemberName'.
11983
11984         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
11985         (member_name): New rule; create a MemberName.
11986
11987 2004-04-02  Martin Baulig  <martin@ximian.com>
11988
11989         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
11990         (CS0305 and CS0308).
11991
11992 2004-04-02  Martin Baulig  <martin@ximian.com>
11993
11994         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
11995         support for nested types.
11996
11997 2004-04-02  Martin Baulig  <martin@ximian.com>
11998
11999         * ecore.cs (IAlias): New public interface.
12000         (TypeExpr, TypeExpression): Implement IAlias.
12001         (TypeAliasExpression): New public class.
12002
12003         * namespace.cs (Namespace): Implement IAlias.
12004         (Namespace.Lookup): Return an IAlias instead on an object.
12005         (Namespace.DefineName): Take an IAlias instead of an object.
12006         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
12007         an object.
12008         (NamespaceEntry.UsingAlias): Take a Membername instead of an
12009         Expression.
12010         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
12011         object.
12012         (NamespaceEntry.Lookup): Likewise.
12013
12014         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
12015         instead of a Type.      
12016
12017         * decl.cs (DeclSpace): Implement IAlias.
12018         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
12019
12020         * generic.cs (ConstructedType): Improved error checking.
12021
12022 2004-04-02  Martin Baulig  <martin@ximian.com>
12023
12024         * convert.cs: Added type parameter conversions.
12025
12026         * ecore.cs
12027         (UnboxCast.Emit): Emit an `unbox.any' for type params.
12028         (ClassCast.Emit): If the source type is a type parameter, box it.
12029         If the target type is a type parameter, emit an `unbox.any'
12030         instead of a `classcast'.1      
12031
12032 2004-04-01  Martin Baulig  <martin@ximian.com>
12033
12034         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
12035
12036 2004-04-01  Martin Baulig  <martin@ximian.com>
12037
12038         * generic.cs (ConstructedType.CheckConstraints): Use
12039         Convert.ImplicitStandardConversionExists(); user-defined implicit
12040         conversions are not allowed according to the spec.
12041
12042 2004-03-30  Martin Baulig  <martin@ximian.com>
12043
12044         * expression.cs (New): Added support for type parameters.
12045
12046         * typemanager.cs
12047         (TypeManager.activator_type): New public static field.
12048         (TypeManager.activator_create_instance): Likewise.
12049
12050 2004-03-30  Martin Baulig  <martin@ximian.com>
12051
12052         * typemanager.cs (TypeManager.HasConstructorConstraint): New
12053         public method.
12054
12055 2004-03-30  Martin Baulig  <martin@ximian.com>
12056
12057         * generic.cs (ConstructedType.CheckConstraints): Actually follow
12058         the spec here: the argument type must be convertible to the
12059         constraints.
12060
12061 2004-03-30  Martin Baulig  <martin@ximian.com>
12062
12063         * generic.cs
12064         (TypeParameter.Define, TypeParameter.DefineMethod): Call
12065         TypeManager.AddTypeParameter().
12066         (ConstructedType.CheckConstraints): Re-enable this and actually
12067         check whether we have a constructor constraint.
12068
12069         * typemanager.cs
12070         (TypeManager.builder_to_type_param): New static field.
12071         (TypeManager.AddTypeParameter): New static method.
12072         (TypeManager.LookupTypeParameter): New public method.
12073
12074 2004-03-30  Martin Baulig  <martin@ximian.com>
12075
12076         * generic.cs (TypeParameter.DefineType): Return a boolean and use
12077         the new API to actually define the constructor constraint.
12078
12079         * typemanager.cs
12080         (TypeManager.new_constraint_attr_type): New static field.
12081         (TypeManager.InitCoreTypes): Initialize it.
12082
12083 2004-03-30  Martin Baulig  <martin@ximian.com>
12084
12085         * generic.cs (Constraints): Completed error checking, use correct
12086         error numbers.
12087
12088 2004-03-29  Martin Baulig  <martin@ximian.com>
12089
12090         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
12091
12092         * expression.cs (Invocation.InferTypeArguments): Added overloaded
12093         public version which takes a `ParameterData pd' instead of an
12094         `ArrayList args'.
12095
12096 2004-03-29  Martin Baulig  <martin@ximian.com>
12097
12098         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
12099         not a MethodInfo.       
12100
12101 2004-03-29  Martin Baulig  <martin@ximian.com>
12102
12103         * expression.cs (Argument.ResolveMethodGroup): If we're a
12104         ConstructedType, call GetMemberAccess() on it.  
12105
12106 2004-03-29  Martin Baulig  <martin@ximian.com>
12107
12108         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
12109         (MethodCore.CheckGenericOverride): When overriding a generic
12110         method, check whether the constraints match.
12111
12112         * support.cs (GenericConstraints): New public interface.
12113         (ParameterData.GenericConstraints): New public method.
12114
12115         * parameter.cs (Parameter.Resolve): Check whether we're a generic
12116         method parameter and compute our constraints if appropriate.
12117         (Parameter.GenericConstraints): New public property.
12118
12119         * generic.cs (Constraints): Implement GenericConstraints.
12120
12121 2004-03-29  Martin Baulig  <martin@ximian.com>
12122
12123         * decl.cs (MemberCache.FindMemberToOverride): Use
12124         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
12125
12126 2004-03-29  Martin Baulig  <martin@ximian.com>
12127
12128         * generic.cs (GenericMethod.Define): Resolve our type parameters.
12129
12130 2004-03-29  Martin Baulig  <martin@ximian.com>
12131
12132         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
12133         not allowed on non-generic declarations").
12134
12135 2004-03-29  Martin Baulig  <martin@ximian.com>
12136
12137         * expression.cs (Invocation.InferTypeArguments): Added overloaded
12138         public version of this method.
12139
12140         * class.cs (MethodCore.IsDuplicateImplementation): Use
12141         Invocation.InferTypeArguments() to check this.
12142
12143 2004-03-29  Martin Baulig  <martin@ximian.com>
12144
12145         * convert.cs: Use TypeManager.IsDelegateType() instead of
12146         comparing types correctly.
12147
12148 2004-03-29  Martin Baulig  <martin@ximian.com>
12149
12150         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
12151         types directly to make it work for generic instances.
12152
12153         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
12154
12155 2004-03-29  Martin Baulig  <martin@ximian.com>
12156
12157         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
12158         support for arrays.     
12159
12160 2004-03-24  Martin Baulig  <martin@ximian.com>
12161
12162         * decl.cs (DeclSpace.FindType): Also use
12163         TypeManager.CheckGeneric() for types from the using clauses.
12164
12165 2004-03-23  Martin Baulig  <martin@ximian.com>
12166
12167         * expression.cs (Invocation.OverloadResolve): Added `bool
12168         may_fail' argument and use it instead of the Location.IsNull() hack.
12169
12170 2004-03-23  Martin Baulig  <martin@ximian.com>
12171
12172         * expression.cs (Invocation.InferType): Use correct type inference
12173         rules here.     
12174
12175 2004-03-23  Martin Baulig  <martin@ximian.com>
12176
12177         * ecore.cs (MethodGroupExpr.Name): Use
12178         TypeManager.CSharpSignature() instead of just the name.
12179
12180         * expression.cs (Invocation.OverloadResolve): Provide better error
12181         reporting.
12182         (Invocation.DoResolve): OverloadResolve() never returns null
12183         without reporting an error, so removed the error -6 reporting here.
12184
12185 2004-03-23  Martin Baulig  <martin@ximian.com>
12186
12187         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
12188         generic methods.
12189
12190         * cs-parser.jay (delegate_declaration): Support generic delegates.
12191
12192         * delegate.cs: Support generic delegates.
12193
12194 2004-03-22  Martin Baulig  <martin@ximian.com>
12195
12196         * expression.cs (Invocation.InferParamsTypeArguments): New static
12197         method; does type inference for params arguments.
12198
12199 2004-03-21  Martin Baulig  <martin@ximian.com>
12200
12201         * typemanager.cs (TypeManager.IsGenericMethod): New public static
12202         method; checks whether a method is a generic method.    
12203
12204         * expression.cs (Invocation.InferTypeArguments): New static method;
12205         infer type arguments for generic method invocation.
12206
12207         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
12208         property; we set this to true if we're resolving a generic method
12209         invocation and the user specified type arguments, ie. we're not
12210         doing type inference.
12211
12212 2004-03-20  Martin Baulig  <martin@ximian.com>
12213
12214         * class.cs (MethodData.DeclaringType): New public property.
12215         (MethodData.Define): Set DeclaringType here.
12216         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
12217         instead of OperatorMethodBuilder.DeclaringType.
12218
12219 2004-03-20  Martin Baulig  <martin@ximian.com>
12220
12221         * cs-tokenizer.cs (xtoken): Return a special
12222         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
12223
12224         * cs-parser.jay (default_value_expression): Switch to the new
12225         syntax (14.5.13).
12226
12227 2004-03-19  Martin Baulig  <martin@ximian.com>
12228
12229         * decl.cs (MemberName): New class.  We use this to "construct"
12230         namespace_or_type_name's.
12231
12232         * generics.cs (TypeArguments.GetDeclarations): New public method;
12233         returns the type arguments as a string[] and reports a CS0081 if
12234         one of them is not an identifier.
12235
12236         * class.cs (MemberBase): The .ctor now takes the name as a
12237         MemberName instead of a string.
12238         (MemberBase.ExplicitInterfaceName): Changed type from string to
12239         Expression.
12240         (MemberBase.DoDefine): If we're an explicit implementation, the
12241         InterfaceType may be a generic instance.
12242
12243         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
12244         (namespace_name): Call MemberName.GetName () to transform the
12245         MemberName into a string and ensure we don't have any type
12246         arguments.
12247         (type_name): Call MemberName.GetTypeExpression() to transfrom the
12248         MemberName into an expression.
12249         (method_header): Use namespace_or_type_name instead of member_name.     
12250
12251 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
12252
12253         * rootcontext.cs: Add new types to the boot resolution.
12254
12255         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
12256         MulticastDelegate is not allowed.
12257
12258         * typemanager.cs: Add new types to lookup: System.TypedReference
12259         and ArgIterator.
12260
12261         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
12262         check for TypedReference or ArgIterator, they are not allowed. 
12263
12264         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
12265         makes us properly catch 1510 in some conditions (see bug 56016 for
12266         details). 
12267
12268 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
12269
12270         * CryptoConvert.cs: update from corlib version
12271         with endian fixes.
12272
12273 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
12274
12275         * class.cs (Indexer.Define): Check indexername declaration
12276
12277 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
12278
12279         * attribute.cs (IsClsCompliant): Fixed problem with handling
12280         all three states (compliant, not-compliant, undetected).
12281
12282 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
12283
12284         * attribute.cs (Attribute): Location is now public.
12285         (Resolve): Store resolved arguments (pos_values) in attribute class.
12286         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
12287         (GetClsCompliantAttributeValue): New method that gets
12288         CLSCompliantAttribute value.
12289         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
12290         if exists else null.
12291         (AttributeTester): New class for CLS-Compliant verification routines.
12292
12293         * class.cs (Emit): Add CLS-Compliant verification.
12294         (Method.GetSignatureForError): Implemented.
12295         (Constructor.GetSignatureForError): Implemented
12296         (Constructor.HasCompliantArgs): Returns if constructor has
12297         CLS-Compliant arguments.
12298         (Constructor.Emit): Override.
12299         (Construcor.IsIdentifierClsCompliant): New method; For constructors
12300         is needed to test only parameters.
12301         (FieldBase.GetSignatureForError): Implemented.
12302         (TypeContainer): New member for storing base interfaces.
12303         (TypeContainer.FindMembers): Search in base interfaces too.
12304
12305         * codegen.cs (GetClsComplianceAttribute): New method that gets
12306         assembly or module CLSCompliantAttribute value.
12307         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
12308         for assembly.
12309         (ModuleClass.Emit): Add error 3012 test.
12310
12311         * const.cs (Emit): Override and call base for CLS-Compliant tests.
12312
12313         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
12314         state for all decl types.
12315         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
12316         if CLS-Compliant tests are required.
12317         (IsClsCompliaceRequired): New method. Analyze whether code
12318         must be CLS-Compliant.
12319         (IsExposedFromAssembly): New method. Returns true when MemberCore
12320         is exposed from assembly.
12321         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
12322         value or gets cached value.
12323         (HasClsCompliantAttribute): New method. Returns true if MemberCore
12324         is explicitly marked with CLSCompliantAttribute.
12325         (IsIdentifierClsCompliant): New abstract method. This method is
12326         used to testing error 3005.
12327         (IsIdentifierAndParamClsCompliant): New method. Common helper method
12328         for identifier and parameters CLS-Compliant testing.
12329         (VerifyClsCompliance): New method. The main virtual method for
12330         CLS-Compliant verifications.
12331         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
12332         null. I don't know why is null (too many public members !).
12333         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
12334         and get value of first CLSCompliantAttribute that found.
12335
12336         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
12337         (VerifyClsCompliance): Override and add extra tests.
12338
12339         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
12340         clscheck- disable CLS-Compliant verification event if assembly is has
12341         CLSCompliantAttribute(true).
12342
12343         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
12344         ApllyAttribute is now called in emit section as in the other cases.
12345         Possible future Emit integration.
12346         (IsIdentifierClsCompliant): New override.
12347         (VerifyClsCompliance): New override.
12348         (GetEnumeratorName): Returns full enum name.
12349
12350         * parameter.cs (GetSignatureForError): Implemented.
12351
12352         * report.cs (WarningData): New struct for Warning message information.
12353         (LocationOfPreviousError): New method.
12354         (Warning): New method. Reports warning based on the warning table.
12355         (Error_T): New method. Reports error based on the error table.
12356
12357         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
12358         verifications are done here.
12359
12360         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
12361
12362         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
12363         CLSCompliantAttribute.
12364         (all_imported_types): New member holds all imported types from other
12365         assemblies.
12366         (LoadAllImportedTypes): New method fills static table with exported types
12367         from all referenced assemblies.
12368         (Modules): New property returns all assembly modules.
12369
12370 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
12371
12372         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
12373         throwing a parser error.
12374
12375         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
12376         which removes the hardcoded get_/set_ prefixes for properties, as
12377         IL allows for the properties to be named something else.  
12378
12379         Bug #56013
12380
12381         * expression.cs: Do not override operand before we know if it is
12382         non-null.  Fix 56207
12383
12384 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12385
12386         * typemanager.cs: support for pinned variables.
12387
12388 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12389
12390         * decl.cs, typemanager.cs: Avoid using an arraylist
12391         as a buffer if there is only one result set.
12392
12393 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12394
12395         * expression.cs: Make sure you cant call a static method
12396         with an instance expression, bug #56174.
12397
12398 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
12399
12400         * class.cs (IsDuplicateImplementation): Improve error reporting to
12401         flag 663 (method only differs in parameter modifier).
12402
12403         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12404         in preprocessor directives.
12405
12406         * location.cs (LookupFile): Allow for the empty path.
12407
12408         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
12409         better approach for some of that patch, but its failing with the
12410         CharSet enumeration.  For now try/catch will do.
12411
12412         * typemanager.cs: Do not crash if a struct does not have fields.
12413         Fixes 56150.
12414
12415 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12416
12417         * expression.cs: cs0213, cant fix a fixed expression.
12418         fixes 50231.
12419
12420 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12421
12422         * cs-parser.jay: detect invalid embeded statements gracefully.
12423         bug #51113.
12424
12425 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12426
12427         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12428         As a regex:
12429         s/
12430         the invocation type may not be a subclass of the tye of the item/
12431         The type of the item must be a subclass of the invocation item.
12432         /g
12433
12434         Fixes bug #50820.
12435
12436 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
12437
12438         * attribute.cs: Added methods to get a string and a bool from an
12439         attribute. Required to information from AssemblyKeyFileAttribute,
12440         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12441         * codegen.cs: Modified AssemblyName creation to include support for
12442         strongnames. Catch additional exceptions to report them as CS1548.
12443         * compiler.csproj: Updated include CryptoConvert.cs.
12444         * compiler.csproj.user: Removed file - user specific configuration.
12445         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
12446         Mono.Security assembly. The original class is maintained and tested in
12447         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12448         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12449         like CSC 8.0 (C# v2) supports.
12450         * Makefile: Added CryptoConvert.cs to mcs sources.
12451         * rootcontext.cs: Added new options for strongnames.
12452
12453 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
12454
12455         * driver.cs: For --expect-error, report error code `2'
12456         if the program compiled with no errors, error code `1' if
12457         it compiled with an error other than the one expected.
12458
12459 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
12460
12461         * compiler.csproj: Updated for Visual Studio .NET 2003.
12462         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12463         * compiler.sln: Updated for Visual Studio .NET 2003.
12464
12465 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
12466
12467         * expression.cs: Fix bug #47234. We basically need to apply the
12468         rule that we prefer the conversion of null to a reference type
12469         when faced with a conversion to 'object' (csc behaviour).
12470
12471 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12472
12473         * statement.cs: Shorter form for foreach, eliminates
12474         a local variable. r=Martin.
12475
12476 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12477
12478         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12479         checks if we can use brtrue/brfalse to test for 0.
12480         * expression.cs: use the above in the test for using brtrue/brfalse.
12481         cleanup code a bit.
12482
12483 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12484
12485         * expression.cs: Rewrite string concat stuff. Benefits:
12486
12487         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12488         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12489         rather than a concat chain.
12490
12491         * typemanager.cs: Add lookups for more concat overloads.
12492
12493 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12494
12495         * expression.cs: Emit shorter il code for array init.
12496
12497         newarr
12498         dup
12499         // set 1
12500
12501         // set 2
12502
12503         newarr
12504         stloc.x
12505
12506         ldloc.x
12507         // set 1
12508
12509         ldloc.x
12510         // set 2
12511
12512 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
12513
12514         * statement.cs: Before, two switch blocks would be merged if the
12515         total size of the blocks (end_item - begin_item + 1) was less than
12516         two times the combined sizes of the blocks.
12517
12518         Now, it will only merge if after the merge at least half of the
12519         slots are filled.
12520
12521         fixes 55885.
12522
12523 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
12524
12525         * class.cs : csc build fix for GetMethods(). See bug #52503.
12526
12527 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
12528
12529         * expression.cs: Make sure fp comparisons work with NaN.
12530         This fixes bug #54303. Mig approved this patch a long
12531         time ago, but we were not able to test b/c the runtime
12532         had a related bug.
12533
12534 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
12535
12536         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
12537
12538 2004-03-19  Martin Baulig  <martin@ximian.com>
12539
12540         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
12541         two overloads may unify for some type parameter substitutions and
12542         report a CS0408 if appropriate.
12543
12544 2004-03-19  Martin Baulig  <martin@ximian.com>
12545
12546         * class.cs (MemberCore.IsDuplicateImplementation): Report the
12547         error here and not in our caller.
12548
12549 2004-03-19  Martin Baulig  <martin@ximian.com>
12550
12551         * interface.cs: Completely killed this file.
12552         (Interface): We're now a TypeContainer and live in class.cs.
12553
12554         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12555         argument; we're now also called for interfaces.
12556         (TypeContainer.DefineMembers): Allow this method being called
12557         multiple times.
12558         (TypeContainer.GetMethods): New public method; formerly known as
12559         Interface.GetMethod().  This is used by PendingImplementation.
12560         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12561         it's now private and non-static.
12562         (Interface): Moved this here; it's now implemented similar to
12563         Class and Struct.
12564         (Method, Property, Event, Indexer): Added `bool is_interface'
12565         argument to their .ctor's.
12566         (MemberBase.IsInterface): New public field.
12567
12568         * cs-parser.jay: Create normal Method, Property, Event, Indexer
12569         instances instead of InterfaceMethod, InterfaceProperty, etc.
12570         (opt_interface_base): Removed; we now use `opt_class_base' instead.
12571         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12572
12573 2004-03-19  Martin Baulig  <martin@ximian.com>
12574
12575         * class.cs (MethodCore.IsDuplicateImplementation): New private
12576         method which does the CS0111 checking.
12577         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12578         Use IsDuplicateImplementation().
12579
12580 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
12581
12582         * decl.cs (FindMemberToOverride): New method to find the correct
12583         method or property to override in the base class.
12584         * class.cs
12585             - Make Method/Property use the above method to find the
12586               version in the base class.
12587             - Remove the InheritableMemberSignatureCompare as it is now
12588               dead code.
12589
12590         This patch makes large code bases much faster to compile, as it is
12591         O(n) rather than O(n^2) to do this validation.
12592
12593         Also, it fixes bug 52458 which is that nested classes are not
12594         taken into account when finding the base class member.
12595
12596         Reviewed/Approved by Martin.
12597
12598 2004-03-17  Martin Baulig  <martin@ximian.com>
12599
12600         * expression.cs (MemberAccess.DoResolve): Take the parent's number
12601         of type arguments into account; use the `real_num_type_args'
12602         approach like in DoResolveAsTypeStep().
12603
12604         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
12605         nested types.
12606
12607 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
12608
12609         * interface.cs: In all interface classes removed redundant
12610         member initialization.
12611
12612 2004-03-16  Martin Baulig  <martin@ximian.com>
12613
12614         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12615
12616 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12617
12618         * decl.cs (DefineTypeAndParents): New helper method to define a
12619         type's containers before the type itself is defined;  This is a
12620         bug exposed by the recent changes to Windows.Forms when an
12621         implemented interface was defined inside a class that had not been
12622         built yet.   
12623
12624         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12625
12626         (Check): Loop correctly to report errors modifiers
12627         (UNSAFE was not in the loop, since it was the same as TOP).
12628
12629         * interface.cs: Every interface member now takes a ModFlags,
12630         instead of a "is_new" bool, which we set on the base MemberCore. 
12631
12632         Every place where we called "UnsafeOk" in the interface, now we
12633         call the proper member (InterfaceMethod.UnsafeOK) instead to get
12634         the unsafe settings from the member declaration instead of the
12635         container interface. 
12636
12637         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
12638
12639         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12640         `set_indexer_name' to the pending bits (one per type).
12641
12642         We fixed a bug today that was picking the wrong method to
12643         override, since for properties the existing InterfaceMethod code
12644         basically ignored the method name.  Now we make sure that the
12645         method name is one of the valid indexer names.
12646
12647 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
12648  
12649         * support.cs (SeekableStreamReader): Keep track of stream byte
12650         positions and don't mix them with character offsets to the buffer.
12651
12652         Patch from Gustavo Giráldez
12653
12654 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
12655
12656         * interface.cs (InterfaceSetGetBase): Removed double member
12657         initialization, base class does it as well.
12658
12659 2004-03-13  Martin Baulig  <martin@ximian.com>
12660
12661         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12662         when compiling corlib.
12663
12664 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
12665
12666         * convert.cs (ExplicitConversion): We were reporting an error on
12667         certain conversions (object_type source to a value type, when the
12668         expression was `null') before we had a chance to pass it through
12669         the user defined conversions.
12670
12671         * driver.cs: Replace / and \ in resource specifications to dots.
12672         Fixes 50752
12673
12674         * class.cs: Add check for duplicate operators.  Fixes 52477
12675
12676 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
12677
12678         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12679         that are in the middle of the statements, not only at the end.
12680         Fixes #54987
12681
12682         * class.cs (TypeContainer.AddField): No longer set the
12683         `HaveStaticConstructor' flag, now we call it
12684         `UserDefineStaticConstructor' to diferentiate the slightly
12685         semantic difference.
12686
12687         The situation is that we were not adding BeforeFieldInit (from
12688         Modifiers.TypeAttr) to classes that could have it.
12689         BeforeFieldInit should be set to classes that have no static
12690         constructor. 
12691
12692         See:
12693
12694         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12695
12696         And most importantly Zoltan's comment:
12697
12698         http://bugzilla.ximian.com/show_bug.cgi?id=44229
12699
12700         "I think beforefieldinit means 'it's ok to initialize the type sometime 
12701          before its static fields are used', i.e. initialization does not need
12702          to be triggered by the first access to the type. Setting this flag
12703          helps the JIT to compile better code, since it can run the static
12704          constructor at JIT time, and does not need to generate code to call it
12705          (possibly lots of times) at runtime. Unfortunately, mcs does not set
12706          this flag for lots of classes like String. 
12707          
12708          csc sets this flag if the type does not have an explicit static 
12709          constructor. The reasoning seems to be that if there are only static
12710          initalizers for a type, and no static constructor, then the programmer
12711          does not care when this initialization happens, so beforefieldinit
12712          can be used.
12713          
12714          This bug prevents the AOT compiler from being usable, since it 
12715          generates so many calls to mono_runtime_class_init that the AOT code
12716          is much slower than the JITted code. The JITted code is faster, 
12717          because it does not generate these calls if the vtable is type is
12718          already initialized, which is true in the majority of cases. But the
12719          AOT compiler can't do this."
12720
12721 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
12722
12723         * class.cs (MethodData.Emit): Refactor the code so symbolic
12724         information is generated for destructors;  For some reasons we
12725         were taking a code path that did not generate symbolic information
12726         before. 
12727
12728 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12729
12730         * class.cs: Create a Constructor.CheckBase method that
12731         takes care of all validation type code. The method
12732         contains some code that was moved from Define.
12733
12734         It also includes new code that checks for duplicate ctors.
12735         This fixes bug #55148.
12736
12737 2004-03-09  Joshua Tauberer <tauberer@for.net>
12738
12739         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12740         a { ... }-style array creation invokes EmitStaticInitializers
12741         which is not good for reference-type arrays.  String, decimal
12742         and now null constants (NullCast) are not counted toward
12743         static initializers.
12744
12745 2004-03-05  Martin Baulig  <martin@ximian.com>
12746
12747         * location.cs (SourceFile.HasLineDirective): New public field;
12748         specifies whether the file contains or is referenced by a "#line"
12749         directive.
12750         (Location.DefineSymbolDocuments): Ignore source files which
12751         either contain or are referenced by a "#line" directive.        
12752
12753 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
12754
12755         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12756         direct access to our parent, so check the method inline there.
12757
12758 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12759
12760         * expression.cs (Invocation.EmitCall): Miguel's last commit
12761         caused a regression. If you had:
12762
12763             T t = null;
12764             t.Foo ();
12765
12766         In Foo the implict this would be null.
12767
12768 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
12769
12770         * expression.cs (Invocation.EmitCall): If the method is not
12771         virtual, do not emit a CallVirt to it, use Call.
12772
12773         * typemanager.cs (GetFullNameSignature): Improve the method to
12774         cope with ".ctor" and replace it with the type name.
12775
12776         * class.cs (ConstructorInitializer.Resolve): Now the method takes
12777         as an argument the ConstructorBuilder where it is being defined,
12778         to catch the recursive constructor invocations.
12779
12780 2004-03-16  Martin Baulig  <martin@ximian.com>
12781
12782         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
12783         ConstructedType, call ResolveType() on it to get the type rather
12784         than just using `expr.Type'.
12785
12786 2004-03-16  Martin Baulig  <martin@ximian.com>
12787
12788         * generics.cs (ConstructedType.GetMemberAccess): Take the
12789         EmitContext instead on the TypeExpr and use
12790         ec.TypeContainer.CurrentType/ec.ContainerType.
12791
12792 2004-03-16  Martin Baulig  <martin@ximian.com>
12793
12794         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
12795         parameters before aliases.
12796
12797 2004-03-16  Martin Baulig  <martin@ximian.com>
12798
12799         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
12800         New oublic function; checks whether two generic instances may become
12801         equal under some instantiations (26.3.1).
12802
12803         * class.cs (TypeContainer.Define): Call
12804         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
12805         error.
12806
12807 2004-03-16  Martin Baulig  <martin@ximian.com>
12808
12809         * class.cs (TypeContainer.GetClassBases): Moved
12810         Error_TypeParameterAsBase() here and also check whether the base
12811         class is not an attribute.
12812
12813 2004-03-16  Martin Baulig  <martin@ximian.com>
12814
12815         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12816
12817 2004-03-16  Martin Baulig  <martin@ximian.com>
12818
12819         * class.cs (Error_TypeParameterAsBase): Use correct error number
12820         here (CS0689).  
12821
12822 2004-03-16  Martin Baulig  <martin@ximian.com>
12823
12824         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
12825         for generics.
12826
12827         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
12828         error reporting.
12829
12830 2004-03-15  Martin Baulig  <martin@ximian.com>
12831
12832         * typemanager.cs (TypeManager.GetFullName): New public method.
12833         (TypeManager.MemberLookup): Added `int_num_type_arguments'
12834         argument; only return members with the correct number of type
12835         arguments.
12836         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
12837         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
12838         whether the number of type arguments matches.
12839
12840         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
12841         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
12842
12843         * expression.cs (MemberAccess): Added public `NumTypeArguments'
12844         field; it's set by the protected .ctor when we're actually a
12845         GenericMemberAccess.
12846         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
12847         arguments and pass it to MemberLookupFinal ().
12848
12849         * ecore.cs (Expression.MemberLookup): Added `int
12850         num_type_arguments' argument; only return members with the correct
12851         number of type arguments.
12852         (Expression.MemberLookupFailed): Check whether the MemberLookup
12853         failed because we did not have the correct number of type
12854         arguments; report CS0305 in this case.
12855
12856         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
12857         `e.ResolveAsTypeTerminal()' already did so.
12858
12859 2004-03-15  Martin Baulig  <martin@ximian.com>
12860
12861         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
12862         we're a ConstructedType; in this case, the caller must report an
12863         error (for instance CS0131).
12864
12865         * generic.cs (TypeArguments): Added Location argument to the .ctor.
12866         (TypeArguments.Resolve): Actually report errors here.
12867
12868 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12869
12870         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12871         `set_indexer_name' to the pending bits (one per type).
12872
12873         We fixed a bug today that was picking the wrong method to
12874         override, since for properties the existing InterfaceMethod code
12875         basically ignored the method name.  Now we make sure that the
12876         method name is one of the valid indexer names.
12877
12878 2004-03-15  Martin Baulig  <martin@ximian.com>
12879
12880         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
12881         for generic instances.
12882
12883 2004-03-13  Martin Baulig  <martin@ximian.com>
12884
12885         * class.cs (TypeContainer.DefineType): Call
12886         TypeManager.AddUserType() immediately after creating the
12887         TypeBuilder; pass all type parameters when creating the
12888         CurrentType.
12889
12890         * decl.cs (DeclSpace.FindNestedType): New public method.
12891         (DeclSpace.FindType): Added `int num_type_args' argument; only
12892         return types with the correct number of type parameters.
12893         (DeclSpace.CountTypeParams): New public property.
12894
12895         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
12896         the number of type parameters; defaults to zero.
12897
12898         * generic.cs (TypeArguments.Count): New public property.
12899         (ConstructedType.DoResolveAsTypeStep): First call
12900         ds.FindNestedType() to find out whether we're nested in the
12901         current generic type; in this case, we inherit all type parameters
12902         from the current class.
12903
12904         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
12905         num_type_args' argument.
12906         (RootContext.LookupType): Added overloaded version which takes the
12907         number of type arguments; only return types with the correct
12908         number of type arguments.
12909
12910         * typemanager.cs (TypeManager.CheckGeneric): New public function;
12911         checks whether `Type t' has `int num_type_args'.
12912
12913 2004-03-13  Martin Baulig  <martin@ximian.com>
12914
12915         * generic.cs (GenericMethod.DefineType): New method; calls
12916         DefineType() on all the type parameters.
12917
12918         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
12919         (MethodData.Define): If we're a generic method, call
12920         GenericMethod.DefineType() to define the type parameters.       
12921
12922 2004-03-10  Martin Baulig  <martin@ximian.com>
12923
12924         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
12925         instead of IsAssignableFrom.    
12926
12927 2004-03-10  Martin Baulig  <martin@ximian.com>
12928
12929         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
12930
12931         * support.cs (ParameterData.HasArrayParameter): New property.
12932         (ReflectionParameters.ctor): Take a MethodBase instead of a
12933         ParameterInfo[].  If we have any type parameters, get the generic
12934         method definition and ask it whether we have variable arguments.
12935
12936 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
12937
12938         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12939         routines to check if a type is an enumerable/enumerator allow
12940         classes that implement the IEnumerable or IEnumerator interfaces.
12941
12942         * class.cs (Property, Operator): Implement IIteratorContainer, and
12943         implement SetYields.
12944
12945         (Property.Define): Do the block swapping for get_methods in the
12946         context of iterators.   We need to check if Properties also
12947         include indexers or not.
12948
12949         (Operator): Assign the Block before invoking the
12950         OperatorMethod.Define, so we can trigger the Iterator code
12951         replacement. 
12952
12953         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
12954         Property and Operator classes are not created when we parse the
12955         declarator but until we have the block completed, so we use a
12956         singleton SimpleIteratorContainer.Simple to flag whether the
12957         SetYields has been invoked.
12958
12959         We propagate this setting then to the Property or the Operator to
12960         allow the `yield' to function.
12961
12962 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
12963
12964         * codegen.cs: Implemented attribute support for modules.
12965         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12966         Assembly/Module functionality.
12967
12968         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12969         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12970         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12971
12972 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
12973
12974         * interface.cs (FindMembers): The operation is performed on all base
12975         interfaces and not only on the first. It is required for future CLS Compliance patch.
12976
12977 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12978
12979         * statement.cs, codegen.cs:
12980         This patch deals with patterns such as:
12981
12982         public class List : IEnumerable {
12983
12984                 public MyEnumerator GetEnumerator () {
12985                         return new MyEnumerator(this);
12986                 }
12987
12988                 IEnumerator IEnumerable.GetEnumerator () {
12989                         ...
12990                 }
12991                 
12992                 public struct MyEnumerator : IEnumerator {
12993                         ...
12994                 }
12995         }
12996
12997         Before, there were a few things we did wrong:
12998         1) we would emit callvirt on a struct, which is illegal
12999         2) we emited ldarg when we needed to emit ldarga
13000         3) we would mistakenly call the interface methods on an enumerator
13001         type that derived from IEnumerator and was in another assembly. For example:
13002
13003         public class MyEnumerator : IEnumerator
13004
13005         Would have the interface methods called, even if there were public impls of the
13006         method. In a struct, this lead to invalid IL code.
13007
13008 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
13009
13010         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
13011           renamed to Emit.
13012
13013         * delegate.cs (Define): Fixed crash when delegate type is undefined.
13014
13015 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
13016
13017         * cs-parser.jay: Fix small regression: we were not testing V2
13018         compiler features correctly.
13019
13020         * interface.cs: If the emit context is null, then create one
13021
13022 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
13023
13024         * decl.cs (GetSignatureForError): New virtual method to get full name
13025           for error messages.
13026
13027         * attribute.cs (IAttributeSupport): New interface for attribute setting.
13028           Now it is possible to rewrite ApplyAttributes method to be less if/else.
13029
13030         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
13031           Duplicated members and code in these classes has been removed.
13032           Better encapsulation in these classes.
13033
13034 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
13035
13036         * assign.cs (Assign.DoResolve): When dealing with compound
13037         assignments, there is a new rule in ECMA C# 2.4 (might have been
13038         there before, but it is documented here) that states that in:
13039
13040         a op= b;
13041
13042         If b is of type int, and the `op' is a shift-operator, then the
13043         above is evaluated as:
13044
13045         a = (int) a op b 
13046
13047         * expression.cs (Binary.ResolveOperator): Instead of testing for
13048         int/uint/long/ulong, try to implicitly convert to any of those
13049         types and use that in pointer arithmetic.
13050
13051         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
13052         method to print information for from the type, not from the
13053         null-method we were given.
13054
13055 2004-02-01  Duncan Mak  <duncan@ximian.com>
13056
13057         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
13058         parsing for cmd, fixes bug #53694.
13059
13060 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
13061
13062         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
13063         in the member name duplication tests. Property and operator name duplication
13064         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
13065
13066 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
13067
13068         * interface.cs (PopulateMethod): Fixed crash when interface method
13069         returns not existing type (error test cs0246-3.cs).
13070
13071 2004-02-02  Ravi Pratap M <ravi@ximian.com>
13072
13073         * cs-parser.jay (interface_accessors): Re-write actions to also
13074         store attributes attached to get and set methods. Fix spelling
13075         while at it.
13076
13077         (inteface_property_declaration): Modify accordingly.
13078
13079         (InterfaceAccessorInfo): New helper class to store information to pass
13080         around between rules that use interface_accessors.
13081
13082         * interface.cs (Emit): Apply attributes on the get and set
13083         accessors of properties and indexers too.
13084
13085         * attribute.cs (ApplyAttributes): Modify accordingly to use the
13086         right MethodBuilder when applying attributes to the get and set accessors.
13087
13088 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
13089
13090         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
13091
13092 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
13093
13094         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
13095
13096 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
13097
13098         * cs-parser.jay: Remove YIELD token, instead use the new grammar
13099         changes that treat `yield' specially when present before `break'
13100         or `return' tokens.
13101
13102         * cs-tokenizer.cs: yield is no longer a keyword.
13103
13104 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
13105
13106         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
13107         setting for default constructors.
13108         For default constructors are almost every time set wrong Modifier. The
13109         generated IL code has been alright. But inside mcs this values was
13110         wrong and this was reason why several of my CLS Compliance tests
13111         failed.
13112
13113 2004-02-27  Martin Baulig  <martin@ximian.com>
13114
13115         * generics.cs (ConstructedType.ResolveType): Make the nested type
13116         stuff actually work.
13117
13118 2004-02-25  Martin Baulig  <martin@ximian.com>
13119
13120         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
13121         property; returns the type parameters just from the current type,
13122         ie. with the ones from outer classes.
13123         (DeclSpace.LookupGeneric): First search in the current class, then
13124         in outer classes.
13125         (DeclSpace.initialize_type_params): When hiding a type parameter
13126         from an outer class, put it into the `type_param_list' anyways.
13127
13128         * expression.cs (MemberAccess.expr): Made this field protected.
13129
13130         * class.cs (TypeContainer.Define): The `CurrentType' just contains
13131         the type parameters from the current class.
13132
13133         * generic.cs (ConstructedType.ResolveType): Support nested generic
13134         types by taking the type parameters which we inherit from outer
13135         classes into account.
13136         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
13137         support for nested generic types.
13138
13139 2004-02-23  Martin Baulig  <martin@ximian.com>
13140
13141         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
13142         field and check whether we're nested inside a generic type.
13143         (DeclSpace.ResolveType): If we're resolving to a generic type
13144         definition, create a ConstructedType and return its resolved type.
13145         (DeclSpace.initialize_type_params): New private method;
13146         initializes the `type_param_list' field from the type parameters
13147         from this and all enclosing classes.
13148         (DeclSpace.TypeParameters): Call initialize_type_params() unless
13149         we're already initialized.
13150
13151 2004-02-23  Martin Baulig  <martin@ximian.com>
13152
13153         * class.cs (Method.Define): Create the generic method before
13154         calling DoDefine().
13155         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
13156         the TypeContainer one); we use this for generic methods.
13157
13158         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
13159         parent's TypeBuilder.
13160
13161 2004-02-18  Martin Baulig  <martin@ximian.com>
13162
13163         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
13164         to check for equality.
13165
13166 2004-02-05  Martin Baulig  <martin@ximian.com>
13167
13168         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
13169         `ec.TypeContainer.CurrentType', use it instead of
13170         `ec.ContainerType' to check whether we're in the type's ctor.
13171
13172 2004-01-29  Martin Baulig  <martin@ximian.com>
13173
13174         * expression.cs (Invocation.DoResolve): If we're a
13175         `ConstructedType', then we're actually a generic method, so
13176         rewrite the expr as a GenericMemberAccess.
13177
13178         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
13179         here; manually parse it into a string.
13180
13181 2004-01-28  Martin Baulig  <martin@ximian.com>
13182
13183         * typemanager.cs (TypeManager.IsEqual): New static method.
13184         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
13185         check for equality instead of using `=='.
13186
13187 2004-01-26  Martin Baulig  <martin@ximian.com>
13188
13189         * decl.cs (DeclSpace.CurrentType): New public field.
13190
13191         * expression.cs (This.ResolveBase): If we have an
13192         `ec.TypeContainer.CurrentType', use it instead of
13193         `ec.ContainerType'.
13194
13195         * class.cs (TypeContainer.DefineType): If we're a generic type,
13196         create the `CurrentType' (unresolved).
13197         (TypeContainer.GenericType): New private field.
13198         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
13199         it and store it in `GenericType' before creating the MemberCache.
13200         (TypeContainer.GetMembers): If we have a `GenericType', call
13201         TypeManager.FindMembers() on it.
13202
13203         * interface.cs (Interface.GenericType): New private field.
13204         (Interface.DefineType): If we're a generic type, create the
13205         `CurrentType' (unresolved).
13206         (Interface.DefineMembers): If we have a `CurrentType', resolve it
13207         and store it in `GenericType' before creating the MemberCache.
13208         (Interface.GetMembers): If we have a `GenericType', call
13209         TypeManager.FindMembers() on it.
13210
13211 2004-01-22  Martin Baulig  <martin@ximian.com>
13212
13213         * cs-parser.jay (namespace_or_type_name): Return an Expression,
13214         not a QualifiedIdentifier.  This is what `type_name_expression'
13215         was previously doing.
13216         (type_name_expression): Removed; the code is now in
13217         `namespace_or_type_name'.
13218         (qualified_identifier): Removed, use `namespace_or_type_name'
13219         instead.
13220         (QualifiedIdentifier): Removed this class.      
13221
13222 2004-01-22  Martin Baulig  <martin@ximian.com>
13223
13224         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
13225         not a string as alias name.
13226
13227 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
13228
13229         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
13230         #52730 bug, and instead compute correctly the need to use a
13231         temporary variable when requesting an address based on the
13232         static/instace modified of the field and the constructor.
13233  
13234 2004-01-21  Martin Baulig  <martin@ximian.com>
13235
13236         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
13237         class and namespace before looking up aliases.  Fixes #52517.
13238
13239 2004-01-21  Martin Baulig  <martin@ximian.com>
13240
13241         * flowanalysis.cs (UsageVector.Merge): Allow variables being
13242         assinged in a 'try'; fixes exception4.cs.
13243
13244 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13245         * class.cs : Implemented parameter-less constructor for TypeContainer
13246
13247         * decl.cs: Attributes are now stored here. New property OptAttributes
13248
13249         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
13250
13251         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
13252
13253 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13254
13255         * typemanager.cs (CSharpSignature): Now reports also inner class name.
13256           (CSharpSignature): New method for indexer and property signature.
13257
13258 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13259
13260         * pending.cs (IsVirtualFilter): Faster implementation.
13261
13262 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13263
13264         * typemanager.cs: Avoid inclusion of same assembly more than once.
13265
13266 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13267
13268         * cs-parser.jay: Fixed problem where the last assembly attribute
13269           has been applied also to following declaration (class, struct, etc.)
13270           
13271 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13272
13273         * class.cs: Added error CS0538, CS0539 reporting.
13274         Fixed crash on Microsoft runtime when field type is void.
13275
13276         * cs-parser.jay: Added error CS0537 reporting.
13277
13278         * pending.cs: Added error CS0535 reporting.
13279         Improved error report for errors CS0536, CS0534.
13280
13281 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
13282
13283         Merge a few bits from the Anonymous Method MCS tree.
13284
13285         * statement.cs (ToplevelBlock): New class for toplevel methods,
13286         will hold anonymous methods, lifted variables.
13287
13288         * cs-parser.jay: Create toplevel blocks for delegates and for
13289         regular blocks of code. 
13290
13291 2004-01-20  Martin Baulig  <martin@ximian.com>
13292
13293         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
13294         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
13295         and `NeedExplicitReturn'; added `IsLastStatement'.
13296         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
13297         have a `ReturnLabel' or we're not unreachable.
13298
13299         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
13300         child's reachability; don't just override ours with it.  Fixes
13301         #58058 (lluis's example).
13302         (FlowBranching): Added public InTryOrCatch(), InCatch(),
13303         InFinally(), InLoop(), InSwitch() and
13304         BreakCrossesTryCatchBoundary() methods.
13305
13306         * statement.cs (Return): Do all error checking in Resolve().
13307         Unless we are the last statement in a top-level block, always
13308         create a return label and jump to it.
13309         (Break, Continue): Do all error checking in Resolve(); also make
13310         sure we aren't leaving a `finally'.
13311         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
13312         statement in a top-level block.
13313         (Block.Flags): Added `IsDestructor'.
13314         (Block.IsDestructor): New public property.
13315
13316 2004-01-20  Martin Baulig  <martin@ximian.com>
13317
13318         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
13319
13320 2004-01-20  Martin Baulig  <martin@ximian.com>
13321
13322         * statement.cs (Statement.ResolveUnreachable): New public method.
13323         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
13324         (Block.Resolve): Resolve unreachable statements.
13325
13326 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13327
13328         * expression.cs: We need to fix the case where we do
13329         not have a temp variable here.
13330
13331         * assign.cs: Only expression compound assignments need
13332         temporary variables.
13333
13334 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13335
13336         * flowanalysis.cs: Reduce memory allocation in a few ways:
13337           - A block with no variables should not allocate a bit
13338             vector for itself.
13339           - A method with no out parameters does not need any tracking
13340             for assignment of the parameters, so we need not allocate
13341             any data for it.
13342           - The arrays:
13343                 public readonly Type[] VariableTypes;
13344                 public readonly string[] VariableNames;
13345             Are redundant. The data is already stored in the variable
13346             map, so we need not allocate another array for it.
13347           - We need to add alot of checks for if (params | locals) == null
13348             due to the first two changes.
13349
13350 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
13351
13352         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
13353         implement IMemoryLocation, we store a copy on a local variable and
13354         take the address of it.  Patch from Benjamin Jemlich
13355
13356         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
13357         to use a special "type_name_expression" rule which reduces the
13358         number of "QualifiedIdentifier" classes created, and instead
13359         directly creates MemberAccess expressions.
13360
13361 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
13362
13363         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
13364         that fixes #52853.  Null literal assignment to ValueType
13365
13366         * class.cs (MethodData.Emit): Instead of checking the name of the
13367         method to determine if its a destructor, create a new derived
13368         class from Method called Destructor, and test for that.  
13369
13370         * cs-parser.jay: Create a Destructor object instead of a Method.  
13371
13372         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
13373
13374         Fixes: 52933
13375
13376 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
13377
13378         * expression.cs (Binary.ResolveOperator): Perform an implicit
13379         conversion from MethodGroups to their delegate types on the
13380         Addition operation.
13381
13382         * delegate.cs: Introduce a new class DelegateCreation that is the
13383         base class for `NewDelegate' and `ImplicitDelegateCreation',
13384         factor some code in here.
13385
13386         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
13387         conversion from MethodGroups to compatible delegate types. 
13388
13389         * ecore.cs (Expression.Resolve): Do not flag error 654
13390         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
13391         we allow conversions from MethodGroups to delegate types now.
13392
13393         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
13394         assignments in v2 either.
13395
13396 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
13397
13398         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
13399         static read-only fields in ctors.
13400
13401         Applied patch from Benjamin Jemlich 
13402
13403         * expression.cs (UnaryMutator): Avoid leaking local variables. 
13404
13405 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
13406
13407         * cs-tokenizer.cs (IsCastToken): Allow the various native types
13408         here to return true, as they can be used like this:
13409
13410                 (XXX) int.MEMBER ()
13411
13412         Fixed 49836 and all the other dups
13413
13414 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
13415
13416         * driver.cs: Implement /win32res and /win32icon.
13417
13418 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
13419
13420         * cs-parser.jay: Add a rule to improve error handling for the
13421         common mistake of placing modifiers after the type.
13422
13423 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
13424
13425         * cs-parser.jay (interface_event_declaration): Catch
13426         initialization of events on interfaces, and report cs0068
13427
13428         * cs-parser.jay (interface_event_declaration): Catch
13429         initialization of events. 
13430
13431         * ecore.cs: Better report missing constructors.
13432
13433         * expression.cs (Binary.ResolveOperator): My previous bug fix had
13434         the error reporting done in the wrong place.  Fix.
13435
13436         * expression.cs (Binary.ResolveOperator): Catch the 
13437         operator + (E x, E y) error earlier, and later allow for implicit
13438         conversions in operator +/- (E e, U x) from U to the underlying
13439         type of E.
13440
13441         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
13442         52596, if the container class is abstract, the default constructor
13443         is protected otherwise its public (before, we were always public).
13444
13445         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
13446         fixed statement.
13447
13448         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
13449         Jemlich that fixes bug #52597, MCS was generating invalid code for
13450         idisposable structs.   Thanks to Ben for following up with this
13451         bug as well.
13452
13453 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
13454
13455         * driver.cs: Allow assemblies without code to be generated, fixes
13456         52230.
13457
13458 2004-01-07  Nick Drochak <ndrochak@gol.com>
13459
13460         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
13461
13462 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
13463
13464         * cs-parser.jay: Add rules to improve error reporting if fields or
13465         methods are declared at the namespace level (error 116)
13466
13467         * Add rules to catch event add/remove
13468
13469 2004-01-04  David Sheldon <dave-mono@earth.li>
13470
13471   * expression.cs: Added matching ")" to error message for 
13472   CS0077
13473
13474 2004-01-03 Todd Berman <tberman@gentoo.org>
13475
13476         * ecore.cs, attribute.cs:
13477         Applying fix from #52429.
13478
13479 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13480
13481         * ecore.cs, expression.cs, statement.cs:
13482         Total rewrite of how we handle branching. We
13483         now handle complex boolean expressions with fewer
13484         jumps. As well if (x == 0) no longer emits a ceq.
13485
13486         if (x is Foo) is much faster now, because we generate
13487         better code.
13488
13489         Overall, we get a pretty big improvement on our benchmark
13490         tests. The code we generate is smaller and more readable.
13491
13492         I did a full two-stage bootstrap. The patch was reviewed
13493         by Martin and Miguel.
13494
13495 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13496
13497         * cs-parser.jay: Make primary_expression not take a QI.
13498         we dont need this because the member_access rule covers
13499         us here. So we replace the rule with just IDENTIFIER.
13500
13501         This has two good effects. First, we remove a s/r conflict.
13502         Second, we allocate many fewer QualifiedIdentifier objects.
13503
13504 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13505
13506         * attribute.cs: Handle MarshalAs attributes as pseudo, and
13507         set the correct information via SRE. This prevents
13508         hanging on the MS runtime. Fixes #29374.
13509
13510 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13511
13512         * convert.cs: correctly handle conversions to value types
13513         from Enum and ValueType as unboxing conversions.
13514
13515         Fixes bug #52569. Patch by Benjamin Jemlich.
13516
13517 2004-01-02  Ravi Pratap  <ravi@ximian.com>
13518
13519         * expression.cs (BetterConversion): Prefer int -> uint
13520         over int -> ulong (csc's behaviour). This fixed bug #52046.
13521
13522 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13523
13524         * decl.cs (MemberCache.FindMembers): now returns a
13525         MemberInfo [].
13526
13527         * typemanager.cs: In general, go with with ^^.
13528         (CopyNewMethods): take an IList.
13529         (RealMemberLookup): Only allocate an arraylist
13530         if we copy from two sets of methods.
13531
13532         This change basically does two things:
13533         1) Fewer array lists allocated due to CopyNewMethods.
13534         2) the explicit cast in MemberList costed ALOT.
13535
13536 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
13537
13538         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
13539         a hashtable to avoid needless string allocations when an identifier is
13540         used more than once (the common case).
13541
13542 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13543
13544         * pending.cs: MS's TypeBuilder.GetInterfaces ()
13545         is broken, it will not return anything. So, we
13546         have to use the information we have in mcs to
13547         do the task.
13548
13549         * typemanager.cs: Add a cache for GetInterfaces,
13550         since this will now be used more often (due to ^^)
13551
13552         (GetExplicitInterfaces) New method that gets the
13553         declared, not effective, interfaces on a type
13554         builder (eg, if you have interface IFoo, interface
13555         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
13556         { IBar }.
13557
13558         This patch makes MCS able to bootstrap itself on
13559         Windows again.
13560
13561 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13562
13563         * expression.cs: Remove the Nop's that Miguel put
13564         in by mistake.
13565
13566 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13567
13568         * report.cs, codegen.cs: Give the real stack trace to
13569         the error when an exception is thrown.
13570
13571 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13572
13573         * decl.cs: only allocate hashtables for ifaces if 
13574         it is an iface!
13575
13576 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13577
13578         * expression.cs: fix the error from cs0121-2.cs
13579         (a parent interface has two child interfaces that
13580         have a function with the same name and 0 params
13581         and the function is called through the parent).
13582
13583 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13584
13585         * class.cs, rootcontext.cs, typmanager.cs: do not
13586         leak pointers.
13587
13588 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
13589
13590         * codegen.cs: remove stack for the ec flow branching.
13591         It is already a linked list, so no need.
13592
13593 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
13594
13595         * Makefile: Allow custom profiler here.
13596
13597 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13598
13599         * typemanager.cs (LookupType):
13600           - Use a static char [], because split takes
13601             a param array for args, so it was allocating
13602             every time.
13603           - Do not store true in a hashtable, it boxes.
13604
13605 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13606
13607         * flowanalysis.cs: bytify common enums.
13608
13609 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13610
13611         * modifiers.cs: Add a new set of flags for the
13612         flags allowed on explicit interface impls.
13613         * cs-parser.jay: catch the use of modifiers in
13614         interfaces correctly.
13615         * class.cs: catch private void IFoo.Blah ().
13616
13617         All related to bug #50572.
13618
13619 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13620
13621         * decl.cs: Rewrite the consistant accessability checking.
13622         Accessability is not linear, it must be implemented in
13623         a tableish way. Fixes #49704.
13624
13625 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13626
13627         * expression.cs: Handle negation in a checked context.
13628         We must use subtraction from zero. Fixes #38674.
13629
13630 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13631
13632         * class.cs: Ignore static void main in DLLs.
13633         * rootcontext.cs: Handle the target type here,
13634         since we are have to access it from class.cs
13635         * driver.cs: account for the above.
13636
13637 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13638
13639         * report.cs: Give line numbers and files if available.
13640
13641 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
13642
13643         * driver.cs: Implement /addmodule.
13644
13645         * typemanager.cs:  Change 'modules' field so it now contains Modules not
13646         ModuleBuilders.
13647
13648 2003-12-20  Martin Baulig  <martin@ximian.com>
13649
13650         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13651         (FieldBase.IsAssigned): Removed this field.
13652         (FieldBase.SetAssigned): New public method.
13653         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13654
13655 2003-12-20  Martin Baulig  <martin@ximian.com>
13656
13657         * expression.cs (LocalVariableReference.DoResolve): Don't set
13658         `vi.Used' if we're called from DoResolveLValue().
13659
13660         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13661         returns the usage vector it just merged into the current one -
13662         pass this one to UsageWarning().
13663         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13664         of the `EmitContext', don't call this recursively on our children.
13665
13666 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
13667
13668         * driver.cs: Implement /target:module.
13669
13670 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
13671
13672         * support.cs (CharArrayHashtable): New helper class.
13673
13674         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
13675         char arrays, not strings, so we can avoid creating a string in
13676         consume_identifier if the identifier is a keyword.
13677
13678 2003-12-16  Martin Baulig  <martin@ximian.com>
13679
13680         * statement.cs (LocalInfo.Assigned): Removed this property.
13681         (LocalInfo.Flags): Removed `Assigned'.
13682         (LocalInfo.IsAssigned): New public method; takes the EmitContext
13683         and uses flow analysis.
13684         (Block.UsageWarning): Made this method private.
13685         (Block.Resolve): Call UsageWarning() if appropriate.
13686
13687         * expression.cs (LocalVariableReference.DoResolve): Always set
13688         LocalInfo.Used here.
13689
13690 2003-12-13  Martin Baulig  <martin@ximian.com>
13691
13692         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13693         any value here; we're now using flow analysis to figure out
13694         whether a statement/block returns a value.
13695
13696 2003-12-13  Martin Baulig  <martin@ximian.com>
13697
13698         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13699         working again.
13700         (FlowBranching.MergeFinally): Don't call
13701         `branching.CheckOutParameters()' here, this is called in
13702         MergeTopBlock().
13703         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13704         when adding the `finally' vector.       
13705
13706 2003-12-13  Martin Baulig  <martin@ximian.com>
13707
13708         * flowanalysis.cs
13709         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13710         actually work and also fix #48962.
13711
13712 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
13713
13714         * decl.cs: Do not check System.Object for nested types,
13715         since we know it does not have any. Big bang for buck:
13716
13717         BEFORE:
13718            Run 1:   8.35 seconds
13719            Run 2:   8.32 seconds
13720            corlib:  17.99 seconds
13721         AFTER:
13722            Run 1:   8.17 seconds
13723            Run 2:   8.17 seconds
13724            corlib:  17.39 seconds
13725
13726 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
13727
13728         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13729         time we are returning 0 members, so we save alot here.
13730
13731 2003-12-11  Martin Baulig  <martin@ximian.com>
13732
13733         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13734         `MergeChild()', also just take the `FlowBranching' as argument;
13735         call Merge() on it and return the result.
13736         (FlowBranching.Merge): We don't need to do anything if we just
13737         have one sibling.
13738
13739 2003-12-11  Martin Baulig  <martin@ximian.com>
13740
13741         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13742         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
13743         Maurer for this idea.
13744
13745 2003-12-11  Martin Baulig  <martin@ximian.com>
13746
13747         * flowanalysis.cs (MergeResult): This class is now gone; we now
13748         use the `UsageVector' for this.  The reason for this is that if a
13749         branching just has one sibling, we don't need to "merge" them at
13750         all - that's the next step to do.
13751         (FlowBranching.Merge): We now return a `UsageVector' instead of a
13752         `MergeResult'.
13753
13754 2003-12-11  Martin Baulig  <martin@ximian.com>
13755
13756         Reworked flow analyis and made it more precise and bug-free.  The
13757         most important change is that we're now using a special `Reachability'
13758         class instead of having "magic" meanings of `FlowReturns'.  I'll
13759         do some more cleanups and optimizations and also add some more
13760         documentation this week.
13761
13762         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13763         largely reworked this class.
13764         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13765         the new `Reachability' class instead of having "magic" values here.
13766         (FlowBranching): We're now using an instance of `Reachability'
13767         instead of having separate `Returns', `Breaks' etc. fields.
13768
13769         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13770         based on flow analysis; ignore the return value of block.Emit ().
13771
13772 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
13773
13774         * driver.cs typemanager.cs: Find the mono extensions to corlib even
13775         if they are private.
13776
13777 2003-12-09  Martin Baulig  <martin@ximian.com>
13778
13779         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13780         call them directly on the UsageVector.
13781
13782 2003-12-09  Martin Baulig  <martin@ximian.com>
13783
13784         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13785         Changed return type from `FlowReturns' to `Reachability'.
13786
13787 2003-12-09  Martin Baulig  <martin@ximian.com>
13788
13789         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13790         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13791         `Reachable' fields with a single `Reachability' one.
13792
13793 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13794
13795         * class.cs (FindMembers): Remove foreach's.
13796
13797         Bootstrap times:
13798
13799         BEFORE
13800                 Run 1:   8.74 seconds
13801                 Run 2:   8.71 seconds
13802
13803         AFTER
13804                 Run 1:   8.64 seconds
13805                 Run 2:   8.58 seconds
13806
13807
13808 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13809
13810         * cs-parser.jay:
13811         * gen-treedump.cs:
13812         * statement.cs:
13813         This patch does a few things:
13814                 1. EmptyStatement is now a singleton, so it is never reallocated.
13815                 2. All blah is EmptyStatement constructs have been changed to
13816                    blah == EmptyStatement.Value, which is much faster and valid
13817                    now that EmptyStatement is a singleton.
13818                 3. When resolving a block, rather than allocating a new array for
13819                    the non-empty statements, empty statements are replaced with
13820                    EmptyStatement.Value
13821                 4. Some recursive functions have been made non-recursive.
13822         Mainly the performance impact is from (3), however (1) and (2) are needed for
13823         this to work. (4) does not make a big difference in normal situations, however
13824         it makes the profile look saner.
13825
13826         Bootstrap times:
13827
13828         BEFORE
13829         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13830         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13831         Total memory allocated: 56397 KB
13832
13833         AFTER
13834         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13835         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13836         Total memory allocated: 55666 KB
13837
13838 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13839
13840         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13841         than the hashtable in a hashtable version
13842
13843         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13844         we always end up concating a string. This results in a huge perf
13845         loss, because many strings have to be tracked by the GC. In this
13846         patch, we first use a hashtable that works with two keys, so that
13847         the strings do not need to be concat'ed.
13848
13849         Bootstrap times:
13850         BEFORE
13851                 Run 1:   8.74 seconds
13852                 Run 2:   8.71 seconds
13853
13854         AFTER
13855                 Run 1:   8.65 seconds
13856                 Run 2:   8.56 seconds
13857
13858 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13859
13860         * Makefile: Add a new target `do-time' that does a quick and simple
13861         profile, leaving easy to parse output.
13862
13863 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
13864
13865         * codegen.cs (Init): Create the dynamic assembly with 
13866         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13867
13868 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13869
13870         * support.cs: Make the PtrHashtable use only one
13871         instance of its comparer.
13872
13873 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
13874
13875         * typemanager.cs: Fix lookup of GetNamespaces.
13876
13877 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
13878
13879         * expression.cs: Removed redundant line.
13880
13881         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13882         ArrayLists, use for loops with bounds.  
13883
13884         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13885         arraylist.
13886
13887         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13888         arraylists, use for loop with bounds.
13889
13890         The above three changes give us a 0.071 second performance
13891         improvement out of 3.294 seconds down to 3.223.  On my machine
13892         the above changes reduced the memory usage by 1,387 KB during
13893         compiler bootstrap.
13894
13895         * cs-parser.jay (QualifiedIdentifier): New class used to represent
13896         QualifiedIdentifiers.  Before we created a new string through
13897         concatenation, and mostly later on, the result would be
13898         manipulated by DecomposeQI through string manipulation.
13899
13900         This reduced the compiler memory usage for bootstrapping from
13901         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13902         compile times in 0.05 seconds.
13903
13904 2003-11-28  Dick Porter  <dick@ximian.com>
13905
13906         * support.cs: Do string compares with the Invariant culture.
13907
13908         * rootcontext.cs: 
13909         * gen-treedump.cs: 
13910         * expression.cs: 
13911         * driver.cs: 
13912         * decl.cs: 
13913         * codegen.cs: 
13914         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13915         the comparison is done with the Invariant culture.
13916
13917 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
13918
13919         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13920         GetEnumerator method.
13921
13922         (ProbeCollectionType): Iterate starting at the most specific type
13923         upwards looking for a GetEnumerator
13924
13925         * expression.cs: Shift count can be up to 31 for int/uint and 63
13926         for long/ulong.
13927
13928 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
13929
13930         * statement.cs (Block.LookupLabel): Also look for the label on the
13931         children blocks.  Use a hash table to keep track of visited
13932         nodes. 
13933
13934         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13935         we actually did transform the other operand, otherwise fall back
13936         to the common codepath that casts to long.
13937
13938         * cs-tokenizer.cs: Use the same code pattern as the int case.
13939         Maybe I should do the parsing myself, and avoid depending on the
13940         Parse routines to get this done.
13941
13942 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
13943
13944         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13945         which fixes bug 51347.  This time test it.
13946
13947         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13948         attributes for example can not tell the difference between these.
13949         The difference was only a syntax feature of the language. 
13950
13951         * attribute.cs: Apply attributes to delegates.
13952
13953         * delegate.cs: Call the apply attributes method.
13954
13955 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
13956
13957         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13958         comparing 0 vs Byte.MinValue, not the value
13959
13960         (ImplicitConversionRequired): When reporting a conversion error,
13961         use error 31 to print out the constant error instead of the
13962         simpler 29.
13963
13964         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13965         which fixes bug 51347.
13966
13967 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
13968
13969         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
13970         which fixes the -warnaserror command line option.
13971
13972 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
13973
13974         * cfold.cs (DoNumericPromotions): During constant folding of
13975         additions on UIntConstant, special case intconstants with
13976         IntConstants like we do on the expression binary operator. 
13977
13978 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
13979
13980         * convert.cs (ImplicitReferenceConversion): We were missing a case
13981         (System.Enum are not value types or class types, so we need to
13982         classify them separatedly).
13983
13984         * driver.cs: We do not support error 2007.
13985
13986 2003-11-12 Jackson Harper <jackson@ximian.com>
13987
13988         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13989         system directory. Also use the full file name so users can
13990         libraries names mscorlib-o-tron.dll in a non system dir.
13991         
13992 2004-01-04  David Sheldon <dave-mono@earth.li>
13993
13994         * expression.cs: Added matching ")" to error message for CS0077.
13995
13996 2003-12-19  Martin Baulig  <martin@ximian.com>
13997
13998         * typemanager.cs (TypeManager.IsEqualGenericType): New public
13999         static method; see documentation in the method.
14000         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
14001
14002         * convert.cs (Convert.ImplicitReferenceConversion,
14003         Convert.ImplicitReferenceConversionExists): Add support for
14004         generic type declarations; see gen-36.cs.
14005
14006 2003-12-19  Martin Baulig  <martin@ximian.com>
14007
14008         * pending.cs (Pending.InterfaceMethod): Use
14009         `Type.IsAssignableFrom()' instead of `=='.
14010
14011 2003-12-18  Martin Baulig  <martin@ximian.com>
14012
14013         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
14014         byref types first.
14015
14016         * convert.cs (Convert.ImplicitStandardConversionExists): Use
14017         `expr_type.Equals (target_type)' instead of `=='.
14018
14019 2003-12-08  Martin Baulig  <martin@ximian.com>
14020
14021         * generics.cs (Constraints.Types): Removed.
14022         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
14023         to Type's.
14024         (Constraints.ResolveTypes): New public method; resolves the
14025         TypeExpr's to Type's.
14026         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
14027         longer takes the constraints.
14028         (TypeParameter.DefineMethod): Likewise.
14029         (TypeParameter.DefineType): New public method.  Calls
14030         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
14031         the constraints.
14032
14033 2003-12-08  Martin Baulig  <martin@ximian.com>
14034
14035         * convert.cs (Convert.ImplicitConversionStandard): Use
14036         `expr_type.Equals (target_type)' instead of `=='.
14037
14038 2003-12-08  Martin Baulig  <martin@ximian.com>
14039
14040         * typemanager.cs (TypeManager.GetReferenceType): Call
14041         `Type.MakeByRefType ()'.
14042
14043 2003-12-08  Martin Baulig  <martin@ximian.com>
14044
14045         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
14046         just has some special meaning in some situations.  For instance,
14047         it is allowed to use `where' as the name of a variable etc.
14048
14049 2003-12-04  Martin Baulig  <martin@ximian.com>
14050
14051         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
14052         `Type.MakeArrayType()' for array types.
14053
14054 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
14055
14056         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
14057         debugging message.
14058
14059         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
14060         corlib to compile.
14061
14062 2003-11-16  Martin Baulig  <martin@ximian.com>
14063
14064         * codegen.cs (EmitContext.IsGeneric): Removed.
14065
14066         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
14067         ResolveGeneric() on the DeclSpace.
14068
14069 2003-11-16  Martin Baulig  <martin@ximian.com>
14070
14071         * generic.cs (TypeArguments.Resolve):
14072         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
14073         `ResolveType()' on it to get the Type.
14074
14075 2003-11-15  Martin Baulig  <martin@ximian.com>
14076
14077         * generic.cs (ConstructedType.GetInterfaces): Override this.
14078
14079 2003-11-14  Martin Baulig  <martin@ximian.com>
14080
14081         * interface.cs (Interface.DefineType): Define all type parameters
14082         before adding the interfaces we inherit.
14083
14084 2003-11-11  Martin Baulig  <martin@ximian.com>
14085
14086         * generic.cs (ConstructedType.ResolveType): Always call
14087         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
14088
14089 2003-11-10  Martin Baulig  <martin@ximian.com>
14090
14091         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
14092         (TypeManager.InitCoreTypes): Initialize them here, but instead of
14093         calling `ResolveType()' on them, directly assign their `Type'.
14094
14095 2003-11-08  Martin Baulig  <martin@ximian.com>
14096
14097         * generic.cs (ConstructedType): Override `IsClass' etc.
14098
14099 2003-11-08  Martin Baulig  <martin@ximian.com>
14100
14101         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
14102         return value and the `out parent' parameter.
14103         (TypeContainer.DefineType): Moved the CS0644 check into
14104         GetClassBases().  Don't pass the interface types to the
14105         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
14106         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
14107
14108         * ecore.cs (TypeExpr.IsAttribute): New property.
14109         (TypeExpr.GetInterfaces): New method.
14110
14111         * interface.cs (Interface.GetInterfaceTypeByName): Return a
14112         TypeExpr instead of a Type.
14113         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
14114         (Interface.DefineType): Don't pass the interface types to the
14115         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
14116         them later and then call `TypeBulider.AddInterfaceImplementation()'.
14117
14118         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
14119         instead of a `Type[]'.
14120         (TypeManager.RegisterBuilder): Likewise.
14121         (TypeManager.AddUserInterface): Likewise.
14122         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
14123         `Type[]' and also return a `TypeExpr[]'.
14124         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
14125
14126 2003-11-08  Martin Baulig  <martin@ximian.com>
14127
14128         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
14129         Expression.     
14130
14131 2003-11-08  Martin Baulig  <martin@ximian.com>
14132
14133         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
14134         TypeManager.ResolveExpressionTypes().
14135
14136         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
14137         instead of an Expression.
14138         (TypeExpr): This is now an abstract base class for `TypeExpression'.
14139         (TypeExpression): New public class; formerly known as `TypeExpr'.
14140
14141         * expression.cs (ComposedCast): Derive from TypeExpr.
14142
14143         * typemanager.cs (TypeManager.system_*_expr): These are now
14144         TypExpr's instead of Expression's.
14145         (TypeManager.ResolveExpressionTypes): New public static function;
14146         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
14147         of them.        
14148
14149 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
14150
14151         * expression.cs (New.DoResolve): Do not dereference value that
14152         might be a null return.
14153
14154         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
14155         sure that the constant value has the right type.  Fixes an
14156         unreported bug, similar to 50425.
14157
14158         * const.cs (Const.LookupConstantValue): Call
14159         ImplicitStandardConversionExists before doing a conversion to
14160         avoid havng the TypeManager.ChangeType do conversions.
14161
14162         Reduced the number of casts used
14163
14164         (Const.ChangeType): New routine to enable reuse of the constant
14165         type changing code from statement.
14166
14167         * typemanager.cs (ChangeType): Move common initialization to
14168         static global variables.
14169
14170         Fixes #50425.
14171
14172         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
14173         every value type to go through, even if it was void.  Fix that. 
14174
14175         * cs-tokenizer.cs: Use is_identifier_start_character on the start
14176         character of the define, and the is_identifier_part_character for
14177         the rest of the string.
14178
14179 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
14180
14181         * expression.cs (UnaryMutator.EmitCode): When I updated
14182         LocalVariableReference.DoResolve, I overdid it, and dropped an
14183         optimization done on local variable references.
14184
14185 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
14186
14187         * ecore.cs: Convert the return from Ldlen into an int.
14188
14189 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
14190
14191         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
14192         the accessibility, this is a special case for toplevel non-public
14193         classes (internal for instance).
14194
14195 2003-10-20  Nick Drochak <ndrochak@gol.com>
14196
14197         * ecore.cs: Fix typo and build.  Needed another right paren.
14198
14199 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
14200
14201         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
14202         `internal' case regular and protected, but not allowing protected
14203         to be evaluated later.  Bug 49840
14204
14205 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
14206
14207         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
14208         to kb.Nlast, and not the kb.nFirst to isolate the switch
14209         statement.
14210
14211         Extract the underlying type, so enumerations of long/ulong are
14212         treated like long/ulong.
14213
14214 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
14215
14216         * expression.cs (New): Overload the meaning of RequestedType to
14217         track the possible creation of the NewDelegate type, since
14218         DoResolve is invoked more than once for new constructors on field
14219         initialization.
14220
14221         See bugs: #48800 and #37014
14222
14223         * cs-parser.jay (declare_local_constants): Take an arraylist
14224         instead of a single constant.
14225
14226         (local_constant_declaration): It should take a
14227         constant_declarators, not a constant_declarator.  Fixes 49487
14228
14229         * convert.cs: Fix error report.
14230
14231 2003-10-13 Jackson Harper <jackson@ximian.com>
14232
14233         * typemanager.cs (TypeToCoreType): Add float and double this fixes
14234         bug #49611
14235         
14236 2003-11-03  Martin Baulig  <martin@ximian.com>
14237
14238         * expression.cs (ArrayAccess.GetStoreOpcode): Added
14239         `out bool has_type_arg'; if set, we need to pass the type to
14240         ig.Emit().
14241         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
14242         Stelem_Any/Ldelem_Any for generic parameters.   
14243
14244 2003-11-02  Martin Baulig  <martin@ximian.com>
14245
14246         * expression.cs (Invocation.EmitCall): Use
14247         `TypeManager.IsValueType()' to check whether it's a value type.
14248         Don't set `struct_call' when calling a method on a type parameter.
14249
14250 2003-11-02  Martin Baulig  <martin@ximian.com>
14251
14252         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
14253         and removed the TypeBuilder argument.
14254
14255         * typemanager.cs (TypeManager.IsValueType): Return
14256         `t.IsGenericParameter || t.IsValueType'.
14257
14258 2003-10-25  Martin Baulig  <martin@ximian.com>
14259
14260         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
14261         call ConstructedType.Resolve() on it.
14262
14263         * generic.cs (ConstructedType.Resolve): Set `type' on success.
14264
14265 2003-10-25  Martin Baulig  <martin@ximian.com>
14266
14267         * class.cs (TypeContainer.GetClassBases): Changed
14268         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
14269         CS8214 reporting here.
14270         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
14271         instead of a `Type' for our parent.  In case of a recursive
14272         declaration (see tests/gen-23.cs for an example), our parent is a
14273         ConstructedType and it doesn't have its type set.  So, first
14274         create our own TypeBuilder, then call constructed.Resolve() to get
14275         the parent's type and finally TypeBuilder.SetParent() it.
14276
14277         * ecore.cs (TypeExpr.Name): New public virtual property.
14278
14279         * generic.cs
14280         (ConstructedType): We're now a TypeExpr and not just an Expression.
14281         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
14282         arguments here; this is done later.
14283         (ConstructedType.Resolve): New public method to resolve the type
14284         arguments and bind them.
14285
14286 2003-10-21  Martin Baulig  <martin@ximian.com>
14287
14288         * convert.cs: Use `TypeManager.IsValueType' instead of
14289         'type.IsValueType' everywhere.
14290
14291         * typemanager.cs (TypeManager.IsValueType): Return true for type
14292         parameters.  The reason for this is that we need to box a type
14293         parameter when converting it to a reference type.
14294
14295         * cs-parser.jay: Added support for default value expressions.
14296
14297         * generics.cs (DefaultValueExpression): New public class.       
14298
14299 2003-10-17  Martin Baulig  <martin@ximian.com>
14300
14301         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
14302         TypeContainer so we can also use this for Interfaces.
14303         (TypeParameter.Resolve): Likewise.
14304
14305         * interface.cs (Interface.DefineType): Added support for generic
14306         interfaces.
14307
14308         * cs-parser.jay: Added support for generic structs and interfaces.
14309
14310 2003-10-17  Martin Baulig  <martin@ximian.com>
14311
14312         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
14313         call generic methods :-)
14314
14315 2003-10-16  Martin Baulig  <martin@ximian.com>
14316
14317         * cs-parser.jay (namespace_or_type_name): Only create a
14318         GenericMemberAccess if we actually have type arguments.
14319
14320 2003-10-13  Martin Baulig  <martin@ximian.com>
14321
14322         * class.cs (Method.Define): If we're a generic method, call
14323         TypeBuilder.DefineGenericMethod () before resolving
14324         the parameters.
14325         (MethodData): Added .ctor which takes an additional MethodBuilder
14326         argument; this is used for generic methods.
14327         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
14328         we already have a MethodBuilder.
14329
14330 2003-10-10  Martin Baulig  <martin@ximian.com>
14331
14332         * class.cs (Method): Added .ctor which takes a `GenericMethod'
14333         instead of a `DeclSpace'.  This is used for generic methods.
14334
14335         * cs-parser.jay (method_header): Added support for generic
14336         methods; create a `GenericMethod' instance and pass it to the
14337         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
14338         parameters and locals.
14339
14340         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
14341         since we already have the location.  Check whether we're a generic
14342         type declaration or a generic method and create the correct type
14343         parameter.
14344
14345         * generic.cs (TypeParameter.DefineMethod): New public method.
14346         (GenericMethod): New public class; derives from DeclSpace and is
14347         used for generic methods.       
14348
14349 2003-10-09  Martin Baulig  <martin@ximian.com>
14350
14351         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
14352         to the .ctor.
14353         (MethodCore.DoDefineParameters): Removed the TypeContainer
14354         argument; use the DeclSpace which was passed to the .ctor instead.
14355         (MethodCore.CheckParameter): Take a DeclSpace instead of a
14356         TypeContainer; we only need a DeclSpace here.
14357
14358 2003-10-09  Martin Baulig  <martin@ximian.com>
14359
14360         * class.cs (MethodData): Added additional `DeclSpace ds' argument
14361         to the .ctor.
14362         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
14363         EmitContext's .ctor.    
14364
14365 2003-10-09  Martin Baulig  <martin@ximian.com>
14366
14367         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
14368         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
14369         AsAccessible(), moved them as well.
14370
14371         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
14372
14373 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
14374
14375         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
14376         generation for >=, as spotted by Paolo, bug 48679.  
14377         Patch from David Waite.
14378
14379         * cs-tokenizer.cs: Add handling for #pragma.
14380
14381         * cs-parser.jay: Allow for both yield and yield return in the
14382         syntax.  The anti-cobolization of C# fight will go on!
14383
14384         * class.cs (TypeBuilder.DefineType): Catch error condition here
14385         (Parent.DefineType erroring out and returning null).
14386
14387         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14388         coping with enumerations variables, we were mistakenly processing
14389         them as a regular value type instead of built-in types.  Fixes the
14390         bug #48063
14391
14392         * typemanager.cs (IsBuiltinOrEnum): New method.
14393
14394 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
14395
14396         * cs-parser.jay: Upgrade: yield now needs the return clause.
14397
14398 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
14399
14400         * cs-parser.jay : Renamed yyName to yyNames related to jay.
14401
14402 2003-09-29  Martin Baulig  <martin@ximian.com>
14403
14404         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
14405         inflated generic methods.
14406
14407         * generics.cs (ConstructedType): Distinguish between open and
14408         closed constructed types; correctly resolve the arguments.
14409
14410 2003-09-22  Martin Baulig  <martin@ximian.com>
14411
14412         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
14413         all type arguments meet their constraints.
14414
14415 2003-09-19  Martin Baulig  <martin@ximian.com>
14416
14417         * decl.cs (MemberCache.SetupCacheForInterface): Take a
14418         `MemberCache parent' argument.  Normally, an interface doesn't
14419         have a parent type except System.Object, but we use this in gmcs
14420         for generic type parameters.
14421
14422 2003-09-18  Martin Baulig  <martin@ximian.com>
14423
14424         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
14425         on `type.IsInterface'; don't check whether the type has a parent
14426         to determine whether it's an interface.
14427
14428 2003-09-17  Martin Baulig  <martin@ximian.com>
14429
14430         * generic.cs (ConstructedType.ToString): Always use `name' as the
14431         type name.
14432
14433 2003-09-15  Martin Baulig  <martin@ximian.com>
14434
14435         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
14436
14437         * generic.cs (Constraints.Resolve): New public method; this is
14438         called to resolve the constraint types and to check whether all
14439         the constraints are correct.
14440         (Constraints.Types): New public property.
14441         (TypeParameter.Resolve): New public method; resolves all the
14442         type's constraints.
14443
14444         * class.cs (TypeContainer.DefineType): Call
14445         TypeParameter.Resolve() before actually defining the type.
14446
14447 2003-09-15  Martin Baulig  <martin@ximian.com>
14448
14449         * class.cs (TypeContainer.DefineType): Added an error flag to
14450         avoid reporting duplicate CS0146's ("class definition is
14451         circular.").
14452
14453         * driver.cs (Driver.MainDriver): Abort if
14454         RootContext.ResolveTree() reported any errors.
14455
14456 2003-09-07  Martin Baulig  <martin@ximian.com>
14457
14458         * report.cs (Error, Warning): Added overloaded versions which take
14459         a `params object[] args' and call String.Format().
14460
14461 2003-09-07  Martin Baulig  <martin@ximian.com>
14462
14463         * decl.cs (DeclSpace..ctor): Don't call
14464         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
14465         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
14466         (DeclSpace.RecordDecl): New method.
14467
14468         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
14469
14470 2003-09-02  Ravi Pratap  <ravi@ximian.com>
14471
14472         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
14473         value attributes to be applied to ParameterBuilders.
14474
14475         * class.cs (MethodCore.LabelParameters): Make static and more
14476         generic so that it can be used from other places - like interface
14477         methods, for instance.
14478
14479         * interface.cs (Interface.Emit): Call LabelParameters before
14480         emitting attributes on the InterfaceMethod.
14481
14482 2003-09-07  Martin Baulig  <martin@ximian.com>
14483
14484         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
14485         if the number of type parameters doesn't match.
14486
14487 2003-09-04  Martin Baulig  <martin@ximian.com>
14488
14489         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
14490         for arrays of generic type params (ie. `!0[]').
14491
14492 2003-09-04  Martin Baulig  <martin@ximian.com>
14493
14494         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
14495         for the moment.
14496
14497 2003-09-04  Martin Baulig  <martin@ximian.com>
14498
14499         * decl.cs (DeclSpace.LookupGeneric): New method.
14500         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
14501         moment.
14502
14503         * generic.cs (TypeParameterExpr): Take a TypeParameter as
14504         argument, not just a string.
14505         (TypeParameter.Define): New public method; this is called to
14506         actually define the generic parameter; after this, you can use the
14507         new `Type' property to get the type.
14508
14509 2003-09-04  Martin Baulig  <martin@ximian.com>
14510
14511         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
14512         is now an ArrayList; initialize the result of the `TypeParameters'
14513         property here.
14514         (DeclSpace.GetGenericData): Removed.
14515         (DeclSpace.LookupGeneric): Temporarily removed; we need to
14516         implement this in a different way.
14517         (DeclSpace.GetTypeParameters): Removed; there's now a
14518         `TypeParameters' property.
14519         (DeclSpace.TypeParameters): New public property.
14520
14521         * generic.cs (Constraints): Make this class public.
14522         (TypeParameter): New public class.
14523
14524 2003-09-04  Martin Baulig  <martin@ximian.com>
14525
14526         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
14527         generic parameters.
14528
14529         * class.cs (TypeContainer.DefineType): Call
14530         TypeBuilder.DefineGenericParameter () on all generic parameters if
14531         this is a generic type.
14532
14533 2003-08-28  Martin Baulig  <martin@ximian.com>
14534
14535         * sample-stack.il: Compile this with ilasm: "ilasm /dll
14536         sample-stack.il".
14537
14538         * sample-hello.cs: Compile this with gmcs: "gmcs
14539         /r:sample-stack.dll sample-hello.cs".
14540
14541 2003-08-28  Martin Baulig  <martin@ximian.com>
14542
14543         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
14544         the parameters to the generic type.
14545
14546 2003-08-28  Martin Baulig  <martin@ximian.com>
14547
14548         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
14549
14550 2003-08-28  Martin Baulig  <martin@ximian.com>
14551
14552         * cs-parser.jay (opt_type_argument_list): Use
14553         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
14554         (primary_expression): Replace `qualified_identifier' with `type_name'.
14555         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
14556
14557         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
14558         parser to check whether it is syntactically a type parameter list;
14559         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
14560         this case.
14561
14562 2003-08-26  Martin Baulig  <martin@ximian.com>
14563
14564         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
14565         resolving aliases; fixes #47927.
14566
14567 2003-08-26  Martin Baulig  <martin@ximian.com>
14568
14569         * statement.cs (Using.DoResolve): This is internally emitting a
14570         try/finally clause, so we need to set ec.NeedExplicitReturn if we
14571         do not always return.  Fixes #47681.
14572
14573 2003-08-26  Martin Baulig  <martin@ximian.com>
14574
14575         * decl.cs (MemberCore): Moved WarningNotHiding(),
14576         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
14577         into MemberBase.
14578         (AdditionResult): Make this nested in DeclSpace.
14579         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
14580         argument; call NamespaceEntry.Define() unless we're nested in a
14581         class or struct.
14582
14583         * namespace.cs (Namespace.DefineName): New public function.  This
14584         is called from DeclSpace's .ctor to add 
14585         (Namespace.Lookup): Include DeclSpaces in the lookup.
14586
14587         * class.cs (Operator): Derive from MemberBase, not MemberCore.
14588
14589         * const.cs (Const): Derive from MemberBase, not MemberCore.     
14590
14591 2003-08-25  Martin Baulig  <martin@ximian.com>
14592
14593         * convert.cs (Convert.ExplicitReferenceConversion): When
14594         converting from an interface type to a class, unbox if the target
14595         type is a struct type.  Fixes #47822.
14596
14597 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14598
14599         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
14600         #47854.
14601
14602 2003-08-22  Martin Baulig  <martin@ximian.com>
14603
14604         * class.cs (TypeManager.DefineType): When defining a nested type,
14605         call DefineType() on our parent; fixes #47801.
14606
14607 2003-08-22  Martin Baulig  <martin@ximian.com>
14608
14609         * class.cs (MethodData.Define): While checking if a method is an
14610         interface implementation, improve the test a bit more to fix #47654.
14611
14612 2003-08-22  Martin Baulig  <martin@ximian.com>
14613
14614         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
14615         correctly; fixes #47722.
14616
14617 2003-08-22  Martin Baulig  <martin@ximian.com>
14618
14619         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
14620         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
14621
14622         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
14623
14624 2003-08-22  Martin Baulig  <martin@ximian.com>
14625
14626         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
14627         can only be assigned in static constructors.  Fixes #47161.
14628
14629 2003-08-22  Martin Baulig  <martin@ximian.com>
14630
14631         Rewrote and improved the flow analysis code.
14632
14633         * flowbranching.cs (FlowBranching): Make this class abstract.
14634         (FlowBranching.CreateBranching): New static function to create a
14635         new flow branching.
14636         (FlowBranchingBlock, FlowBranchingException): New classes.
14637         (FlowBranching.UsageVector.Type): New public readonly field.
14638         (FlowBranching.UsageVector.Breaks): Removed the setter.
14639         (FlowBranching.UsageVector.Returns): Removed the setter.
14640         (FlowBranching.UsageVector): Added Break(), Return(),
14641         NeverReachable() and Throw() methods to modify the reachability.
14642         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
14643         done by FlowBranching.Merge().
14644         (FlowBranching.UsageVector.MergeChild): New method; merges the
14645         merge result into the current vector.
14646         (FlowBranching.Merge): New abstract method to merge a branching.
14647
14648 2003-08-12  Martin Baulig  <martin@ximian.com>
14649
14650         * expression.cs (Indirection.CacheTemporaries): Create the
14651         LocalTemporary with the pointer type, not its element type.
14652
14653 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
14654
14655         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
14656         token was a keyword or not.
14657
14658         Add `error' options where an IDENTIFIER was expected;  Provide
14659         CheckToken and CheckIdentifierToken convenience error reporting
14660         functions. 
14661
14662         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
14663
14664         * decl.cs: Rename `NamespaceEntry Namespace' public field into
14665         NameSpaceEntry NameSpaceEntry.
14666
14667         (LookupInterfaceOrClass): Avoid creating a full qualified name
14668         from namespace and name: avoid doing lookups when we know the
14669         namespace is non-existant.   Use new Tree.LookupByNamespace which
14670         looks up DeclSpaces based on their namespace, name pair.
14671
14672         * driver.cs: Provide a new `parser verbose' to display the
14673         exception thrown during parsing.  This is turned off by default
14674         now, so the output of a failure from mcs is more graceful.
14675
14676         * namespace.cs: Track all the namespaces defined in a hashtable
14677         for quick lookup.
14678
14679         (IsNamespace): New method
14680
14681 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
14682
14683         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
14684         we know that we need to concatenate (full typename can never be
14685         null). 
14686
14687         * class.cs: ditto.
14688
14689         * statement.cs: Use a bitfield;  Do not initialize to null things
14690         which are done by the constructor by default.
14691
14692         * cs-parser.jay: bug fix, parameter was 4, not 3.
14693
14694         * expression.cs: Just use the property;
14695
14696         * statement.cs: No need for GetVariableInfo method.
14697
14698 2003-08-08  Martin Baulig  <martin@ximian.com>
14699
14700         * flowanalysis.cs (FlowReturns): This is now nested in the
14701         `FlowBranching' class.
14702         (MyBitVector): Moved this here from statement.cs.
14703         (FlowBranching.SiblingType): New enum type.
14704         (FlowBranching.CreateSibling): Added `SiblingType' argument.
14705
14706 2003-08-07  Martin Baulig  <martin@ximian.com>
14707
14708         * flowanalysis.cs (FlowBranchingType): This is now nested in the
14709         `FlowBranching' class and called `BranchingType'.
14710
14711 2003-08-07  Martin Baulig  <martin@ximian.com>
14712
14713         * flowanalysis.cs: Moved all the control flow analysis code into
14714         its own file.
14715
14716 2003-08-07  Martin Baulig  <martin@ximian.com>
14717
14718         * assign.cs (Assign.DoResolve): `target' must either be an
14719         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
14720         #37319.
14721
14722 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
14723
14724         * expression.cs (BinaryMethod): This kind of expression is created by the
14725         Binary class if it determines that the operator has to be handled
14726         by a method.
14727
14728         (BinaryDelegate): This kind of expression is created if we are
14729         dealing with a + or - operator on delegates.
14730
14731         (Binary): remove method, argumetns, and DelegateOperator: when
14732         dealing with methods, 
14733
14734         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14735
14736         * statement.cs (Block): use bitfields for the three extra booleans
14737         we had in use.   Remove unused topblock parameter.
14738
14739         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14740
14741         * assign.cs: Drop extra unneeded tests.
14742
14743 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
14744
14745         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14746
14747         * statement.cs (Foreach): Use VariableStorage instead of
14748         LocalBuilders.   
14749
14750         * codegen.cs (VariableStorage): New class used by clients that
14751         require a variable stored: locals or fields for variables that
14752         need to live across yield.
14753
14754         Maybe provide a convenience api for EmitThis+EmitLoad?
14755
14756         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14757         these bad boys.
14758
14759 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
14760
14761         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14762         RemapParameterLValue): New methods that are used to turn a
14763         precomputed FieldInfo into an expression like this:
14764
14765                 instance.FieldInfo
14766
14767         The idea is to use this instead of making LocalVariableReference
14768         have more than one meaning.
14769
14770         * cs-parser.jay: Add error production to BASE.
14771
14772         * ecore.cs: Deal with TypeManager.GetField returning null, which
14773         is now a valid return value.
14774
14775         (FieldExprNoAddress): New expression for Fields whose address can
14776         not be taken.
14777
14778         * expression.cs (LocalVariableReference): During the resolve
14779         phases, create new expressions if we are in a remapping context.
14780         Remove code that dealt with remapping here.
14781
14782         (ParameterReference): same.
14783
14784         (ProxyInstance): New expression, like the `This' expression, but
14785         it is born fully resolved.  We know what we are doing, so remove
14786         the errors that are targeted to user-provided uses of `this'.
14787
14788         * statement.cs (Foreach): our variable is now stored as an
14789         Expression;  During resolution, follow the protocol, dont just
14790         assume it will return this.
14791
14792 2003-08-06  Martin Baulig  <martin@ximian.com>
14793
14794         * support.cs (SeekableStreamReader.cs): New public class.
14795
14796         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14797         SeekableStreamReader instead of the normal StreamReader.
14798
14799 2003-08-04  Martin Baulig  <martin@ximian.com>
14800
14801         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14802         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14803         deambiguate casts and delegate invocations.
14804         (parenthesized_expression): Use the new tokens to ensure this is
14805         not a cast of method invocation.
14806
14807         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14808         when reading a `)' and Deambiguate_CloseParens () was previously
14809         called.
14810
14811         * expression.cs (ParenthesizedExpression): New class.  This is
14812         just used for the CS0075 test.
14813         (Binary.DoResolve): Check for CS0075.   
14814
14815 2003-07-29  Ravi Pratap  <ravi@ximian.com>
14816
14817         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14818         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14819         reference comparison.
14820
14821         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14822         examine the ReturnType for equality - this is necessary in the
14823         cases of implicit and explicit operators whose signature also
14824         includes the return type.
14825
14826 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
14827
14828         * namespace.cs: Cache the result of the namespace computation,
14829         instead of computing it every time.
14830
14831 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14832
14833         * decl.cs: Use a global arraylist that we reuse over invocations
14834         to avoid excesive memory consumption.  Reduces memory usage on an
14835         mcs compile by one meg (45 average).
14836
14837         * typemanager.cs (LookupTypeReflection): In .NET pointers are
14838         private, work around that.
14839
14840 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
14841
14842         * literal.cs (IntLiteral): Define Zero and One static literals. 
14843
14844         * cs-parser.jay (integer_literal): use static literals to reduce
14845         memory usage for the most used literals (0, 1 and -1).  211kb
14846         reduced in memory usage.
14847
14848         Replace all calls to `new ArrayList' with `new
14849         ArrayList(4)' which is a good average number for most allocations,
14850         and also requires only 16 bytes of memory for its buffer by
14851         default. 
14852
14853         This reduced MCS memory usage in seven megabytes for the RSS after
14854         bootstrapping.
14855
14856 2003-07-28  Ravi Pratap  <ravi@ximian.com>
14857
14858         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14859         handle params methods the correct way by forming only one
14860         applicable set with params and normal methods in them. Earlier we
14861         were looking at params methods only if we found no normal methods
14862         which was not the correct thing to do.
14863
14864         (Invocation.BetterFunction): Take separate arguments indicating
14865         when candidate and the best method are params methods in their
14866         expanded form.
14867
14868         This fixes bugs #43367 and #46199.
14869
14870         * attribute.cs: Documentation updates.
14871
14872         (CheckAttribute): Rename to CheckAttributeTarget.
14873         (GetValidPlaces): Rename to GetValidTargets.
14874
14875         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14876         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14877
14878         Fixes bug #44468.
14879
14880 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
14881
14882         * codegen.cs: Compute IsGeneric correctly.
14883
14884         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
14885         resolution. 
14886
14887         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
14888         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
14889         regressions, and I was chasing more bugs than I required.
14890
14891         * interface.cs: Use expressions for base type names (like classes
14892         and structs have been doing for a while now), and resolve that.
14893         This patch should probably go into head as well.
14894
14895         This makes it one less user of FindType.
14896
14897 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14898
14899         This compiler can not self host currently.  Need to fix that.
14900         
14901         * Makefile: compile to `gmcs.exe'
14902
14903         * driver.cs: Turn on v2 by default on gmcs.
14904
14905         * generic.cs (ConstructedType): Does no longer take a container
14906         type argument;  That will be taken care of later.
14907
14908         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
14909         Use SimpleName to resolve for now, so we can continue the work on
14910         the parser, until we get Type.GetType that understands generics.
14911
14912         (ConstructedType.ToString): Implement
14913
14914         (TypeArguments.Resolve): Resolve the child expressions as types. 
14915         
14916         * cs-parser.jay: Rename interface_constraints to
14917         type_parameter_constraints
14918
14919         (namespace_or_type_name): Only use constructed types for the basic
14920         construction, we will deal with identifier<...> later.
14921
14922         (type/type_name): No longer call DecomposeQI, as
14923         namespace_or_type_name is always decoded now.
14924         
14925 2003-07-22  Ravi Pratap  <ravi@ximian.com>
14926
14927         * expression.cs (Invocation.OverloadResolve): Follow the spec more
14928         closely: we eliminate methods in base types when we have an
14929         applicable method in a top-level type.
14930
14931         Please see section 14.5.5.1 for an exact description of what goes
14932         on. 
14933
14934         This fixes bug #45127 and a host of other related to corlib compilation.
14935
14936         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14937         array is the method corresponding to the top-level type (this is
14938         because of the changes made to icall.c) so we change this
14939         accordingly.
14940
14941         (MethodGroupExpr.Name): This too.
14942
14943         * typemanager.cs (GetElementType): New method which does the right
14944         thing when compiling corlib. 
14945
14946         * everywhere: Make use of the above in the relevant places.
14947
14948 2003-07-22  Martin Baulig  <martin@ximian.com>
14949
14950         * cs-parser.jay (invocation_expression): Moved
14951         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14952         `cast_expression', but create a InvocationOrCast which later
14953         resolves to either an Invocation or a Cast.
14954
14955         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14956         method; call this before EmitStatement() to make sure that this
14957         expression can be used as a statement.
14958
14959         * expression.cs (InvocationOrCast): New class; resolves to either
14960         an Invocation or a Cast.
14961
14962         * statement.cs (StatementExpression): Call ResolveStatement() on
14963         the ExpressionStatement before emitting it.
14964
14965 2003-07-21  Martin Baulig  <martin@ximian.com>
14966
14967         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14968         `ref' and `out' attributes match; fixes #46220.
14969         (MemberAccess.ResolveMemberAccess): You can't reference a type
14970         through an expression; fixes #33180.
14971         (Indexers.GetIndexersForType): Don't return the indexers from
14972         interfaces the class implements; fixes #46502.
14973
14974 2003-07-21  Martin Baulig  <martin@ximian.com>
14975
14976         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14977         CS0661 checks; fixes bug #30442.
14978
14979 2003-07-21  Martin Baulig  <martin@ximian.com>
14980
14981         * decl.cs (AdditionResult): Added `Error'.
14982
14983         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14984
14985         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
14986         cs0031.cs actually work.
14987
14988  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14989  
14990         * cs-parser.jay (namespace_name): do not use
14991         namespace_or_type_name, use qualified_identifier, because
14992         namespace_or_type_name will soon return a composed expression
14993         instead of a string.
14994  
14995         (namespace_or_type_name): Instead of returning a string, now this
14996         production returns an expression.
14997  
14998         * codegen.cs (EmitContext): Setup IsGeneric property based on
14999         whether our DeclSpace is generic, our the method is generic.
15000  
15001         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
15002         the method is generic.
15003  
15004         * cs-parser.jay (type_arguments, opt_type_argument_list,
15005         type_parameters, type_parameter_list, opt_type_parameter_list,
15006         type_parameter,, opt_type_parameter_constraints_clauses,
15007         type_parameter_constraints_clauses,
15008         type_parameter_constraint_clause, type_parameter_constraint,
15009         interface_constraints): Add new production
15010  
15011         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
15012         DeclSpace is generic or not.
15013  
15014         (DeclSpace.SetParameterInfo): New routine, used to set the
15015         parameter info for a type.
15016  
15017         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
15018         returns a GenericTypeExpr
15019  
15020         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
15021         generic, lookup the generic argument.
15022  
15023         * attribute.cs: Do not allow TypeParameterExpressions in
15024         Attributes.
15025  
15026         * class.cs: Do not allow the Main method to be defined in a
15027         Generic container.
15028  
15029         * expression.cs (SizeOf): Do not allow generic types to be used as
15030         arguments to sizeof.
15031  
15032         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
15033         it: whether a type is generic or not.  Only works for types we are
15034         currently building for now.
15035         
15036 2003-07-20  Martin Baulig  <martin@ximian.com>
15037
15038         * namespace.cs: Fixed that bug which caused a crash when compiling
15039         the debugger's GUI.
15040
15041 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
15042
15043         * typemanager.cs (LookupTypeReflection): Never expose types which
15044         are NotPublic, NestedPrivate, NestedAssembly, or
15045         NestedFamANDAssem.  We used to return these, and later do a check
15046         that would report a meaningful error, but the problem is that we
15047         would not get the real match, if there was a name override.
15048
15049 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
15050
15051         * namespace.cs (Namespace, Name): Do not compute the namespace
15052         name dynamically, compute it in the constructor.  This reduced
15053         memory usage by 1697 KB.
15054
15055         * driver.cs: Use --pause to pause at the end.
15056
15057 2003-07-17  Peter Williams  <peter@newton.cx>
15058
15059         * Makefile: Change the name of the test target so that it doesn't
15060         conflict with the recursive test target.
15061
15062 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
15063
15064         * expression.cs (LocalVariableReference.Emit, EmitAssign,
15065         AddressOf): Do not use EmitThis, that was wrong, use the actual
15066         this pointer.
15067
15068 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
15069
15070         * class.cs (MethodData.Define): While checking if a method is an
15071         interface implementation, improve the test: If we are not public
15072         (use new test here: use the computed MethodAttributes directly,
15073         instead of the parsed modifier flags) check if the `implementing'
15074         method comes from an interface or not.
15075
15076         * pending.cs (VerifyPendingMethods): Slightly better error
15077         message.
15078
15079         * makefile: add test target that does the mcs bootstrap.
15080
15081 2003-07-16  Ravi Pratap  <ravi@ximian.com>
15082
15083         * interface.cs (Define): Do nothing here since there are no
15084         members to populate etc. Move the attribute emission out of here
15085         since this was just totally the wrong place to put it. Attribute
15086         application happens during the 'Emit' phase, not in the 'Define'
15087         phase.
15088
15089         (Emit): Add this method and move the attribute emission here
15090
15091         * rootcontext.cs (EmitCode): Call the Emit method on interface
15092         types too.
15093
15094 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
15095
15096         * expression.cs (OverloadResolve): Report error only if Location
15097         is not 'Null' which means that there was a probe going on.
15098
15099 2003-07-14  Martin Baulig  <martin@ximian.com>
15100
15101         * expression.cs (ConditionalLogicalOperator): New public class to
15102         implement user defined conditional logical operators.
15103         This is section 14.11.2 in the spec and bug #40505.
15104
15105 2003-07-14  Martin Baulig  <martin@ximian.com>
15106
15107         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
15108
15109 2003-07-14  Martin Baulig  <martin@ximian.com>
15110
15111         * codegen.cs (EmitContext.InFixedInitializer): New public field.
15112
15113         * ecore.cs (IVariable.VerifyFixed): New interface method.
15114
15115         * expression.cs (Unary.ResolveOperator): When resolving the `&'
15116         operator, check whether the variable is actually fixed.  Fixes bug
15117         #36055.  Set a variable definitely assigned when taking its
15118         address as required by the spec.
15119
15120         * statement.cs (LocalInfo.IsFixed): New field.
15121         (LocalInfo.MakePinned): Set `IsFixed' to true.
15122
15123 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
15124
15125         * attribute.cs (Attribute.Resolve): While doing a Member lookup
15126         for .ctors, ensure that we only ask for members declared in the
15127         attribute type (BindingFlags.DeclaredOnly).
15128
15129         Fixes bug #43632.
15130
15131         * expression.cs (Error_WrongNumArguments): Report error 1501
15132         correctly the way CSC does.
15133
15134 2003-07-13  Martin Baulig  <martin@ximian.com>
15135
15136         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
15137         lookup on the fully qualified name, to make things like "X.X" work
15138         where "X.X" is a fully qualified type name, but we also have a
15139         namespace "X" in the using list.  Fixes #41975.
15140
15141 2003-07-13  Martin Baulig  <martin@ximian.com>
15142
15143         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
15144         function. If we're a CompoundAssign, we need to create an embedded
15145         CompoundAssign, not an embedded Assign.
15146         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
15147         Fixes #45854.
15148
15149 2003-07-13  Martin Baulig  <martin@ximian.com>
15150
15151         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
15152         work to fix bug #46088.
15153
15154 2003-07-13  Ravi Pratap <ravi@ximian.com>
15155
15156         * class.cs (Operator.Emit): Do not emit attributes here - it is
15157         taken care of by the Method class that we delegate too. This takes
15158         care of bug #45876.
15159
15160 2003-07-10  Martin Baulig  <martin@ximian.com>
15161
15162         * expression.cs (TypeOfVoid): New class.
15163         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
15164
15165 2003-07-10  Martin Baulig  <martin@ximian.com>
15166
15167         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
15168         bug #35957.
15169
15170 2003-07-10  Martin Baulig  <martin@ximian.com>
15171
15172         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
15173         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
15174
15175         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
15176
15177         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
15178
15179 2003-07-10  Martin Baulig  <martin@ximian.com>
15180
15181         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
15182         of decimal.  Fixes #42850.
15183
15184         NOTE: I also fixed the created byte blob, but this doesn't work on
15185         the MS runtime and csc never produces any byte blobs for decimal
15186         arrays.
15187
15188 2003-07-10  Martin Baulig  <martin@ximian.com>
15189
15190         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
15191         structs; fixes #32068.
15192         (Block.AddChildVariableNames): Fixed #44302.
15193
15194 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15195
15196         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
15197
15198 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
15199
15200         * attribute.cs: And this test is onger needed.
15201
15202 2003-07-08  Martin Baulig  <martin@ximian.com>
15203
15204         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
15205         inaccessible types.  Fixes #36313.
15206
15207         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
15208
15209         * namespace.cs (NamespaceEntry): Create implicit entries for all
15210         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
15211         implicit entries for N1.N2 and N1.
15212
15213 2003-07-08  Martin Baulig  <martin@ximian.com>
15214
15215         Rewrote the handling of namespaces to fix a lot of the issues
15216         wrt. `using' aliases etc.
15217
15218         * namespace.cs (Namespace): Splitted this class into a
15219         per-assembly `Namespace' and a per-file `NamespaceEntry'.
15220
15221         * typemanager.cs (TypeManager.IsNamespace): Removed.
15222         (TypeManager.ComputeNamespaces): Only compute namespaces from
15223         loaded assemblies here, not the namespaces from the assembly we're
15224         currently compiling.
15225
15226 2003-07-08  Martin Baulig  <martin@ximian.com>
15227
15228         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
15229
15230 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
15231
15232         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
15233         already fixed it.  
15234
15235         I thought about the memory savings here, but LookupTypeReflection
15236         is used under already very constrained scenarios.  Compiling
15237         corlib or mcs only exposes one hit, so it would not really reduce
15238         any memory consumption.
15239
15240 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15241
15242         * typemanager.cs: fixes bug #45889 by only adding public types from
15243         other assemblies to the list of known types.
15244
15245 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
15246
15247         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
15248         on the type we resolved.
15249
15250 2003-07-05  Martin Baulig  <martin@ximian.com>
15251
15252         * pending.cs (PendingImplementation.ParentImplements): Don't
15253         create the proxy if the parent is abstract.
15254
15255         * class.cs (TypeContainer.DefineIndexers): Process explicit
15256         interface implementations first.  Fixes #37714.
15257
15258 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
15259
15260         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
15261         defined recursively;  but since we modify the input parameters
15262         (left is set to `this' temporarily), we reset this value if the
15263         left_is_explicit is false, which gives the original semantics to
15264         the code.  
15265
15266         * literal.cs (NullPointer): new class used to represent a null
15267         literal in a pointer context.
15268
15269         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
15270         type is a pointer, use a NullPointer object instead of a
15271         NullLiteral.   Closes 43687
15272
15273         (ExplicitConversion): Convert pointer values using
15274         the conv opcode to the proper type.
15275
15276         * ecore.cs (New): change ValueTypeVariable property into a method,
15277         that returns whether the valuetype is suitable for being used.
15278
15279         * expression.cs (Binary.DoNumericPromotions): Only return if we
15280         the int constant was a valid uint, and we can return both left and
15281         right as uints.  If not, we continue processing, to trigger the
15282         type conversion.  This fixes 39018.
15283
15284         * statement.cs (Block.EmitMeta): During constant resolution, set
15285         the CurrentBlock property on the emitcontext, so that we resolve
15286         constants propertly.
15287
15288 2003-07-02  Martin Baulig  <martin@ximian.com>
15289
15290         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
15291         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
15292
15293         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
15294         than emitting it here.
15295
15296         * statement.cs: Fixed some more flow analysis bugs.
15297
15298 2003-07-02  Martin Baulig  <martin@ximian.com>
15299
15300         * class.cs (MethodData.Define): When implementing interface
15301         methods, set Final unless we're Virtual.
15302
15303         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
15304         check work for interface methods.
15305
15306 2003-07-01  Martin Baulig  <martin@ximian.com>
15307
15308         * ecore.cs (EmitContext.This): Replaced this property with a
15309         GetThis() method which takes a Location argument.  This ensures
15310         that we get the correct error location for a CS0188.
15311
15312 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
15313
15314         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
15315         ImplicitStandardConversion.
15316
15317         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
15318
15319 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
15320
15321         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
15322         optimization.
15323
15324 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
15325
15326         * class.cs (Constructor.Define): Turn off initlocals for unsafe
15327         constructors.
15328
15329         (MethodData.Define): Turn off initlocals for unsafe methods.
15330
15331 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
15332
15333         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
15334         complete;  Fixes #37521.
15335
15336         * delegate.cs: Use Modifiers.TypeAttr to compute the
15337         TypeAttributes, instead of rolling our own.  This makes the flags
15338         correct for the delegates.
15339
15340 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
15341
15342         * class.cs (Constructor.Define): Set the private flag for static
15343         constructors as well.
15344
15345         * cs-parser.jay (statement_expression): Set the return value to
15346         null, to avoid a crash when we catch an error.
15347
15348 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
15349
15350         * cs-parser.jay: Applied patch from Jackson that adds support for
15351         extern and unsafe modifiers to destructor declarations.
15352
15353         * expression.cs: Report error 21 if the user is trying to index a
15354         System.Array.
15355
15356         * driver.cs: Add an error message, suggested by the bug report.
15357
15358         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
15359         if we do not have a ": this ()" constructor initializer.  Fixes 45149
15360
15361 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
15362
15363         * namespace.cs: Add some information to reduce FAQs.
15364
15365 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
15366
15367         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
15368         underlying enumeration types.  Fixes #43915.
15369
15370         * expression.cs: Treat ushort/short as legal values to be used in
15371         bitwise operations.
15372
15373 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
15374
15375         * delegate.cs: transfer custom attributes for paramenters from
15376         the delegate declaration to Invoke and BeginInvoke.
15377
15378 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
15379
15380         * attribute.cs: handle custom marshalers and emit marshal info
15381         for fields, too.
15382
15383 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
15384
15385         * makefile.gnu: Added anonymous.cs to the compiler sources.
15386
15387 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
15388
15389         * iterators.cs: Change the name of the proxy class to include two
15390         underscores.
15391
15392         * cs-parser.jay: Update grammar to include anonymous methods.
15393
15394         * anonymous.cs: new file.
15395
15396 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
15397
15398         * class.cs (Field.Define): Add missing test for pointers and
15399         safety. 
15400
15401 2003-05-27  Ravi Pratap  <ravi@ximian.com>
15402
15403         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
15404         we use the stobj opcode.
15405
15406         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
15407         since it wasn't the correct fix. 
15408
15409         It still is puzzling that we are required to use stobj for IntPtr
15410         which seems to be a ValueType.
15411
15412 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
15413
15414         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
15415         during regular simple name resolution.   Now, the trick is that
15416         instead of returning for processing the simplename, we do a
15417         TypeManager.LookupType (ie, a rooted lookup as opposed to a
15418         contextual lookup type).   If a match is found, return that, if
15419         not, return for further composition.
15420
15421         This fixes long-standing 30485.
15422
15423         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15424         using the address to initialize an object, do an Stobj instead of
15425         using the regular Stelem.
15426
15427         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
15428         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
15429         Because if we are a BaseIndexerAccess that value will be true.
15430         Fixes 43643.
15431
15432         * statement.cs (GotoCase.Resolve): Return after reporting an
15433         error, do not attempt to continue. 
15434
15435         * expression.cs (PointerArithmetic.Emit): If our operand is a
15436         long, convert our constants to match the operand before
15437         multiplying.  Convert to I type before adding.   Fixes 43670.
15438
15439 2003-05-14  Ravi Pratap  <ravi@ximian.com>
15440
15441         * enum.cs (ImplicitConversionExists) : Rename to
15442         ImplicitEnumConversionExists to remove ambiguity. 
15443
15444         * ecore.cs (NullCast): New type of cast expression class which
15445         basically is very similar to EmptyCast with the difference being
15446         it still is a constant since it is used only to cast a null to
15447         something else
15448         (eg. (string) null)
15449
15450         * convert.cs (ImplicitReferenceConversion): When casting a null
15451         literal, we return a NullCast.
15452
15453         * literal.cs (NullLiteralTyped): Remove - I don't see why this
15454         should be around anymore.
15455
15456         The renaming (reported was slightly wrong). Corrections:
15457
15458         ConvertImplicitStandard -> ImplicitConversionStandard
15459         ConvertExplicitStandard -> ExplicitConversionStandard
15460
15461         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
15462         before passing them in !
15463
15464         * convert.cs (ImplicitConversionStandard): When comparing for
15465         equal expr and target types, ensure that expr is not a
15466         NullLiteral.
15467
15468         In general, we must not be checking (expr_type ==
15469         target_type) in the top level conversion methods
15470         (ImplicitConversion, ExplicitConversion etc). This checking is
15471         done in the methods that they delegate to.
15472
15473 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
15474
15475         * convert.cs: Move Error_CannotConvertType,
15476         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
15477         ImplicitNumericConversion, ImplicitConversionExists,
15478         ImplicitUserConversionExists, StandardConversionExists,
15479         FindMostEncompassedType, FindMostSpecificSource,
15480         FindMostSpecificTarget, ImplicitUserConversion,
15481         ExplicitUserConversion, GetConversionOperators,
15482         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
15483         TryImplicitIntConversion, Error_CannotConvertImplicit,
15484         ConvertImplicitRequired, ConvertNumericExplicit,
15485         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
15486         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
15487         its own file.
15488
15489         Perform the following renames:
15490
15491         StandardConversionExists -> ImplicitStandardConversionExists
15492         ConvertImplicit -> ImplicitConversion
15493         ConvertImplicitStandard -> ImplicitStandardConversion
15494         TryImplicitIntConversion -> ImplicitIntConversion
15495         ConvertImplicitRequired -> ImplicitConversionRequired
15496         ConvertNumericExplicit -> ExplicitNumericConversion
15497         ConvertReferenceExplicit -> ExplicitReferenceConversion
15498         ConvertExplicit -> ExplicitConversion
15499         ConvertExplicitStandard -> ExplicitStandardConversion
15500
15501 2003-05-19  Martin Baulig  <martin@ximian.com>
15502
15503         * statement.cs (TypeInfo.StructInfo): Made this type protected.
15504         (TypeInfo): Added support for structs having structs as fields.
15505
15506         * ecore.cs (FieldExpr): Implement IVariable.
15507         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
15508         VariableInfo for the field.
15509
15510 2003-05-18  Martin Baulig  <martin@ximian.com>
15511
15512         * expression.cs (This.DoResolve): Report a CS0027 if we're
15513         emitting a field initializer.
15514
15515 2003-05-18  Martin Baulig  <martin@ximian.com>
15516
15517         * expression.cs (This.ResolveBase): New public function.
15518         (This.DoResolve): Check for CS0188.
15519
15520         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
15521         This.Resolve().
15522
15523         * ecore.cs (MethodGroupExpr.DoResolve): Set the
15524         `instance_expression' to null if we don't have any non-static
15525         methods.
15526
15527 2003-05-18  Martin Baulig  <martin@ximian.com>
15528
15529         Reworked the way how local variables and parameters are handled by
15530         the flow analysis code.
15531
15532         * statement.cs (TypeInfo, VariableMap): New public classes.
15533         (VariableInfo): New public class.  This is now responsible for
15534         checking whether a variable has been assigned.  It is used for
15535         parameters and local variables.
15536         (Block.EmitMeta): Take the InternalParameters as argument; compute
15537         the layout of the flow vectors here.
15538         (Block.LocalMap, Block.ParameterMap): New public properties.
15539         (FlowBranching): The .ctor doesn't get the InternalParameters
15540         anymore since Block.EmitMeta() now computes the layout of the flow
15541         vector.
15542         (MyStructInfo): This class is now known as `StructInfo' and nested
15543         in `TypeInfo'; we don't access this directly anymore.
15544
15545         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
15546         property and removed IsAssigned(), IsFieldAssigned(),
15547         SetAssigned() and SetFieldAssigned(); we now call them on the
15548         VariableInfo so we don't need to duplicate this code everywhere.
15549
15550         * expression.cs (ParameterReference): Added `Block block' argument
15551         to the .ctor.
15552         (LocalVariableReference, ParameterReference, This): The new
15553         VariableInfo class is now responsible for all the definite
15554         assignment stuff.
15555
15556         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
15557         IsParameterAssigned, SetParameterAssigned): Removed.
15558
15559 2003-05-18  Martin Baulig  <martin@ximian.com>
15560
15561         * typemanager.cs (InitCoreTypes): Try calling
15562         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
15563         the 3-args-version.  Corlib now also needs our `void_type'.
15564         (GetMethod): Added overloaded version which takes an optional
15565         `bool report_errors' to allow lookups of optional methods.
15566
15567 2003-05-12  Martin Baulig  <martin@ximian.com>
15568
15569         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
15570         only used for locals and not for parameters.
15571
15572 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
15573
15574         * support.cs (InternalParameters.ParameterType): Return the
15575         ExternalType of the parameter.
15576
15577         * parameter.cs (Parameter.ExternalType): drop the two arguments,
15578         they were unused.
15579
15580 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
15581
15582         * class.cs (MethodData.Define): Do not set the `newslot' on
15583         interface members, if they are also flagged as "override".
15584
15585         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
15586         better code for ++i and i++.  This only works for static fields
15587         and local variables.
15588
15589         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
15590         want to pull the DeclSpace out of the builder_to_declspace instead
15591         of the TypeBuilder (like in TypeContainer.FindMembers).
15592
15593         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
15594         instead of LookupTypeContainer.  Fixes the crash on .NET for
15595         looking up interface members.
15596
15597         * const.cs: Create our own emit context during the Definition
15598         stage, so that constants are evaluated in the proper context, when
15599         a recursive definition happens.
15600
15601 2003-05-11  Martin Baulig  <martin@ximian.com>
15602
15603         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
15604         new block for a switch section.
15605         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
15606         the adding/lookup in the switch block.  Fixes #39828.
15607
15608 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
15609
15610         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
15611         functionality: I needed to convert the data after I had performed
15612         the add/sub operation into the operands type size.
15613
15614         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
15615         pass the type for the box operation, otherwise the resulting
15616         object would have been of type object.
15617
15618         (BoxedCast): Add constructor to specify the type to box as.
15619
15620 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
15621
15622         * iterators.cs: I was reusing the `count' variable inadvertently,
15623         take steps to not allow this to happen.
15624
15625 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
15626
15627         * attribute.cs (Attribute.Resolve): Params attributes are encoded
15628         by creating an array at the point where the params starts and
15629         putting all those arguments there, then adjusting the size of the
15630         array.
15631
15632 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
15633
15634         * expression.cs (New.AddressOf): Implement interface
15635         IMemoryLocation.  This is used when the `new' operator is used in
15636         the context of an invocation to a method on a value type.
15637
15638         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
15639         example. 
15640
15641         * namespace.cs: Also check the using aliases here.
15642
15643         * driver.cs: Move the test for using validity after the types have
15644         been entered, so we do a single pass that also includes the using
15645         aliases. 
15646
15647         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
15648         in the regular case.   CreateSiblingForFinally is doing extra
15649         error checking.
15650
15651         * attribute.cs (GetAttributeArgumentExpression): Store the result
15652         on an out value, and use the return value to indicate failure
15653         instead of using null (which is a valid return for Constant.GetValue).
15654
15655         * statement.cs: Perform the analysis flow for the increment
15656         portion after the statement, because this will be the real flow of
15657         execution.  Fixes #42385
15658
15659         * codegen.cs (EmitContext.EmitArgument,
15660         EmitContext.EmitStoreArgument): New helper functions when the
15661         RemapToProxy flag is set.
15662
15663         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
15664         function.
15665
15666         Add support for remapping parameters. 
15667
15668         * iterators.cs: Propagate parameter values;  Store parameter
15669         values in the proxy classes.
15670
15671 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
15672
15673         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
15674         need a proxy reference;  I do not know what I was thinking
15675
15676         * cs-parser.jay (constructor_initializer): catch another error,
15677         and display nice message.
15678
15679         (field_declaration): catch void field declaration
15680         to flag a better error. 
15681
15682         * class.cs (MemberBase.CheckBase): Report an error instead of a
15683         warning if a new protected member is declared in a struct. 
15684         (Field.Define): catch the error of readonly/volatile.
15685
15686         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
15687
15688         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
15689         volatile variable is taken
15690
15691 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
15692
15693         * statement.cs (Fixed.Resolve): Report an error if we are not in
15694         an unsafe context.
15695
15696 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
15697
15698         * typemanager.cs: reuse the code that handles type clashes for
15699         delegates and enumerations.
15700
15701         * class.cs (Report28): Always report.
15702
15703         * expression.cs (EncodeAsAttribute): Allow nulls here.
15704
15705 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
15706
15707         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
15708         the functionality for testing whether an expression is valid for
15709         an attribute here.  Also handle the case of arrays of elements
15710         being stored. 
15711
15712         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
15713         encoding a linear array into an array of objects that are suitable
15714         to be passed to an CustomAttributeBuilder.
15715
15716         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15717
15718         * ecore.cs: (FieldExpr): Handle field remapping here.
15719
15720         * iteratators.cs: Pass the instance variable (if the method is an
15721         instance method) to the constructors, so we can access the field
15722         variables on the class.
15723
15724         TODO: Test this with structs.  I think the THIS variable on
15725         structs might have to be a pointer, and not a refenrece
15726
15727 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
15728
15729         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15730         local variables to fields in a proxy class.
15731
15732         * iterators.cs (PopulateProxy): Rename our internal fields to
15733         <XXX>.  
15734         Create a <THIS> field if we are an instance method, so we can
15735         reference our parent container variables.
15736         (MapVariable): Called back from the EmitContext code to enter a
15737         new variable to field mapping into the proxy class (we just create
15738         a FieldBuilder).
15739
15740         * expression.cs
15741         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15742         for using the remapped locals to fields.
15743
15744         I placed the code here, because that gives the same semantics to
15745         local variables, and only changes the Emit code.
15746
15747         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15748         statements inside iterators.
15749         (VariableInfo): Add a FieldBuilder for the cases when we are
15750         remapping local variables to fields in a proxy class
15751
15752         * ecore.cs (SimpleNameResolve): Avoid testing two times for
15753         current_block != null.
15754
15755         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15756         not cope with strings, as it has been moved to the
15757         TableSwitchEmit.  Fixed bug in switch generation.
15758
15759         * expression.cs (New.DoResolve): Provide more context for the user
15760         when reporting an error.
15761
15762         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15763         pointers. 
15764
15765         * expression.cs (MemberAccess.DoResolve): When we get a type back,
15766         check the permissions for it.  Note than in a type-resolution
15767         context the check was already present in DeclSpace.ResolveType,
15768         but was missing from the MemberAccess.
15769
15770         (ArrayCreation.CheckIndices): warn if the user has
15771         more nested levels of expressions, but there are no more
15772         dimensions specified.  Avoids crash on bug 41906.
15773
15774 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
15775
15776         * statement.cs (Block): replace Implicit bool, for a generic
15777         flags.   
15778         New flag: `Unchecked'.  This is used during the EmitMeta phase
15779         (which is out-of-line with the regular Resolve/Emit process for a
15780         statement, as this is done ahead of time, but still gets a chance
15781         to call constant resolve).
15782
15783         (Block.Flags): new enum for adding a new flag.
15784
15785         (Block.EmitMeta): track the state of unchecked.
15786
15787         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15788         to enable constant resolution to work there as well.
15789
15790 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
15791
15792         * typemanager.cs (ienumerable_type): Also look up
15793         System.Collections.IEnumerable. 
15794
15795 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
15796
15797         TODO: Test more than one conditional per method.
15798
15799         * class.cs (Indexer.Define): Report the location where the user is
15800         referencing the unsupported feature.
15801
15802         (MethodData): Overload the use of `conditionals' to
15803         minimize the creation of needless ArrayLists.   This saves roughly
15804         212kb on my machine.
15805
15806         (Method): Implement the new IIteratorContainer interface.
15807         (Method.SetYields): Implement the method by setting the ModFlags
15808         to contain METHOD_YIELDS.
15809
15810         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15811         which just got set to null.
15812
15813         * iterators.cs: New file.
15814
15815         (Yield, YieldBreak): New statements.
15816
15817         * statement.cs (Return.Resolve): Flag an error if we are used in
15818         an iterator method.
15819
15820         * codegen.cs (InIterator): New flag set if the code is being
15821         compiled in an iterator method.
15822
15823         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
15824         internal modifier, and we just use it to avoid adding extra
15825         fields, as this is seldom used.  
15826
15827         * cs-parser.jay: Add yield_statement (yield and yield break).
15828
15829         * driver.cs: New flag -v2 to turn on version 2 features. 
15830
15831         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15832         hashtable when v2 is enabled.
15833
15834 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
15835
15836         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15837         there is already a namespace defined with this name.
15838
15839         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15840         people upgraded their corlibs.
15841
15842         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15843         always use fully qualified types, no need to use the compiler
15844         front end.
15845
15846         (TypeManager.IsNamespace): Use binarysearch.
15847
15848         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15849         AddDelegate): I did not quite use the new IsValid API properly: I
15850         have to pass the short-name and the fullname.  I was passing only
15851         the basename instead of the fullname sometimes. 
15852
15853         (TypeContainer.DefineType): call NamespaceClash.
15854
15855         * interface.cs (Interface.DefineType): use NamespaceClash before
15856         defining the type.
15857
15858         * delegate.cs (Delegate.DefineType): use NamespaceClash before
15859         defining the type.
15860
15861         * enum.cs: (Enum.DefineType): use NamespaceClash before
15862         defining the type.
15863
15864         * typemanager.cs (: 3-line patch that gives us some tasty 11%
15865         speed increase.  First, use the negative_hits cache when we get a
15866         negative.  Second, add the type with its full original name
15867         instead of the new . and + encoded name (reflection uses + to
15868         separate type from a nested type).  Use LookupTypeReflection
15869         directly which bypasses the type->name hashtable (that we already
15870         know does not contain the type.
15871
15872         * decl.cs (DeclSpace.ResolveTypeExpr): track the
15873         location/container type. 
15874
15875         * driver.cs: When passing utf8, use directly the UTF8Encoding.
15876
15877 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
15878
15879         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15880
15881         * delegate.cs (NewDelegate.Resolve): Test whether an instance
15882         method is being referenced in the method group from a static
15883         context, and report error 120 if so.
15884
15885         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15886         Error118. 
15887
15888         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15889         is created, we create the A namespace).
15890
15891         * cs-parser.jay: A namespace also introduces a DeclarationFound.
15892         Fixes #41591
15893
15894 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
15895
15896         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15897         invocation to ModuleBuilder.GetType with the same values will
15898         return a new type instance, so we need to cache its return
15899         values. 
15900
15901         * expression.cs (Binary.ResolveOperator): Only allow the compare
15902         operators on enums if they are of the same type.
15903
15904         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15905         types of ValueType on their own case.  Before we were giving them
15906         the same treatment as objects.
15907
15908         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15909         fullname.  Short name is used to compare against container name.
15910         Fullname is used to check against defined namespace names.
15911
15912         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15913         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15914
15915         (Method.CheckBase): Call parent.
15916         (MemberBase.CheckBase): Check for protected members on sealed
15917         classes.
15918         (PropertyBase.CheckBase): Call parent.
15919         (Field.Define): Call parent.
15920
15921         * report.cs: Negative error codes are now mapped to 8000 - code,
15922         so that the display is render more nicely.
15923
15924         * typemanager.cs: Do not use try/catch, instead report a regular
15925         error. 
15926
15927         (GetPointerType, GetReferenceType): These methods provide
15928         mechanisms to obtain the T* and T& from a T.  We had the code
15929         previously scattered around the code base, and it also used
15930         TypeManager.LookupType that would go through plenty of caches.
15931         This one goes directly to the type source.
15932
15933         In some places we did the Type.GetType followed by
15934         ModuleBuilder.GetType, but not in others, so this unifies the
15935         processing as well.
15936
15937         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15938         statements now that we have namespace information.
15939
15940         * typemanager.cs (IsNamespace): New method, returns whether the
15941         string presented is a namespace or not.
15942
15943         (ComputeNamespaces): New public entry point, computes the list of
15944         available namespaces, using the GetNamespaces API call in Mono, or
15945         the slower version in MS.NET.   
15946
15947         Now before we start the semantic analysis phase, we have a
15948         complete list of namespaces including everything that the user has
15949         provided.
15950
15951         Deleted old code to cache namespaces in .nsc files.
15952
15953 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
15954
15955         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15956         class/struct location definition Location for the implicit
15957         constructor location.
15958
15959         (Operator.Define): Use the location of the operator for the
15960         implicit Method definition.
15961
15962         (Constructor.Emit): use the constructor location for the implicit
15963         base initializer constructor.
15964
15965         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
15966         and the Expression class now contains two new methods:
15967
15968         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
15969         isolate type lookup from the rest of the resolution process.
15970
15971         Since we use Expressions to hold type definitions due to the way
15972         we parse the input we have historically overloaded Resolve to
15973         perform the Type lookups if a special flag is passed.  Now this is
15974         eliminated and two methods take their place. 
15975
15976         The differences in the two methods between xStep and xTerminal is
15977         that xStep is involved in our current lookup system that uses
15978         SimpleNames to compose a name, while xTerminal is used just to
15979         catch the case where the simplename lookup failed.
15980
15981 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
15982
15983         * expression.cs (ResolveMemberAccess): Remove redundant code.
15984         TypeExpr expressions are always born fully resolved.
15985
15986         * interface.cs (PopulateMethod): Do not lookup the types twice.
15987         We were doing it once during SemanticAnalysis and once during
15988         PopulateMethod.
15989
15990         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15991         in local variable type definitions, were being returned as a
15992         SimpleName (we decomposed everything into a string), that is
15993         because primary_expression was being used instead of a type in the
15994         grammar (reduce/reduce conflicts).
15995
15996         The part that was wrong is that we converted the expression into a
15997         string (an oversimplification in one hand, compounded with primary
15998         expressions doing string concatenation).
15999
16000         So things like:
16001
16002         A.B.C [] x;
16003
16004         Would return "A.B.C[]" as a SimpleName.  This stopped things like
16005         using clauses from working on this particular context.  And a type
16006         was being matched directly against "A.B.C[]".
16007
16008         We now use the correct approach, and allow for ComposedCast to be
16009         part of the unary expression.  So the "A.B.C []" become a composed
16010         cast of "A.B.C" (as a nested group of MemberAccess with a
16011         SimpleName at the end) plus the rank composition "[]". 
16012
16013         Also fixes 35567
16014
16015 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
16016
16017         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
16018         for the access level checking.
16019
16020         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
16021         `TypeContainer container', because I kept getting confused when I
16022         was debugging this code.
16023
16024         * expression.cs (Indexers): Instead of tracking getters/setters,
16025         we now track them in parallel.  We create one arraylist less, but
16026         most importantly it is possible now for the LValue code to find a
16027         matching get for a set.
16028
16029         (IndexerAccess.DoResolveLValue): Update the code.
16030         GetIndexersForType has been modified already to extract all the
16031         indexers from a type.  The code assumed it did not.
16032
16033         Also make the code set the correct return type for the indexer.
16034         This was fixed a long time ago for properties, but was missing for
16035         indexers.  It used to be void_type.
16036
16037         (Binary.Emit): Test first for doubles instead of
16038         floats, as they are more common.
16039
16040         (Binary.EmitBranchable): Use the .un version of the branch opcodes
16041         when dealing with floats and the <=, >= operators.  This fixes bug
16042         #39314 
16043
16044         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
16045         to load the array value by emitting a load on the foreach variable
16046         type.  This was incorrect.  
16047
16048         We now emit the code to load an element using the the array
16049         variable type, and then we emit the conversion operator.
16050
16051         Fixed #40176
16052
16053 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
16054
16055         * attribute.cs: Avoid allocation of ArrayLists in the common case.
16056
16057 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
16058
16059         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
16060         test for protection before we test for signatures. 
16061
16062         (MethodSignature.ToString): implement.
16063
16064         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
16065         to the case where we reduced into a LongConstant.
16066
16067         * decl.cs (CheckAccessLevel): If the type is an array, we can not
16068         depend on whether the information is acurrate, because the
16069         Microsoft runtime will always claim that the array type is public,
16070         regardless of the real state.
16071
16072         If the type is a pointer, another problem happens: the type is
16073         reported as non-public in Microsoft.  
16074
16075         In both cases we have to call CheckAccessLevel recursively with
16076         the underlying type as the argument to be tested.
16077
16078 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
16079
16080         * assign.cs (Assign.Emit): If we are dealing with a compound
16081         assignment expression, we should use the code path that stores the
16082         intermediate result in a temporary value.  This fixes #40903.
16083
16084         *expression.cs (Indirection.ToString): Provide ToString method for
16085         debugging. 
16086
16087 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
16088
16089         * class.cs: Null out fields holding references to Block objects so
16090         they can be garbage collected.
16091
16092         * expression.cs (OverloadResolve): Remove unused local.
16093
16094 2003-04-07  Martin Baulig  <martin@ximian.com>
16095
16096         * codegen.cs (EmitContext.CurrentFile): New public field.
16097         (EmitContext.Mark): Use the CurrentFile to check whether the
16098         location is in the correct file.
16099         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
16100
16101 2003-04-07  Martin Baulig  <martin@ximian.com>
16102
16103         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
16104
16105         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
16106         location.  [FIXME: The location argument which gets passed to this
16107         method is sometimes wrong!]
16108
16109 2003-04-07  Nick Drochak <ndrochak@gol.com>
16110
16111         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
16112
16113 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
16114
16115         * expression.cs (Indirection.EmitAssign): We were using the
16116         temporary, but returning immediately instead of continuing the
16117         EmitAssing flow.
16118
16119 2003-04-06  Martin Baulig  <martin@ximian.com>
16120
16121         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
16122         if it's a nested child, but also deriving from the outer class.
16123         See test 190.cs.
16124
16125         * typemanager.cs (IsNestedChildOf): Make this work if it's a
16126         nested child, but also deriving from the outer class.  See
16127         test-190.cs.
16128         (FilterWithClosure): We may access private members of the outer
16129         class if we're a nested child and deriving from the outer class.
16130         (RealMemberLookup): Only set `closure_private_ok' if the
16131         `original_bf' contained BindingFlags.NonPublic.
16132
16133 2003-04-05  Martin Baulig  <martin@ximian.com>
16134
16135         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
16136         probe if its a type parameter, and if so, flag an error.
16137
16138         * decl.cs: Move here the SetParameterInfo code from class.cs.
16139         Handle IsGeneric here.
16140
16141         Handle a variety of errors in the parameter info definition.
16142
16143         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
16144         type parameters here.
16145
16146         * cs-parser.jay (class_declaration): report errors for parameters
16147         here as well.
16148
16149 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
16150
16151         * generic.cs: New file, contains support code for generics.
16152
16153         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
16154         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
16155
16156         Update parser for the above removals.
16157
16158         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
16159         now taken care of in the parser.
16160
16161 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
16162
16163         * class.cs (Event.Define): Do not allow abstract events to have
16164         initializers. 
16165
16166 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
16167
16168         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
16169         block in event declarations.
16170
16171         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
16172         value type, get its address.
16173
16174         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
16175         leaving a class on the stack instead of a boolean value (int
16176         0/1).  Change the code so we compare against null, and then the
16177         result against zero.
16178
16179         * class.cs (TypeContainer.GetClassBases): We were checking for the
16180         parent class being sealed too late.
16181
16182         * expression.cs (Binary.Emit): For <= and >= when dealing with
16183         floating point values, use cgt.un and clt.un instead of cgt and
16184         clt alone.
16185
16186 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
16187
16188         * statement.cs: Apply the same optimization as MS: skip the 
16189         GetEnumerator returning an IEnumerator, and use the one returning a 
16190         CharEnumerator instead. This allows us to avoid the try-finally block 
16191         and the boxing.
16192
16193 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
16194
16195         * cs-parser.jay: Attributes cannot be applied to
16196                          namespaces. Fixes #40473
16197
16198 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16199
16200         * class.cs:
16201         (Add*): check if the name is valid using the full name for constants,
16202         fields, properties and events.
16203
16204 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
16205
16206         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
16207         char constants to be part of the enumeration.
16208
16209         * expression.cs (Conditional.DoResolve): Add support for operator
16210         true. Implements the missing functionality from 14.12
16211
16212         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
16213         operator true/false as required by the spec.
16214
16215         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
16216         implicit conversion to boolean.
16217
16218         * statement.cs (Statement.ResolveBoolean): A boolean expression is
16219         also one where the type implements `operator true'. 
16220
16221         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
16222         get an expression that will invoke operator true based on an
16223         expression.  
16224
16225         (GetConversionOperators): Removed the hack that called op_True
16226         here.  
16227
16228         (Expression.ResolveBoolean): Move this from Statement.
16229
16230 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
16231
16232         * ecore.cs (FieldExpr): do not allow initialization of initonly
16233         fields on derived classes
16234
16235 2003-03-13  Martin Baulig  <martin@ximian.com>
16236
16237         * statement.cs (Block.Emit): Call ig.BeginScope() and
16238         ig.EndScope() when compiling with debugging info; call
16239         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
16240
16241 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
16242
16243         * expression.cs (Indexers): Do not construct immediately, allow
16244         for new members to be appended as we go.  Fixes 38143
16245
16246 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16247
16248         * expression.cs: save/restore context when resolving an unchecked
16249         expression.
16250
16251 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
16252
16253         * cfold.cs: Catch division by zero in modulus operator during
16254         constant folding.
16255
16256 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
16257
16258         * interface.cs (Interface.DefineMembers): Avoid defining members
16259         twice. 
16260
16261 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
16262
16263         * driver.cs: handle the +/- options for -noconfig
16264
16265         * statement.cs (Unckeched.Resolve): Also track the state of
16266         unchecked in the Resolve phase.
16267
16268 2003-02-27  Martin Baulig  <martin@ximian.com>
16269
16270         * ecore.cs (Expression.MemberLookup): Don't create a
16271         MethodGroupExpr for something which is not a method.  Fixes #38291.
16272
16273 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
16274
16275         * class.cs (MemberBase.CheckParameters): Also check that the type
16276         is unmanaged if it is a pointer.
16277
16278         * expression.cs (SizeOf.Resolve): Add location information.
16279
16280         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
16281         a managed type is declared.
16282
16283         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
16284         parameter modifiers as well.  Fixes bug 38606
16285
16286         * class.cs: Very sad.  Am backing out the speed up changes
16287         introduced by the ArrayList -> Array in the TypeContainer, as they
16288         were not actually that much faster, and introduced a bug (no error
16289         reports on duplicated methods).
16290
16291         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
16292         source first, this will guarantee that we have a valid expression
16293         before calling in lower levels functions that will require a
16294         resolved object.  Then use this original_source in the
16295         target.ResolveLValue instead of the original source that was
16296         passed to us.
16297
16298         Another change.  Use target.Resolve instead of LValueResolve.
16299         Although we are resolving for LValues, we will let the Assign code
16300         take care of that (it will be called again from Resolve).  This
16301         basically allows code like this:
16302
16303         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
16304         class Y { void A (X x) { x [0] += o; }
16305
16306         The problem was that the indexer was trying to resolve for
16307         set_Item (idx, object o) and never finding one.  The real set_Item
16308         was set_Item (idx, X).  By delaying the process we get the right
16309         semantics. 
16310
16311         Fixes bug 36505
16312
16313 2003-02-23  Martin Baulig  <martin@ximian.com>
16314
16315         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
16316         while calling DoEmit ().
16317
16318         * codegen.cs (EmitContext.Mark): Don't mark locations in other
16319         source files; if you use the #line directive inside a method, the
16320         compiler stops emitting line numbers for the debugger until it
16321         reaches the end of the method or another #line directive which
16322         restores the original file.
16323
16324 2003-02-23  Martin Baulig  <martin@ximian.com>
16325
16326         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
16327
16328 2003-02-23  Martin Baulig  <martin@ximian.com>
16329
16330         * statement.cs (Block.AddChildVariableNames): We need to call this
16331         recursively, not just for our immediate children.
16332
16333 2003-02-23  Martin Baulig  <martin@ximian.com>
16334
16335         * class.cs (Event.Define): Always make the field private, like csc does.
16336
16337         * typemanager.cs (TypeManager.RealMemberLookup): Make events
16338         actually work, fixes bug #37521.
16339
16340 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
16341
16342         * delegate.cs: When creating the various temporary "Parameters"
16343         classes, make sure that we call the ComputeAndDefineParameterTypes
16344         on those new parameters (just like we do with the formal ones), to
16345         allow them to be resolved in the context of the DeclSpace.
16346
16347         This fixes the bug that Dick observed in Bugzilla #38530.
16348
16349 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
16350
16351         * expression.cs (ResolveMemberAccess): When resolving a constant,
16352         do not attempt to pull a constant if the value was not able to
16353         generate a valid constant.
16354
16355         * const.cs (LookupConstantValue): Do not report more errors than required.
16356
16357 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16358
16359         * expression.cs: fixes bug #38328.
16360
16361 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
16362
16363         * class.cs: Changed all the various members that can be part of a
16364         class from being an ArrayList to be an Array of the right type.
16365         During the DefineType type_list, interface_list, delegate_list and
16366         enum_list are turned into types, interfaces, delegates and enums
16367         arrays.  
16368
16369         And during the member population, indexer_list, event_list,
16370         constant_list, field_list, instance_constructor_list, method_list,
16371         operator_list and property_list are turned into their real arrays.
16372
16373         Although we could probably perform this operation earlier, for
16374         good error reporting we need to keep the lists and remove the
16375         lists for longer than required.
16376
16377         This optimization was triggered by Paolo profiling the compiler
16378         speed on the output of `gen-sample-program.pl' perl script. 
16379
16380         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
16381         not crash in methods like MemberLookupFailed that use this field.  
16382
16383         This problem arises when the compiler fails to resolve a type
16384         during interface type definition for example.
16385
16386 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
16387
16388         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
16389         inherit from System.Object, so we have to stop at null, not only
16390         when reaching System.Object.
16391
16392 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
16393
16394         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
16395         DeclaredOnly because the parent indexer might have had a different
16396         name, but did not loop until the top of the hierarchy was reached.
16397
16398         The problem this one fixes is 35492: when a class implemented an
16399         indexer from an interface, we were getting the interface method
16400         (which was abstract) and we were flagging an error (can not invoke
16401         abstract method).
16402
16403         This also keeps bug 33089 functioning, and test-148 functioning.
16404
16405         * typemanager.cs (IsSpecialMethod): The correct way of figuring
16406         out if a method is special is to see if it is declared in a
16407         property or event, or whether it is one of the predefined operator
16408         names.   This should fix correctly #36804.
16409
16410 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
16411
16412         The goal here is to remove the dependency on EmptyCast.Peel ().
16413         Killing it completely.
16414
16415         The problem is that currently in a number of places where
16416         constants are expected, we have to "probe" for an EmptyCast, and
16417         Peel, which is not the correct thing to do, as this will be
16418         repetitive and will likely lead to errors. 
16419
16420         The idea is to remove any EmptyCasts that are used in casts that
16421         can be reduced to constants, so we only have to cope with
16422         constants. 
16423
16424         This bug hunt was triggered by Bug 37363 and the desire to remove
16425         the duplicate pattern where we were "peeling" emptycasts to check
16426         whether they were constants.  Now constants will always be
16427         constants.
16428
16429         * ecore.cs: Use an enumconstant here instead of wrapping with
16430         EmptyCast.  
16431
16432         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
16433         throwing me off.  By handling this we can get rid of a few hacks.
16434
16435         * statement.cs (Switch): Removed Peel() code.
16436
16437 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
16438
16439         * class.cs: Location information for error 508
16440
16441         * expression.cs (New.DoResolve): Add a guard against double
16442         resolution of an expression.  
16443
16444         The New DoResolve might be called twice when initializing field
16445         expressions (see EmitFieldInitializers, the call to
16446         GetInitializerExpression will perform a resolve on the expression,
16447         and later the assign will trigger another resolution
16448
16449         This leads to bugs (#37014)
16450
16451         * delegate.cs: The signature for EndInvoke should contain any ref
16452         or out parameters as well.  We were not doing this in the past. 
16453
16454         * class.cs (Field.Define): Do not overwrite the type definition
16455         inside the `volatile' group.  Turns out that volatile enumerations
16456         were changing the type here to perform a validity test, which
16457         broke conversions. 
16458
16459 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
16460
16461         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
16462         and structs, we do not want to load the instance variable
16463
16464         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
16465         enum_type has to be handled like an object reference (implicit
16466         conversions exists from this to object), but the regular IsClass
16467         and IsValueType tests will never return true for this one.
16468
16469         Also we use TypeManager.IsValueType instead of type.IsValueType,
16470         just for consistency with the rest of the code (this is only
16471         needed if we ever use the construct exposed by test-180.cs inside
16472         corlib, which we dont today).
16473
16474 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
16475
16476         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
16477         just InternalCall.
16478
16479 2003-02-09  Martin Baulig  <martin@ximian.com>
16480
16481         * namespace.cs (Namespace..ctor): Added SourceFile argument.
16482         (Namespace.DefineNamespaces): New static public method; this is
16483         called when we're compiling with debugging to add all namespaces
16484         to the symbol file.
16485
16486         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
16487         pass it to the Namespace's .ctor.
16488
16489         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
16490         and MethodBase arguments; pass the namespace ID to the symwriter;
16491         pass the MethodBase instead of the token to the symwriter.
16492         (SymbolWriter.DefineNamespace): New method to add a namespace to
16493         the symbol file.
16494
16495 2003-02-09  Martin Baulig  <martin@ximian.com>
16496
16497         * symbolwriter.cs: New file.  This is a wrapper around
16498         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
16499         methods here in near future.
16500
16501 2003-02-09  Martin Baulig  <martin@ximian.com>
16502
16503         * codegen.cs (EmitContext.Mark): Just pass the arguments to
16504         ILGenerator.MarkSequencePoint() which are actually used by the
16505         symbol writer.
16506
16507 2003-02-09  Martin Baulig  <martin@ximian.com>
16508
16509         * location.cs (SourceFile): New public sealed class.  This
16510         contains the name and an index which is used in the location's token.
16511         (Location): Reserve an appropriate number of bits in the token for
16512         the source file instead of walking over that list, this gives us a
16513         really huge performance improvement when compiling with debugging.
16514
16515         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
16516         `SourceFile' argument instead of a string.
16517         (Driver.ProcessFile): Add all the files via Location.AddFile(),
16518         but don't parse/tokenize here, we need to generate the list of all
16519         source files before we do that.
16520         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
16521         the files.
16522
16523         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
16524         instead of a string.
16525
16526         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
16527         of a string.
16528
16529 2003-02-09  Martin Baulig  <martin@ximian.com>
16530
16531         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
16532         filename on `#line default'.
16533
16534 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
16535
16536         * statement.cs: don't clear the pinned var when the fixed statement
16537         returns from the method (fixes bug#37752).
16538
16539 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
16540
16541         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
16542         to IsValueType.
16543
16544 2003-02-07  Martin Baulig  <martin@ximian.com>
16545
16546         * driver.cs: Removed the `--debug-args' command line argument.
16547
16548         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
16549         automatically by the AsssemblyBuilder.
16550         (CodeGen.InitializeSymbolWriter): We don't need to call any
16551         initialization function on the symbol writer anymore.  This method
16552         doesn't take any arguments.
16553
16554 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
16555
16556         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
16557         from referenced assemblies as well.
16558
16559 2003-02-02  Martin Baulig  <martin@ximian.com>
16560
16561         * class.cs (MethodData.Emit): Generate debugging info for external methods.
16562
16563 2003-02-02  Martin Baulig  <martin@ximian.com>
16564
16565         * class.cs (Constructor.Emit): Open the symbol writer before
16566         emitting the constructor initializer.
16567         (ConstructorInitializer.Emit): Call ec.Mark() to allow
16568         single-stepping through constructor initializers.
16569
16570 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
16571
16572         * class.cs: Handle error 549: do not allow virtual methods in
16573         sealed classes. 
16574
16575 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
16576
16577         * decl.cs: Check access levels when resolving types
16578
16579 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
16580
16581         * statement.cs: Add parameters and locals set in catch blocks that might 
16582         return to set vector
16583
16584 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
16585
16586         * class.cs (Operator): Set the SpecialName flags for operators.
16587
16588         * expression.cs (Invocation.DoResolve): Only block calls to
16589         accessors and operators on SpecialName methods.
16590
16591         (Cast.TryReduce): Handle conversions from char constants.
16592
16593
16594 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
16595
16596         * statement.cs: small memory and time optimization in FlowBranching.
16597
16598 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
16599
16600         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
16601         problem that the last fix but in the other sid (Set).
16602
16603         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
16604         access when there is no indexer in the hierarchy.
16605
16606 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
16607
16608         * class.cs: Combine some if statements.
16609
16610 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16611
16612         * driver.cs: fixed bug #37187.
16613
16614 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
16615
16616         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
16617         any indexer, it's needed to build a list with all the indexers in the
16618         hierarchy (AllGetters), else we have problems. Fixes #35653.
16619
16620 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
16621
16622         * class.cs (MethodData.Define): It is wrong for an interface
16623         implementation to be static in both cases: explicit and implicit.
16624         We were only handling this in one case.
16625
16626         Improve the if situation there to not have negations.
16627
16628         * class.cs (Field.Define): Turns out that we do not need to check
16629         the unsafe bit on field definition, only on usage.  Remove the test.
16630
16631 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16632
16633         * driver.cs: use assembly.Location instead of Codebase (the latest
16634         patch made mcs fail when using MS assemblies).
16635
16636 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
16637
16638         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
16639         get the path to *corlib.dll.
16640
16641 2003-01-21  Nick Drochak <ndrochak@gol.com>
16642
16643         * cs-tokenizer.cs:
16644         * pending.cs:
16645         * typemanager.cs: Remove compiler warnings
16646
16647 2003-01-20  Duncan Mak  <duncan@ximian.com>
16648
16649         * AssemblyInfo.cs: Bump the version number to 0.19.
16650
16651 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16652
16653         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
16654
16655 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
16656
16657         * class.cs (Constructor::Emit): Emit debugging info for constructors.
16658
16659 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
16660
16661         * cs-parser.jay: Small fix: we were not comparing the constructor
16662         name correctly.   Thanks to Zoltan for the initial pointer.
16663
16664 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
16665
16666         * cs-tokenizer.cs: Set file name when specified with #line
16667
16668 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
16669
16670         * cs-parser.jay: Only perform the constructor checks here if we
16671         are named like the class;  This will help provider a better
16672         error.  The constructor path is taken when a type definition is
16673         not found, but most likely the user forgot to add the type, so
16674         report that rather than the constructor error.
16675
16676 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
16677
16678         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
16679         allocations.
16680
16681 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16682
16683         * cs-parser.jay: Add cleanup call.
16684
16685 2003-01-13  Duncan Mak  <duncan@ximian.com>
16686
16687         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
16688         consistent with other methods.
16689
16690 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16691
16692         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
16693
16694 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
16695
16696         * attribute.cs: only set GuidAttr to true when we have a
16697         GuidAttribute.
16698
16699 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16700
16701         * ecore.cs:
16702         * expression.cs:
16703         * typemanager.cs: fixes to allow mcs compile corlib with the new
16704         Type.IsSubclassOf fix.
16705
16706 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
16707
16708         * expression.cs (LocalVariableReference.DoResolve): Classify a
16709         constant as a value, not as a variable.   Also, set the type for
16710         the variable.
16711
16712         * cs-parser.jay (fixed_statement): take a type instead of a
16713         pointer_type, so we can produce a better error message later.
16714
16715         * statement.cs (Fixed.Resolve): Flag types that are not pointers
16716         as an error.  
16717
16718         (For.DoEmit): Make inifinite loops have a
16719         non-conditional branch back.
16720
16721         (Fixed.DoEmit): First populate the pinned variables, then emit the
16722         statement, then clear the variables.  Before I was emitting the
16723         code once for each fixed piece.
16724
16725
16726 2003-01-08  Martin Baulig  <martin@ximian.com>
16727
16728         * statement.cs (FlowBranching.MergeChild): A break in a
16729         SWITCH_SECTION does not leave a loop.  Fixes #36155.
16730
16731 2003-01-08  Martin Baulig  <martin@ximian.com>
16732
16733         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16734         lives in the same number space than `param_map'.  Fixes #36154.
16735
16736 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
16737
16738         * cs-parser.jay (constructor_declaration): Set the
16739         Constructor.ModFlags before probing for it.  This makes the
16740         compiler report 514, 515 and 132 (the code was there, but got
16741         broken). 
16742
16743         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16744         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16745         (GotoCase.Resolve): Set `Returns' to ALWAYS.
16746
16747 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16748
16749         * enum.cs: create the enum static fields using the enum type.
16750
16751 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16752
16753         * class.cs: don't try to create the ParamBuilder for the return
16754         type if it's not needed (and handle it breaking for the ms runtime
16755         anyway).
16756
16757 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16758
16759         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16760
16761 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
16762
16763         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16764         the command.   This showed up while compiling the JANET source
16765         code, which used \r as its only newline separator.
16766
16767 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
16768
16769         * class.cs (Method.Define): If we are an operator (because it
16770         reuses our code), then set the SpecialName and HideBySig.  #36128
16771
16772 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
16773
16774         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16775         exception, report error 120 `object reference required'.
16776
16777         * driver.cs: Add --pause option, used during to measure the size
16778         of the process as it goes with --timestamp.
16779
16780         * expression.cs (Invocation.DoResolve): Do not allow methods with
16781         SpecialName to be invoked.
16782
16783 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
16784
16785         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16786         number before adding it.
16787
16788 2002-12-21  Ravi Pratap  <ravi@ximian.com>
16789
16790         * ecore.cs (StandardImplicitConversion): When in an unsafe
16791         context, we allow conversion between void * to any other pointer
16792         type. This fixes bug #35973.
16793
16794 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16795
16796         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16797         is not thrown when extensionless outputs are used 
16798
16799 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16800
16801         * rootcontext.cs: fixed compilation of corlib.
16802
16803 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
16804
16805         * attribute.cs (Attributes.Contains): Add new method.
16806
16807         * class.cs (MethodCore.LabelParameters): if the parameter is an
16808         `out' parameter, check that no attribute `[In]' has been passed.
16809
16810         * enum.cs: Handle the `value__' name in an enumeration.
16811
16812 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
16813
16814         * decl.cs: Added special case to allow overrides on "protected
16815         internal" methods
16816
16817 2002-12-18  Ravi Pratap  <ravi@ximian.com>
16818
16819         * attribute.cs (Attributes.AddAttributeSection): Rename to this
16820         since it makes much more sense.
16821
16822         (Attributes.ctor): Don't require a Location parameter.
16823
16824         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16825
16826         * attribute.cs (ApplyAttributes): Remove extra Location parameters
16827         since we already have that information per attribute.
16828
16829         * everywhere : make appropriate changes.
16830
16831         * class.cs (LabelParameters): Write the code which actually
16832         applies attributes to the return type. We can't do this on the MS
16833         .NET runtime so we flag a warning in the case an exception is
16834         thrown.
16835
16836 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
16837
16838         * const.cs: Handle implicit null conversions here too.
16839
16840 2002-12-17  Ravi Pratap  <ravi@ximian.com>
16841
16842         * class.cs (MethodCore.LabelParameters): Remove the extra
16843         Type [] parameter since it is completely unnecessary. Instead
16844         pass in the method's attributes so that we can extract
16845         the "return" attribute.
16846
16847 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
16848
16849         * cs-parser.jay (parse): Use Report.Error to flag errors instead
16850         of ignoring it and letting the compile continue.
16851
16852         * typemanager.cs (ChangeType): use an extra argument to return an
16853         error condition instead of throwing an exception.
16854
16855 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
16856
16857         * expression.cs (Unary.TryReduce): mimic the code for the regular
16858         code path.  Perform an implicit cast in the cases where we can
16859         implicitly convert to one of the integral types, and then reduce
16860         based on that constant.   This fixes bug #35483.
16861
16862 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16863
16864         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16865
16866 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16867
16868         * namespace.cs: fixed bug #35489.
16869
16870 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
16871
16872         * class.cs: Remove some dead code.
16873
16874         * cs-parser.jay: Estimate the number of methods needed
16875         (RootContext.MethodCount);
16876
16877         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16878         numbers instead of StringBuilders.
16879
16880         * support.cs (PtrHashtable): Add constructor with initial size;
16881         We can now reduce reallocations of the method table.
16882
16883 2002-12-10  Ravi Pratap  <ravi@ximian.com>
16884
16885         * attribute.cs (ApplyAttributes): Keep track of the emitted
16886         attributes on a per-target basis. This fixes bug #35413.
16887
16888 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
16889
16890         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16891         default to the Windows 1252 encoding.
16892
16893         (UnixParseOption): Support version, thanks to Alp for the missing
16894         pointer. 
16895
16896         * AssemblyInfo.cs: Add nice assembly information.
16897
16898         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16899         (bug 35169).
16900
16901         * cs-parser.jay: Allow a trailing comma before the close bracked
16902         in the attribute_section production.
16903
16904         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16905         address of the instance was being taken, I will take this out,
16906         because we take the address of the object immediately here.
16907
16908 2002-12-09  Ravi Pratap  <ravi@ximian.com>
16909
16910         * typemanager.cs (AreMultipleAllowed): Take care of the most
16911         obvious case where attribute type is not in the current assembly -
16912         stupid me ;-)
16913
16914 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
16915
16916         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16917         definitions, instead of doing that afterwards.  
16918
16919         Also we use a nice little hack, depending on the constructor, we
16920         know if we are a "composed" name or a simple name.  Hence, we
16921         avoid the IndexOf test, and we avoid 
16922
16923         * codegen.cs: Add code to assist in a bug reporter to track down
16924         the source of a compiler crash. 
16925
16926 2002-12-07  Ravi Pratap  <ravi@ximian.com>
16927
16928         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16929         types have been emitted for a given element and flag an error
16930         if something which does not have AllowMultiple set is used more
16931         than once.
16932
16933         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16934         attribute types and their corresponding AllowMultiple properties
16935
16936         (AreMultipleAllowed): Check the property for a given type.
16937
16938         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16939         property in the case we have a TypeContainer.
16940
16941         (Attributes.AddAttribute): Detect duplicates and just skip on
16942         adding them. This trivial fix catches a pretty gross error in our
16943         attribute emission - global attributes were being emitted twice!
16944
16945         Bugzilla bug #33187 is now fixed.
16946
16947 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
16948
16949         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16950         instead of pp_and).
16951
16952         * expression.cs (Binary.ResolveOperator): I can only use the
16953         Concat (string, string, string) and Concat (string, string,
16954         string, string) if the child is actually a concatenation of
16955         strings. 
16956
16957 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
16958
16959         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16960         context where we need a 2-character lookahead.
16961
16962         * pending.cs (PendingImplementation): Rework so we can keep track
16963         of interface types all the time, and flag those which were
16964         implemented by parents as optional.
16965
16966 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
16967
16968         * expression.cs (Binary.ResolveOperator): Use
16969         String.Concat(string,string,string) or
16970         String.Concat(string,string,string,string) when possible. 
16971
16972         * typemanager: More helper methods.
16973
16974
16975 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16976
16977         * pending.cs: remove the bogus return from GetMissingInterfaces()
16978         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16979
16980 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16981
16982         * namespace.cs: avoid duplicated 'using xxx' being added to
16983         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16984         when we get more than one 'using' statement for the same namespace.
16985         Report a CS0105 warning for it.
16986
16987 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
16988
16989         * cs-tokenizer.cs (consume_identifier): use read directly, instead
16990         of calling getChar/putback, uses internal knowledge of it.    
16991
16992         (xtoken): Reorder tokenizer so most common patterns are checked
16993         first.  This reduces the compilation time in another 5% (from 8.11s
16994         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16995
16996         The parsing time is 22% of the compilation in mcs, and from that
16997         64% is spent on the tokenization process.  
16998
16999         I tried using a binary search for keywords, but this is slower
17000         than the hashtable.  Another option would be to do a couple of
17001         things:
17002
17003                 * Not use a StringBuilder, instead use an array of chars,
17004                   with a set value.  Notice that this way we could catch
17005                   the 645 error without having to do it *afterwards*.
17006
17007                 * We could write a hand-parser to avoid the hashtable
17008                   compares altogether.
17009
17010         The identifier consumption process takes 37% of the tokenization
17011         time.  Another 15% is spent on is_number.  56% of the time spent
17012         on is_number is spent on Int64.Parse:
17013
17014                 * We could probably choose based on the string length to
17015                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
17016                   computations. 
17017
17018         Another 3% is spend on wrapping `xtoken' in the `token' function.
17019
17020         Handle 0xa0 as whitespace (#34752)
17021
17022 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
17023
17024         * typemanager.cs (IsCLRType): New routine to tell whether a type
17025         is one of the builtin types.  
17026
17027         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
17028         typecode in more places instead of doing pointer comparissions.
17029         We could leverage some knowledge about the way the typecodes are
17030         laid out.
17031
17032         New code to cache namespaces in assemblies, it is currently not
17033         invoked, to be used soon.
17034
17035         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
17036
17037         * expression.cs (Binary.ResolveOperator): specially handle
17038         strings, and do not perform user-defined operator overloading for
17039         built-in types.
17040
17041 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
17042
17043         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
17044         internalcall as it is a pretty simple operation;  Avoid whenever
17045         possible to call Char.IsLetter.
17046
17047         (consume_identifier): Cut by half the number of
17048         hashtable calls by merging the is_keyword and GetKeyword behavior.
17049
17050         Do not short-circuit, because if we do, we
17051         report errors (ie, #if false && true would produce an invalid
17052         directive error);
17053
17054
17055 2002-11-24  Martin Baulig  <martin@ximian.com>
17056
17057         * expression.cs (Cast.TryReduce): If we're in checked syntax,
17058         check constant ranges and report a CS0221.  Fixes #33186.
17059
17060 2002-11-24  Martin Baulig  <martin@ximian.com>
17061
17062         * cs-parser.jay: Make this work for uninitialized variable
17063         declarations in the `for' initializer.  Fixes #32416.
17064
17065 2002-11-24  Martin Baulig  <martin@ximian.com>
17066
17067         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
17068         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
17069
17070 2002-11-24  Martin Baulig  <martin@ximian.com>
17071
17072         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
17073         argument; if true, we also check for user-defined conversions.
17074         This is only needed if both arguments are of a user-defined type.
17075         Fixes #30443, added test-175.cs.
17076         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
17077
17078         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
17079
17080 2002-11-24  Martin Baulig  <martin@ximian.com>
17081
17082         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
17083         function to get the store opcode.
17084         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
17085         only emit the Ldelema if the store opcode is Stobj.  You must run
17086         both test-34 and test-167 to test this.  Fixes #34529.
17087
17088 2002-11-23  Martin Baulig  <martin@ximian.com>
17089
17090         * ecore.cs (Expression.MemberLookup): Added additional
17091         `qualifier_type' argument which is used when we're being called
17092         from MemberAccess.DoResolve() and null if we're called from a
17093         SimpleName lookup.
17094         (Expression.MemberLookupFailed): New method to report errors; this
17095         does the CS1540 check and reports the correct error message.
17096
17097         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
17098         argument for the CS1540 check and redone the way how we're dealing
17099         with private members.  See the comment in the source code for details.
17100         (FilterWithClosure): Reverted this back to revision 1.197; renamed
17101         `closure_start_type' to `closure_qualifier_type' and check whether
17102         it's not null.  It was not this filter being broken, it was just
17103         being called with the wrong arguments.
17104
17105         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
17106         and pass it the correct `qualifier_type'; this also does the error
17107         handling for us.
17108
17109 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
17110
17111         * expression.cs (Invocation.EmitParams): If the we are dealing
17112         with a non-built-in value type, load its address as well.
17113
17114         (ArrayCreation): Use a a pretty constant instead
17115         of the hardcoded value 2.   Use 6 instead of 2 for the number of
17116         static initializers.  
17117
17118         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
17119         because they are not really value types, just glorified integers. 
17120
17121         * driver.cs: Do not append .exe, the CSC compiler does not do it.
17122
17123         * ecore.cs: Remove redundant code for enumerations, make them use
17124         the same code path as everything else, fixes the casting issue
17125         with enumerations in Windows.Forms.
17126
17127         * attribute.cs: Do only cast to string if it is a string, the
17128         validation happens later.
17129
17130         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
17131         people upgrade their corlibs.
17132
17133         * ecore.cs: Oops, enumerations were not following the entire code path
17134
17135 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
17136
17137         * typemanager.cs (FilterWithClosure): Commented out the test for
17138         1540 in typemanager.cs, as it has problems when accessing
17139         protected methods from a parent class (see test-174.cs). 
17140
17141         * attribute.cs (Attribute.ValidateGuid): new method.
17142         (Attribute.Resolve): Use above.
17143
17144 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
17145
17146         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
17147
17148         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
17149         handling for enumerations, as we only needed the TypeContainer
17150         functionality to begin with (this is required for the fix below to
17151         work for enums that reference constants in a container class for
17152         example). 
17153
17154         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
17155
17156         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
17157         a valid TypeBuilder to perform lookups on.o
17158
17159         * class.cs (InheritableMemberSignatureCompare): Use true in the
17160         call to GetGetMethod and GetSetMethod, because we are comparing
17161         the signature, and we need to get the methods *even* if they are
17162         private. 
17163
17164         (PropertyBase.CheckBase): ditto.
17165
17166         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
17167         GotoCase.Resolve): Use Peel on EmpytCasts.
17168
17169         * ecore.cs (EmptyCast): drop child, add Peel method.
17170
17171 2002-11-17  Martin Baulig  <martin@ximian.com>
17172
17173         * ecore.cs (EmptyCast.Child): New public property.
17174
17175         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
17176         label resolved to an EmptyCast.  Fixes #34162.
17177         (GotoCase.Resolve): Likewise.
17178         (Block.EmitMeta): Likewise.
17179
17180 2002-11-17  Martin Baulig  <martin@ximian.com>
17181
17182         * expression.cs (Invocation.BetterConversion): Prefer int over
17183         uint; short over ushort; long over ulong for integer literals.
17184         Use ImplicitConversionExists instead of StandardConversionExists
17185         since we also need to check for user-defined implicit conversions.
17186         Fixes #34165.  Added test-173.cs.
17187
17188 2002-11-16  Martin Baulig  <martin@ximian.com>
17189
17190         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
17191         with the `true' and `false' literals.  Fixes #33151.
17192
17193 2002-11-16  Martin Baulig  <martin@ximian.com>
17194
17195         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
17196         October 22nd; don't do the cs1540 check for static members.
17197
17198         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
17199         now using our own filter here and doing the cs1540 check again.
17200
17201 2002-11-16  Martin Baulig  <martin@ximian.com>
17202
17203         * support.cs (InternalParameters): Don't crash if we don't have
17204         any fixed parameters.  Fixes #33532.
17205
17206 2002-11-16  Martin Baulig  <martin@ximian.com>
17207
17208         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
17209         when looking up static methods to make this work on Windows.
17210         Fixes #33773.
17211
17212 2002-11-16  Martin Baulig  <martin@ximian.com>
17213
17214         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
17215         a setter rather than using PropertyInfo.CanWrite.
17216
17217 2002-11-15  Nick Drochak  <ndrochak@gol.com>
17218
17219         * class.cs: Allow acces to block member by subclasses. Fixes build
17220         breaker.
17221
17222 2002-11-14  Martin Baulig  <martin@ximian.com>
17223
17224         * class.cs (Constructor.Emit): Added the extern/block check.
17225         Fixes bug #33678.
17226
17227 2002-11-14  Martin Baulig  <martin@ximian.com>
17228
17229         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
17230         iteration while looking for indexers, this is needed because the
17231         indexer may have a different name in our base classes.  Fixed the
17232         error reporting (no indexers at all, not get accessor, no
17233         overloaded match).  Fixes bug #33089.
17234         (IndexerAccess.DoResolveLValue): Likewise.
17235
17236 2002-11-14  Martin Baulig  <martin@ximian.com>
17237
17238         * class.cs (PropertyBase.CheckBase): Make this work for multiple
17239         indexers.  Fixes the first part of bug #33089.
17240         (MethodSignature.InheritableMemberSignatureCompare): Added support
17241         for properties.
17242
17243 2002-11-13  Ravi Pratap  <ravi@ximian.com>
17244
17245         * attribute.cs (Attribute.Resolve): Catch the
17246         NullReferenceException and report it since it isn't supposed to
17247         happen. 
17248
17249 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
17250
17251         * expression.cs (Binary.EmitBranchable): Also handle the cases for
17252         LogicalOr and LogicalAnd that can benefit from recursively
17253         handling EmitBranchable.  The code now should be nice for Paolo.
17254
17255 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
17256
17257         * typemanager.cs (LookupType): Added a negative-hit hashtable for
17258         the Type lookups, as we perform quite a number of lookups on
17259         non-Types.  This can be removed once we can deterministically tell
17260         whether we have a type or a namespace in advance.
17261
17262         But this might require special hacks from our corlib.
17263
17264         * TODO: updated.
17265
17266         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
17267         and double which avoids a conversion from an integer to a double.
17268
17269         * expression.cs: tiny optimization, avoid calling IsConstant,
17270         because it effectively performs the lookup twice.
17271
17272 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
17273
17274         But a bogus return here to keep the semantics of the old code
17275         until the Mono runtime is fixed.
17276
17277         * pending.cs (GetMissingInterfaces): New method used to remove all
17278         the interfaces that are already implemented by our parent
17279         classes from the list of pending methods. 
17280
17281         * interface.cs: Add checks for calls after ResolveTypeExpr.
17282
17283 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
17284
17285         * class.cs (Class.Emit): Report warning 67: event not used if the
17286         warning level is beyond 3.
17287
17288         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
17289         being a NullLiteral.
17290
17291         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
17292         specifiers. 
17293
17294         * class.cs (TypeContainer.GetClassBases): Cover a missing code
17295         path that might fail if a type can not be resolved.
17296
17297         * expression.cs (Binary.Emit): Emit unsigned versions of the
17298         operators. 
17299
17300         * driver.cs: use error 5.
17301
17302 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
17303
17304         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
17305
17306 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
17307
17308         * cs-parser.jay (switch_section): A beautiful patch from Martin
17309         Baulig that fixed 33094.
17310
17311 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
17312
17313         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
17314         Check whether the base is abstract and report an error if so.
17315
17316         * expression.cs (IndexerAccess.DoResolveLValue,
17317         IndexerAccess.DoResolve): ditto. 
17318
17319         (Invocation.DoResolve): ditto.
17320
17321         (Invocation.FullMethodDesc): Improve the report string.
17322
17323         * statement.cs (Block): Eliminate IsVariableDefined as it is
17324         basically just a wrapper for GetVariableInfo.
17325
17326         * ecore.cs (SimpleName): Use new 
17327
17328         * support.cs (ReflectionParamter.ParameterType): We unwrap the
17329         type, as we return the actual parameter ref/unref state on a
17330         different call.
17331
17332 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
17333
17334         * support.cs: Return proper flags REF/OUT fixing the previous
17335         commit.  
17336
17337         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
17338         not used to mean `ref' but `ref or out' in ParameterReference
17339
17340         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
17341         full type signature instead of calling TypeManger.CSharpName
17342         ourselves. 
17343
17344         * support.cs (InternalParameters.ParameterDesc): Do not compare
17345         directly to the modflags, because REF/OUT will actually be bitsets
17346         if set. 
17347
17348         * delegate.cs (VerifyMethod): Check also the modifiers.
17349
17350         * cs-tokenizer.cs: Fix bug where floating point values with an
17351         exponent where a sign was missing was ignored.
17352
17353         * driver.cs: Allow multiple assemblies to be specified in a single
17354         /r: argument
17355
17356 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
17357
17358         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
17359         because identifiers after a parenthesis would end up in this kind
17360         of production, and we needed to desamiguate it for having casts
17361         like:
17362
17363                 (UserDefinedType *) xxx
17364
17365 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
17366
17367         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
17368         we should set on the Bindingflags.NonPublic, but not turn on
17369         private_ok.  private_ok controls whether a Private member is
17370         returned (this is chekced on the filter routine), while the
17371         BindingFlags.NonPublic just controls whether private/protected
17372         will be allowed.   This fixes the problem part of the problem of
17373         private properties being allowed to be used in derived classes.
17374
17375         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
17376         so we can call the children DoResolveLValue method (this will
17377         properly signal errors on lvalue assignments to base properties)
17378
17379         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
17380         getter are null, and we have a property info, we know that this
17381         happened because the lookup failed, so we report an error 122 for
17382         protection level violation.
17383
17384         We also silently return if setter and getter are null in the
17385         resolve functions, this condition only happens if we have flagged
17386         the error before.  This is the other half of the problem. 
17387
17388         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
17389         not have accessibility information, that is why we were returning
17390         true in the filter function in typemanager.cs.
17391
17392         To properly report 122 (property is inaccessible because of its
17393         protection level) correctly, we report this error in ResolveAccess
17394         by failing if both the setter and the getter are lacking (ie, the
17395         lookup failed). 
17396
17397         DoResolve and DoLResolve have been modified to check for both
17398         setter/getter being null and returning silently, the reason being
17399         that I did not want to put the knowledge about this error in upper
17400         layers, like:
17401
17402         int old = Report.Errors;
17403         x = new PropertyExpr (...);
17404         if (old != Report.Errors)
17405                 return null;
17406         else
17407                 return x;
17408
17409         So the property expr is returned, but it is invalid, so the error
17410         will be flagged during the resolve process. 
17411
17412         * class.cs: Remove InheritablePropertySignatureCompare from the
17413         class, as we no longer depend on the property signature to compute
17414         whether it is possible to implement a method or not.
17415
17416         The reason is that calling PropertyInfo.GetGetMethod will return
17417         null (in .NET, in Mono it works, and we should change this), in
17418         cases where the Get Method does not exist in that particular
17419         class.
17420
17421         So this code:
17422
17423         class X { public virtual int A { get { return 1; } } }
17424         class Y : X { }
17425         class Z : Y { public override int A { get { return 2; } } }
17426
17427         Would fail in Z because the parent (Y) would not have the property
17428         defined.  So we avoid this completely now (because the alternative
17429         fix was ugly and slow), and we now depend exclusively on the
17430         method names.
17431
17432         (PropertyBase.CheckBase): Use a method-base mechanism to find our
17433         reference method, instead of using the property.
17434
17435         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
17436         routines are gone now.
17437
17438         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
17439         names, they were incorrectly named.
17440
17441         * cs-tokenizer.cs: Return are more gentle token on failure. 
17442
17443         * pending.cs (PendingImplementation.InterfaceMethod): This routine
17444         had an out-of-sync index variable, which caused it to remove from
17445         the list of pending methods the wrong method sometimes.
17446
17447 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
17448
17449         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
17450         CanWrite, because those refer to this particular instance of the
17451         property, and do not take into account the fact that we can
17452         override single members of a property.
17453
17454         Constructor requires an EmitContext.  The resolution process does
17455         not happen here, but we need to compute the accessors before,
17456         because the resolution does not always happen for properties.
17457
17458         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
17459         subclass, before we did not update this flag, but we did update
17460         bindingflags. 
17461
17462         (GetAccessors): Drop this routine, as it did not work in the
17463         presence of partially overwritten set/get methods. 
17464
17465         Notice that this broke the cs1540 detection, but that will require
17466         more thinking. 
17467
17468 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17469
17470         * class.cs:
17471         * codegen.cs:
17472         * driver.cs: issue a warning instead of an error if we don't support
17473         debugging for the platform. Also ignore a couple of errors that may
17474         arise when trying to write the symbols. Undo my previous patch.
17475
17476 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17477
17478         * driver.cs: ignore /debug switch except for Unix platforms.
17479
17480 2002-10-23  Nick Drochak  <ndrochak@gol.com>
17481
17482         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
17483
17484 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
17485
17486         * driver.cs: Do not make mcs-debug conditional, so we do not break
17487         builds that use it.
17488
17489         * statement.cs (UsageVector.MergeChildren): I would like Martin to
17490         review this patch.  But basically after all the children variables
17491         have been merged, the value of "Breaks" was not being set to
17492         new_breaks for Switch blocks.  I think that it should be set after
17493         it has executed.  Currently I set this to the value of new_breaks,
17494         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
17495         conservative, but I do not understand this code very well.
17496
17497         I did not break anything in the build, so that is good ;-)
17498
17499         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
17500
17501 2002-10-20  Mark Crichton  <crichton@gimp.org>
17502
17503         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
17504
17505 2002-10-20  Nick Drochak  <ndrochak@gol.com>
17506
17507         * cfold.cs: Fixed compile blocker.
17508
17509 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
17510
17511         * driver.cs: I was chekcing the key, not the file.
17512
17513 2002-10-19  Ravi Pratap  <ravi@ximian.com>
17514
17515         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
17516         message that we were generating - we just need to silently return
17517         a null.
17518
17519 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
17520
17521         * class.cs (Event.Define): Change my previous commit, as this
17522         breaks the debugger.  This is a temporary hack, as it seems like
17523         the compiler is generating events incorrectly to begin with.
17524
17525         * expression.cs (Binary.ResolveOperator): Added support for 
17526         "U operator - (E x, E y)"
17527
17528         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
17529         y)".
17530
17531         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
17532         init-only variables, but this path did not take into account that
17533         there might be also instance readonly variables.  Correct this
17534         problem. 
17535
17536         This fixes bug 32253
17537
17538         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
17539         delegates as well.
17540
17541         * driver.cs: Change the extension for modules to `netmodule'
17542
17543         * cs-parser.jay: Improved slightly the location tracking for
17544         the debugger symbols.
17545
17546         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
17547         modifiers that were specified instead of the hardcoded value
17548         (FamAndAssem).  This was basically ignoring the static modifier,
17549         and others.  Fixes 32429.
17550
17551         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
17552         fixed a bug in the process (32476)
17553
17554         * expression.cs (ArrayAccess.EmitAssign): Patch from
17555         hwang_rob@yahoo.ca that fixes bug 31834.3
17556
17557 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
17558
17559         * driver.cs: Make the module extension .netmodule.
17560
17561 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
17562
17563         * driver.cs: Report an error if the resource file is not found
17564         instead of crashing.
17565
17566         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
17567         false, like Emit does.
17568
17569 2002-10-16  Nick Drochak  <ndrochak@gol.com>
17570
17571         * typemanager.cs: Remove unused private member.  Also reported mcs
17572         bug to report this as a warning like csc.
17573
17574 2002-10-15  Martin Baulig  <martin@gnome.org>
17575
17576         * statement.cs (Statement.Emit): Made this a virtual method; emits
17577         the line number info and calls DoEmit().
17578         (Statement.DoEmit): New protected abstract method, formerly knows
17579         as Statement.Emit().
17580
17581         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
17582
17583 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
17584
17585         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
17586         have fixed a remaining problem: not every AddXXXX was adding a
17587         fully qualified name.  
17588
17589         Now everyone registers a fully qualified name in the DeclSpace as
17590         being defined instead of the partial name.  
17591
17592         Downsides: we are slower than we need to be due to the excess
17593         copies and the names being registered this way.  
17594
17595         The reason for this is that we currently depend (on the corlib
17596         bootstrap for instance) that types are fully qualified, because
17597         we dump all the types in the namespace, and we should really have
17598         types inserted into the proper namespace, so we can only store the
17599         basenames in the defined_names array.
17600
17601 2002-10-10  Martin Baulig  <martin@gnome.org>
17602
17603         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
17604         from bug #31834, see the bug report for a testcase which is
17605         miscompiled.
17606
17607 2002-10-10  Martin Baulig  <martin@gnome.org>
17608
17609         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
17610         flow analysis code for this.
17611
17612         * statement.cs (Do, While, For): Tell the flow analysis code about
17613         infinite loops.
17614         (FlowBranching.UsageVector): Added support for infinite loops.
17615         (Block.Resolve): Moved the dead code elimination here and use flow
17616         analysis to do it.
17617
17618 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
17619
17620         * class.cs (Field.Define): Catch cycles on struct type
17621         definitions. 
17622
17623         * typemanager.cs (IsUnmanagedtype): Do not recursively check
17624         fields if the fields are static.  We only need to check instance
17625         fields. 
17626
17627         * expression.cs (As.DoResolve): Test for reference type.
17628
17629         * statement.cs (Using.ResolveExpression): Use
17630         ConvertImplicitRequired, not ConvertImplicit which reports an
17631         error on failture
17632         (Using.ResolveLocalVariableDecls): ditto.
17633
17634         * expression.cs (Binary.ResolveOperator): Report errors in a few
17635         places where we had to.
17636
17637         * typemanager.cs (IsUnmanagedtype): Finish implementation.
17638
17639 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
17640
17641         * expression.cs: Use StoreFromPtr instead of extracting the type
17642         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
17643
17644         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
17645         an enumeration value to a System.Enum, but System.Enum is not a
17646         value type, but an class type, so we need to box.
17647
17648         (Expression.ConvertExplicit): One codepath could return
17649         errors but not flag them.  Fix this.  Fixes #31853
17650
17651         * parameter.cs (Resolve): Do not allow void as a parameter type.
17652
17653 2002-10-06  Martin Baulig  <martin@gnome.org>
17654
17655         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
17656         if it's a class type and not a struct.  Fixes #31815.
17657
17658 2002-10-06  Martin Baulig  <martin@gnome.org>
17659
17660         * statement.cs: Reworked the flow analysis code a bit to make it
17661         usable for dead code elimination.
17662
17663 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17664
17665         * cs-parser.jay: allow empty source files. Fixes bug #31781.
17666
17667 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17668
17669         * expression.cs (ComposedCast.DoResolveType): A quick workaround
17670         to fix the test 165, will investigate deeper.
17671
17672 2002-10-04  Martin Baulig  <martin@gnome.org>
17673
17674         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
17675         finally blocks actually work.
17676         (Try.Resolve): We don't need to create a sibling for `finally' if
17677         there is no finally block.
17678
17679 2002-10-04  Martin Baulig  <martin@gnome.org>
17680
17681         * class.cs (Constructor.Define): The default accessibility for a
17682         non-default constructor is private, not public.
17683
17684 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17685
17686         * class.cs (Constructor): Make AllowedModifiers public, add
17687         EXTERN.
17688
17689         * cs-parser.jay: Perform the modifiers test here, as the
17690         constructor for the Constructor class usually receives a zero
17691         because of the way we create it (first we create, later we
17692         customize, and we were never checking the modifiers).
17693
17694         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
17695         is a version of LookupTypeReflection that includes the type-name
17696         cache.  This can be used as a fast path for functions that know
17697         the fully qualified name and are only calling into *.GetType() to
17698         obtain a composed type.
17699
17700         This is also used by TypeManager.LookupType during its type
17701         composition.
17702
17703         (LookupType): We now also track the real type name, as sometimes
17704         we can get a quey for the real type name from things like
17705         ComposedCast.  This fixes bug 31422.
17706
17707         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
17708         complete type fullname, it does not have to go through the type
17709         resolution system to obtain the composed version of the type (for
17710         obtaining arrays or pointers).
17711
17712         (Conditional.Emit): Use the EmitBoolExpression to
17713         generate nicer code, as requested by Paolo.
17714
17715         (ArrayCreation.CheckIndices): Use the patch from
17716         hwang_rob@yahoo.ca to validate the array initializers. 
17717
17718 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
17719
17720         * class.cs (ConstructorInitializer.Emit): simplify code by using
17721         Invocation.EmitCall, and at the same time, fix the bugs in calling
17722         parent constructors that took variable arguments. 
17723
17724         * ecore.cs (Expression.ConvertNumericExplicit,
17725         Expression.ImplicitNumericConversion): Remove the code that
17726         manually wrapped decimal (InternalTypeConstructor call is now gone
17727         as well).
17728
17729         * expression.cs (Cast.TryReduce): Also handle decimal types when
17730         trying to perform a constant fold on the type.
17731
17732         * typemanager.cs (IsUnmanagedtype): Partially implemented.
17733
17734         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17735         that only turned off an error report, and did nothing else. 
17736
17737 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
17738
17739         * driver.cs: Handle and ignore /fullpaths
17740
17741 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
17742
17743         * expression.cs (Binary.ResolveOperator): Catch the case where
17744         DoNumericPromotions returns true, 
17745
17746         (Binary.DoNumericPromotions): Simplify the code, and the tests.
17747
17748 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
17749
17750         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17751         report error 70.
17752
17753 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
17754
17755         * ecore.cs (ConvertNumericExplicit): It is not enough that the
17756         conversion exists, but it is also required that the conversion be
17757         performed.  This manifested in "(Type64Enum) 2".  
17758
17759         * class.cs (TypeManager.AddMethod): The fix is not to change
17760         AddEnum, because that one was using a fully qualified name (every
17761         DeclSpace derivative does), but to change the AddMethod routine
17762         that was using an un-namespaced name.  This now correctly reports
17763         the duplicated name.
17764
17765         Revert patch until I can properly fix it.  The issue
17766         is that we have a shared Type space across all namespaces
17767         currently, which is wrong.
17768
17769         Options include making the Namespace a DeclSpace, and merge
17770         current_namespace/current_container in the parser.
17771
17772 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
17773
17774         * cs-parser.jay: Improve error reporting when we get a different
17775         kind of expression in local_variable_type and
17776         local_variable_pointer_type. 
17777
17778         Propagate this to avoid missleading errors being reported.
17779
17780         * ecore.cs (ImplicitReferenceConversion): treat
17781         TypeManager.value_type as a target just like object_type.   As
17782         code like this:
17783
17784         ValueType v = 1;
17785
17786         Is valid, and needs to result in the int 1 being boxed before it
17787         is assigned to the value type v.
17788
17789         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17790         to validate the enumeration name.
17791
17792         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17793         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
17794         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17795
17796         * ecore.cs (TryImplicitIntConversion): When doing an
17797         implicit-enumeration-conversion, check if the type is 64-bits and
17798         perform a conversion before passing to EnumConstant.
17799
17800 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
17801
17802         * decl.cs (Error_AmbiguousTypeReference); New routine used to
17803         report ambiguous type references.  Unlike the MS version, we
17804         report what the ambiguity is.   Innovation at work ;-)
17805
17806         (DeclSpace.FindType): Require a location argument to
17807         display when we display an ambiguous error.
17808
17809         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17810
17811         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17812
17813         * expression.cs (EmitDynamicInitializers): Apply patch from
17814         hwang_rob@yahoo.ca that fixes the order in which we emit our
17815         initializers. 
17816
17817 2002-09-21  Martin Baulig  <martin@gnome.org>
17818
17819         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17820         delegate takes no arguments.
17821
17822 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
17823
17824         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17825         from integers.
17826
17827         * expression.cs: Extract the underlying type.
17828
17829         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17830
17831         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17832
17833 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
17834
17835         * class.cs (TypeContainer.DefineType): We can not use the nice
17836         PackingSize with the size set to 1 DefineType method, because it
17837         will not allow us to define the interfaces that the struct
17838         implements.
17839
17840         This completes the fixing of bug 27287
17841
17842         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17843         means also structs.  This fixes part of the problem. 
17844         (Expresion.ImplicitReferenceConversionExists): ditto.
17845
17846         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17847         error if there were no errors reported during the type lookup
17848         process, to avoid duplicates or redundant errors.  Without this
17849         you would get an ambiguous errors plus a type not found.  We have
17850         beaten the user enough with the first error.  
17851
17852         (DeclSparce.FindType): Emit a warning if we have an ambiguous
17853         reference. 
17854
17855         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17856         during the resolution process, stop the lookup, this avoids
17857         repeated error reports (same error twice).
17858
17859         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17860
17861         * typemanager.cs (LookupType): Redo the type lookup code to match
17862         the needs of System.Reflection.  
17863
17864         The issue is that System.Reflection requires references to nested
17865         types to begin with a "+" sign instead of a dot.  So toplevel
17866         types look like: "NameSpace.TopLevelClass", and nested ones look
17867         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17868         levels. 
17869
17870 2002-09-19  Martin Baulig  <martin@gnome.org>
17871
17872         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17873         says that a method always returns or always throws an exception,
17874         don't report the CS0161.
17875
17876         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17877         set `Returns = new_returns'.
17878
17879 2002-09-19  Martin Baulig  <martin@gnome.org>
17880
17881         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17882         to an enum constant, check for a CS0176.
17883
17884 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
17885
17886         * class.cs (TypeContainer.CheckPairedOperators): Now we check
17887         for operators that must be in pairs and report errors.
17888
17889         * ecore.cs (SimpleName.DoResolveType): During the initial type
17890         resolution process, when we define types recursively, we must
17891         check first for types in our current scope before we perform
17892         lookups in the enclosing scopes.
17893
17894         * expression.cs (MakeByteBlob): Handle Decimal blobs.
17895
17896         (Invocation.VerifyArgumentsCompat): Call
17897         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17898         I thought we were supposed to always call this, but there are a
17899         few places in the code where we dont do it.
17900
17901 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
17902
17903         * driver.cs: Add support in -linkres and -resource to specify the
17904         name of the identifier.
17905
17906 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17907
17908         * ecore.cs (StandardConversionExists): Sync with the conversion
17909         code: allow anything-* to void* conversions.
17910
17911         (FindMostSpecificSource): Use an Expression argument
17912         instead of a Type, because we might be handed over a Literal which
17913         gets a few more implicit conversions that plain types do not.  So
17914         this information was being lost.
17915
17916         Also, we drop the temporary type-holder expression when not
17917         required.
17918
17919 2002-09-17  Martin Baulig  <martin@gnome.org>
17920
17921         * class.cs (PropertyBase.CheckBase): Don't check the base class if
17922         this is an explicit interface implementation.
17923
17924 2002-09-17  Martin Baulig  <martin@gnome.org>
17925
17926         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17927         different `IndexerName' attributes.
17928
17929         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17930         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17931         virtual CommonResolve().
17932
17933 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17934
17935         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17936         and convert that to the UnderlyingType.
17937
17938         * statement.cs (Foreach.Resolve): Indexers are just like variables
17939         or PropertyAccesses.
17940
17941         * cs-tokenizer.cs (consume_string): Track line numbers and columns
17942         inside quoted strings, we were not doing this before.
17943
17944 2002-09-16  Martin Baulig  <martin@gnome.org>
17945
17946         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17947         resolve it.  This is needed for the definite assignment check of the
17948         instance expression, fixes bug #29846.
17949         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17950
17951 2002-09-16  Nick Drochak  <ndrochak@gol.com>
17952
17953         * parameter.cs: Fix compile error.  Cannot reference static member
17954         from an instance object.  Is this an mcs bug?
17955
17956 2002-09-14  Martin Baulig  <martin@gnome.org>
17957
17958         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17959         multiple times.  Fixes bug #30295, added test-166.cs.
17960
17961 2002-09-14  Martin Baulig  <martin@gnome.org>
17962
17963         * statement.cs (Block.Emit): Don't emit unreachable code.
17964         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17965         `break' statements.
17966         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17967
17968 2002-09-14  Martin Baulig  <martin@gnome.org>
17969
17970         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17971         is set.
17972
17973 2002-09-14  Martin Baulig  <martin@gnome.org>
17974
17975         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17976         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17977         be false on the ms runtime.
17978
17979 2002-09-13  Martin Baulig  <martin@gnome.org>
17980
17981         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17982         the CS0038 error message.
17983
17984 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
17985
17986         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17987         constant inside, return it.
17988
17989 2002-09-12  Martin Baulig  <martin@gnome.org>
17990
17991         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17992         implicit conversion can be done between enum types.
17993
17994         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17995         check whether an implicit conversion to the current enum's UnderlyingType
17996         exists and report an error if not.
17997
17998         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17999         without debugging support.
18000
18001         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
18002         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
18003
18004 2002-09-12  Martin Baulig  <martin@gnome.org>
18005
18006         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
18007
18008         * ecore.cs (IMemberExpr.DeclaringType): New property.
18009         (SimpleName.SimpleNameResolve): Check whether we're accessing a
18010         nonstatic member of an outer type (CS0038).
18011
18012 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
18013
18014         * driver.cs: Activate the using-error detector at warning level
18015         4 (at least for MS-compatible APIs).
18016
18017         * namespace.cs (VerifyUsing): Small buglett fix.
18018
18019         * pending.cs (PendingImplementation): pass the container pointer. 
18020
18021         * interface.cs (GetMethods): Allow for recursive definition.  Long
18022         term, I would like to move every type to support recursive
18023         definitions, not the current ordering mechanism that we have right
18024         now.
18025
18026         The situation is this: Attributes are handled before interfaces,
18027         so we can apply attributes to interfaces.  But some attributes
18028         implement interfaces, we will now handle the simple cases
18029         (recursive definitions will just get an error).  
18030
18031         * parameter.cs: Only invalidate types at the end if we fail to
18032         lookup all types.  
18033
18034 2002-09-09  Martin Baulig  <martin@gnome.org>
18035
18036         * ecore.cs (PropertyExpr.Emit): Also check for
18037         TypeManager.system_int_array_get_length so this'll also work when
18038         compiling corlib.  Fixes #30003.
18039
18040 2002-09-09  Martin Baulig  <martin@gnome.org>
18041
18042         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
18043         and throw an exception if we can't get the type's size.  Fixed #30040,
18044         added test-165.cs.
18045
18046 2002-09-09  Martin Baulig  <martin@gnome.org>
18047
18048         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
18049
18050         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
18051         context.  Fixes bug #30027.
18052
18053         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
18054         virtual functions.  Fixes bug #30043, added test-164.cs.
18055
18056 2002-09-08  Ravi Pratap  <ravi@ximian.com>
18057
18058         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
18059
18060 2002-09-08  Nick Drochak  <ndrochak@gol.com>
18061
18062         * driver.cs: Use an object to get the windows codepage since it's not a
18063         static property.
18064
18065 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
18066
18067         * statement.cs (For.Emit): for infinite loops (test == null)
18068         return whether there is a break inside, not always "true".
18069
18070         * namespace.cs (UsingEntry): New struct to hold the name of the
18071         using definition, the location where it is defined, and whether it
18072         has been used in a successful type lookup.
18073
18074         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
18075         strings.
18076
18077         * decl.cs: ditto.
18078
18079 2002-09-06  Ravi Pratap  <ravi@ximian.com>
18080
18081         * attribute.cs : Fix incorrect code which relied on catching
18082         a NullReferenceException to detect a null being passed in
18083         where an object was expected.
18084
18085 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
18086
18087         * statement.cs (Try): flag the catch variable as assigned
18088
18089         * expression.cs (Cast): Simplified by using ResolveType instead of
18090         manually resolving.
18091
18092         * statement.cs (Catch): Fix bug by using ResolveType.
18093
18094 2002-09-06  Ravi Pratap  <ravi@ximian.com>
18095
18096         * expression.cs (BetterConversion): Special case for when we have
18097         a NullLiteral as the argument and we have to choose between string
18098         and object types - we choose string the way csc does.
18099
18100         * attribute.cs (Attribute.Resolve): Catch the
18101         NullReferenceException and report error #182 since the Mono
18102         runtime no more has the bug and having this exception raised means
18103         we tried to select a constructor which takes an object and is
18104         passed a null.
18105
18106 2002-09-05  Ravi Pratap  <ravi@ximian.com>
18107
18108         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
18109         message (1502, 1503) when we can't locate a method after overload
18110         resolution. This is much more informative and closes the bug
18111         Miguel reported.
18112
18113         * interface.cs (PopulateMethod): Return if there are no argument
18114         types. Fixes a NullReferenceException bug.
18115
18116         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
18117         expressions too. Previously we were checking only in one place for
18118         positional arguments leaving out named arguments.
18119
18120         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
18121         type to the enum type is not allowed. Remove code corresponding to
18122         that.
18123
18124         (ConvertNumericExplicit): Allow explicit conversions from
18125         the underlying type to enum type. This precisely follows the spec
18126         and closes a bug filed by Gonzalo.
18127
18128 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18129
18130         * compiler.csproj:
18131         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
18132
18133 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
18134
18135         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
18136         it was important that we stored the right value after the
18137         reduction in `converted'.
18138
18139 2002-09-04  Martin Baulig  <martin@gnome.org>
18140
18141         * location.cs (Location.SymbolDocument): Use full pathnames for the
18142         source files.
18143
18144 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
18145
18146         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
18147         of the expression resolve mechanism, because that will catch the
18148         SimpleName error failures.
18149
18150         (Conditional): If we can not resolve the
18151         expression, return, do not crash.
18152
18153 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18154
18155         * cs-tokenizer.cs:
18156         (location): display token name instead of its number.
18157
18158 2002-08-28  Martin Baulig  <martin@gnome.org>
18159
18160         * expression.cs (Binary.ResolveOperator): Don't silently return
18161         but return an error if an operator cannot be applied between two
18162         enum types.
18163
18164 2002-08-28  Martin Baulig  <martin@gnome.org>
18165
18166         * class.cs (Constructor.Define): Set the permission attributes
18167         correctly instead of making all constructors public.
18168
18169 2002-08-28  Martin Baulig  <martin@gnome.org>
18170
18171         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
18172         for private members before reporting a CS0103; if we find anything,
18173         it's a CS0122.
18174
18175 2002-08-28  Martin Baulig  <martin@gnome.org>
18176
18177         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
18178         to check whether `closure_start_type == closure_invocation_type',
18179         we also need to check whether `m.DeclaringType == closure_invocation_type'
18180         before bypassing the permission checks.  We might be accessing
18181         protected/private members from the base class.
18182         (TypeManager.RealMemberLookup): Only set private_ok if private
18183         members were requested via BindingFlags.NonPublic.
18184
18185         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
18186
18187         * expression.cs (MemberAccess.ResolveMemberAccess): Set
18188         MethodGroupExpr.IsExplicitImpl if appropriate.
18189         (Invocation.DoResolve): Don't report the CS0120 for explicit
18190         interface implementations.
18191
18192 2002-08-27  Martin Baulig  <martin@gnome.org>
18193
18194         * expression.cs (Invocation.DoResolve): If this is a static
18195         method and we don't have an InstanceExpression, we must report
18196         a CS0120.
18197
18198 2002-08-25  Martin Baulig  <martin@gnome.org>
18199
18200         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
18201         `==' between a valuetype and an object.
18202
18203 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
18204
18205         * ecore.cs (TypeExpr): Provide a ToString method.
18206
18207 2002-08-24  Martin Baulig  <martin@gnome.org>
18208
18209         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
18210         now called proggie.dbg and it's a binary file.
18211
18212 2002-08-23  Martin Baulig  <martin@gnome.org>
18213
18214         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
18215
18216 2002-08-23  Martin Baulig  <martin@gnome.org>
18217
18218         * struct.cs (MyStructInfo.ctor): Make this work with empty
18219         structs; it's not allowed to use foreach() on null.
18220
18221 2002-08-23  Martin Baulig  <martin@gnome.org>
18222
18223         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
18224         writer the full pathname of the generated assembly.
18225
18226 2002-08-23  Martin Baulig  <martin@gnome.org>
18227
18228         * statements.cs (FlowBranching.UsageVector.MergeChildren):
18229         A `finally' block never returns or breaks; improved handling of
18230         unreachable code.
18231
18232 2002-08-23  Martin Baulig  <martin@gnome.org>
18233
18234         * statement.cs (Throw.Resolve): Allow `throw null'.
18235
18236 2002-08-23  Martin Baulig  <martin@gnome.org>
18237
18238         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
18239         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
18240         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
18241         MemberLookup would return a wrong event if this is an explicit
18242         interface implementation and the class has an event with the same
18243         name.
18244
18245 2002-08-23  Martin Baulig  <martin@gnome.org>
18246
18247         * statement.cs (Block.AddChildVariableNames): New public method.
18248         (Block.AddChildVariableName): Likewise.
18249         (Block.IsVariableNameUsedInChildBlock): Likewise.
18250         (Block.AddVariable): Check whether a variable name has already
18251         been used in a child block.
18252
18253         * cs-parser.jay (declare_local_variables): Mark all variable names
18254         from the current block as being used in a child block in the
18255         implicit block.
18256
18257 2002-08-23  Martin Baulig  <martin@gnome.org>
18258
18259         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
18260         find the symbol writer.
18261
18262         * driver.cs: csc also allows the arguments to /define being
18263         separated by commas, not only by semicolons.
18264
18265 2002-08-23  Martin Baulig  <martin@gnome.org>
18266
18267         * interface.cs (Interface.GetMembers): Added static check for events.
18268
18269 2002-08-15  Martin Baulig  <martin@gnome.org>
18270
18271         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
18272         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
18273
18274         * ecore.cs (Expression.MemberLookup): Added documentation and explained
18275         why the MethodData.EmitDestructor() change was necessary.
18276
18277 2002-08-20  Martin Baulig  <martin@gnome.org>
18278
18279         * class.cs (TypeContainer.FindMembers): Added static check for events.
18280
18281         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
18282
18283         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
18284         use Type.GetEvents(), not Type.FindMembers().
18285
18286 2002-08-20  Martin Baulig  <martin@gnome.org>
18287
18288         * decl.cs (MemberCache): Added a special method cache which will
18289         be used for method-only searched.  This ensures that a method
18290         search will return a MethodInfo with the correct ReflectedType for
18291         inherited methods.      
18292
18293 2002-08-20  Martin Baulig  <martin@gnome.org>
18294
18295         * decl.cs (DeclSpace.FindMembers): Made this public.
18296
18297 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18298
18299         * delegate.cs: fixed build on windows.
18300         [FIXME:  Filed as bug #29150: MCS must report these errors.]
18301
18302 2002-08-19  Ravi Pratap  <ravi@ximian.com>
18303
18304         * ecore.cs (StandardConversionExists): Return a false
18305         if we are trying to convert the void type to anything else
18306         since that is not allowed.
18307
18308         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
18309         we flag error 70 in the event an event is trying to be accessed
18310         directly from outside the declaring type.
18311
18312 2002-08-20  Martin Baulig  <martin@gnome.org>
18313
18314         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
18315         MemberCache from typemanager.cs to decl.cs.
18316
18317 2002-08-19  Martin Baulig  <martin@gnome.org>
18318
18319         * class.cs (TypeContainer): Implement IMemberContainer.
18320         (TypeContainer.DefineMembers): Create the MemberCache.
18321         (TypeContainer.FindMembers): Do better BindingFlags checking; only
18322         return public members if BindingFlags.Public was given, check
18323         whether members are static.
18324
18325 2002-08-16  Martin Baulig  <martin@gnome.org>
18326
18327         * decl.cs (DeclSpace.Define): Splitted this in Define and
18328         DefineMembers.  DefineMembers is called first and initializes the
18329         MemberCache.
18330
18331         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
18332         DefineMembers() on all our DeclSpaces.
18333
18334         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
18335         but call DefineMembers() on all nested interfaces.  We call their
18336         Define() in our new Define() function.
18337
18338         * interface.cs (Interface): Implement IMemberContainer.
18339         (Interface.Define): Moved all code except the attribute stuf to
18340         DefineMembers().
18341         (Interface.DefineMembers): Initialize the member cache.
18342
18343         * typemanager.cs (IMemberFinder): Removed this interface, we don't
18344         need this anymore since we can use MemberCache.FindMembers directly.
18345
18346 2002-08-19  Martin Baulig  <martin@gnome.org>
18347
18348         * typemanager.cs (MemberCache): When creating the cache for an
18349         interface type, add all inherited members.
18350         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
18351         to `out bool used_cache' and documented it.
18352         (TypeManager.MemberLookup): If we already used the cache in the first
18353         iteration, we don't need to do the interfaces check.
18354
18355 2002-08-19  Martin Baulig  <martin@gnome.org>
18356
18357         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
18358         here from IMemberFinder and don't implement this interface anymore.
18359         (DeclSpace.MemberCache): Moved here from IMemberFinder.
18360
18361         * typemanager.cs (IMemberFinder): This interface is now only used by
18362         classes which actually support the member cache.
18363         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
18364         since we only put DeclSpaces into this Hashtable.
18365         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
18366         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
18367
18368 2002-08-16  Martin Baulig  <martin@gnome.org>
18369
18370         * typemanager.cs (ICachingMemberFinder): Removed.
18371         (IMemberFinder.MemberCache): New property.
18372         (TypeManager.FindMembers): Merged this with RealFindMembers().
18373         This function will never be called from TypeManager.MemberLookup()
18374         so we can't use the cache here, just the IMemberFinder.
18375         (TypeManager.MemberLookup_FindMembers): Check whether the
18376         IMemberFinder has a MemberCache and call the cache's FindMembers
18377         function.
18378         (MemberCache): Rewrote larger parts of this yet another time and
18379         cleaned it up a bit.
18380
18381 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
18382
18383         * driver.cs (LoadArgs): Support quoting.
18384
18385         (Usage): Show the CSC-like command line arguments.
18386
18387         Improved a few error messages.
18388
18389 2002-08-15  Martin Baulig  <martin@gnome.org>
18390
18391         * typemanager.cs (IMemberContainer.Type): New property.
18392         (IMemberContainer.IsInterface): New property.
18393
18394         The following changes are conditional to BROKEN_RUNTIME, which is
18395         defined at the top of the file.
18396
18397         * typemanager.cs (MemberCache.MemberCache): Don't add the base
18398         class'es members, but add all members from TypeHandle.ObjectType
18399         if we're an interface.
18400         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
18401         is the current type.
18402         (MemberCache.CacheEntry.Container): Removed this field.
18403         (TypeHandle.GetMembers): Include inherited members.
18404
18405 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18406
18407         * typemanager.cs: fixed compilation and added a comment on a field that
18408         is never used.
18409
18410 2002-08-15  Martin Baulig  <martin@gnome.org>
18411
18412         * class.cs (ConstructorInitializer.Resolve): In the
18413         Expression.MemberLookup call, use the queried_type as
18414         invocation_type.
18415
18416         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
18417         declared' attribute, it's always true.
18418         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
18419         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
18420         temporary wrapper for FindMembers which tells MemberLookup whether
18421         members from the base classes are included in the return value.
18422         This will go away soon.
18423         (TypeManager.MemberLookup): Use this temporary hack here; once the
18424         new MemberCache is completed, we don't need to do the DeclaredOnly
18425         looping here anymore since the MemberCache will take care of this.
18426         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
18427         (MemberCache): When creating the MemberCache for a class, get
18428         members from the current class and all its base classes.
18429         (MemberCache.CacheEntry.Container): New field.  This is a
18430         temporary hack until the Mono runtime is fixed to distinguish
18431         between ReflectedType and DeclaringType.  It allows us to use MCS
18432         with both the MS runtime and the unfixed Mono runtime without
18433         problems and without accecting performance.
18434         (MemberCache.SearchMembers): The DeclaredOnly looping from
18435         TypeManager.MemberLookup is now done here.      
18436
18437 2002-08-14  Martin Baulig  <martin@gnome.org>
18438
18439         * statement.cs (MyStructInfo.MyStructInfo): Don't call
18440         Type.GetFields on dynamic types but get the fields from the
18441         corresponding TypeContainer.
18442         (MyStructInfo.GetStructInfo): Added check for enum types.
18443
18444         * typemanager.cs (MemberList.IsSynchronized): Implemented.
18445         (MemberList.SyncRoot): Implemented.
18446         (TypeManager.FilterWithClosure): No need to check permissions if
18447         closure_start_type == closure_invocation_type, don't crash if
18448         closure_invocation_type is null.
18449
18450 2002-08-13  Martin Baulig  <martin@gnome.org>
18451
18452         Rewrote TypeContainer.FindMembers to use a member cache.  This
18453         gives us a speed increase of about 35% for the self-hosting MCS
18454         build and of about 15-20% for the class libs (both on GNU/Linux).
18455
18456         * report.cs (Timer): New class to get enhanced profiling.  This
18457         whole class is "TIMER" conditional since it remarkably slows down
18458         compilation speed.
18459
18460         * class.cs (MemberList): New class.  This is an IList wrapper
18461         which we're now using instead of passing MemberInfo[]'s around to
18462         avoid copying this array unnecessarily.
18463         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
18464         (ICachingMemberFinder, IMemberContainer): New interface.
18465         (TypeManager.FilterWithClosure): If `criteria' is null, the name
18466         has already been checked, otherwise use it for the name comparision.
18467         (TypeManager.FindMembers): Renamed to RealMemberFinder and
18468         provided wrapper which tries to use ICachingMemberFinder.FindMembers
18469         if possible.  Returns a MemberList, not a MemberInfo [].
18470         (TypeHandle): New class, implements IMemberContainer.  We create
18471         one instance of this class per type, it contains a MemberCache
18472         which is used to do the member lookups.
18473         (MemberCache): New class.  Each instance of this class contains
18474         all members of a type and a name-based hash table.
18475         (MemberCache.FindMembers): This is our new member lookup
18476         function.  First, it looks up all members of the requested name in
18477         the hash table.  Then, it walks this list and sorts out all
18478         applicable members and returns them.
18479
18480 2002-08-13  Martin Baulig  <martin@gnome.org>
18481
18482         In addition to a nice code cleanup, this gives us a performance
18483         increase of about 1.4% on GNU/Linux - not much, but it's already
18484         half a second for the self-hosting MCS compilation.
18485
18486         * typemanager.cs (IMemberFinder): New interface.  It is used by
18487         TypeManager.FindMembers to call FindMembers on a TypeContainer,
18488         Enum, Delegate or Interface.
18489         (TypeManager.finder_to_member_finder): New PtrHashtable.
18490         (TypeManager.finder_to_container): Removed.
18491         (TypeManager.finder_to_delegate): Removed.
18492         (TypeManager.finder_to_interface): Removed.
18493         (TypeManager.finder_to_enum): Removed.
18494
18495         * interface.cs (Interface): Implement IMemberFinder.
18496
18497         * delegate.cs (Delegate): Implement IMemberFinder.
18498
18499         * enum.cs (Enum): Implement IMemberFinder.
18500
18501         * class.cs (TypeContainer): Implement IMemberFinder.
18502
18503 2002-08-12  Martin Baulig  <martin@gnome.org>
18504
18505         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
18506
18507 2002-08-12  Martin Baulig  <martin@gnome.org>
18508
18509         * ecore.cs (ITypeExpression): New interface for expressions which
18510         resolve to a type.
18511         (TypeExpression): Renamed to TypeLookupExpression.
18512         (Expression.DoResolve): If we're doing a types-only lookup, the
18513         expression must implement the ITypeExpression interface and we
18514         call DoResolveType() on it.
18515         (SimpleName): Implement the new ITypeExpression interface.
18516         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
18517         hack, the situation that we're only looking up types can't happen
18518         anymore when this method is called.  Moved the type lookup code to
18519         DoResolveType() and call it.
18520         (SimpleName.DoResolveType): This ITypeExpression interface method
18521         is now doing the types-only lookup.
18522         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
18523         (ResolveFlags): Added MaskExprClass.
18524
18525         * expression.cs (MemberAccess): Implement the ITypeExpression
18526         interface.
18527         (MemberAccess.DoResolve): Added support for a types-only lookup
18528         when we're called via ITypeExpression.DoResolveType().
18529         (ComposedCast): Implement the ITypeExpression interface.
18530
18531         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
18532         Expression.Resolve() with ResolveFlags.Type instead.
18533
18534 2002-08-12  Martin Baulig  <martin@gnome.org>
18535
18536         * interface.cs (Interface.Define): Apply attributes.
18537
18538         * attribute.cs (Attribute.ApplyAttributes): Added support for
18539         interface attributes.
18540
18541 2002-08-11  Martin Baulig  <martin@gnome.org>
18542
18543         * statement.cs (Block.Emit): Only check the "this" variable if we
18544         do not always throw an exception.
18545
18546         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
18547         whether the property has a set accessor.
18548
18549 2002-08-11  Martin Baulig  <martin@gnome.org>
18550
18551         Added control flow analysis support for structs.
18552
18553         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
18554         with control flow analysis turned off.
18555         (IVariable): New interface.
18556         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
18557         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
18558         (FieldExpr.DoResolve): Resolve the instance expression with flow
18559         analysis turned off and do the definite assignment check after the
18560         resolving when we know what the expression will resolve to.
18561
18562         * expression.cs (LocalVariableReference, ParameterReference):
18563         Implement the new IVariable interface, only call the flow analysis
18564         code if ec.DoFlowAnalysis is true.
18565         (This): Added constructor which takes a Block argument.  Implement
18566         the new IVariable interface.
18567         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
18568         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
18569         This does the definite assignment checks for struct members.
18570
18571         * class.cs (Constructor.Emit): If this is a non-static `struct'
18572         constructor which doesn't have any initializer, call
18573         Block.AddThisVariable() to tell the flow analysis code that all
18574         struct elements must be initialized before control returns from
18575         the constructor.
18576
18577         * statement.cs (MyStructInfo): New public class.
18578         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
18579         argument to this indexer.  If non-zero, check an individual struct
18580         member, not the whole struct.
18581         (FlowBranching.CheckOutParameters): Check struct members.
18582         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
18583         overloaded versions of these methods which take an additional
18584         `int field_idx' argument to check struct members.
18585         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
18586         overloaded versions of these methods which take an additional
18587         `string field_name' argument to check struct member.s
18588         (VariableInfo): Implement the IVariable interface.
18589         (VariableInfo.StructInfo): New public property.  Returns the
18590         MyStructInfo instance of the variable if it's a struct or null.
18591         (Block.AddThisVariable): New public method.  This is called from
18592         Constructor.Emit() for non-static `struct' constructor which do
18593         not have any initializer.  It creates a special variable for the
18594         "this" instance variable which will be checked by the flow
18595         analysis code to ensure that all of the struct's fields are
18596         initialized before control returns from the constructor.
18597         (UsageVector): Added support for struct members.  If a
18598         variable/parameter is a struct with N members, we reserve a slot
18599         in the usage vector for each member.  A struct is considered fully
18600         initialized if either the struct itself (slot 0) or all its
18601         members are initialized.
18602
18603 2002-08-08  Martin Baulig  <martin@gnome.org>
18604
18605         * driver.cs (Driver.MainDriver): Only report an error CS5001
18606         if there were no compilation errors.
18607
18608         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
18609         `UnsafeContext' property to determine whether the parent is in
18610         unsafe context rather than checking the parent's ModFlags:
18611         classes nested in an unsafe class are unsafe as well.
18612
18613 2002-08-08  Martin Baulig  <martin@gnome.org>
18614
18615         * statement.cs (UsageVector.MergeChildren): Distinguish between
18616         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
18617         we return.  Added test17() and test18() to test-154.cs.
18618
18619 2002-08-08  Martin Baulig  <martin@gnome.org>
18620
18621         * typemanager.cs (TypeManager.FilterWithClosure): If we have
18622         Family access, make sure the invoking type isn't a subclass of the
18623         queried type (that'd be a CS1540).
18624
18625         * ecore.cs (Expression.MemberLookup): Added overloaded version of
18626         this method which takes an additional `Type invocation_type'.
18627
18628         * expression.cs (BaseAccess.DoResolve): Use the base type as
18629         invocation and query type.
18630         (MemberAccess.DoResolve): If the lookup failed and we're about to
18631         report a CS0122, try a lookup with the ec.ContainerType - if this
18632         succeeds, we must report a CS1540.
18633
18634 2002-08-08  Martin Baulig  <martin@gnome.org>
18635
18636         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
18637         (MethodGroupExpr): Implement the IMemberExpr interface.
18638
18639         * expression (MemberAccess.ResolveMemberAccess): No need to have
18640         any special code for MethodGroupExprs anymore, they're now
18641         IMemberExprs.   
18642
18643 2002-08-08  Martin Baulig  <martin@gnome.org>
18644
18645         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
18646         Family, FamANDAssem and FamORAssem permissions.
18647         (TypeManager.IsSubclassOrNestedChildOf): New public method.
18648
18649 2002-08-08  Martin Baulig  <martin@gnome.org>
18650
18651         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
18652         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
18653         or loop block.
18654
18655 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
18656
18657         * driver.cs: implemented /resource option to embed managed resources.
18658
18659 2002-08-07  Martin Baulig  <martin@gnome.org>
18660
18661         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
18662         (FieldBase.HasFieldInitializer): New public property.
18663         (FieldBase.GetInitializerExpression): New public method.  Resolves and
18664         returns the field initializer and makes sure it is only resolved once.
18665         (TypeContainer.EmitFieldInitializers): Call
18666         FieldBase.GetInitializerExpression to get the initializer, this ensures
18667         that it isn't resolved multiple times.
18668
18669         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
18670         the resolving process (SimpleName/MemberLookup) that we're currently
18671         emitting a field initializer (which must not access any instance members,
18672         this is an error CS0236).
18673
18674         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
18675         argument, if the `IsFieldInitializer' flag is set, we must report and
18676         error CS0236 and not an error CS0120.   
18677
18678 2002-08-07  Martin Baulig  <martin@gnome.org>
18679
18680         * ecore.cs (IMemberExpr): New public interface.
18681         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
18682         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
18683         if the expression is an IMemberExpr.
18684
18685         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
18686         to be null, implicitly default to `this' if we're non-static in
18687         this case.  Simplified the code a lot by using the new IMemberExpr
18688         interface.  Also fixed bug #28176 here.
18689
18690 2002-08-06  Martin Baulig  <martin@gnome.org>
18691
18692         * cs-parser.jay (SimpleLookup): Removed.  We need to create
18693         ParameterReferences during semantic analysis so that we can do a
18694         type-only search when resolving Cast, TypeOf and SizeOf.
18695         (block): Pass the `current_local_parameters' to the Block's
18696         constructor.
18697
18698         * class.cs (ConstructorInitializer): Added `Parameters parameters'
18699         argument to the constructor.
18700         (ConstructorInitializer.Resolve): Create a temporary implicit
18701         block with the parameters.
18702
18703         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
18704         references here if we aren't doing a type-only search.
18705
18706         * statement.cs (Block): Added constructor which takes a
18707         `Parameters parameters' argument.
18708         (Block.Parameters): New public property.
18709
18710         * support.cs (InternalParameters.Parameters): Renamed `parameters'
18711         to `Parameters' and made it public readonly.
18712
18713 2002-08-06  Martin Baulig  <martin@gnome.org>
18714
18715         * ecore.cs (Expression.Warning): Made this public as well.
18716
18717         * report.cs (Report.Debug): Print the contents of collections.
18718
18719 2002-08-06  Martin Baulig  <martin@gnome.org>
18720
18721         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
18722         used to tell Resolve() which kinds of expressions it may return.
18723         (Expression.Resolve): Added overloaded version of this method which
18724         takes a `ResolveFlags flags' argument.  This can be used to tell
18725         Resolve() which kinds of expressions it may return.  Reports a
18726         CS0118 on error.
18727         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18728         ResolveFlags.SimpleName.
18729         (Expression.Error118): Added overloaded version of this method which
18730         takes a `ResolveFlags flags' argument.  It uses the flags to determine
18731         which kinds of expressions are allowed.
18732
18733         * expression.cs (Argument.ResolveMethodGroup): New public method.
18734         Resolves an argument, but allows a MethodGroup to be returned.
18735         This is used when invoking a delegate.
18736
18737         * TODO: Updated a bit.
18738
18739 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18740
18741         Fixed compilation with csc.
18742
18743         * ecore.cs: Expression.Error made public. Is this correct? Should
18744         Warning be made public too?
18745
18746         * expression.cs: use ea.Location instead of ea.loc.
18747         [FIXME:  Filed as bug #28607: MCS must report these errors.]
18748
18749 2002-08-06  Martin Baulig  <martin@gnome.org>
18750
18751         * ecore.cs (Expression.loc): Moved the location here instead of
18752         duplicating it in all derived classes.
18753         (Expression.Location): New public property.
18754         (Expression.Error, Expression.Warning): Made them non-static and
18755         removed the location argument.
18756         (Expression.Warning): Added overloaded version which takes an
18757         `int level' argument.
18758         (Expression.Error118): Make this non-static and removed the
18759         expression and location arguments.
18760         (TypeExpr): Added location argument to the constructor.
18761
18762         * expression.cs (StaticCallExpr): Added location argument to
18763         the constructor.
18764         (Indirection, PointerArithmetic): Likewise.
18765         (CheckedExpr, UnCheckedExpr): Likewise.
18766         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18767         (StringPtr): Likewise.
18768
18769
18770 2002-08-05  Martin Baulig  <martin@gnome.org>
18771
18772         * expression.cs (BaseAccess.DoResolve): Actually report errors.
18773
18774         * assign.cs (Assign.DoResolve): Check whether the source
18775         expression is a value or variable.
18776
18777         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18778         while resolving the corresponding blocks.
18779
18780         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18781         an error, don't silently return null.
18782
18783         * statement.cs (Block.AddVariable): Do the error reporting here
18784         and distinguish between CS0128 and CS0136.
18785         (Block.DoResolve): Report all unused labels (warning CS0164).
18786         (LabeledStatement): Pass the location to the constructor.
18787         (LabeledStatement.HasBeenReferenced): New property.
18788         (LabeledStatement.Resolve): Set it to true here.
18789
18790         * statement.cs (Return.Emit): Return success even after reporting
18791         a type mismatch error (CS0126 or CS0127), this is what csc does and
18792         it avoids confusing the users with any consecutive errors.
18793
18794 2002-08-05  Martin Baulig  <martin@gnome.org>
18795
18796         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18797
18798         * const.cs (Const.LookupConstantValue): Catch circular definitions.
18799
18800         * expression.cs (MemberAccess.DoResolve): Silently return if an
18801         error has already been reported.
18802
18803         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18804         error has already been reported.
18805
18806 2002-08-05  Martin Baulig  <martin@gnome.org>
18807
18808         * statement.cs (UsageVector): Only initialize the `parameters'
18809         vector if we actually have any "out" parameters.
18810
18811 2002-08-05  Martin Baulig  <martin@gnome.org>
18812
18813         * expression.cs (Binary.ResolveOperator): When combining delegates,
18814         they must have the same type.
18815
18816 2002-08-05  Martin Baulig  <martin@gnome.org>
18817
18818         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18819         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18820         work with the ms runtime and we also don't need it: if we're a
18821         PropertyBuilder and not in the `indexer_arguments' hash, then we
18822         are a property and not an indexer.
18823
18824         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18825         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18826         since the latter one doesn't work with the ms runtime.
18827
18828 2002-08-03  Martin Baulig  <martin@gnome.org>
18829
18830         Fixed bugs #27998 and #22735.
18831
18832         * class.cs (Method.IsOperator): New public field.
18833         (Method.CheckBase): Report CS0111 if there's already a method
18834         with the same parameters in the current class.  Report CS0508 when
18835         attempting to change the return type of an inherited method.
18836         (MethodData.Emit): Report CS0179 if a method doesn't have a body
18837         and it's not marked abstract or extern.
18838         (PropertyBase): New abstract base class for Property and Indexer.
18839         (PropertyBase.CheckBase): Moved here from Property and made it work
18840         for indexers.
18841         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18842         the same so we can reuse it there.
18843         (Property, Indexer): Derive from PropertyBase.
18844         (MethodSignature.inheritable_property_signature_filter): New delegate
18845         to find properties and indexers.
18846
18847         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18848         argument and improved error reporting.
18849
18850         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18851         EmptyReadOnlyParameters and made it a property.
18852
18853         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18854         version of this method which takes a `PropertyInfo indexer'.
18855         (TypeManager.RegisterIndexer): New method.
18856
18857         * class.cs: Added myself as author of this file :-)
18858
18859 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18860
18861         * class.cs: fixed compilation on windoze.
18862
18863 2002-08-03  Martin Baulig  <martin@gnome.org>
18864
18865         * interface.cs (Interface.GetInterfaceBases): Check whether all
18866         base interfaces are at least as accessible than the current one.
18867
18868         * class.cs (TypeContainer.GetClassBases): Check whether base types
18869         are at least as accessible than the current type.
18870         (TypeContainer.AsAccessible): Implemented and made non-static.
18871         (MemberBase.CheckParameters): Report errors if the accessibility
18872         checks fail.
18873
18874         * delegate.cs (Delegate.Delegate): The default visibility is
18875         internal for top-level types and private for nested types.
18876         (Delegate.Define): Report errors if the accessibility checks fail.
18877
18878         * enum.cs (Enum.Enum): The default visibility is internal for
18879         top-level types and private for nested types.
18880         (Enum.DefineType): Compute the correct visibility.
18881
18882         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18883         function which takes a `bool is_toplevel' instead of a TypeContainer.
18884
18885         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18886         builtin type.
18887
18888 2002-08-02  Martin Baulig  <martin@gnome.org>
18889
18890         * expression.cs (LocalVariableReferenc): Added constructor which
18891         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18892         (LocalVariableReference.IsReadOnly): New property.
18893         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18894         variable is readonly, use our own readonly flag to do this; you can
18895         use the new constructor to get a writable reference to a read-only
18896         variable.
18897
18898         * cs-parser.jay (foreach_statement, using_statement): Get a writable
18899         reference to the local variable.
18900
18901 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
18902
18903         * rootcontext.cs (ResolveCore): Also include System.Exception
18904
18905         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18906         we reach an EmptyStatement.
18907
18908         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18909         is also fine.
18910
18911         * expression.cs (Binary.ResolveOperator): Check error result in
18912         two places.
18913
18914         use brtrue/brfalse directly and avoid compares to null.
18915
18916 2002-08-02  Martin Baulig  <martin@gnome.org>
18917
18918         * class.cs (TypeContainer.Define): Define all nested interfaces here.
18919         Fixes bug #28407, added test-155.cs.
18920
18921 2002-08-01  Martin Baulig  <martin@gnome.org>
18922
18923         * class.cs (Event.EmitDefaultMethod): Make this work with static
18924         events.  Fixes #28311, added verify-3.cs.
18925
18926 2002-08-01  Martin Baulig  <martin@gnome.org>
18927
18928         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18929         `is_disposable' fields.
18930         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18931         `hm.is_disposable' if we're using the collection pattern.
18932         (Foreach.EmitCollectionForeach): Use the correct type for the
18933         enumerator's local variable, only emit the try/finally block if
18934         necessary (fixes #27713).
18935
18936 2002-08-01  Martin Baulig  <martin@gnome.org>
18937
18938         * ecore.cs (Expression.report118): Renamed to Error118 and made
18939         it public static.
18940
18941         * statement.cs (Throw.Resolve): Check whether the expression is of
18942         the correct type (CS0118) and whether the type derives from
18943         System.Exception (CS0155).
18944         (Catch.Resolve): New method.  Do the type lookup here and check
18945         whether it derives from System.Exception (CS0155).
18946         (Catch.CatchType, Catch.IsGeneral): New public properties.
18947
18948         * typemanager.cs (TypeManager.exception_type): Added.
18949
18950 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
18951
18952         * driver.cs: Updated About function.
18953
18954 2002-07-31  Martin Baulig  <martin@gnome.org>
18955
18956         Implemented Control Flow Analysis.
18957
18958         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18959         (EmitContext.CurrentBranching): Added.
18960         (EmitContext.StartFlowBranching): Added.
18961         (EmitContext.EndFlowBranching): Added.
18962         (EmitContext.KillFlowBranching): Added.
18963         (EmitContext.IsVariableAssigned): Added.
18964         (EmitContext.SetVariableAssigned): Added.
18965         (EmitContext.IsParameterAssigned): Added.
18966         (EmitContext.SetParameterAssigned): Added.
18967         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18968         Added control flow analysis stuff here.
18969
18970         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18971         resolve the expression as lvalue.
18972         (LocalVariableReference.DoResolve): Check whether the variable has
18973         already been assigned.
18974         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18975         the parameter as assigned here.
18976         (ParameterReference.DoResolve): Check whether the parameter has already
18977         been assigned.
18978         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18979         expression as lvalue.
18980
18981         * statement.cs (FlowBranching): New class for the flow analysis code.
18982         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18983         (LabeledStatement.IsDefined): New public property.
18984         (LabeledStatement.AddUsageVector): New public method to tell flow
18985         analyis that the label may be reached via a forward jump.
18986         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18987         flow analysis.
18988         (VariableInfo.Number): New public field.  This is used by flow analysis
18989         to number all locals of a block.
18990         (Block.CountVariables): New public property.  This is the number of
18991         local variables in this block (including the locals from all parent
18992         blocks).
18993         (Block.EmitMeta): Number all the variables.
18994
18995         * statement.cs: Added flow analysis support to all classes.
18996
18997 2002-07-31  Martin Baulig  <martin@gnome.org>
18998
18999         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
19000         To get debugging messages, compile mcs with /define:MCS_DEBUG and
19001         then use this argument.
19002
19003         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
19004
19005         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
19006         use this to specify /define options.
19007
19008 2002-07-29  Martin Baulig  <martin@gnome.org>
19009
19010         * statement.cs (Fixed): Moved all code that does variable lookups
19011         and resolvings from Emit to Resolve.
19012
19013         * statement.cs (For): Moved all code that does variable lookups
19014         and resolvings from Emit to Resolve.
19015
19016         * statement.cs (Using): Moved all code that does variable lookups
19017         and resolvings from Emit to Resolve.
19018
19019 2002-07-29  Martin Baulig  <martin@gnome.org>
19020
19021         * attribute.cs (Attribute.Resolve): Explicitly catch a
19022         System.NullReferenceException when creating the
19023         CustromAttributeBuilder and report a different warning message.
19024
19025 2002-07-29  Martin Baulig  <martin@gnome.org>
19026
19027         * support.cs (ParameterData.ParameterName): Added method to
19028         get the name of a parameter.
19029
19030         * typemanager.cs (TypeManager.IsValueType): New public method.
19031
19032 2002-07-29  Martin Baulig  <martin@gnome.org>
19033
19034         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
19035         is a flag which specifies that it's either ref or out.
19036         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
19037         the out parameter to `out Parameter.Modifier mod', also set the
19038         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
19039
19040         * support.cs (InternalParameters.ParameterModifier): Distinguish
19041         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
19042         Parameter.Modifier.ISBYREF flag if it's either ref or out.
19043
19044         * expression.cs (Argument.GetParameterModifier): Distinguish
19045         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
19046         Parameter.Modifier.ISBYREF flag if it's either ref or out.
19047
19048 2002-07-29  Martin Baulig  <martin@gnome.org>
19049
19050         * expression.cs (ParameterReference.ParameterReference): Added
19051         `Location loc' argument to the constructor.
19052
19053         * cs-parser.jay: Pass location to ParameterReference.
19054
19055 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
19056
19057         * statement.cs (Try): Initialize the location.
19058
19059         * cs-parser.jay: pass location to Try.
19060
19061         * expression.cs (Unary.Reduce): Change the prototype to return
19062         whether a constant fold could be performed or not.  The result is
19063         returned in an out parameters.  In the case of Indirection and
19064         AddressOf, we want to perform the full tests.
19065
19066 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
19067
19068         * statement.cs (Statement.Emit): Flag dead code.
19069
19070 2002-07-27  Andrew Birkett  <andy@nobugs.org>
19071
19072         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
19073
19074 2002-07-27  Martin Baulig  <martin@gnome.org>
19075
19076         * class.cs (MethodData.Define): Put back call to
19077         TypeManager.AddMethod(), accidentally commented this out.
19078
19079         * report.cs (Debug): New public method to print debugging information,
19080         this is `[Conditional ("DEBUG")]'.
19081
19082 2002-07-26  Martin Baulig  <martin@gnome.org>
19083
19084         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
19085         (switch_statement): Push the current_block to the switch_stack and
19086         pop it again when we're done with the switch.
19087         (switch_section): The new block is a child of the current_block.
19088         Fixes bug #24007, added test-152.cs.
19089
19090 2002-07-27  Martin Baulig  <martin@gnome.org>
19091
19092         * expression.cs (Invocation.EmitArguments): When calling a varargs
19093         function with only its fixed arguments, we need to pass an empty
19094         array.
19095
19096 2002-07-27  Martin Baulig  <martin@gnome.org>
19097
19098         Mono 0.13 has been released.
19099
19100 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
19101
19102         * driver.cs: Rename --resource to --linkres, because that is what
19103         we do currently, we dont support --resource yet.
19104
19105         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
19106
19107 2002-07-25  Martin Baulig  <martin@gnome.org>
19108
19109         * class.cs (MethodData): New public class.  This is a `method builder'
19110         class for a method or one accessor of a Property/Indexer/Event.
19111         (MethodData.GetMethodFlags): Moved here from MemberBase.
19112         (MethodData.ApplyAttributes): Likewise.
19113         (MethodData.ApplyObsoleteAttribute): Likewise.
19114         (MethodData.ApplyConditionalAttribute): Likewise.
19115         (MethodData.ApplyDllImportAttribute): Likewise.
19116         (MethodData.CheckAbstractAndExternal): Likewise.
19117         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
19118         (MethodData.Emit): Formerly known as Method.Emit().
19119         (MemberBase): Moved everything which was specific to a single
19120         accessor/method to MethodData.
19121         (Method): Create a new MethodData and call Define() and Emit() on it.
19122         (Property, Indexer, Event): Create a new MethodData objects for each
19123         accessor and call Define() and Emit() on them.
19124
19125 2002-07-25  Martin Baulig  <martin@gnome.org>
19126
19127         Made MethodCore derive from MemberBase to reuse the code from there.
19128         MemberBase now also checks for attributes.
19129
19130         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
19131         (MemberBase.GetMethodFlags): Moved here from class Method and marked
19132         as virtual.
19133         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
19134         `CallingConventions cc' and `Attributes opt_attrs' arguments.
19135         (MemberBase.ApplyAttributes): New virtual method; applies the
19136         attributes to a method or accessor.
19137         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
19138         (MemberBase.ApplyConditionalAttribute): Likewise.
19139         (MemberBase.ApplyDllImportAttribute): Likewise.
19140         (MemberBase.CheckAbstractAndExternal): Likewise.
19141         (MethodCore.ParameterTypes): This is now a property instead of a
19142         method, it's initialized from DoDefineParameters().
19143         (MethodCore.ParameterInfo): Removed the set accessor.
19144         (MethodCore.DoDefineParameters): New protected virtual method to
19145         initialize ParameterTypes and ParameterInfo.
19146         (Method.GetReturnType): We can now simply return the MemberType.
19147         (Method.GetMethodFlags): Override the MemberBase version and add
19148         the conditional flags.
19149         (Method.CheckBase): Moved some code from Define() here, call
19150         DoDefineParameters() here.
19151         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
19152         here to avoid some larger code duplication.
19153         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
19154         ensure that abstract and external accessors don't declare a body.
19155
19156         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
19157         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
19158         lookup in the attribute's parent classes, so we need to abort as soon
19159         as we found the first match.
19160         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
19161         the attribute has no arguments.
19162
19163         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
19164         of a Method.
19165
19166 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19167
19168         * cs-parser.jay: reverted previous patch.
19169
19170 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19171
19172         * cs-parser.jay: fixed bug #22119.
19173
19174 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19175
19176         * attribute.cs: fixed compilation. The error was:
19177         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
19178         be assigned to before control leaves the current method."
19179         [FIXME:  Filed as bug #28186: MCS must report this error.]
19180
19181 2002-07-25  Martin Baulig  <martin@gnome.org>
19182
19183         * attribute.cs (Attribute.Conditional_GetConditionName): New static
19184         method to pull the condition name ouf of a Conditional attribute.
19185         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
19186         the obsolete message and error flag out of an Obsolete attribute.
19187
19188         * class.cs (Method.GetMethodFlags): New public method to get the
19189         TypeManager.MethodFlags for this method.
19190         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
19191         private methods.
19192         (Method.Define): Get and apply the Obsolete and Conditional attributes;
19193         if we're overriding a virtual function, set the new private variable
19194         `parent_method'; call the new TypeManager.AddMethod().
19195
19196         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
19197         the MethodBuilder and the Method in a PtrHashtable.
19198         (TypeManager.builder_to_method): Added for this purpose.
19199         (TypeManager.MethodFlags): Added IsObsoleteError.
19200         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
19201         Obsolete and Conditional arguments in MethodBuilders.  If we discover
19202         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
19203         the message from the attribute.
19204
19205 2002-07-24  Martin Baulig  <martin@gnome.org>
19206
19207         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
19208         preprocessor directives, ensure that the argument to #define/#undef is
19209         exactly one identifier and that it's actually an identifier.
19210
19211         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
19212         did not work ....
19213
19214 2002-07-24  Martin Baulig  <martin@gnome.org>
19215
19216         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
19217         initialize it to TypeManager.object_type in the constructor.
19218         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
19219         of the `hm.get_current' method if we're using the collection pattern.
19220         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
19221         for the explicit conversion to make it work when we're using the collection
19222         pattern and the `Current' property has a different return type than `object'.
19223         Fixes #27713.
19224
19225 2002-07-24  Martin Baulig  <martin@gnome.org>
19226
19227         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
19228         does not match, but don't report any errors.  This method is called in
19229         order for all methods in a MethodGroupExpr until a matching method is
19230         found, so we don't want to bail out if the first method doesn't match.
19231         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
19232         matches, report the 123.  Fixes #28070.
19233
19234 2002-07-24  Martin Baulig  <martin@gnome.org>
19235
19236         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
19237         TypeManager.TypeToCoreType() to the top of the method so the
19238         following equality checks will work.  Fixes #28107.
19239
19240 2002-07-24  Martin Baulig  <martin@gnome.org>
19241
19242         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
19243         operand is of type uint, and the other operand is of type sbyte,
19244         short or int, the operands are converted to type long." -
19245         Actually do what this comment already told us.  Fixes bug #28106,
19246         added test-150.cs.
19247
19248 2002-07-24  Martin Baulig  <martin@gnome.org>
19249
19250         * class.cs (MethodBase): New abstract class.  This is now a base
19251         class for Property, Indexer and Event to avoid some code duplication
19252         in their Define() and DefineMethods() methods.
19253         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
19254         generic methods for Define() and DefineMethods().
19255         (FieldBase): Derive from MemberBase, not MemberCore.
19256         (Property): Derive from MemberBase, not MemberCore.
19257         (Property.DefineMethod): Moved all the code from this method to the
19258         new MethodBase.DefineAccessor(), just call it with appropriate
19259         argumetnts.
19260         (Property.Define): Call the new Property.DoDefine(), this does some
19261         sanity checks and we don't need to duplicate the code everywhere.
19262         (Event): Derive from MemberBase, not MemberCore.
19263         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
19264         accessors, this will also make them work with interface events.
19265         (Indexer): Derive from MemberBase, not MemberCore.
19266         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
19267         (Indexer.Define): Use the new MethodBase functions.
19268
19269         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
19270         argument to the constructor.
19271         (Interface.FindMembers): Added support for interface events.
19272         (Interface.PopluateEvent): Implemented.
19273
19274         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
19275
19276 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
19277
19278         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
19279         but this is required to check for a method name being the same as
19280         the containing class.  
19281
19282         Handle this now.
19283
19284 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19285
19286         * interface.cs: initialize variable.
19287
19288 2002-07-23  Martin Baulig  <martin@gnome.org>
19289
19290         Implemented the IndexerName attribute in interfaces.
19291
19292         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
19293         name if this is an explicit interface implementation.
19294         (Indexer.InterfaceIndexerName): New public variable.  If we're
19295         implementing an interface indexer, this is the IndexerName in that
19296         interface.  Otherwise, it's the IndexerName.
19297         (Indexer.DefineMethod): If we're implementing interface indexer,
19298         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
19299         and Pending.ImplementIndexer methods.
19300         (Indexer.Define): Also define the PropertyBuilder if we're
19301         implementing an interface indexer and this is neither an explicit
19302         interface implementation nor do the IndexerName match the one in
19303         the interface.
19304
19305         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
19306         If a method is defined here, then we always need to create a proxy
19307         for it.  This is used when implementing interface indexers.
19308         (Pending.IsInterfaceIndexer): New public method.
19309         (Pending.ImplementIndexer): New public method.
19310         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
19311         This is used when implementing interface indexers to define a proxy
19312         if necessary.
19313         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
19314         define a proxy if necessary.
19315
19316         * interface.cs (Interface.IndexerName): New public variable.
19317         (Interface.PopulateIndexer): Set the IndexerName.
19318         (Interface.DefineIndexers): New private method.  Populate all the
19319         indexers and make sure their IndexerNames match.
19320
19321         * typemanager.cs (IndexerPropertyName): Added support for interface
19322         indexers.
19323
19324 2002-07-22  Martin Baulig  <martin@gnome.org>
19325
19326         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
19327         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
19328         ret if HasReturnLabel.
19329         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
19330         variables.
19331
19332         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
19333         and set the ec.LoopBeginTryCatchLevel.
19334         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
19335         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
19336         the current ec.TryCatchLevel, the branch goes out of an exception
19337         block.  In this case, we need to use Leave and not Br.
19338
19339 2002-07-22  Martin Baulig  <martin@gnome.org>
19340
19341         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
19342         block unless the block does not always return or it is contained in
19343         another try { ... } catch { ... } block.  Fixes bug #26506.
19344         Added verify-1.cs to the test suite.
19345
19346 2002-07-22  Martin Baulig  <martin@gnome.org>
19347
19348         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
19349         then we do not always return.  Fixes bug #24985.
19350
19351 2002-07-22  Martin Baulig  <martin@gnome.org>
19352
19353         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
19354         lookup on a per-class level; ie. walk up the class hierarchy until we
19355         found at least one applicable method, then choose the best among them.
19356         Fixes bug #24463 and test-29.cs.
19357
19358 2002-07-22  Martin Baulig  <martin@gnome.org>
19359
19360         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
19361         return types of the methods.  The return type is not part of the
19362         signature and we must not check it to make the `new' modifier work.
19363         Fixes bug #27999, also added test-147.cs.
19364         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
19365
19366         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
19367         on the method's return type.
19368
19369 2002-07-21  Martin Baulig  <martin@gnome.org>
19370
19371         * assign.cs: Make this work if the rightmost source is a constant and
19372         we need to do an implicit type conversion.  Also adding a few more tests
19373         to test-38.cs which should have caught this.
19374
19375         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
19376         target in the makefile for this.  The makefile.gnu is primarily intended
19377         for end-users who don't want to debug the compiler.
19378
19379 2002-07-21  Martin Baulig  <martin@gnome.org>
19380
19381         * assign.cs: Improved the Assign class so it can now handle embedded
19382         assignments (X = Y = Z = something).  As a side-effect this'll now also
19383         consume less local variables.  test-38.cs now passes with MCS, added
19384         a few new test cases to that test.
19385
19386 2002-07-20  Martin Baulig  <martin@gnome.org>
19387
19388         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
19389         instructions.  Fixes bug #27977, also added test-146.cs.
19390
19391 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19392
19393         * cs-tokenizer.cs: fixed getHex ().
19394
19395 2002-07-19  Martin Baulig  <martin@gnome.org>
19396
19397         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
19398         not Type.GetType() to lookup the array type.  This is needed when
19399         we're constructing an array of a user-defined type.
19400         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
19401         single-dimensional arrays, but also for single-dimensial arrays of
19402         type decimal.
19403
19404 2002-07-19  Martin Baulig  <martin@gnome.org>
19405
19406         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
19407         this function is called, it's not allowed to share LocalBuilders
19408         among ILGenerators.
19409
19410 2002-07-19  Martin Baulig  <martin@gnome.org>
19411
19412         * expression.cs (Argument.Resolve): Report an error 118 when trying
19413         to pass a type as argument.
19414
19415 2002-07-18  Martin Baulig  <martin@gnome.org>
19416
19417         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
19418         Conv_R_Un for the signed `long' type.
19419
19420 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
19421
19422         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
19423         `expr' for the temporary result, as that will fail if we do
19424         multiple resolves on the same expression.
19425
19426 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
19427
19428         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
19429         ec.TypeContainer for looking up aliases. 
19430
19431         * class.cs (TypeContainer): Remove LookupAlias from here.
19432
19433         * decl.cs (DeclSpace); Move here.
19434
19435 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
19436
19437         * class.cs (FindMembers): Only call filter if the constructor
19438         bulider is not null.
19439
19440         Also handle delegates in `NestedTypes' now.  Now we will perform
19441         type lookups using the standard resolution process.  This also
19442         fixes a bug.
19443
19444         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
19445         This uses Expressions (the limited kind that can be parsed by the
19446         tree) instead of strings.
19447
19448         * expression.cs (ComposedCast.ToString): Implement, used to flag
19449         errors since now we have to render expressions.
19450
19451         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
19452         FormArrayType. 
19453
19454         * ecore.cs (SimpleName.ToString): ditto.
19455
19456         * cs-parser.jay: Instead of using strings to assemble types, use
19457         Expressions to assemble the type (using SimpleName, ComposedCast,
19458         MemberAccess).  This should fix the type lookups in declarations,
19459         because we were using a different code path for this.
19460
19461         * statement.cs (Block.Resolve): Continue processing statements
19462         even when there is an error.
19463
19464 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
19465
19466         * class.cs (Event.Define): Also remove the `remove' method from
19467         the list of pending items.
19468
19469         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
19470         generate more compact code. 
19471
19472 2002-07-17  Martin Baulig  <martin@gnome.org>
19473
19474         * const.cs (Const.LookupConstantValue): Add support for constant
19475         `unchecked' and `checked' expressions.
19476         Also adding test case test-140.cs for this.
19477
19478 2002-07-17  Martin Baulig  <martin@gnome.org>
19479
19480         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
19481         check whether mi.ReturnType implements the IEnumerator interface; the
19482         `==' and the IsAssignableFrom() will fail in this situation.
19483
19484 2002-07-16  Ravi Pratap  <ravi@ximian.com>
19485
19486         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
19487         here too.
19488
19489 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19490
19491         * expression.cs: fixed bug #27811.
19492
19493 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
19494
19495         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
19496         Molaro: when we are a ref, the value already contains a pointer
19497         value, do not take the address of it.
19498
19499 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19500         * removed mb-parser.jay and mb-tokenizer.cs
19501
19502 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19503
19504         * expression.cs: check against the building corlib void type.
19505
19506 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
19507
19508         * ecore.cs: fix for valuetype static readonly fields: when 
19509         initializing them, we need their address, not the address of a copy.
19510
19511 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
19512
19513         * typemanager.cs: register also enum_type in corlib.
19514
19515 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19516
19517         * class.cs: allow calling this (but not base) initializers in structs.
19518
19519 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
19520
19521         * ecore.cs: make sure we compare against the building base types
19522         in GetTypeSize ().
19523
19524 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
19525
19526         * typemanager.cs: fix TypeToCoreType() to handle void and object
19527         (corlib gets no more typerefs after this change).
19528
19529 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
19530
19531         * expression.cs (ArrayCreation.EmitArrayArguments): use
19532         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
19533
19534         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
19535         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
19536         array indexes, the runtime actually forbids them.
19537
19538         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
19539         for array arguments here.
19540
19541         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
19542         instead of the default for ValueTypes.
19543
19544         (New.DoEmit): Use IsValueType instead of
19545         IsSubclassOf (value_type)
19546         (New.DoResolve): ditto.
19547         (Invocation.EmitCall): ditto.
19548
19549         * assign.cs (Assign): ditto.
19550
19551         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
19552         Statements *are* currently doing part of their resolution during
19553         Emit.  
19554
19555         Expressions do always resolve during resolve, but statements are
19556         only required to propagate resolution to their children.
19557
19558 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
19559
19560         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
19561
19562         (LoadAssembly): Do not add the dll if it is already specified
19563
19564         (MainDriver): Add the System directory to the link path at the end,
19565         after all the other -L arguments. 
19566
19567         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
19568         wrong opcode for loading bytes and bools (ldelem.i1 instead of
19569         ldelem.u1) and using the opposite for sbytes.
19570
19571         This fixes Digger, and we can finally run it.
19572
19573         * driver.cs (UnixParseOption): Move the option parsing here.  
19574         (CSCParseOption): Implement CSC-like parsing of options.
19575
19576         We now support both modes of operation, the old Unix way, and the
19577         new CSC-like way.  This should help those who wanted to make cross
19578         platform makefiles.
19579
19580         The only thing broken is that /r:, /reference: and /lib: are not
19581         implemented, because I want to make those have the same semantics
19582         as the CSC compiler has, and kill once and for all the confussion
19583         around this.   Will be doing this tomorrow.
19584
19585         * statement.cs (Unsafe.Resolve): The state is checked during
19586         resolve, not emit, so we have to set the flags for IsUnsfe here.
19587
19588 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
19589
19590         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
19591         not catch the Error_ObjectRefRequired in SimpleName (as it is
19592         possible to have a class/instance variable name that later gets
19593         deambiguated), we have to check this here.      
19594
19595 2002-07-10  Ravi Pratap  <ravi@ximian.com>
19596
19597         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
19598         make static and put into Expression.
19599
19600         (Event.Define): Register the private field of the event with the 
19601         TypeManager so that GetFieldFromEvent can get at it.
19602
19603         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
19604         keep track of the private field associated with an event which
19605         has no accessors.
19606
19607         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
19608         private field.
19609
19610         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
19611
19612 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
19613
19614         * expression.cs (Binary.EmitBranchable): this routine emits the
19615         Binary expression in a branchable context.  This basically means:
19616         we need to branch somewhere, not just get the value on the stack.
19617
19618         This works together with Statement.EmitBoolExpression.
19619
19620         * statement.cs (Statement.EmitBoolExpression): Use
19621         EmitBranchable. 
19622
19623 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
19624
19625         * statement.cs (For): Reduce the number of jumps in loops.
19626
19627         (For): Implement loop inversion for the For statement.
19628
19629         (Break): We can be breaking out of a Try/Catch controlled section
19630         (foreach might have an implicit try/catch clause), so we need to
19631         use Leave instead of Br.
19632
19633         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
19634         now).  If the instace expression supports IMemoryLocation, we use
19635         the AddressOf method from the IMemoryLocation to extract the
19636         address instead of emitting the instance.
19637
19638         This showed up with `This', as we were emitting the instance
19639         always (Emit) instead of the Address of This.  Particularly
19640         interesting when This is a value type, as we dont want the Emit
19641         effect (which was to load the object).
19642
19643 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
19644
19645         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
19646
19647         * statement.cs (Checked): Set the CheckedState during the resolve
19648         process too, as the ConvCast operations track the checked state on
19649         the resolve process, and not emit.
19650
19651         * cs-parser.jay (namespace_member_declaration): Flag that we have
19652         found a declaration when we do.  This is used to flag error 1529
19653
19654         * driver.cs: Report ok when we display the help only.
19655
19656 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
19657
19658         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
19659
19660 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
19661
19662         * cs-tokenizer.cs (define): We also have to track locally the
19663         defines.  AllDefines is just used for the Conditional Attribute,
19664         but we also need the local defines for the current source code. 
19665
19666 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
19667
19668         * statement.cs (While, For, Do): These loops can exit through a
19669         Break statement, use this information to tell whether the
19670         statement is the last piece of code.
19671
19672         (Break): Flag that we break.
19673
19674         * codegen.cs (EmitContexts): New `Breaks' state variable.
19675
19676 2002-07-03  Martin Baulig  <martin@gnome.org>
19677
19678         * class.cs (TypeContainer.MethodModifiersValid): Allow override
19679         modifiers in method declarations in structs.  Otherwise, you won't
19680         be able to override things like Object.Equals().
19681
19682 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19683
19684         * class.cs (Method, Property, Indexer): Do not allow the public
19685         modifier to be used in explicit interface implementations.
19686
19687         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
19688         override modifiers in method declarations in structs
19689
19690 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
19691
19692         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
19693         integer or real overflow, report an error
19694
19695 2002-07-02  Martin Baulig  <martin@gnome.org>
19696
19697         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
19698         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
19699         to tell the runtime about our newly created System.Object and
19700         System.ValueType types.
19701
19702 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19703
19704         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
19705         struct instead of Ldarg/Starg.
19706
19707 2002-07-02  Martin Baulig  <martin@gnome.org>
19708
19709         * expression.cs (Indirection.Indirection): Call
19710         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
19711
19712 2002-07-02  Martin Baulig  <martin@gnome.org>
19713
19714         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
19715         ValueType, call TypeManager.TypeToCoreType() on it.
19716         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19717         the OpCodes.Newarr argument.
19718
19719 2002-07-02  Martin Baulig  <martin@gnome.org>
19720
19721         * expression.cs (Invocation.EmitCall): When compiling corlib,
19722         replace all calls to the system's System.Array type to calls to
19723         the newly created one.
19724
19725         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19726         System.Array methods.
19727         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19728         from the system's System.Array type which must be replaced.
19729
19730 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19731
19732         * typemanager.cs: load unverifiable_code_ctor so we can build
19733         corlib using the correct type. Avoid using GetTypeCode() with
19734         TypeBuilders.
19735         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19736         TypeManager.object_type to allow building corlib.
19737
19738 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19739
19740         * ecore.cs: handle System.Enum separately in LoadFromPtr().
19741
19742 2002-07-01  Martin Baulig  <martin@gnome.org>
19743
19744         * class.cs: Make the last change actually work, we need to check
19745         whether `ifaces != null' to avoid a crash.
19746
19747 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19748
19749         * class.cs: when we build structs without fields that implement
19750         interfaces, we need to add the interfaces separately, since there is
19751         no API to both set the size and add the interfaces at type creation
19752         time.
19753
19754 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19755
19756         * expression.cs: the dimension arguments to the array constructors
19757         need to be converted if they are a long.
19758
19759 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19760
19761         * class.cs: don't emit ldarg.0 if there is no parent constructor
19762         (fixes showstopper for corlib).
19763
19764 2002-06-29  Martin Baulig  <martin@gnome.org>
19765
19766         MCS now compiles corlib on GNU/Linux :-)
19767
19768         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19769         ie. check for MethodImplOptions.InternalCall.
19770
19771         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19772         and TypeManager.attribute_type are null, so we must explicitly check
19773         whether parent is not null to find out whether it's an attribute type.
19774         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19775         and SetBuilder, not only if the property is neither abstract nor external.
19776         This is necessary to set the MethodImplOptions on the accessor methods.
19777         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19778         SetBuilder, see Property.Emit().
19779
19780         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19781         populate "System.Object", "System.ValueType" and "System.Attribute" since
19782         they've already been populated from BootCorlib_PopulateCoreTypes().
19783
19784 2002-06-29  Martin Baulig  <martin@gnome.org>
19785
19786         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19787         is the NullLiteral, we also need to make sure that target_type is not
19788         an enum type.   
19789
19790 2002-06-29  Martin Baulig  <martin@gnome.org>
19791
19792         * rootcontext.cs (RootContext.ResolveCore): We must initialize
19793         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19794         before calling BootstrapCorlib_ResolveDelegate ().
19795
19796 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19797
19798         * statement.cs: fixed build-breaker. All tests passed ok.
19799
19800 2002-06-27  Martin Baulig  <martin@gnome.org>
19801
19802         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19803         for System.Decimal when compiling corlib.
19804
19805 2002-06-27  Martin Baulig  <martin@gnome.org>
19806
19807         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19808         switch blocks which contain nothing but a default clause.
19809
19810 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
19811
19812        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19813
19814 2002-06-27  Martin Baulig  <martin@gnome.org>
19815
19816         * ecore.cs (PropertyExpr.PropertyExpr): Call
19817         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19818
19819         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19820         is already a TypeBuilder.
19821
19822 2002-06-27  Martin Baulig  <martin@gnome.org>
19823
19824         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19825         `target_type == TypeManager.array_type', not IsAssignableFrom() in
19826         the "from an array-type to System.Array" case.  This makes it work
19827         when compiling corlib.
19828
19829 2002-06-27  Martin Baulig  <martin@gnome.org>
19830
19831         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19832         non-static PropertyExpr, set its InstanceExpression.  This makes
19833         the `ICollection.Count' property work in System/Array.cs.
19834
19835 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
19836
19837         * driver.cs: Made error handling more consistent.  Errors now
19838         tracked by Report class, so many methods which used to return int
19839         now return void.  Main() now prints success/failure and 
19840         errors/warnings message.
19841
19842         Renamed '--probe' compiler argument to '--expect-error'.  Removed
19843         the magic number return values (123 and 124).  Now, if the
19844         expected error occurs, the compiler exits with success (exit value
19845         0).  If the compilation completes without seeing that particular
19846         error, the compiler exits with failure (exit value 1).  The
19847         makefile in mcs/errors has been changed to handle the new behaviour.
19848
19849         * report.cs: Made 'expected error' number a property and renamed
19850         it from 'Probe' to 'ExpectedError'.
19851
19852         * genericparser.cs: Removed error handling support, since it is
19853         now all done by Report class.
19854
19855         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19856         class, so parse() no longer returns an int.
19857
19858         * namespace.cs: Use Report.Error instead of GenericParser.error
19859
19860 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
19861
19862         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19863         TypeContainer.AddOperator): At the front of the list put the
19864         explicit implementations, so they get resolved/defined first. 
19865
19866 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
19867
19868         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19869         interface type is implemented by this TypeContainer.  Used during
19870         explicit interface implementation.
19871
19872         (Property.Define, Indexer.Define, Method.Define): Validate that
19873         the given interface in the explicit implementation is one of the
19874         base classes for the containing type.
19875
19876         Also if we are explicitly implementing an interface, but there is
19877         no match in the pending implementation table, report an error.
19878
19879         (Property.Define): Only define the property if we are
19880         not explicitly implementing a property from an interface.  Use the
19881         correct name also for those properties (the same CSC uses,
19882         although that is really not needed).
19883
19884         (Property.Emit): Do not emit attributes for explicitly implemented
19885         properties, as there is no TypeBuilder.
19886
19887         (Indexer.Emit): ditto.
19888
19889         Hiding then means that we do not really *implement* a pending
19890         implementation, which makes code fail.
19891
19892 2002-06-22  Martin Baulig  <martin@gnome.org>
19893
19894         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19895         the return value of Object.GetType().  [FIXME: we need to do this whenever
19896         we get a type back from the reflection library].
19897
19898 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19899
19900         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19901
19902 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
19903
19904         * attribute.cs: Return null if we can not look up the type.
19905
19906         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19907         the interface types found.
19908
19909         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19910         interface types found.
19911
19912         * typemanager.cs (GetInterfaces): Make this routine returns alll
19913         the interfaces and work around the lame differences between
19914         System.Type and System.Reflection.Emit.TypeBuilder in the results
19915         result for GetInterfaces.
19916
19917         (ExpandInterfaces): Given an array of interface types, expand and
19918         eliminate repeated ocurrences of an interface.  This expands in
19919         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19920         be IA, IB, IC.
19921
19922 2002-06-21  Martin Baulig  <martin@gnome.org>
19923
19924         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19925         on System.Enum.
19926
19927 2002-06-21  Martin Baulig  <martin@gnome.org>
19928
19929         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
19930         and called with one of the core types, return the corresponding typebuilder for
19931         that type.
19932
19933         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19934         element type.
19935
19936 2002-06-21  Martin Baulig  <martin@gnome.org>
19937
19938         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19939         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19940         (Expression.ConvertReferenceExplicit): Likewise.
19941
19942         * expression.cs (ElementAccess.DoResolve): Likewise.
19943         (ElementAccess.DoResolveLValue): Likewise.
19944
19945 2002-06-10  Martin Baulig  <martin@gnome.org>
19946
19947         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19948         add the "value" parameter to the parameter list.
19949
19950         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19951         to our caller.
19952
19953 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
19954
19955         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19956         the argument to an int, uint, long or ulong, per the spec.  Also
19957         catch negative constants in array creation.
19958
19959 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19960
19961         * class.cs: do not allow the same interface to appear twice in
19962         the definition list.
19963
19964 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19965
19966         * ecore.cs: don't use ldlen with System.Array.
19967
19968 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19969
19970         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19971
19972 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19973
19974         * modifiers.cs: produce correct field attributes for protected
19975         internal. Easy fix so miguel can work on ther harder stuff:-)
19976
19977 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
19978
19979         * pending.cs: New file.  Move the code from class.cs here.
19980         Support clearning the pending flag for all methods (when not doing
19981         explicit interface implementation).
19982
19983 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19984
19985         * rootcontext.cs: added a couple more types needed to bootstrap.
19986
19987 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
19988
19989         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19990         constructor in the type, instead of any constructor in the type
19991         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
19992         a bug in the Mono runtime when applying the params attribute). 
19993
19994 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
19995         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19996
19997 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
19998
19999         * expression.cs (Unary.ResolveOperator): Use TypeManager
20000         to resolve the type.
20001
20002 2002-06-13  Ravi Pratap  <ravi@ximian.com>
20003
20004         * cs-parser.jay (enum_member_declaration): Pass in the attributes
20005         attached.
20006
20007         * enum.cs (AddEnumMember): Add support to store the attributes associated 
20008         with each member too.
20009
20010         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
20011         field builders too - this takes care of the enum member case.
20012
20013 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
20014
20015         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
20016         address-of operator on both value types and pointers.
20017
20018 2002-06-10  Martin Baulig  <martin@gnome.org>
20019
20020         * interface.cs (Interface.PopulateIndexer): Add the indexer's
20021         PropertyBuilder to the `property_builders' list.
20022
20023         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
20024         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
20025         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
20026         find any indexers which are inherited from an interface.
20027
20028 2002-06-09  Martin Baulig  <martin@gnome.org>
20029
20030         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
20031         the same type as the constant if necessary.  There's also a test-130.cs
20032         for this.
20033
20034         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
20035
20036         * typemanager.cs (TypeManager.ChangeType): Previously known as
20037         Enum.ChangeEnumType().
20038
20039 2002-06-09  Martin Baulig  <martin@gnome.org>
20040
20041         * expression.cs (Cast.TryReduce): Added support for consts.
20042
20043 2002-06-08  Ravi Pratap  <ravi@ximian.com>
20044
20045         * class.cs (Accessor): Hold attributes information so we can pass
20046         it along.
20047
20048         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
20049         Modify to pass in attributes attached to the methods.
20050
20051         (add_accessor_declaration, remove_accessor_declaration): Ditto.
20052
20053         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
20054         to handle the Accessor kind :-)
20055
20056         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
20057
20058 2002-06-08  Martin Baulig  <martin@gnome.org>
20059
20060         * expression.cs (Unary.TryReduceNegative): Added support for
20061         ULongConstants.
20062
20063 2002-06-08  Martin Baulig  <martin@gnome.org>
20064
20065         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
20066         name can't be found in the `defined_names' - the caller will do a
20067         MemberLookup in this case and thus find methods in System.Enum
20068         such as Enum.IsDefined().
20069
20070 2002-06-08  Martin Baulig  <martin@gnome.org>
20071
20072         * enum.cs (Enum.ChangeEnumType): This is a custom version of
20073         Convert.ChangeType() which works with TypeBuilder created types.
20074         (Enum.LookupEnumValue, Enum.Define): Use it here.
20075
20076         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
20077         `TypeBuilder.BaseType != null' check.
20078         (TypeContainer.FindMembers): Only lookup parent members if we
20079         actually have a parent.
20080         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
20081         (ConstructorInitializer.Resolve): Likewise.
20082
20083         * interface.cs (Interface.FindMembers): Added
20084         `TypeBuilder.BaseType != null' check.
20085
20086         * rootcontext.cs (RootContext.ResolveCore): Added
20087         "System.Runtime.CompilerServices.IndexerNameAttribute" to
20088         classes_second_stage.
20089
20090         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
20091         debug_type and trace_type when compiling with --nostdlib.       
20092
20093 2002-06-07  Martin Baulig  <martin@gnome.org>
20094
20095         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
20096         (AddField): Set it to true when adding a non-static field.
20097         (DefineType): Use `have_nonstatic_fields' to find out whether we
20098         have non-static fields, not `Fields != null'.
20099
20100 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
20101
20102         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
20103         dereferencing a null on the static-field code path)
20104
20105 2002-05-30  Martin Baulig  <martin@gnome.org>
20106
20107         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
20108         to take command line arguments.  Use reflection to call the new
20109         custom `Initialize' function on the symbol writer and pass it the
20110         command line arguments.
20111
20112         * driver.cs (--debug-args): New command line argument to pass command
20113         line arguments to the symbol writer.
20114
20115 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
20116
20117         * assign.cs (DoResolve): Forgot to do the implicit conversion to
20118         the target type for indexers and properties.  Thanks to Joe for
20119         catching this.
20120
20121 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
20122
20123         * typemanager.cs (MethodFlags): returns the method flags
20124         (Obsolete/ShouldIgnore) that control warning emission and whether
20125         the invocation should be made, or ignored. 
20126
20127         * expression.cs (Invocation.Emit): Remove previous hack, we should
20128         not do this on matching a base type, we should do this based on an attribute
20129
20130         Only emit calls to System.Diagnostics.Debug and
20131         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
20132         on the command line.
20133
20134         * rootcontext.cs: Global settings for tracing and debugging.
20135
20136         * cs-tokenizer.cs (define): New utility function to track
20137         defines.   Set the global settings for TRACE and DEBUG if found.
20138
20139 2002-05-25  Ravi Pratap  <ravi@ximian.com>
20140
20141         * interface.cs (Populate*): Pass in the TypeContainer as well as
20142         the DeclSpace as parameters so that we can create EmitContexts and
20143         then use that to apply attributes etc.
20144
20145         (PopulateMethod, PopulateEvent, PopulateProperty)
20146         (PopulateIndexer): Apply attributes everywhere.
20147
20148         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
20149         etc.
20150
20151         (ApplyAttributes): Update accordingly.
20152
20153         We now apply interface attributes for all members too.
20154
20155 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
20156
20157         * class.cs (Indexer.Define); Correctly check if we are explicit
20158         implementation (instead of checking the Name for a ".", we
20159         directly look up if the InterfaceType was specified).
20160
20161         Delay the creation of the PropertyBuilder.
20162
20163         Only create the PropertyBuilder if we are not an explicit
20164         interface implementation.   This means that explicit interface
20165         implementation members do not participate in regular function
20166         lookups, and hence fixes another major ambiguity problem in
20167         overload resolution (that was the visible effect).
20168
20169         (DefineMethod): Return whether we are doing an interface
20170         implementation. 
20171
20172         * typemanager.cs: Temporary hack until we get attributes in
20173         interfaces (Ravi is working on that) and we get IndexerName
20174         support in interfaces.
20175
20176         * interface.cs: Register the indexers as properties.
20177
20178         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
20179         warning, I have verified that this is a bug in the .NET runtime
20180         (JavaScript suffers of the same problem).
20181
20182         * typemanager.cs (MemberLookup): When looking up members for
20183         interfaces, the parent of an interface is the implicit
20184         System.Object (so we succeed in searches of Object methods in an
20185         interface method invocation.  Example:  IEnumerable x;  x.ToString
20186         ()) 
20187
20188 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
20189
20190         * class.cs (Event): Events should also register if they do
20191         implement the methods that an interface requires.
20192
20193         * typemanager.cs (MemberLookup); use the new GetInterfaces
20194         method. 
20195
20196         (GetInterfaces): The code used to lookup interfaces for a type is
20197         used in more than one place, factor it here. 
20198
20199         * driver.cs: Track the errors at the bottom of the file, we kept
20200         on going.
20201
20202         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
20203         instance if the method we are calling is static!
20204
20205 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
20206
20207         * attribute.cs (ApplyAttributes): Make this function filter out
20208         the IndexerName attribute (as that attribute in reality is never
20209         applied) and return the string constant for the IndexerName
20210         attribute. 
20211
20212         * class.cs (TypeContainer.Emit): Validate that all the indexers
20213         have the same IndexerName attribute, and if so, set the
20214         DefaultName attribute on the class. 
20215
20216         * typemanager.cs: The return value might contain other stuff (not
20217         only methods).  For instance, consider a method with an "Item"
20218         property and an Item method.
20219
20220         * class.cs: If there is a problem with the parameter types,
20221         return. 
20222
20223 2002-05-24  Ravi Pratap  <ravi@ximian.com>
20224
20225         * ecore.cs (ImplicitConversionExists): Wrapper function which also
20226         looks at user defined conversion after making a call to 
20227         StandardConversionExists - we need this for overload resolution.
20228
20229         * expression.cs : Update accordingly the various method calls.
20230
20231         This fixes 2 bugs filed against implicit user defined conversions 
20232
20233 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
20234
20235         * statement.cs: Track the result of the assignment.
20236
20237 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
20238
20239         * expression.cs (MemberAccess): Improved error reporting for
20240         inaccessible members.
20241
20242 2002-05-22  Martin Baulig  <martin@gnome.org>
20243
20244         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
20245         itself with debugging support.
20246
20247 2002-05-22  Martin Baulig  <martin@gnome.org>
20248
20249         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
20250         Removed, this isn't needed anymore.
20251
20252 2002-05-20  Martin Baulig  <martin@gnome.org>
20253
20254         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
20255         be underlying type for an enum.
20256
20257 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
20258
20259         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
20260         that splits out the loading of just the core types.
20261
20262         * rootcontext.cs (ResolveCore): Split the struct resolution in
20263         two, so we can load the enumeration underlying types before any
20264         enums are used.
20265
20266         * expression.cs (Is): Bandaid until we fix properly Switch (see
20267         bug #24985 for details).
20268
20269         * typemanager.cs (ImplementsInterface): The hashtable will contain
20270         a null if there are no interfaces implemented.
20271
20272 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
20273
20274         * cs-parser.jay (indexer_declarator): It is fine to have array
20275         parameters
20276
20277 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
20278
20279         * typemanager.cs: (RegisterBuilder): New function used to register
20280         TypeBuilders that implement interfaces.  Since
20281         TypeBuilder.GetInterfaces (as usual) does not work with lame
20282         Reflection.Emit. 
20283         (AddUserType): register interfaces.
20284
20285         (ImplementsInterface): Use the builder_to_ifaces hash if we are
20286         dealing with TypeBuilder.  Also, arrays are showing up as
20287         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
20288         methods can not be invoked on them!
20289
20290         * ecore.cs (ExplicitReferenceConversionExists): Made public.
20291         (ImplicitReferenceConversionExists): Split out from
20292         StandardConversionExists. 
20293
20294         * expression.cs (As): We were only implementing one of the three
20295         cases for the as operator.  We now implement them all.
20296         (Is): Implement the various other cases for Is as well.
20297
20298         * typemanager.cs (CACHE): New define used to control if we want or
20299         not the FindMembers cache.  Seems to have a negative impact on
20300         performance currently
20301
20302         (MemberLookup): Nested types have full acess to
20303         enclosing type members
20304
20305         Remove code that coped with instance/static returns for events, we
20306         now catch this in RealFindMembers.
20307
20308         (RealFindMembers): only perform static lookup if the instance
20309         lookup did not return a type or an event.  
20310
20311 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
20312
20313         * assign.cs (CompoundAssign): We pass more semantic information
20314         now to Compound Assignments than we did before: now we have all
20315         the information at hand, and now we resolve the target *before* we
20316         do the expression expansion, which allows the "CacheValue" method
20317         to have the effect we intended (before, a [x] += 1 would generate
20318         two differen ArrayAccess expressions from the ElementAccess,
20319         during the resolution process).
20320
20321         (CompoundAssign.DoResolve): Resolve target and original_source here.
20322
20323 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
20324
20325         * expression.cs (ArrayAccess): dropped debugging information. 
20326
20327         * typemanager.cs: Small bug fix: I was always returning i_members,
20328         instead of one of i_members or s_members (depending on which had
20329         the content).
20330
20331         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
20332         method is invoked before any code generation takes place, and it
20333         is a mechanism to inform that the expression will be invoked more
20334         than once, and that the method should use temporary values to
20335         avoid having side effects
20336
20337         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
20338
20339         * ecore.cs (Expression.CacheTemporaries): Provide empty default
20340         implementation.
20341
20342         * expression.cs (Indirection, ArrayAccess): Add support for
20343         CacheTemporaries in these two bad boys. 
20344
20345         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
20346         ldobj or ldind_ref.  
20347         (StoreFromPtr): Handle stobj as well.
20348
20349         * expression.cs (UnaryMutator): Share more code.
20350
20351         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
20352         down: I was not tracking the Filter function as well, which
20353         was affecting the results of the cache.
20354
20355 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
20356
20357         * attribute.cs: Remove the hack to handle the CharSet property on
20358         StructLayouts. 
20359
20360 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
20361
20362         * attribute.cs (DoResolve): More uglyness, we now only try to
20363         resolve the attribute partially, to extract the CharSet
20364         information (only if we are a StructLayout attribute).  Otherwise 
20365
20366         (GetExtraTypeInfo): Add some code to conditionally kill in the
20367         future this.   I am more and more convinced that the .NET
20368         framework has special code to handle the attribute setting on
20369         certain elements.
20370
20371         * expression.cs (IsParamsMethodApplicable): Revert my previous
20372         foreach change here, it was wrong.
20373
20374 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
20375
20376         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
20377         (pp_expr): do not abort on unknown input, just return.
20378         (eval): abort if there are pending chars.
20379
20380         * attribute.cs (Attribute.Resolve): Positional parameters are
20381         optional.  Deal with that case.
20382
20383         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
20384         the Ansi/Unicode/Auto information for the type.
20385
20386         (TypeContainer.DefineType): instantiate the EmitContext here, as
20387         we will be using it during the type definition (to resolve
20388         attributes) and during the emit phase.
20389
20390         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
20391         to pull type information out of the attributes
20392
20393         (Attribute.Resolve): track the constructor builder, and allow for
20394         multiple invocations (structs and classes will use this).
20395
20396         * ecore.cs (MemberLookupFinal): new version with all the
20397         parameters customizable.
20398
20399         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
20400         constructors.  Return if the result value is null (as the error
20401         would have been flagged already by MemberLookupFinal)
20402
20403         Do not allow instances of abstract classes or interfaces to be
20404         created.
20405
20406         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
20407         We have to compare the assembly property here when dealing with
20408         FamANDAssem and Assembly access modifiers, because we might be
20409         creating an assembly from *modules* (that means that we are not
20410         getting TypeBuilders for types defined in other modules that are
20411         part of this assembly).
20412
20413         (Method.Emit): If the method is marked abstract and has a body,
20414         emit an error. 
20415
20416         (TypeContainer.DefineMembers): If both the defined member and the
20417         parent name match are methods, then do not emit any warnings: let
20418         the Method.Define routine take care of flagging warnings.  But if
20419         there is a mismatch (method overrides something else, or method is
20420         overriwritten by something, then emit warning).
20421
20422         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
20423         set to null, this means `do not check for the return type on the
20424         signature'. 
20425
20426         (Method.Define): set the return type for the method signature to
20427         null, so that we get methods with the same name and parameters and
20428         different return types.  This is used to flag warning 114 (you are
20429         hiding a method, and you probably want to use the new/override
20430         keywords instead).
20431
20432         * typemanager.cs (MemberLookup): Implemented proper access
20433         control, closing a long standing set of bug reports.  The problem
20434         was that the Framework only has two bits: Public and NonPublic,
20435         and NonPublic includes private and protected methods, but we need
20436         to enforce the FamANDAssem, FamOrAssem and Family. 
20437
20438 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
20439
20440         * statement.cs (GotoCase): Return true: Ammounts to giving up
20441         knowledge on whether we return or not, and letting the other case
20442         be responsible for it.
20443
20444 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
20445
20446         * driver.cs: Do not load directories for each file processed, only
20447         do it if there is a pattern.
20448
20449         * ecore.cs: Report readonly assigns here as well, as we might have
20450         been resolved only by MemberAccess.
20451
20452         (SimpleName.SimpleNameResolve): Also be useful for LValue
20453         resolution.   We need this to propagate assign to local readonly variables
20454
20455         * typemanager.cs: Use a ptrhashtable for the criteria, because we
20456         do not want to reuse potential criteria memory.
20457
20458         * class.cs (MyEventBuilder): Set reflected_type;
20459
20460         * ecore.cs (Constantify): Added support for constifying bools.
20461
20462         (RootContext.LookupType): Added a cache for values looked up in
20463         the declaration space.
20464
20465         * typemanager.cs (FindMembers): Now is a front-end to
20466         RealFindMembers, and provides a two-level hashtable-based cache to
20467         the request.  
20468
20469         15% performance improvement: from 22.5 to 19.2 seconds.
20470
20471         * expression.cs (IsParamsMethodApplicable): use foreach.
20472         (Invocation.DoResolve): ditto.
20473         (New.DoResolve): ditto.
20474         (ArrayCreation.DoResolve): ditto.
20475
20476         * ecore.cs (FindMostEncompassingType): use foreach.
20477
20478         * delegate.cs (NewDelegate.DoResolve): Use foreach
20479
20480         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
20481         (RemoveMethods): use foreach.
20482
20483         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
20484         nested foreach statements instead of for, and also break out of
20485         the inner loop once a match is found.
20486
20487         (Invocation.OverloadResolve): Use foreach, simplify the code. 
20488
20489 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
20490
20491         * cfold.cs (BinaryFold): During an enumeration evaluation context,
20492         we actually unwrap the expression to allow for extra information
20493         to be extracted. 
20494
20495         * expression.cs: Use Shr_Un on unsigned operations. 
20496
20497 2002-05-08  Ravi Pratap  <ravi@ximian.com>
20498
20499         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
20500         applicable operators was not being considered correctly. This closes
20501         the bug Miguel reported.
20502
20503 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
20504
20505         * attribute.cs: check that the type derives from System.Attribute
20506         and report the correct error in that case (moved the duplicate code to
20507         its own method, too).
20508
20509 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
20510
20511         * attribute.cs: lookup attribute type name as the spec says: first the
20512         bare attribute name and then name + "Attribute" (nant compiles with
20513         mcs after this fix).
20514
20515 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
20516
20517         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
20518         Because of the way we parse things, we should try to see if a
20519         UIntConstant can fit in an integer.
20520
20521 2002-05-07  Ravi Pratap  <ravi@ximian.com>
20522
20523         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
20524         when we are in an explicit context.
20525
20526         (ConvertReferenceExplicit): When converting from Iface type S to Class
20527         T make sure the rules are implemented as an OR.
20528
20529         * parameter.cs (ParameterType): Make it a property for now although the
20530         purpose really isn't anything immediate.
20531
20532         * expression.cs (Is*Applicable): Do better checking on the parameter type
20533         of a ref/out parameter. The ones from the system assemblies are already 
20534         marked with the correct type so we don't need to do any correction.
20535
20536         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
20537         the object type is standard too so include that.
20538
20539 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20540
20541         * ecore.cs (StandardConversionExists): Augment with missing code:
20542         deal with IntConstant, LongConstants and Enumerations.
20543
20544         * assign.cs: Report the error, instead of failing silently
20545
20546         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
20547         typecontainer that they are declared, because the
20548         typecontainer/namespace will have the list of using clauses that
20549         need to be applied.
20550
20551         Assembly Attributes were escaping the normal registration
20552         mechanism. 
20553
20554         (EmitCode): Apply attributes within an EmitContext that represents
20555         the container they were declared on.
20556
20557         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
20558
20559 2002-05-06  Ravi Pratap  <ravi@ximian.com>
20560
20561         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
20562         Revamp completely - make much cleaner as we now operate only
20563         on a set of Types.
20564
20565         (FindMostSpecificSource, FindMostSpecificTarget): New methods
20566         to implement the logic detailed in the spec more correctly.
20567
20568         (UserDefinedConversion): Update accordingly.
20569
20570 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20571
20572         * statement.cs: Return flow analysis information up.
20573
20574         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
20575         and the default.
20576
20577         (token): Do not consume an extra character before calling
20578         decimal_digits.
20579
20580 2002-05-06  Piers Haken <piersh@friskit.com>
20581
20582         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
20583
20584 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20585
20586         * class.cs (Constructor.Emit): Set the IsStatic flag in the
20587         EmitContext during the instance constructor initializer
20588         resolution, to stop access to instance variables.
20589
20590         This is mandated by the spec, last paragraph of the `constructor
20591         initializers' section. 
20592
20593 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
20594
20595         * cs-parser.jay, class.cs (Accessor): new class used to represent
20596         an accessor (get or set).  In the past we used `null' to represent
20597         a missing accessor.  But this is ambiguous because there was no
20598         way to tell in abstract indexers/properties if one of them was
20599         specified.
20600
20601         Now there is a way of addressing that.
20602
20603         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
20604         instead of FindMembers.
20605
20606         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
20607         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
20608
20609         * attribute.cs: Treat indexers and properties as the same in terms
20610         of applying attributes
20611
20612         * ecore.cs (FindMostEncompassedType): Use statically initialized
20613         EmptyExpressions()s like we do elsewhere to avoid creating useless
20614         objects (and we take this out of the tight loop).
20615
20616         (GetConversionOperators): Move the code to extract the actual
20617         operators to a separate routine to clean things up.
20618
20619 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
20620
20621         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
20622         events are always registered FieldBuilders.
20623
20624         * class.cs (FieldBase): New class shared by Fields 
20625
20626         * delegate.cs: If we are a toplevel delegate, use our full name.
20627         If we are a nested delegate, then only use our tail name.
20628
20629 2002-05-02  Ravi Pratap  <ravi@ximian.com>
20630
20631         * expression.cs (IsApplicable): Ensure that we add the "&" to
20632         ref/out types before comparing it with the type of the argument.
20633
20634         (IsParamsMethodApplicable): Ditto.
20635
20636         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
20637         silly me ;-)
20638
20639         * delegate.cs : Handle the case when we have more than one applicable
20640         method. Flag an error only when we finish checking all.
20641
20642 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
20643
20644         * expression.cs: Add support for boolean static initializers.
20645
20646 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
20647
20648         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
20649
20650         * parameter.cs (ComputeParameterTypes,
20651         ComputeAndDefineParameterTypes): Better error handling: now we
20652         clear the `types' cache if we fail during any of the type lookups.
20653         We also return the status code correctly to our caller
20654
20655         * delegate.cs: If we fail to define a delegate, abort the extra
20656         steps. 
20657
20658         * expression.cs (Binary.ResolveOperator): for
20659         operator==(object,object) and operator !=(object, object) we also
20660         have to verify that there is an implicit conversion from one to
20661         the other.
20662
20663         (ArrayAccess.DoResolve): Array Access can operate on
20664         non-variables. 
20665
20666 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
20667
20668         * assign.cs (CompoundAssign): A new class used as a "flag" that
20669         the assignment actually is happening as part of a compound
20670         assignment operator.
20671
20672         During compound assignment, a few new rules exist to enable things
20673         like:
20674
20675         byte b |= 1 + 2
20676
20677         From the spec:
20678
20679         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
20680         to the type of x) if y is implicitly convertible to the type of x,
20681         and the operator is a builtin operator and the return type of the
20682         operator is explicitly convertible to the type of x. 
20683
20684         * rootcontext.cs: Reset warning level to 2.  4 catches various
20685         "interesting" features in mcs, we must clean this up at some
20686         point, but currently am trying to kill other bugs ;-)
20687
20688         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
20689         in container classes as well.  
20690
20691         * expression.cs (Binary.ResolveOperator): Handle string case
20692         before anything else (as operator overloading does emit an error
20693         before doing anything else).
20694
20695         This code could go away when we move to a table driven model, but
20696         i could not come up with a good plan last night.
20697
20698 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
20699
20700         * typemanager.cs (CSharpName): reimplementation using regex.
20701         * class.cs: added null check for fields in Emit
20702         * rootcontext.cs: set warninglevel to 4
20703
20704 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
20705
20706         * typemanager.cs (CSharpName): reimplemented with Lupus
20707         suggestion.
20708
20709 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
20710
20711         * statement.cs (If): correclty implement Resolve, because we were
20712         not catching sem errors in there.  The same process is needed
20713         everywhere else. 
20714         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
20715
20716
20717         (Statement.Warning_DeadCodeFound): Factorize code.
20718         (While): Report dead code here too.
20719
20720         (Statement): Added Resolve virtual method to allow
20721         for resolution split from the emit code.
20722
20723 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20724
20725         * statement.cs (EmitBoolExpression): No longer try to resolve the
20726         expression here.    
20727         (MakeBoolean): New utility function that resolve, implicitly
20728         converts to boolean and tags the expression. 
20729
20730
20731         (If, Do): Implement dead code elimination.
20732         (While): Implement loop inversion
20733
20734         (Do, While, For, If): Resolve the expression prior to calling our
20735         code generation.
20736
20737 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
20738
20739         * class.cs:
20740           - added method Report28 (warning: program has more than one entry point)
20741           - added method IsEntryPoint, implements paragraph 10.1 of the spec
20742           - modified method Method.Define, the part at the end of the method
20743
20744         * rootcontext.cs: added static public Location EntryPointLocation;
20745           
20746         * ../errors/cs0028.cs : Add test case for the above warning.              
20747
20748         * typemanager.cs:
20749           - modified method CSharpName to allow arrays of primitive type to
20750             be printed nicely (e.g. instead of System.Int32[][] it now prints
20751             int[][])
20752           - added method CSharpSignature: returns the signature of a method
20753             in string format to be used in reporting errors, warnings, etc.
20754
20755         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20756         with String.Empty.
20757
20758 2002-04-26  Ravi Pratap  <ravi@ximian.com>
20759
20760         * delegate.cs (Define): Fix extremely silly bug where I was
20761         setting the type of the 'object' parameter of the BeginInvoke
20762         method to System.IAsyncResult instead of System.Object ;-)
20763
20764 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20765
20766         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20767         here. 
20768
20769         (Constructor.Emit): return if we fail to initialize the
20770         constructor.  Another door closed!  
20771
20772         * expression.cs (New.DoResolve): Improve error message (from -6 to
20773         1501).  Use DeclaredOnly lookup to find the exact constructor.
20774
20775         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20776         loop.  This is useful.
20777
20778         * cs-parser.jay: Adjust the default parameters so that destructors
20779         have the proper signature.
20780
20781 2002-04-26  Martin Baulig  <martin@gnome.org>
20782
20783         * driver.cs (LoadAssembly): If `assembly' contains any characters
20784         which are only valid in path names and not in assembly names
20785         (currently slash, backslash and point), use Assembly.LoadFrom ()
20786         instead of Assembly.Load () on the `assembly' (before iteration
20787         over the link_paths).
20788
20789 2002-04-26  Martin Baulig  <martin@gnome.org>
20790
20791         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20792
20793 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
20794
20795         * class.cs (Property): use the new typemanager.MemberLookup
20796
20797         (TypeContainer.MemberLookup): Implement using the
20798         TypeManager.MemberLookup now. 
20799
20800         * typemanager.cs: Make MemberLookup a function of the TypeManager,
20801         and return MemberInfos, so that these can be used without an
20802         EmitContext (what we had before).
20803
20804 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
20805
20806         * expression.cs: Fix the case where the argument to params if the
20807         type of the params.  I omitted handling this before.   Fixed
20808
20809 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20810
20811         * driver.cs: Call BootCorlib_PopulateCoreType
20812
20813         * class.cs (Property.CheckBase): Check for properties only, not
20814         for all members. 
20815
20816         * interface.cs: Temporary hack: try/catch around the
20817         CustomAttributeBuilder, because I am getting an exception that I
20818         do not understand.
20819
20820         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20821         types whose definitions are required to be there (attributes are
20822         defined before standard types).
20823
20824         Compute definitions as we boot the various types, as they are used
20825         immediately (value_type class will need object_type, but if we do
20826         not initialize object_type, we will pass a null, which will let
20827         the runtime pick the System.Object from the existing corlib, which
20828         is not what we want).
20829
20830 2002-04-22  Patrik Torstensson <totte@labs2.com>
20831
20832         * cs-tokenizer.cs: fixed a number of trim() issues.
20833
20834 2002-04-22  Ravi Pratap  <ravi@ximian.com>
20835
20836         * expression.cs (Argument.Type): Ensure that we return the correct
20837         type when we have out or ref parameters [in which case we 
20838         append a "&"].
20839
20840 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20841
20842         * class.cs (Property, Indexer): Allow extern modifier in there. 
20843
20844         * typemanager.cs (InitBaseTypes): Initializes object_type and
20845         value_type, since those will be used early on during the bootstrap
20846         process to compile corlib.
20847
20848         (InitCoreTypes): Move code from here to InitBaseTypes.
20849
20850 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
20851
20852         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20853         single-dimension arrays as using the ldlen opcode.  
20854
20855         Daniel Lewis discovered this optimization.  
20856
20857         * typemanager.cs: Add signature for System.Array::get_Length
20858
20859 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20860
20861         * statement.cs: report the error when the foreach does not apply to an
20862         array nor a collection.
20863
20864 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
20865
20866         * expression.cs: Add implicit conversions to the operator ~.
20867
20868         * constant.cs (DecimalConstant.Emit): Emit decimal value.
20869
20870         * typemanager.cs: Locate the decimal constructor.
20871
20872 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20873
20874         * attribute.cs: use the new property of TypeOf.
20875         * expression.cs: added 'get' property around typearg.
20876
20877         These changes fix a build breaker reported by NickD. Is this the
20878         correct way to fix?  If not, please, revert my changes and make it
20879         work :-).
20880
20881 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
20882
20883         * attribute.cs: Add support for typeof in attribute invocations.
20884         I am not sure that this is right though.
20885
20886 2002-04-14  Duncan Mak  <duncan@ximian.com>
20887
20888         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20889         Binary.Operator.Division case.
20890
20891 2002-04-13  Ravi Pratap  <ravi@ximian.com>
20892
20893         * class.cs (DefineType): Ensure that we do a proper check on
20894         attribute types and also register it with the TypeManager.
20895
20896         (TypeContainer.Targets): The default for attribute types is
20897         AttributeTargets.All.
20898
20899         * attribute.cs (ApplyAttributes): Registering the attribute type
20900         is done elsewhere, not when we discover we have a Usage attribute.
20901
20902 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20903
20904         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20905         and get rid of is_delegate parameter.
20906
20907         * everywhere : update.
20908
20909 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20910
20911         * cs-parser.jay (compilation_unit): Revamp completely to use
20912         some new ideas that I got from Rhys' grammar to solve the problems
20913         with assembly level attributes.
20914
20915         (outer_declaration): New grammar production.
20916
20917         (attribute_sections): Add.
20918
20919         (opt_attributes): Base on attribute_sections
20920
20921         (namespace_declaration): Allow opt_attributes to tackle the case
20922         when we have assembly level attributes - we are clever in this
20923         regard now ;-)
20924
20925         * attribute.cs (ApplyAttributes): Do not worry about assembly 
20926         attributes in the non-global context.
20927
20928         * rootcontext.cs (AddGlobalAttributes): Go back to using this
20929         instead of SetGlobalAttributes.
20930
20931         * class.cs, rootcontext.cs : Ensure we define and generate 
20932         attribute types before anything else.
20933
20934         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20935         and flag the new error -20 for the case when the attribute type
20936         does not have valid targets specified. csc does not catch this.
20937
20938         * ../errors/errors.txt : update for error # -20
20939
20940 2002-04-11  Ravi Pratap  <ravi@ximian.com>
20941
20942         * support.cs (InternalParameters.ParameterModifier): Do some null
20943         checking and return sane values.
20944
20945         * class.cs (Method.Define): If we are a PInvoke method, ensure
20946         that we are static and extern. Report error # 601
20947
20948         * ../errors/cs0601.cs : Add test case for the above error.
20949
20950 2002-04-07  Ravi Pratap  <ravi@ximian.com>
20951
20952         * rootcontext.cs (attribute_types): We need to keep type of
20953         all attribute types separately and emit code for them first.
20954
20955         (RegisterAttribute) : Implement.
20956
20957         * class.cs (DefineType): Check if the current Type is a custom
20958         attribute type and register it accordingly.
20959
20960         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20961         adding the first attribute twice and rename to
20962
20963         (SetGlobalAttributes): this.
20964
20965         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20966         lookups.
20967
20968         * attribute.cs (ApplyAttributes): Take an additional argument telling us
20969         if we are processing global arguments. Hmm, I am unsure of this.
20970
20971 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20972
20973         * expression.cs: added static array of strings to avoid calling
20974         Enum.ToString () for Operator in Binary. Significant recover of
20975         performance.
20976
20977 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
20978
20979         * class.cs (FindMembers): Allow the Builders of the various
20980         members to be null.  If they are skip them.  This only happens
20981         during the PInvoke declaration.
20982
20983 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
20984
20985         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20986         failure, so we do not keep going afterwards.
20987
20988         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20989         wanted to pass `false' as the `is_delegate' argument.  If this is
20990         the case, why not use delegate_type == null to mean `is_delegate =
20991         false' and anything else as is_delegate = true.
20992
20993 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
20994
20995         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20996         code for the section, not the beginning of the tests.
20997
20998 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
20999
21000         * cfold.cs: Handle operator + (Enum x, Underlying x) 
21001
21002         * expression.cs (Binary): same.  Warn about errors where we have
21003         Enum/Enum in operator + as well.
21004
21005 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
21006
21007         * statement.cs:
21008                 - added support for switch(bool)
21009                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
21010                 - add TableSwitchEmit() to handle table-based switch statements
21011
21012 2002-04-05  Ravi Pratap  <ravi@ximian.com>
21013
21014         * expression.cs (Invocation.OverloadResolve): Factor out code which
21015         does parameter compatibility checking with arguments so that we can 
21016         re-use the code even from Delegate.VerifyApplicability
21017
21018         (VerifyArgumentsCompat): Move above code here.
21019
21020         * delegate.cs (VerifyApplicability): Get rid of duplicate code
21021         and instead make a call to the above method.
21022
21023 2002-03-31  Ravi Pratap  <ravi@ximian.com>
21024
21025         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
21026         We use it to keep track of classes which are attribute types.
21027
21028 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
21029
21030         * delegate.cs (Delegate.Define): Correctly define the types in the
21031         presence of fixed and array parameters.
21032
21033         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
21034         doing FindMembers.
21035
21036         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
21037         include NonPublic after the first iteration.
21038
21039         * class.cs (Indexer.CheckBase): Only check if both parents are
21040         non-null. 
21041
21042         * cs-parser.jay (accessor_body): If empty, set to null.
21043
21044         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
21045         same code path here to resolve constants names that we did have in
21046         MemberAccess.DoResolve.  There is too much code duplicated here.
21047
21048 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
21049
21050         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
21051
21052         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
21053         to MakeUnionSet.
21054
21055         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
21056         tokens, numbers and strings.
21057
21058         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
21059         parenthesis.
21060
21061         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
21062         asyncronous parameters and the regular parameters.  
21063
21064         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
21065         specify the target directory.
21066
21067         * expression.cs: (This.DoResolve): Simplify
21068         (As.Emit): Optimize, do not generate IsInst if the expression is
21069         always of the given type.
21070
21071         (Is.DoResolve): Bug fix, we were reporting both always/never for
21072         the is expression.
21073
21074         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
21075         creating too many unnecessary arrays.
21076
21077 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
21078
21079         * class.cs (EmitFieldInitializer): Use Assign expression to assign
21080         fields instead of rolling our own initializer.   Takes care of all
21081         implicit conversions, and drops unnecessary static checks/argument.
21082
21083 2002-03-31  Dick Porter  <dick@ximian.com>
21084
21085         * driver.cs: use the GetDirectories() return values properly, and
21086         use "/" as path separator.
21087
21088 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
21089
21090         * expression.cs (Unary): Optimize - - expr into expr.
21091         (Binary): Optimize a + (-b) into a -b.
21092
21093         * codegen.cs (CodeGen): Made all methods static.
21094
21095 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
21096
21097         * rootcontext.cs: 
21098
21099         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
21100         TypeBuilder property.
21101
21102         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
21103         instead. 
21104
21105         * tree.cs: Removed the various RecordXXXX, and replaced with a
21106         single RecordDecl.  Removed all the accessor methods, and just
21107         left a single access point Type 
21108
21109         * enum.cs: Rename DefineEnum to DefineType.
21110
21111         * decl.cs: New abstract method `DefineType' used to unify the
21112         Defines for Enumerations, Interfaces, TypeContainers and
21113         Delegates.
21114
21115         (FindType): Moved LookupInterfaceOrClass here.  Moved the
21116         LookupBaseClasses method that used to live in class.cs and
21117         interface.cs here, and renamed to FindType.
21118
21119         * delegate.cs: Implement DefineType.  Take advantage of the
21120         refactored pattern for locating the parent builder without taking
21121         the parent_builder argument (which we know does not work if we are
21122         nested, and triggering a toplevel definition).
21123
21124 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
21125
21126         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
21127         accessibility of a member has changed during override and report
21128         an error if so.
21129
21130         * class.cs (Method.Define, Property.Define): Only complain on
21131         overrides if the method is private, any other accessibility is
21132         fine (and since we just checked the permission is the same, we are
21133         good to go).
21134
21135         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
21136         and elif are processed always.  The other pre-processing
21137         directives are only processed if we are "taking" the path
21138
21139 2002-03-29  Martin Baulig  <martin@gnome.org>
21140
21141         * class.cs (Method.Emit): Only emit symbolic debugging info if the
21142         current location is not Null.
21143
21144         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
21145         a separate method so we can profile it.
21146
21147         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
21148         `span.Seconds' are just seconds, but no minutes or hours.
21149         (MainDriver): Profile the CodeGen.SaveSymbols calls.
21150
21151 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
21152
21153         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
21154         Remove the gratuitous set of Final:
21155
21156                                 // If an interface implementation, then we can set Final.
21157                                 if (((flags & MethodAttributes.Abstract) == 0) &&
21158                                     implementing.DeclaringType.IsInterface)
21159                                         flags |= MethodAttributes.Final;
21160
21161         I do not know what I was smoking when I used that.
21162
21163
21164         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
21165         step into fixing the name resolution issues for delegates and
21166         unifying the toplevel name resolution.
21167
21168 2002-03-28  Martin Baulig  <martin@gnome.org>
21169
21170         * class.cs (Method.Emit): If we have a symbol writer, call its
21171         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
21172         tell it about the current method.
21173
21174         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
21175         writer that we're going to emit the first byte of IL code for a new
21176         statement (a new source line).
21177         (EmitContext.EmitTopBlock): If we have a symbol writer, call
21178         EmitContext.Mark() before emitting any code.
21179
21180         * location.cs (SymbolDocument): Return null when we're Null.
21181
21182         * statement.cs (Statement): Moved the `Location loc' variable here.
21183         (Statement.EmitBoolExpression): If we have a symbol writer, call
21184         ec.Mark() before emitting any code to tell it that we're at the
21185         beginning of a new statement.
21186         (StatementExpression): Added `Location' argument to the constructor.
21187         (Block): Added public readonly variable `StartLocation' and public
21188         variable `EndLocation'.  The latter is to be set using SetEndLocation().
21189         (Block): Added constructor which takes a start and end location.
21190         (Block.SetEndLocation): New method. This sets the end location.
21191         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
21192         local variables we create.
21193         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
21194         each statement and do also mark the begin and end of the block.
21195
21196         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
21197         tell it the current lexer.Location, use Location.Null for the end of the
21198         block.
21199         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
21200         current block, set its end location using SetEndLocation().
21201         (statement_expression): StatementExpression constructor now takes the
21202         lexer.Location as additional argument.
21203         (for_statement, declare_local_variables): Likewise.
21204         (declare_local_variables): When creating a new implicit block, use the
21205         new Block constructor and pass it the lexer.Location.
21206
21207 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
21208
21209         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
21210         members also on the parent interfaces recursively.
21211
21212 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
21213
21214         * report.cs: Use new formats, since Gonzalo finished the missing
21215         bits. 
21216
21217         * expression.cs (Binary.ResolveOperator): added missing operator|
21218         operator& and operator^ for bool/bool.
21219
21220         * cs-parser.jay: CheckDef now takes a Location argument that is
21221         used to report errors more precisly (instead of reporting the end
21222         of a definition, we try to track something which is a lot closer
21223         to the source of the problem).
21224
21225         * cs-tokenizer.cs: Track global token use, so we can properly flag
21226         the use of #define/#undef after the first token has been seen.
21227
21228         Also, rename the reportXXXX to Error_DescriptiveName
21229
21230         * decl.cs (DeclSpace.IsTopLevel): Move property here from
21231         TypeContainer, so that Enum and Interface can use this too.
21232
21233         * class.cs (TypeContainer.LookupInterfaceOrClass,
21234         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
21235         `builder' argument.  Typically this was used to pass the parent
21236         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
21237         the definition).  
21238
21239         The problem is that a nested class could trigger the definition of
21240         a toplevel class, and the builder would be obviously wrong in that
21241         case. 
21242
21243         So we drop this argument, and we compute dynamically the
21244         TypeBuilder/ModuleBuilder (the correct information was available
21245         to us anyways from DeclSpace.Parent)
21246
21247         * interface.cs (Interface.DefineInterface): Drop builder
21248         parameter cleanup like class.cs
21249
21250         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
21251         like class.cs
21252
21253         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
21254         values. 
21255
21256         (Try.Emit): Propagate the returns value from the statement.
21257
21258         (Return.Emit): Even if we are leavning 
21259
21260         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
21261
21262         * modifiers.cs: Fix the computation of MethodAttributes flags.
21263
21264 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
21265
21266         * driver.cs: allow compilation of files that start with '/'.
21267         Add a default case when checking the argument of --target.
21268
21269 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
21270
21271         * interface.cs: Implement the same search algorithm for types in
21272         the interface code.
21273
21274         * delegate.cs: Do not allow multiple definition.
21275
21276         * Recovered ChangeLog that got accidentally amputated
21277
21278         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
21279
21280         * rootcontext.cs: Load manually enum to allow core classes to
21281         contain enumerations.
21282
21283         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
21284         Update to new static methods in TypeManager.
21285
21286         * typemanager.cs (GetMethod, GetConstructor): Use our
21287         implementation of FindMembers to find the members, since during
21288         corlib compilation, the types are TypeBuilders and GetMethod and
21289         GetConstructor do not work.
21290
21291         Make all methods in TypeManager static.
21292
21293         (InitCodeHelpers): Split the functionality from
21294         the InitCodeTypes function.
21295
21296         * driver.cs: Call InitCodeHelpers after we have populated the
21297         types. 
21298
21299         * cs-parser.jay (delegate_declaration): we did not used to compute
21300         the delegate name correctly for void delegates.
21301
21302 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
21303
21304         * rootcontext.cs (RootContext): Init the interface_resolve_order
21305         and type_container_resolve_order always.
21306
21307         (ResolveCore, BootstrapCorlib_ResolveClass,
21308         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
21309         compiler when compiling with --nostdlib
21310
21311         * class.cs (TypeContainer.DefineType): Check that our parent is
21312         not null.  This test is most important when we are bootstraping
21313         the core types.
21314
21315         * codegen.cs: Split out the symbol writing code.
21316
21317 2002-03-25  Martin Baulig  <martin@gnome.org>
21318
21319         * driver.cs (-g): Made -g an alias for --debug.
21320
21321 2002-03-24  Martin Baulig  <martin@gnome.org>
21322
21323         * codegen.cs (SymbolWriter): New public variable. Returns the
21324         current symbol writer.
21325         (CodeGen): Added `bool want_debugging_support' argument to the
21326          constructor. If true, tell the ModuleBuild that we want debugging
21327         support and ask it for the ISymbolWriter.
21328         (Save): If we have a symbol writer, call it's Close() method after
21329         saving the assembly.
21330
21331         * driver.c (--debug): New command line argument to create a
21332         debugger information file.
21333
21334         * location.cs (SymbolDocument): New public property. Returns an
21335         ISymbolDocumentWriter object for the current source file or null
21336         if we don't have a symbol writer.
21337
21338 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
21339
21340         * driver.cs (LoadAssembly): Correctly return when all the paths
21341         have been tried and not before.
21342
21343         * statement.cs (Switch.Emit): return the actual coverage for this
21344         statement (returns/not-returns)
21345
21346         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
21347         switch of the statement if we are the last switch section.  That
21348         kills two problems: try/catch problems (we used to emit an empty
21349         nop at the end) and switch statements where all branches would
21350         return. 
21351
21352 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
21353
21354         * driver.cs: Add default assemblies (the equivalent to the
21355         Microsoft CSC.RSP file)
21356
21357         * cs-tokenizer.cs: When updating `cols and setting it to zero,
21358         also update tokens_seen and set it to false.
21359
21360         * driver.cs: Implement --recurse for Mike.
21361
21362         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
21363         correctly splitting out the paths.
21364
21365 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
21366
21367         * interface.cs (Interface.PopulateProperty): Instead of using
21368         `parent' as the declaration space for the set parameters, use
21369         `this' 
21370
21371         * support.cs (InternalParameters): InternalParameters constructor
21372         takes a DeclSpace instead of a TypeContainer.
21373
21374         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
21375         types are being initialized, load the address of it before calling
21376         the function.  
21377
21378         (New): Provide a mechanism to disable the generation of local
21379         value type temporaries when the caller will be providing us with
21380         an address to store it.
21381
21382         (ArrayCreation.EmitDynamicInitializers): Use it.
21383
21384 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
21385
21386         * expression.cs (Invocation.EmitArguments): Only probe for array
21387         property if there is more than one argument.  Sorry about that.
21388
21389         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
21390         empty param arrays.
21391
21392         * class.cs (Method.LabelParameters): Fix incorrect code path that
21393         prevented the `ParamArrayAttribute' from being applied to the
21394         params attribute.
21395
21396 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
21397
21398         * support.cs (ReflectionParameters): Correctly compute whether the
21399         last argument is a params array.  Fixes the problem with
21400         string.Split ('a')
21401
21402         * typemanager.cs: Make the assemblies array always be non-null
21403         (empty, but non-null)
21404
21405         * tree.cs (RecordDecl): New function that abstracts the recording
21406         of names.  This reports error 101, and provides a pointer to the
21407         previous declaration.  Fixes a crash in the compiler.
21408
21409         * cs-parser.jay (constructor_declaration): Update to new grammar,
21410         and provide a constructor_body that can be empty.
21411
21412 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
21413
21414         * driver.cs: Add support for --resources.
21415
21416         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
21417         Make all types for the various array helper methods be integer.
21418
21419         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
21420         CheckState to ConvCast.
21421
21422         (ConvCast): Now it takes a `checked' state argument, to avoid
21423         depending on the emit context for the conversion, and just using
21424         the resolve time setting.
21425
21426         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
21427         instead of Invocation.EmitArguments.  We do not emit the original
21428         arguments, instead we emit those which have been converted to
21429         unsigned int expressions.
21430
21431         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
21432
21433         * codegen.cs: ditto.
21434
21435         * expression.cs (LocalVariableReference): Drop the use of the
21436         Store function that depended on the variable index.
21437
21438         * statement.cs (VariableInfo): Drop the `Idx' property from this
21439         class, as this is not taking into account the indexes for
21440         temporaries tat we generate during the execution, getting the
21441         indexes wrong.
21442
21443         * class.cs: First emit class initializers, then call the parent
21444         constructor. 
21445
21446         * expression.cs (Binary): Fix opcode emision.
21447         (UnaryMutator.EmitCode): Support checked code generation
21448
21449         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
21450         matches for events for both the Static and Instance scans,
21451         pointing to the same element.   Fix that.
21452
21453 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
21454
21455         * rootcontext.cs (ResolveTree): Always set the
21456         interface_resolve_order, because nested interfaces will be calling
21457         into us.
21458
21459         * class.cs (GetInterfaceOrClass): Track the same resolution
21460         process used by TypeManager.LookupType.  This fixes the nested
21461         type lookups in class declarations (separate path from
21462         LookupType). 
21463
21464         (TypeContainer.DefineType): Also define nested interfaces.
21465         (TypeContainer.RegisterOrder): New public function used to
21466         register the order in which child interfaces need to be closed.
21467
21468         Nested interfaces need to be closed after their parents have been
21469         created. 
21470
21471         * interface.cs (InterfaceAttr): Put all the logic for computing
21472         the interface attribute here. 
21473
21474         (DefineInterface): Register our interface order with the
21475         RootContext or with the TypeContainer depending on the case.
21476
21477 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
21478
21479         * cs-parser.jay: rework foreach statement to work with the new
21480         changes to the policy on SimpleNames.
21481
21482         * report.cs: support Stacktrace on warnings as well.
21483
21484         * makefile: drop --unsafe and /unsafe from the compile.
21485
21486 2002-03-13  Ravi Pratap  <ravi@ximian.com>
21487
21488         * ecore.cs (StandardConversionExists): Modify to take an Expression
21489         as the first parameter. Ensure we do null -> reference type conversion
21490         checking.
21491
21492         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
21493         temporary Expression objects.
21494
21495 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
21496
21497         * interface.cs: workaround bug in method overloading resolution
21498         (there is already a bugzilla bug for it).
21499
21500 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
21501
21502         We could also solve this problem by having a separate path for
21503         performing type lookups, instead of DoResolve, we could have a
21504         ResolveType entry point, and only participating pieces of the
21505         production (simplename, deref, array) would implement this. 
21506
21507         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
21508         signal SimpleName to only resolve type names and not attempt to
21509         resolve anything else.
21510
21511         * expression.cs (Cast): Set the flag.
21512
21513         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
21514
21515         * class.cs: Only report 108 if there is no `new' modifier.
21516
21517         * cs-parser.jay: rework foreach statement to work with the new
21518         changes to the policy on SimpleNames.
21519         
21520         * report.cs: support Stacktrace on warnings as well.
21521
21522         * makefile: drop --unsafe and /unsafe from the compile.
21523
21524 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
21525
21526         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21527         lookups here, instead of doing that at parse time.  This means
21528         that our grammar will not introduce `LocalVariableReferences' as
21529         expressions at this point.  That solves the problem of code like
21530         this:
21531
21532         class X {
21533            static void Main ()
21534            { int X = 1;
21535             { X x = null }}}
21536
21537         This is only half the fix.  The full fix requires parameters to
21538         also be handled in this way.
21539
21540         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
21541         makes the use more obvious of the DeclSpace.  The
21542         ec.TypeContainer.TypeBuilder is now only used to pull the
21543         TypeBuilder for it.
21544
21545         My theory is that I can get rid of the TypeBuilder completely from
21546         the EmitContext, and have typecasts where it is used (from
21547         DeclSpace to where it matters).  
21548
21549         The only pending problem is that the code that implements Aliases
21550         is on TypeContainer, and probably should go in DeclSpace.
21551
21552         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21553         lookups here, instead of doing that at parse time.  This means
21554         that our grammar will not introduce `LocalVariableReferences' as
21555         expressions at this point.  That solves the problem of code like
21556         this:
21557
21558         class X {
21559            static void Main ()
21560            { int X = 1;
21561             { X x = null }}}
21562
21563         This is only half the fix.  The full fix requires parameters to
21564         also be handled in this way.
21565
21566         * class.cs (Property.DefineMethod): When implementing an interface
21567         method, set newslot, when implementing an abstract method, do not
21568         set the flag (before we tried never setting it, or always setting
21569         it, which is the difference).
21570         (Indexer.DefineMethod): same.
21571         (Method.DefineMethod): same.
21572
21573         * ecore.cs: Only set the status used flag if we get back a Field.
21574
21575         * attribute.cs: Temporary hack, so Paolo can keep working.
21576
21577 2002-03-08  Ravi Pratap  <ravi@ximian.com>
21578
21579         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
21580         the unmanaged type in the case we have a MarshalAs attribute.
21581
21582         (Resolve): Handle the case when we are parsing the special MarshalAs
21583         attribute [we need to store the unmanaged type to use later]
21584
21585         * typemanager.cs (marshal_as_attr_type): Built in type for the 
21586         MarshalAs Attribute.
21587
21588         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
21589         on parameters and accordingly set the marshalling info.
21590
21591 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
21592
21593         * class.cs: Optimizing slightly by removing redundant code after
21594         we switched to the `NoTypes' return value.
21595         (Property.DefineMethod): use NoTypes here too.
21596
21597         This fixes the bug I introduced in my last batch of changes.
21598
21599 2002-03-05  Ravi Pratap  <ravi@ximian.com>
21600
21601         * tree.cs (RecordEnum): Add. We now keep track of enums too.
21602
21603         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
21604         Enums since those are types too. 
21605
21606         * cs-parser.jay (enum_declaration): Record enums as we parse them.
21607
21608         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
21609         thanks to a call during the lookup process.
21610
21611 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
21612
21613         * statement.cs (Foreach): Lots of work to accomodate a particular
21614         kind of foreach statement that I had not kept in mind.  It is
21615         possible to have foreachs on classes that provide a GetEnumerator
21616         method that return objects that implement the "pattern" for using
21617         a foreach, there is no need to support GetEnumerator
21618         specifically. 
21619
21620         This is needed to compile nant.
21621
21622         * decl.cs: Only report 114 if the member is not `Finalize' and if
21623         the warning level is at least 2.
21624
21625         * class.cs: Moved the compare function from Method to
21626         MethodSignature. 
21627
21628         (MethodSignature.InheritableMemberSignatureCompare): Add new
21629         filter function that is used to extract inheritable methods from a
21630         class. 
21631
21632         (Method.Define): Use the new `inheritable_method_signature_filter'
21633         delegate
21634
21635         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
21636         command. 
21637
21638 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
21639
21640         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
21641
21642         * cs-parser.jay: Add opt_semicolon to the interface declaration.
21643
21644         * expression.cs: Pass location information to
21645         ConvertImplicitStandard. 
21646
21647         * class.cs: Added debugging code to track return values from
21648         interfaces. 
21649
21650 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
21651
21652         * expression.cs (Is.DoResolve): If either side of the `is' is an
21653         interface, do not flag the warning.
21654
21655         * ecore.cs (ImplicitReferenceConversion): We need a separate test
21656         for interfaces
21657
21658         * report.cs: Allow for --fatal to be used with --probe.
21659
21660         * typemanager.cs (NoTypes): Move the definition for the empty Type
21661         array here. 
21662
21663         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
21664         properties. 
21665         (TypeContainer.DefineProxy): New function used to proxy to parent
21666         implementations when implementing interfaces.
21667         (TypeContainer.ParentImplements): used to lookup if our parent
21668         implements a public function that is required by an interface.
21669         (TypeContainer.VerifyPendingMethods): Hook this up.
21670
21671         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
21672         `modules' and `assemblies' arraylists into arrays.  We only grow
21673         these are the very early start up of the program, so this improves
21674         the speedof LookupType (nicely measured).
21675
21676         * expression.cs (MakeByteBlob): Replaced unsafe code with
21677         BitConverter, as suggested by Paolo.
21678
21679         * cfold.cs (ConstantFold.Binary): Special case: perform constant
21680         folding of string concatenation, but if either side is a string,
21681         and the other is not, then return null, and let the runtime use
21682         the concatenation on the string plus the object (using
21683         `Object.ToString'). 
21684
21685 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
21686
21687         Constant Folding has been implemented now.
21688
21689         * expression.cs (Unary.Reduce): Do not throw an exception, catch
21690         the error instead on types that are not supported in one's
21691         complement. 
21692
21693         * constant.cs (Constant and all children): New set of functions to
21694         perform implict and explicit conversions.
21695
21696         * ecore.cs (EnumConstant): Implement the new functions to perform
21697         conversion by proxying to the child expression.
21698
21699         * codegen.cs: (ConstantCheckState): Constant evaluation has its
21700         own separate setting that can not be turned off from the command
21701         line using --unchecked or --checked and is only controlled using
21702         the checked/unchecked statements and expressions.  This setting is
21703         used by the constant folder to flag errors.
21704
21705         * expression.cs (CheckedExpr, UncheckedExpr): Set the
21706         ConstantCheckState as well.   
21707
21708         During Resolve, they also have to flag the state, because the
21709         constant folder runs completely in the Resolve phase.
21710
21711         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
21712         well.
21713
21714 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21715
21716         * cfold.cs: New file, this file contains the constant folder.
21717
21718         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21719         argument to track whether we are using the resulting address to
21720         load or store a value and provide better error messages. 
21721
21722         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21723         new AddressOf arguments.
21724
21725         * statement.cs (Foreach.EmitCollectionForeach): Update
21726
21727         * expression.cs (Argument.Emit): Call AddressOf with proper
21728         arguments to track usage.
21729
21730         (New.DoEmit): Call AddressOf with new arguments.
21731
21732         (Unary.Emit): Adjust AddressOf call.
21733
21734 2002-03-01  Ravi Pratap  <ravi@ximian.com>
21735
21736         * cs-parser.jay (member_access): Change the case for pre-defined types
21737         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
21738         this suggestion.
21739
21740         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21741         a method body.
21742
21743         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21744         essentially like methods and apply attributes like MethodImplOptions to them too.
21745
21746         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21747         not being null.
21748
21749         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21750         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21751         is the DeclSpace.
21752
21753         * Update code everywhere accordingly.
21754
21755         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21756
21757         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21758
21759 2002-02-28  Ravi Pratap  <ravi@ximian.com>
21760
21761         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21762         try performing lookups against those instead of jumping straight into using
21763         the 'using' clauses.
21764
21765         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21766
21767         (LookupType): Perform lookups in implicit parents too.
21768
21769         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21770         sequence as RootContext.LookupType. 
21771
21772         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
21773         the various cases of namespace lookups into this method.
21774
21775 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21776
21777         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21778         in positional arguments)
21779
21780         * class.cs (Operator): Update the AllowedModifiers to contain
21781         extern. 
21782
21783         * cs-parser.jay: Update operator declaration to allow for the
21784         operator body to be empty.
21785
21786         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21787         values. 
21788
21789 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
21790
21791         * class.cs (Method.Emit): Label parameters.
21792
21793         * driver.cs: Return 1 or 0 as the program exit code.
21794
21795 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
21796
21797         * expression.cs: Special case the `null' object when trying to
21798         auto-compute the type, as anything can be explicitly converted to
21799         that. 
21800
21801         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21802         spotting this Paolo.
21803
21804         (Expression.ImplicitNumericConversion): Perform comparissions of
21805         the type using the underlying type in the case of an enumeration
21806         rather than using the enumeration type for the compare.
21807
21808         Cope with the underlying == type case, which is not possible to
21809         catch before. 
21810
21811         (Expression.ConvertNumericExplicit): Perform comparissions of
21812         the type using the underlying type in the case of an enumeration
21813         rather than using the enumeration type for the compare.
21814
21815         * driver.cs: If the user does not supply an extension, assume .exe
21816
21817         * cs-parser.jay (if_statement): Rewrote so that we can track the
21818         location for the if statement.
21819
21820         * expression.cs (Binary.ConstantFold): Only concat strings when
21821         the operation is "+", not everything ;-)
21822
21823         * statement.cs (Statement.EmitBoolExpression): Take a location
21824         argument. 
21825         (If, While, Do): Track location.
21826
21827         * expression.cs (Binary.ResolveOperator): In the object + string
21828         case, I was missing a call to ConvertImplicit
21829
21830 2002-02-25  Ravi Pratap  <ravi@ximian.com>
21831
21832         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21833         Location arguments. Ensure we use RootContext.LookupType to do our work
21834         and not try to do a direct Type.GetType and ModuleBuilder.GetType
21835
21836         * interface.cs (PopulateMethod): Handle the type of the parameter being
21837         null gracefully.
21838
21839         * expression.cs (Invocation.BetterFunction): Handle the case when we 
21840         have a params method with no fixed arguments and a call is made with no
21841         arguments.
21842
21843 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
21844
21845         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21846         the verbatim-string-literal
21847
21848         * support.cs (InternalParameters.ParameterModifier): handle null
21849         fixed parameters.
21850         (InternalParameters.ParameterType): ditto.
21851
21852         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21853         duplicating the name of the variable parameter.
21854         (GetParameterByName): Fix bug where we were not looking up array
21855         paramters if they were the only present (thanks Paolo!).
21856         (GetParameterInfo): We only have an empty set of types if both
21857         fixed and array are set to null.
21858         (GetParameterInfo-idx): Handle FixedParameter == null
21859
21860         * cs-parser.jay: Handle the case where there is no catch
21861         statements (missing null test).
21862
21863 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
21864
21865         * driver.cs (MainDriver): Be conservative on our command line
21866         handling.
21867
21868         Catch DirectoryNotFoundException when calling GetFiles.
21869
21870         (SplitPathAndPattern): Used to split the input specification into
21871         a path and a pattern that we can feed to Directory.GetFiles.
21872
21873 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
21874
21875         * statement.cs (Fixed): Implement the last case of the Fixed
21876         statement (string handling).
21877
21878         * expression.cs (StringPtr): New class used to return a char * to
21879         a string;  Used by the Fixed statement.
21880
21881         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
21882
21883         * expression.cs (Binary.ResolveOperator): Remove redundant
21884         MemberLookup pn parent type.
21885         Optimize union call, we do not need a union if the types are the same.
21886         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21887         type.
21888
21889         Specialize the use of MemberLookup everywhere, instead of using
21890         the default settings. 
21891
21892         (StackAlloc): Implement stackalloc keyword.
21893
21894         * cs-parser.jay: Add rule to parse stackalloc.
21895
21896         * driver.cs: Handle /h, /help, /?
21897
21898         * expression.cs (MakeByteBlob): Removed the hacks we had in place
21899         before we supported unsafe code.
21900
21901         * makefile: add --unsafe to the self compilation of mcs.
21902
21903 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
21904
21905         * expression.cs (PointerArithmetic): New class that is used to
21906         perform pointer arithmetic.
21907         (Binary.Resolve): Handle pointer arithmetic
21908         Handle pointer comparission.
21909         (ArrayPtr): Utility expression class that is used to take the
21910         address of an array.
21911
21912         (ElementAccess): Implement array access for pointers
21913
21914         * statement.cs (Fixed): Implement fixed statement for arrays, we
21915         are missing one more case before we are done.
21916
21917         * expression.cs (Indirection): Implement EmitAssign and set the
21918         ExprClass to Variable.  This allows pointer dereferences to be
21919         treated as variables, and to have values assigned to them.
21920
21921         * ecore.cs (Expression.StoreFromPtr): New utility function to
21922         store values dereferencing.
21923
21924 2002-02-20  Ravi Pratap  <ravi@ximian.com>
21925
21926         * expression.cs (Binary.ResolveOperator): Ensure that we are
21927         not trying to operate on a void type - this fixes the reported
21928         bug.
21929
21930         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21931         the parent implementation is sealed.
21932
21933         * ../errors/cs0239.cs : Add.
21934
21935         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21936
21937         * typemanager.cs (unverifiable_code_type): Corresponds to 
21938         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21939         which have unsafe code in them.
21940
21941         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
21942         unsafe context.
21943
21944 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
21945
21946         * cs-tokenizer.cs: Add support for @"litreal strings"
21947
21948         Make tokenizer accept pre-processor directives
21949         on any column (remove the old C-like limitation). 
21950
21951         * rootcontext.cs (EmitCode): Emit any global attributes.
21952         (AddGlobalAttributes): Used to keep track of assembly attributes. 
21953
21954         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21955
21956         * cs-parser.jay: Add support for global attributes.  
21957
21958 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
21959
21960         * expression.cs (Indirection): New helper class.  Unary will
21961         create Indirection classes to be able to implement the
21962         IMemoryLocation interface on it.
21963
21964 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
21965
21966         * cs-parser.jay (fixed_statement): reference the right statement.
21967
21968         * statement.cs (Fixed.Emit): Finish implementing the fixed
21969         statement for the &x case.
21970
21971 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
21972
21973         * class.cs (Property.Define, Method.Define): Remove newslot when
21974         `implementing'.  
21975
21976         * modifiers.cs: My use of NewSlot when `Abstract' was set was
21977         wrong.  NewSlot should only be used if the `new' keyword is present.
21978
21979         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21980         locating our system dir.  Sorry about this.
21981
21982 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21983
21984         * driver.cs (GetSystemDir): Compute correctly the location of our
21985         system assemblies.  I was using the compiler directory instead of
21986         the library directory.
21987
21988 2002-02-13  Ravi Pratap  <ravi@ximian.com>
21989
21990         * expression.cs (BetterFunction): Put back in what Miguel commented out
21991         since it is the correct fix. The problem is elsewhere ;-)
21992
21993         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21994         parameters of the parms method are themselves compatible or not !
21995
21996         (StandardConversionExists): Fix very dangerous bug where we were forgetting
21997         to check that a class implements an interface before saying that an implicit
21998         conversion was allowed. Use ImplementsInterface to do the checking.
21999
22000 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
22001
22002         * class.cs (Method.Define): Track whether we are an explicit
22003         implementation or not.  And only call DefineMethodOverride if we
22004         are an explicit implementation.
22005
22006         (Property.DefineMethod): Ditto.
22007
22008 2002-02-11  Ravi Pratap  <ravi@ximian.com>
22009
22010         * expression.cs (BetterFunction): Catch hideous bug which was
22011          preventing us from detecting ambiguous calls due to implicit casts i.e
22012         cs0121.
22013
22014 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
22015
22016         * support.cs (Pair): Remove un-needed method.  I figured why I was
22017         getting the error in cs-parser.jay, the variable in a foreach loop
22018         is readonly, and the compiler does not really treat this as a variable.
22019
22020         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
22021         instead of EQUALS in grammar.  
22022
22023         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
22024
22025         * expression.cs (Unary.DoResolve): Check whether the argument is
22026         managed or not.
22027
22028 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
22029
22030         * support.cs: Api for Pair to set a value.  Despite the fact that
22031         the variables are public the MS C# compiler refuses to compile
22032         code that accesses the field if the variable is part of a foreach
22033         statement. 
22034
22035         * statement.cs (Fixed): Begin implementation of the fixed
22036         statement.
22037
22038         (Block.AddVariable): Return the VariableInfo on success and null
22039         on failure instead of true/false. 
22040
22041         * cs-parser.jay (foreach): Catch errors on variables already
22042         defined (we were ignoring this value before) and properly unwind
22043         the block hierarchy
22044
22045         (fixed_statement): grammar for the fixed statement.
22046
22047 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
22048
22049         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
22050         pointer types to be incretemented.
22051
22052         (SizeOf): Implement.
22053
22054         * cs-parser.jay (pointer_member_access): Implement
22055         expr->IDENTIFIER production.
22056
22057         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
22058         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
22059         on safe contexts.
22060
22061         (Unary): Implement indirection.
22062
22063         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
22064         use in non-unsafe context).
22065
22066         (SimpleName.DoResolve): Check for pointers in field access on safe
22067         contexts. 
22068
22069         (Expression.LoadFromPtr): Factor the load-indirect code in this
22070         function.  This was duplicated in UnboxCast and ParameterReference
22071
22072 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
22073
22074         * expression.cs (ComposedCast): report an error if a pointer cast
22075         is used in a safe region.
22076
22077         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
22078         pointer type casts in unsafe context.
22079
22080         * codegen.cs (EmitContext): Set up IsUnsafe.
22081
22082         * cs-parser.jay (non_expression_type): Add productions for pointer
22083         casts. 
22084
22085         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
22086         code.  We should not use force into static mode if the method is
22087         not virtual.  Fixes bug in MIS
22088
22089         * statement.cs (Do.Emit, While.Emit, For.Emit,
22090         Statement.EmitBoolExpression): Add support to Do and While to
22091         propagate infinite loop as `I do return' semantics.
22092
22093         Improve the For case to also test for boolean constants.
22094
22095         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
22096         to the list of attributes we can add.
22097
22098         Remove `EmitContext' argument.
22099
22100         * class.cs (Method.Define): Apply parameter attributes.
22101         (Constructor.Define): Apply parameter attributes.
22102         (MethodCore.LabelParameters): Move here the core of labeling
22103         parameters. 
22104
22105         * support.cs (ReflectionParameters.ParameterModifier,
22106         InternalParameters.ParameterModifier): Use IsByRef on the type and
22107         only return the OUT bit for these parameters instead of in/out/ref
22108         flags.
22109
22110         This is because I miss-understood things.  The ParameterInfo.IsIn
22111         and IsOut represent whether the parameter has the [In] and [Out]
22112         attributes set.  
22113
22114 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
22115
22116         * ecore.cs (FieldExpr.Emit): Release temporaries.
22117
22118         * assign.cs (LocalTemporary.Release): new function.
22119
22120         * codegen.cs (EmitContext.GetTemporaryStorage,
22121         EmitContext.FreeTemporaryStorage): Rework the way we deal with
22122         temporary storage.  Now we can "put back" localbuilders when we
22123         are done with them
22124
22125 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
22126
22127         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
22128         need to make a copy of the variable to generate verifiable code.
22129
22130 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
22131
22132         * driver.cs: Compute dynamically the system directory.
22133
22134         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
22135         Slower, but more generally useful.  Used by the abstract
22136         registering implementation. 
22137
22138         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
22139         the rules for the special rule on Type/instances.  First check if
22140         we have the same name, and if so, try that special static path
22141         rather than the instance path.
22142
22143 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
22144
22145         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
22146         for, while and if.
22147
22148         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
22149         Enum, ValueType, Delegate or Array for non-corlib compiles.
22150
22151         * cs-tokenizer.cs: Catch long identifiers (645)
22152
22153         * typemanager.cs (IndexerPropetyName): Ravi never tested this
22154         piece of code.
22155
22156         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
22157         fix, we were returning too early, so we were not registering
22158         pending methods from abstract classes.
22159
22160         Do not register pending methods if the class is abstract.
22161
22162         * expression.cs (Conditional.DoResolve): Report circular implicit
22163         conversions when we neecd to compute it for conditional
22164         expressions. 
22165
22166         (Is.DoResolve): If the expression is always of the provided type,
22167         flag warning 183.  If the expression can not ever be of the
22168         provided type flag warning 184.
22169
22170         * class.cs: Catch 169 as well.
22171
22172         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
22173         read. 
22174
22175 2002-01-18  Nick Drochak  <ndrochak@gol.com>
22176
22177         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
22178
22179 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
22180
22181         * interface.cs: (PopulateMethod): Check for pointers being defined
22182         only if the unsafe context is active.
22183         (PopulateProperty): ditto.
22184         (PopulateIndexer): ditto.
22185
22186         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
22187         specified.  If pointers are present, make sure that they are
22188         present in an unsafe context.
22189         (Constructor, Constructor.Define): ditto.
22190         (Field, Field.Define): ditto.
22191         (Property, Property.Define): ditto.
22192         (Event, Event.Define): ditto.
22193
22194         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
22195         hashtable if there are classes or structs defined.
22196
22197         * expression.cs (LocalVariableReference.DoResolve): Simplify this
22198         code, as the constant resolution moved.
22199
22200         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
22201         the metadata, so we can flag error 133. 
22202
22203         * decl.cs (MemberCore.UnsafeOK): New function to test that a
22204         pointer is being declared in an unsafe context.
22205
22206 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
22207
22208         * modifiers.cs (Modifiers.Check): Require a Location argument.
22209         Report error 227 for Unsafe use.
22210
22211         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
22212
22213         * statement.cs (For.Emit): If the test is null, then report that
22214         we do `return', as we wont reach anything afterwards.
22215
22216         (Switch.SwitchGoverningType): Track the expression that matched
22217         the conversion.
22218
22219         * driver.cs: Allow negative numbers as an error code to flag.
22220
22221         * cs-parser.jay: Handle 1551.
22222
22223         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
22224
22225 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
22226
22227         * cs-parser.jay: Report 1518 (type declaration can only contain
22228         class, struct, interface, enum or delegate)
22229
22230         (switch_label): Report 1523 (keywords `case' or `default' must
22231         preced code)
22232
22233         (opt_switch_sections): Report 1522 (empty switch)
22234
22235         * driver.cs: Report 1515 (response file specified multiple times)
22236         Report 1516 (Source file specified multiple times).
22237
22238         * expression.cs (Argument.Resolve): Signal 1510
22239
22240         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
22241         access not allowed in static code)
22242
22243 2002-01-11  Ravi Pratap  <ravi@ximian.com>
22244
22245         * typemanager.cs (IsPointerType): Utility method which we are going
22246         to need a lot.
22247
22248         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
22249         the object type, so we take care of that.
22250
22251         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
22252
22253         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
22254         added to non-params parameters :-)
22255
22256         * typemanager.cs (CSharpName): Include 'void' type too. 
22257
22258         (void_ptr_type): Include in the set of core types.
22259
22260         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
22261         duplicating code.
22262
22263         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
22264         an unsafe context.
22265
22266         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
22267         completely forgotten about it.
22268
22269 2002-01-10  Ravi Pratap  <ravi@ximian.com>
22270
22271         * cs-parser.jay (pointer_type): Add. This begins our implementation
22272         of parsing rules for unsafe code.
22273
22274         (unsafe_statement): Implement.
22275
22276         (embedded_statement): Modify to include the above.
22277
22278         * statement.cs (Unsafe): Implement new class for unsafe blocks.
22279
22280         * codegen.cs (EmitContext.InUnsafe): Add. This determines
22281         if the current context is an unsafe one.
22282
22283         * cs-parser.jay (local_variable_pointer_type): Since local variable types
22284         are handled differently, we need separate rules for them.
22285
22286         (local_variable_declaration): Update to use local_variable_pointer_type
22287         to allow variable declarations of unmanaged pointer types.
22288
22289         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
22290         in unsafe contexts.
22291
22292         * ../errors/cs0214.cs : Add.
22293
22294 2002-01-16  Nick Drochak  <ndrochak@gol.com>
22295
22296         * makefile: remove 'response' file when cleaning.
22297
22298 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
22299
22300         * cs-parser.jay: Report 1524.
22301
22302 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
22303
22304         * typemanager.cs (RegisterMethod): drop checking if we have
22305         registered this from here
22306
22307 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
22308
22309         * class.cs (Method.EmitDestructor): Implement calling our base
22310         destructor. 
22311
22312         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
22313         value of InFinally.
22314
22315         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
22316         this routine and will wrap the call in a try/catch block.  Deal
22317         with the case.
22318
22319 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
22320
22321         * ecore.cs (Expression.MemberLookup): instead of taking a
22322         parameter `same_type' that was used to tell whether we could
22323         access private members we compute our containing type from the
22324         EmitContext.
22325
22326         (FieldExpr): Added partial support for volatile fields.  This does
22327         not work for volatile fields exposed from assemblies, as I can not
22328         figure out how to extract the modreq from it.
22329
22330         Updated all the source files to use this.
22331
22332         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
22333         because it is referenced by MemberLookup very often. 
22334
22335 2002-01-09  Ravi Pratap  <ravi@ximian.com>
22336
22337         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
22338         TypeBuilder.GetCustomAttributes to retrieve what we need.
22339
22340         Get rid of redundant default_member_attr_type as this is the same as
22341         default_member_type which already exists.
22342
22343         * interface.cs, attribute.cs : Update accordingly.
22344
22345 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
22346
22347         * typemanager.cs: Enable IndexerPropertyName again.  It does not
22348         work for TYpeBuilders though.  Ravi, can you please fix this?
22349
22350         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
22351
22352         * expression.cs (Argument.Emit): Handle the case of ref objects
22353         being passed to ref functions;  
22354
22355         (ParameterReference.EmitLoad): Loads the content of the pointer
22356         without dereferencing.
22357
22358 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
22359
22360         * cs-tokenizer.cs: Implemented the pre-processing expressions.
22361
22362 2002-01-08  Ravi Pratap  <ravi@ximian.com>
22363
22364         * class.cs (Indexer.DefineMethod): Incorporate the interface
22365         type in the name of the method if we are doing explicit interface
22366         implementation.
22367
22368         * expression.cs (ConversionExists): Remove as it is completely obsolete.
22369
22370         (BetterConversion): Fix extremely trivial bug where we were referring to
22371         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
22372         again !
22373
22374         * ../errors/bug16.cs : Add although we have fixed it.
22375
22376 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
22377
22378         * expression.cs (BaseIndexer): Begin implementation.
22379
22380         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
22381
22382         * cs-parser.jay (indexer_declarator): Use qualified_identifier
22383         production directly to remove a shift/reduce, and implement
22384         explicit interface implementation.
22385
22386         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
22387         after a floating point suffix.
22388
22389         * expression.cs (DoNumericPromotions): Improved the conversion for
22390         uint/uint.  If we have a constant, we avoid doing a typecast to a
22391         larger type.
22392
22393         * class.cs (Indexer): Implement explicit interface implementation
22394         for indexers.
22395
22396 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
22397
22398         * class.cs: make the default instance constructor public and hidebysig.
22399
22400 2001-01-03  Ravi Pratap  <ravi@ximian.com>
22401
22402         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
22403         so we can call it from elsewhere.
22404
22405         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
22406         we emit it internally if the class has a defined indexer; otherwise the user
22407         emits it by decorating the class definition with the DefaultMemberAttribute.
22408
22409         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
22410         attribute is not used on a type which defines an indexer.
22411
22412         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
22413         character when we skip whitespace.
22414
22415         * ../errors/cs0646.cs : Add.
22416
22417 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
22418
22419         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
22420         again. 
22421
22422         * makefile: Add practical target `mcs3.exe' which builds the third
22423         generation compiler. 
22424
22425         * expression.cs (New): Fix structures constructor calling.
22426
22427         * class.cs (Property, Method, Indexer): Emit Final flag on the
22428         method if we are an interface implementation and we are not
22429         abstract. 
22430
22431         * ecore.cs (PropertyExpr): New public field `IsBase', tells
22432         whether this property is referencing a `base' method.
22433
22434         * expression.cs (Invocation.EmitCall): take an extra argument:
22435         is_base, this is used to determine whether the `call' or
22436         `callvirt' opcode should be used.
22437
22438
22439         * delegate.cs: update EmitCall.
22440
22441         * class.cs (Method.Define): Set NewSlot for the cases where we are
22442         not implementing an interface method.
22443
22444         (Property.Define): ditto.
22445
22446 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
22447
22448         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
22449         'r'.  Allows mcs to parse itself fully.
22450
22451 2002-01-02  Ravi Pratap  <ravi@ximian.com>
22452
22453         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
22454         of the number of initializers that require the InitializeArray method.
22455
22456         (CheckIndices): Store the Expression in all cases - not the plain value. Also
22457         update the above field where necessary.
22458
22459         (MakeByteBlob): Update accordingly.
22460
22461         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
22462         greater than 2.
22463
22464         (EmitDynamicInitializers): Update in accordance with the new optimization.
22465
22466         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
22467         same OpCode applies.
22468
22469         * cs-parser.jay : Fix some glaring errors I introduced.
22470
22471 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
22472
22473         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
22474         so that we can check for name clashes there too.
22475
22476         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
22477         for interface indexers.
22478
22479         * interfaces.cs (Define): Emit the default member attribute.
22480
22481         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
22482         variable was being referred to while setting the value ;-)
22483
22484 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
22485
22486         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
22487         byte-by-byte information when we know the data is zero.
22488
22489         Make the block always a multiple of 4, because
22490         DefineInitializedData has a bug.
22491
22492         * assign.cs: Fix, we should assign from the temporary, not from
22493         the source. 
22494
22495         * expression.cs (MakeByteBlob): Fix my incorrect code.
22496
22497 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
22498
22499         * typemanager.cs (EnumToUnderlying): This function is used to get
22500         the underlying type from an enumeration, because it does not
22501         always work. 
22502
22503         * constant.cs: Use the I4_S form for values between -128 and 127.
22504
22505         * statement.cs (Block.LookupLabel): Looks up a label.
22506         (Block): Drop support for labeled blocks.
22507
22508         (LabeledStatement): New kind of statement that represents a label
22509         only.
22510
22511         (Goto): Finally implement this bad boy.
22512
22513         * cs-parser.jay: Update to reflect new mechanism to implement
22514         labels.
22515
22516 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
22517
22518         * codegen.cs (EmitContext.This): a codegen property that keeps the
22519         a single instance of this instead of creating many different this
22520         instances. 
22521
22522         * delegate.cs (Delegate.DoResolve): Update to use the property;
22523
22524         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
22525
22526         * expression.cs (BaseAccess.DoResolve): Ditto.
22527
22528 2001-12-29  Ravi Pratap  <ravi@ximian.com>
22529
22530         * typemanager.cs (methodimpl_attr_type): Add to hold the type
22531         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
22532
22533         (InitCoreTypes): Update accordingly.
22534
22535         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
22536         so we can quickly store the state.
22537
22538         (ApplyAttributes): Set the correct implementation flags
22539         for InternalCall methods.
22540
22541 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
22542
22543         * expression.cs (EmitCall): if a method is not virtual, then do
22544         not use callvirt on it.
22545
22546         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
22547         user defined stuff) requires the use of stobj, which takes an
22548         address on the stack instead of an array and an index.  So emit
22549         the Ldelema operation for it.
22550
22551         (EmitStoreOpcode): Use stobj for valuetypes.
22552
22553         (UnaryMutator.EmitCode): Use the right 1 value depending on
22554         whether we are dealing with int64/uint64, float or doubles.
22555
22556         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
22557         constructors that I implemented last night.
22558
22559         (Constructor.IsDefault): Fix to work properly for static
22560         constructors.
22561
22562         * cs-parser.jay (CheckDef): report method signature errors.
22563         Update error number 103 to be 132.
22564
22565         * decl.cs: New AdditionResult enumeration value: MethodExists.
22566         Although we do this check for methods later on in the semantic
22567         analysis, catching repeated default constructors is so easy that
22568         we catch these here. 
22569
22570         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
22571         promotions code.
22572
22573         (ParameterReference.EmitAssign, Emit): handle
22574         bools as bytes.
22575
22576         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
22577         (ArrayAccess.EmitStoreOpcode): ditto.
22578
22579         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
22580
22581         * expression.cs (MakeByteBlob): Complete all the missing types
22582         (uint, short, ushort, byte, sbyte)
22583
22584         * class.cs: Only init instance field initializers on instance
22585         constructors. 
22586
22587         Rename `constructors' to instance_constructors. 
22588
22589         (TypeContainer.AddConstructor): Only add constructors to the list
22590         if it is not static.
22591
22592         Make sure that we handle default_static_constructor independently
22593         everywhere where we handle instance_constructors
22594
22595 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
22596
22597         * class.cs: Do not lookup or create a base initializer for a
22598         static constructor.
22599
22600         (ConstructorInitializer.Resolve): use the proper type to lookup
22601         for constructors.
22602
22603         * cs-parser.jay: Report error 1585 (modifiers between type and name).
22604
22605         * enum.cs, interface.cs: Remove CloseType, this is taken care by
22606         in DeclSpace. 
22607
22608         * decl.cs: CloseType is now an virtual method, the default
22609         implementation just closes this type.
22610
22611 2001-12-28  Ravi Pratap  <ravi@ximian.com>
22612
22613         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
22614         to PreserveSig by default. Also emit HideBySig on such methods.
22615
22616         Basically, set the defaults to standard values.
22617
22618         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
22619         argument, if candidate is better, it can't be worse than the best !
22620
22621         (Invocation): Re-write bits to differentiate between methods being
22622         applicable in their expanded form and their normal form - for params
22623         methods of course.
22624
22625         Get rid of use_standard everywhere as only standard conversions are allowed
22626         in overload resolution. 
22627
22628         More spec conformance.
22629
22630 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22631
22632         * driver.cs: Add --timestamp, to see where the compiler spends
22633         most of its time.
22634
22635         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
22636         `this' in static code.
22637
22638         (SimpleName.DoResolve): Implement in terms of a helper function
22639         that allows static-references to be passed upstream to
22640         MemberAccess.
22641
22642         (Expression.ResolveWithSimpleName): Resolve specially simple
22643         names when called by MemberAccess to implement the special
22644         semantics. 
22645
22646         (Expression.ImplicitReferenceConversion): Handle conversions from
22647         Null to reference types before others, as Null's type is
22648         System.Object. 
22649
22650         * expression.cs (Invocation.EmitCall): Handle the special case of
22651         calling methods declared on a reference type from a ValueType
22652         (Base classes System.Object and System.Enum)
22653
22654         (MemberAccess.Resolve): Only perform lookups on Enumerations if
22655         the left hand side is a TypeExpr, not on every enumeration. 
22656
22657         (Binary.Resolve): If types are reference types, then do a cast to
22658         object on operators != and == of both arguments.
22659
22660         * typemanager.cs (FindMembers): Extract instance and static
22661         members if requested.
22662
22663         * interface.cs (PopulateProperty): Use void_type instead of null
22664         as the return type for the setter method.
22665
22666         (PopulateIndexer): ditto.
22667
22668 2001-12-27  Ravi Pratap  <ravi@ximian.com>
22669
22670         * support.cs (ReflectionParameters): Fix minor bug where we
22671         were examining the wrong parameter for the ParamArray attribute.
22672
22673         Cope with requests for the type of the parameter at position
22674         greater than the params parameter's. We now return the element
22675         type of the params array as that makes more sense.
22676
22677         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
22678         accordingly as we no longer have to extract the element type
22679         ourselves.
22680
22681         (Invocation.OverloadResolve): Update.
22682
22683 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22684
22685         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
22686         against IEnumerator, test whether the return value is a descendant
22687         of the IEnumerator interface.
22688
22689         * class.cs (Indexer.Define): Use an auxiliary method to implement
22690         the other bits of the method definition.  Begin support for
22691         explicit interface implementation.
22692
22693         (Property.DefineMethod): Use TypeManager.void_type instead of null
22694         for an empty return value.
22695
22696 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
22697
22698         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
22699         dealing with a FieldExpr which is composed of a FieldBuilder, in
22700         the code path we did extract the constant, but we should have
22701         obtained the underlying value to be able to cast it (otherwise we
22702         end up in an infinite loop, this is what Ravi was running into).
22703
22704         (ArrayCreation.UpdateIndices): Arrays might be empty.
22705
22706         (MemberAccess.ResolveMemberAccess): Add support for section
22707         14.5.4.1 that deals with the special case of E.I when E is a type
22708         and something else, that I can be a reference to a static member.
22709
22710         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
22711         handle a particular array type to create byte blobs, it is just
22712         something we dont generate byteblobs for.
22713
22714         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
22715         arguments. 
22716
22717         * location.cs (Push): remove the key from the hashtable that we
22718         are about to add.   This happens for empty files.
22719
22720         * driver.cs: Dispose files after we have parsed them.
22721
22722         (tokenize): new function that only runs the tokenizer on its
22723         input, for speed testing.
22724
22725 2001-12-26  Ravi Pratap  <ravi@ximian.com>
22726
22727         * class.cs (Event.Define): Define the private field only if there
22728         are no accessors defined.
22729
22730         * expression.cs (ResolveMemberAccess): If there is no associated
22731         field with the event, that means we have an event defined with its
22732         own accessors and we should flag error cs0070 since transforming
22733         ourselves into a field is not valid in that case.
22734
22735         * ecore.cs (SimpleName.DoResolve): Same as above.
22736
22737         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22738         and charset to sane values.
22739
22740 2001-12-25  Ravi Pratap  <ravi@ximian.com>
22741
22742         * assign.cs (DoResolve): Perform check on events only if they 
22743         are being accessed outside the declaring type.
22744
22745         * cs-parser.jay (event_declarations): Update rules to correctly
22746         set the type of the implicit parameter etc.
22747
22748         (add_accessor, remove_accessor): Set current local parameters.
22749
22750         * expression.cs (Binary): For delegate addition and subtraction,
22751         cast the return value from the method into the appropriate delegate
22752         type.
22753
22754 2001-12-24  Ravi Pratap  <ravi@ximian.com>
22755
22756         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22757         of these as the workaround is unnecessary.
22758
22759         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22760         delegate data - none of that is needed at all.
22761
22762         Re-write bits to extract the instance expression and the delegate method
22763         correctly.
22764
22765         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
22766         on delegates too.
22767
22768         * attribute.cs (ApplyAttributes): New method to take care of common tasks
22769         of attaching attributes instead of duplicating code everywhere.
22770
22771         * everywhere : Update code to do attribute emission using the above method.
22772
22773 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22774
22775         * expression.cs (IsParamsMethodApplicable): if there are not
22776         parameters, return immediately.
22777
22778         * ecore.cs: The 0 literal can be implicity converted to an enum
22779         type. 
22780
22781         (SimpleName.DoResolve): First lookup the type, then lookup the
22782         members. 
22783
22784         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22785         want to get its address.  If the InstanceExpression is not
22786         addressable, store the result in a temporary variable, then get
22787         the address of it.
22788
22789         * codegen.cs: Only display 219 errors on warning level or above. 
22790
22791         * expression.cs (ArrayAccess): Make it implement the
22792         IMemoryLocation interface.
22793
22794         (Binary.DoResolve): handle the operator == (object a, object b)
22795         and operator != (object a, object b) without incurring into a
22796         BoxedCast (because 5 != o should never be performed).
22797
22798         Handle binary enumerator operators.
22799
22800         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22801         value type, otherwise use Ldelem_ref.
22802
22803         Use precomputed names;
22804
22805         (AddressOf): Implement address of
22806
22807         * cs-parser.jay (labeled_statement): Fix recursive block
22808         addition by reworking the production.
22809
22810         * expression.cs (New.DoEmit): New has a special case:
22811                 
22812                  If we are dealing with a ValueType, we have a few
22813                  situations to deal with:
22814                 
22815                     * The target of New is a ValueType variable, that is
22816                       easy, we just pass this as the variable reference
22817                 
22818                     * The target of New is being passed as an argument,
22819                       to a boxing operation or a function that takes a
22820                       ValueType.
22821                 
22822                       In this case, we need to create a temporary variable
22823                       that is the argument of New.
22824
22825
22826 2001-12-23  Ravi Pratap  <ravi@ximian.com>
22827
22828         * rootcontext.cs (LookupType): Check that current_type is not null before
22829         going about looking at nested types.
22830
22831         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22832         not implement the IAssignMethod interface any more.
22833
22834         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22835         where we tranform them into FieldExprs if they are being resolved from within
22836         the declaring type.
22837
22838         * ecore.cs (SimpleName.DoResolve): Do the same here.
22839
22840         * assign.cs (DoResolve, Emit): Clean up code considerably. 
22841
22842         * ../errors/bug10.cs : Add.
22843
22844         * ../errors/cs0070.cs : Add.
22845
22846         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22847
22848         * assign.cs : Get rid of EventIsLocal everywhere.
22849
22850 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22851
22852         * ecore.cs (ConvertIntLiteral): finished the implementation.
22853
22854         * statement.cs (SwitchLabel): Convert the value we are using as a
22855         key before looking up the table.
22856
22857 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22858
22859         * codegen.cs (EmitTopBlock): Require a Location argument now.
22860
22861         * cs-parser.jay (constructor_declarator): We need to setup
22862         current_local_parameters before we parse the
22863         opt_constructor_initializer, to allow the variables to be bound
22864         to the constructor arguments.
22865
22866         * rootcontext.cs (LookupType): First lookup nested classes in our
22867         class and our parents before we go looking outside our class.
22868
22869         * expression.cs (ConstantFold): Extract/debox the values at the
22870         beginnning. 
22871
22872         * rootcontext.cs (EmitCode): Resolve the constants first before we
22873         resolve the types.  This is not really needed, but it helps debugging.
22874
22875         * statement.cs: report location.
22876
22877         * cs-parser.jay: pass location to throw statement.
22878
22879         * driver.cs: Small bug fix.
22880
22881         * report.cs: Updated format to be 4-zero filled digits.
22882
22883 2001-12-22  Ravi Pratap  <ravi@ximian.com>
22884
22885         * expression.cs (CheckIndices): Fix minor bug where the wrong
22886         variable was being referred to ;-)
22887
22888         (DoEmit): Do not call EmitStaticInitializers when the 
22889         underlying type is System.Object.
22890
22891 2001-12-21  Ravi Pratap  <ravi@ximian.com>
22892
22893         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22894         and do the usual workaround for SRE.
22895
22896         * class.cs (MyEventBuilder.EventType): New member to get at the type
22897         of the event, quickly.
22898
22899         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22900
22901         * assign.cs (Assign.DoResolve): Handle the case when the target
22902         is an EventExpr and perform the necessary checks.
22903
22904         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22905         interface.
22906
22907         (SimpleName.MemberStaticCheck): Include check for EventExpr.
22908
22909         (EventExpr): Set the type in the constructor itself since we 
22910         are meant to be born fully resolved.
22911
22912         (EventExpr.Define): Revert code I wrote earlier.
22913                 
22914         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22915         instance expression is null. The instance expression is a This in that case
22916         or a null, depending on whether it is a static method or not.
22917
22918         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22919         refers to more than one method.
22920
22921         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22922         and accordingly flag errors.
22923
22924 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22925
22926         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22927
22928 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22929
22930         * location.cs (ToString): Provide useful rutine.
22931
22932 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22933
22934         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22935         objects, return the actual integral boxed.
22936
22937         * statement.cs (SwitchLabel): define an ILLabel for each
22938         SwitchLabel. 
22939
22940         (Switch.CheckSwitch): If the value is a Literal, extract
22941         the underlying literal.
22942
22943         Also in the unused hashtable we had, add the SwitchLabel so we can
22944         quickly look this value up.
22945
22946         * constant.cs: Implement a bunch of new constants.  Rewrite
22947         Literal based on this.  Made changes everywhere to adapt to this.
22948
22949         * expression.cs (Expression.MakeByteBlob): Optimize routine by
22950         dereferencing array only once, and also copes with enumrations.
22951
22952         bytes are two bytes wide, not one.
22953
22954         (Cast): Perform constant conversions.
22955
22956         * ecore.cs (TryImplicitIntConversion): Return literals instead of
22957         wrappers to the literals here.
22958
22959         * expression.cs (DoNumericPromotions): long literals can converted
22960         to ulong implicity (this is taken care of elsewhere, but I was
22961         missing this spot).
22962
22963         * ecore.cs (Expression.Literalize): Make the return type Literal,
22964         to improve type checking.
22965
22966         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22967
22968 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22969
22970         * literal.cs: Revert code from ravi that checked the bounds.  The
22971         bounds are sane by the definition of the type itself. 
22972
22973         * typemanager.cs: Fix implementation of ImplementsInterface.  We
22974         need to actually look up in our parent hierarchy for interfaces
22975         implemented. 
22976
22977         * const.cs: Use the underlying type for enumerations
22978
22979         * delegate.cs: Compute the basename for the delegate creation,
22980         that should fix the delegate test case, and restore the correct
22981         Type Lookup semantics in rootcontext
22982
22983         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
22984         referencing a nested type with the Reflection API is using the "+"
22985         sign. 
22986
22987         * cs-parser.jay: Do not require EOF token at the end.
22988
22989 2001-12-20  Ravi Pratap  <ravi@ximian.com>
22990
22991         * rootcontext.cs (LookupType): Concatenate type names with
22992         a '.' instead of a '+' The test suite passes again.
22993
22994         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22995         field of the enumeration.
22996
22997         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22998         the case when the member is an EventExpr.
22999
23000         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
23001         static has an associated instance expression.
23002
23003         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
23004
23005         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
23006
23007         * class.cs (Event.Define): Register event and perform appropriate checks
23008         for error #111.
23009
23010         We define the Add and Remove methods even if the use provides none because
23011         in that case, we provide default implementations ourselves.
23012
23013         Define a private field of the type of the event. This is done by the CSC compiler
23014         and we should be doing it too ;-)
23015
23016         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
23017         More methods we use in code we generate.
23018
23019         (multicast_delegate_type, delegate_type): Two separate types since the distinction
23020         is important.
23021
23022         (InitCoreTypes): Update accordingly for the above.
23023
23024         * class.cs (Event.Emit): Generate code for default accessors that we provide
23025
23026         (EmitDefaultMethod): Do the job in the above.
23027
23028         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
23029         appropriate place.
23030
23031 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
23032
23033         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
23034         builders even if we were missing one.
23035
23036         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
23037         pass the Basename as our class name instead of the Name.  The
23038         basename will be correctly composed for us.
23039
23040         * parameter.cs (Paramters): Now takes a Location argument.
23041
23042         * decl.cs (DeclSpace.LookupType): Removed convenience function and
23043         make all the code call directly LookupType in RootContext and take
23044         this chance to pass the Location information everywhere.
23045
23046         * Everywhere: pass Location information.
23047
23048 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
23049
23050         * class.cs (Constructor.Define): Updated way of detecting the
23051         length of the parameters.
23052
23053         (TypeContainer.DefineType): Use basename as the type name for
23054         nested types.
23055
23056         (TypeContainer.Define): Do not recursively define types here, as
23057         definition is taken care in order by the RootContext.
23058
23059         * tree.cs: Keep track of namespaces in a per-file basis.
23060
23061         * parameter.cs (Parameter.ComputeSignature): Update to use
23062         DeclSpace. 
23063
23064         (Parameters.GetSignature): ditto.
23065
23066         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
23067         instead of a TypeContainer.
23068
23069         (Interface.SemanticAnalysis): Use `this' instead of our parent to
23070         resolve names.  Because we need to be resolve in our context, not
23071         our parents.
23072
23073         * driver.cs: Implement response files.
23074
23075         * class.cs (TypeContainer.DefineType): If we are defined, do not
23076         redefine ourselves.
23077
23078         (Event.Emit): Emit the code for add/remove handlers.
23079         (Event.Define): Save the MethodBuilders for add/remove.
23080
23081         * typemanager.cs: Use pair here too.
23082
23083         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
23084         DictionaryEntry requires the first argument to be non-null.  
23085
23086         (enum_declaration): Compute full name for registering the
23087         enumeration.
23088
23089         (delegate_declaration): Instead of using
23090         formal_parameter_list, use opt_formal_parameter_list as the list
23091         can be empty.
23092
23093         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
23094         (EventParsing): New property that controls whether `add' and
23095         `remove' are returned as tokens or identifiers (for events);
23096
23097 2001-12-19  Ravi Pratap  <ravi@ximian.com>
23098
23099         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
23100         use MyEventBuilder only and let it wrap the real builder for us.
23101
23102         (MyEventBuilder): Revamp constructor etc.
23103
23104         Implement all operations that we perform on EventBuilder in precisely the same
23105         way here too.
23106
23107         (FindMembers): Update to use the EventBuilder member.
23108
23109         (Event.Emit): Update accordingly.
23110
23111 2001-12-18  Ravi Pratap  <ravi@ximian.com>
23112
23113         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
23114         by calling the appropriate methods.
23115
23116         (GetCustomAttributes): Make stubs as they cannot possibly do anything
23117         useful.
23118
23119         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
23120
23121 2001-12-17  Ravi Pratap  <ravi@ximian.com>
23122
23123         * delegate.cs (Delegate.Populate): Check that the return type
23124         and various parameters types are indeed accessible.
23125
23126         * class.cs (Constructor.Define): Same here.
23127
23128         (Field.Define): Ditto.
23129
23130         (Event.Define): Ditto.
23131
23132         (Operator.Define): Check that the underlying Method defined itself
23133         correctly - so it's MethodBuilder should not be null.
23134
23135         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
23136         expression happens to be null.
23137
23138         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
23139         members but as of now we don't seem to be able to do anything really useful with it.
23140
23141         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
23142         not the EventBuilder.
23143
23144 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
23145
23146         * cs-tokenizer.cs: Add support for defines.
23147         Add support for #if, #elif, #else, #endif
23148
23149         (eval_var): evaluates a variable.
23150         (eval): stubbed for evaluating functions.
23151
23152         * cs-parser.jay: Pass the defines information
23153
23154         * driver.cs: Add --define command line option.
23155
23156         * decl.cs: Move MemberCore here.
23157
23158         Make it the base class for DeclSpace.  This allows us to catch and
23159         report 108 and 109 for everything now.
23160
23161         * class.cs (TypeContainer.Define): Extract all the members
23162         before populating and emit the warning 108 (new keyword required
23163         to override) instead of having each member implement this.
23164
23165         (MemberCore.Define): New abstract method, we will be using this in
23166         the warning reporting engine in Populate.
23167
23168         (Operator.Define): Adjust to new MemberCore protocol. 
23169
23170         * const.cs (Const): This does not derive from Expression, it is a
23171         temporary object we use to create fields, it is a MemberCore. 
23172
23173         * class.cs (Method.Define): Allow the entry point to be in a
23174         specific class.
23175
23176         * driver.cs: Rewrite the argument handler to clean it up a bit.
23177
23178         * rootcontext.cs: Made it just an auxiliary namespace feature by
23179         making everything static.
23180
23181         * driver.cs: Adapt code to use RootContext type name instead of
23182         instance variable.
23183
23184         * delegate.cs: Remove RootContext argument.
23185
23186         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
23187         argument. 
23188
23189         * class.cs (Event.Define): The lookup can fail.
23190
23191         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
23192
23193         * expression.cs: Resolve the this instance before invoking the code.
23194
23195 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
23196
23197         * cs-parser.jay: Add a production in element_access that allows
23198         the thing to become a "type" reference.  This way we can parse
23199         things like "(string [])" as a type.
23200
23201         Note that this still does not handle the more complex rules of
23202         casts. 
23203
23204
23205         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
23206
23207         * ecore.cs: (CopyNewMethods): new utility function used to
23208         assemble the list of methods from running FindMembers.
23209
23210         (MemberLookup): Rework FindMembers so that 
23211
23212 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
23213
23214         * class.cs (TypeContainer): Remove Delegates who fail to be
23215         defined.
23216
23217         * delegate.cs (Populate): Verify that we dont get null return
23218         values.   TODO: Check for AsAccessible.
23219
23220         * cs-parser.jay: Use basename to emit error 574 (destructor should
23221         have the same name as container class), not the full name.
23222
23223         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
23224         possible representation.  
23225
23226         Also implements integer type suffixes U and L.
23227
23228 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
23229
23230         * expression.cs (ArrayCreation.DoResolve): We need to do the
23231         argument resolution *always*.
23232
23233         * decl.cs: Make this hold the namespace.  Hold the root context as
23234         well.
23235         (LookupType): Move here.
23236
23237         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
23238
23239         * location.cs (Row, Name): Fixed the code, it was always returning
23240         references to the first file.
23241
23242         * interface.cs: Register properties defined through interfaces.
23243
23244         * driver.cs: Add support for globbing on the command line
23245
23246         * class.cs (Field): Make it derive from MemberCore as well.
23247         (Event): ditto.
23248
23249 2001-12-15  Ravi Pratap  <ravi@ximian.com>
23250
23251         * class.cs (Event::Define): Check that the type of the event is a delegate
23252         type else flag error #66.
23253
23254         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
23255         same.
23256
23257         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
23258         values of EntryPoint, CharSet etc etc.
23259
23260         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
23261
23262         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
23263         be null and we should ignore this. I am not sure if this is really clean. Apparently,
23264         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
23265         which needs this to do its work.
23266
23267         * ../errors/cs0066.cs : Add.
23268
23269 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
23270
23271         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
23272         helper functions.
23273
23274         * class.cs: (MethodSignature.MethodSignature): Removed hack that
23275         clears out the parameters field.
23276         (MemberSignatureCompare): Cleanup
23277
23278         (MemberCore): New base class used to share code between MethodCore
23279         and Property.
23280
23281         (RegisterRequiredImplementations) BindingFlags.Public requires
23282         either BindingFlags.Instace or Static.  Use instance here.
23283
23284         (Property): Refactored code to cope better with the full spec.
23285
23286         * parameter.cs (GetParameterInfo): Return an empty array instead
23287         of null on error.
23288
23289         * class.cs (Property): Abstract or extern properties have no bodies.
23290
23291         * parameter.cs (GetParameterInfo): return a zero-sized array.
23292
23293         * class.cs (TypeContainer.MethodModifiersValid): Move all the
23294         method modifier validation to the typecontainer so we can reuse
23295         this on properties.
23296
23297         (MethodCore.ParameterTypes): return an empty sized array of types.
23298
23299         (Property.Define): Test property modifier validity.
23300
23301         Add tests for sealed/override too.
23302
23303         (Method.Emit): abstract or extern methods have no bodies.
23304
23305 2001-12-14  Ravi Pratap  <ravi@ximian.com>
23306
23307         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
23308         thing.
23309
23310         (Method::Define, ::Emit): Modify accordingly.
23311
23312         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
23313
23314         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
23315
23316         * makefile: Pass in /unsafe.
23317
23318 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
23319
23320         * class.cs (MakeKey): Kill routine.
23321
23322         * class.cs (TypeContainer.Define): Correctly define explicit
23323         method implementations (they require the full interface name plus
23324         the method name).
23325
23326         * typemanager.cs: Deply the PtrHashtable here and stop using the
23327         lame keys.  Things work so much better.
23328
23329         This of course broke everyone who depended on `RegisterMethod' to
23330         do the `test for existance' test.  This has to be done elsewhere.
23331
23332         * support.cs (PtrHashtable): A hashtable that avoid comparing with
23333         the object stupid Equals method (because, that like fails all over
23334         the place).  We still do not use it.
23335
23336         * class.cs (TypeContainer.SetRequiredInterface,
23337         TypeContainer.RequireMethods): Killed these two routines and moved
23338         all the functionality to RegisterRequiredImplementations.
23339
23340         (TypeContainer.RegisterRequiredImplementations): This routine now
23341         registers all the implementations required in an array for the
23342         interfaces and abstract methods.  We use an array of structures
23343         which can be computed ahead of time to reduce memory usage and we
23344         also assume that lookups are cheap as most classes will not
23345         implement too many interfaces.
23346
23347         We also avoid creating too many MethodSignatures.
23348
23349         (TypeContainer.IsInterfaceMethod): Update and optionally does not
23350         clear the "pending" bit if we find that there are problems with
23351         the declaration.
23352
23353         (TypeContainer.VerifyPendingMethods): Update to report errors of
23354         methods that look like implementations but are not.
23355
23356         (TypeContainer.Define): Add support for explicit interface method
23357         implementation. 
23358
23359 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
23360
23361         * typemanager.cs: Keep track of the parameters here instead of
23362         being a feature of the TypeContainer.
23363
23364         * class.cs: Drop the registration of parameters here, as
23365         InterfaceMethods are also interface declarations.
23366
23367         * delegate.cs: Register methods with the TypeManager not only with
23368         the TypeContainer.  This code was buggy.
23369
23370         * interface.cs: Full registation here.
23371
23372 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
23373
23374         * expression.cs: Remove reducer for binary expressions, it can not
23375         be done this way.
23376
23377         * const.cs: Put here the code that used to go into constant.cs
23378
23379         * constant.cs: Put here the code for constants, this is a new base
23380         class for Literals.
23381
23382         * literal.cs: Make Literal derive from Constant.
23383
23384 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
23385
23386         * statement.cs (Return.Emit): Report error 157 if the user
23387         attempts to return from a finally block.
23388
23389         (Return.Emit): Instead of emitting a return, jump to the end of
23390         the function.
23391
23392         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
23393         LocalBuilder to store the result of the function.  ReturnLabel is
23394         the target where we jump.
23395
23396
23397 2001-12-09  Radek Doulik  <rodo@ximian.com>
23398
23399         * cs-parser.jay: remember alias in current namespace
23400
23401         * ecore.cs (SimpleName::DoResolve): use aliases for types or
23402         namespaces
23403
23404         * class.cs (LookupAlias): lookup alias in my_namespace
23405
23406         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
23407         aliases hashtable
23408         (LookupAlias): lookup alias in this and if needed in parent
23409         namespaces
23410
23411 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
23412
23413         * support.cs: 
23414
23415         * rootcontext.cs: (ModuleBuilder) Made static, first step into
23416         making things static.  I need this to avoid passing the
23417         TypeContainer when calling ParameterType.
23418
23419         * support.cs (InternalParameters.ParameterType): Remove ugly hack
23420         that did string manipulation to compute the type and then call
23421         GetType.  Use Parameter.ParameterType instead.
23422
23423         * cs-tokenizer.cs: Consume the suffix for floating values.
23424
23425         * expression.cs (ParameterReference): figure out whether this is a
23426         reference parameter or not.  Kill an extra variable by computing
23427         the arg_idx during emission.
23428
23429         * parameter.cs (Parameters.GetParameterInfo): New overloaded
23430         function that returns whether a parameter is an out/ref value or not.
23431
23432         (Parameter.ParameterType): The type of the parameter (base,
23433         without ref/out applied).
23434
23435         (Parameter.Resolve): Perform resolution here.
23436         (Parameter.ExternalType): The full type (with ref/out applied).
23437
23438         * statement.cs (Using.Emit, Using.EmitExpression): Implement
23439         support for expressions on the using statement.
23440
23441 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
23442
23443         * statement.cs (Using.EmitLocalVariableDecls): Split the
23444         localvariable handling of the using statement.
23445
23446         (Block.EmitMeta): Keep track of variable count across blocks.  We
23447         were reusing slots on separate branches of blocks.
23448
23449         (Try.Emit): Emit the general code block, we were not emitting it. 
23450
23451         Check the type of the declaration to be an IDisposable or
23452         something that can be implicity converted to it. 
23453
23454         Emit conversions if required.
23455
23456         * ecore.cs (EmptyExpression): New utility class.
23457         (Expression.ImplicitConversionExists): New utility function.
23458
23459 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
23460
23461         * statement.cs (Using): Implement.
23462
23463         * expression.cs (LocalVariableReference): Support read only variables.
23464
23465         * statement.cs: Remove the explicit emit for the Leave opcode.
23466         (VariableInfo): Add a readonly field.
23467
23468 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
23469
23470         * ecore.cs (ConvCast): new class used to encapsulate the various
23471         explicit integer conversions that works in both checked and
23472         unchecked contexts.
23473
23474         (Expression.ConvertNumericExplicit): Use new ConvCast class to
23475         properly generate the overflow opcodes.
23476
23477 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
23478
23479         * statement.cs: The correct type for the EmptyExpression is the
23480         element_type, not the variable type.  Ravi pointed this out.
23481
23482 2001-12-04  Ravi Pratap  <ravi@ximian.com>
23483
23484         * class.cs (Method::Define): Handle PInvoke methods specially
23485         by using DefinePInvokeMethod instead of the usual one.
23486
23487         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
23488         above to do the task of extracting information and defining the method.
23489
23490 2001-12-04  Ravi Pratap  <ravi@ximian.com>
23491
23492         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
23493         of the condition for string type.
23494
23495         (Emit): Move that here. 
23496
23497         (ArrayCreation::CheckIndices): Keep string literals in their expression
23498         form.
23499
23500         (EmitDynamicInitializers): Handle strings appropriately.
23501
23502 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
23503
23504         * codegen.cs (EmitContext): Replace multiple variables with a
23505         single pointer to the current Switch statement.
23506
23507         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
23508         EmitContext.
23509
23510 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
23511
23512         * statement.cs 
23513
23514         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
23515         default'.
23516
23517         (Foreach.Emit): Foreach on arrays was not setting
23518         up the loop variables (for break/continue).
23519
23520         (GotoCase): Semi-implented.
23521
23522 2001-12-03  Ravi Pratap  <ravi@ximian.com>
23523
23524         * attribute.cs (CheckAttribute): Handle system attributes by using
23525         Attribute.GetAttributes to examine information we need.
23526
23527         (GetValidPlaces): Same here.
23528
23529         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
23530
23531         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
23532
23533         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
23534
23535         (Method::Define): Set appropriate flags if we have a DllImport attribute.
23536
23537         (Method::Emit): Handle the case when we are a PInvoke method.
23538
23539 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
23540
23541         * expression.cs: Use ResolveWithSimpleName on compound names.
23542
23543 2001-12-02  Ravi Pratap  <ravi@ximian.com>
23544
23545         * constant.cs (EmitConstant): Make sure we resolve the associated expression
23546         before trying to reduce it.
23547
23548         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
23549
23550         * constant.cs (LookupConstantValue): Implement.
23551
23552         (EmitConstant): Use the above in emitting the constant.
23553
23554         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
23555         that are user-defined by doing a LookupConstantValue on them.
23556
23557         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
23558         too, like above.
23559
23560 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
23561
23562         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
23563
23564         (BaseAccess.DoResolve): Implement.
23565
23566         (MemberAccess.DoResolve): Split this routine into a
23567         ResolveMemberAccess routine that can be used independently
23568
23569 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
23570
23571         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
23572         As that share bits of the implementation.  Is returns a boolean,
23573         while As returns the Type that is being probed.
23574
23575 2001-12-01  Ravi Pratap  <ravi@ximian.com>
23576
23577         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
23578         instead of a Literal - much easier.
23579
23580         (EnumInTransit): Remove - utterly useless :-)
23581
23582         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
23583
23584         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
23585
23586         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
23587         chain when we have no associated expression.
23588
23589 2001-11-30  Ravi Pratap  <ravi@ximian.com>
23590
23591         * constant.cs (Define): Use Location while reporting the errror.
23592
23593         Also emit a warning when 'new' is used and there is no inherited
23594         member to hide.
23595
23596         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
23597         populated.
23598
23599         (LookupEnumValue): Implement to lookup an enum member's value and define it
23600         if necessary.
23601
23602         (Populate): Re-write accordingly to use the above routine.
23603
23604 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
23605
23606         * expression.cs (This): Fix prototype for DoResolveLValue to
23607         override the base class DoResolveLValue.
23608
23609         * cs-parser.cs: Report errors cs574 and cs575 (destructor
23610         declarations) 
23611
23612         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
23613         (we need to load the address of the field here).  This fixes
23614         test-22. 
23615
23616         (FieldExpr.DoResolveLValue): Call the DoResolve
23617         function to initialize the Instance expression.
23618
23619         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
23620         correctly the GetEnumerator operation on a value type.
23621
23622         * cs-parser.jay: Add more simple parsing error catches.
23623
23624         * statement.cs (Switch): Add support for string switches.
23625         Handle null specially.
23626
23627         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
23628
23629 2001-11-28  Ravi Pratap  <ravi@ximian.com>
23630
23631         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
23632
23633         (declare_local_constant): New helper function.
23634
23635         * statement.cs (AddConstant): Keep a separate record of constants
23636
23637         (IsConstant): Implement to determine if a variable is a constant.
23638
23639         (GetConstantExpression): Implement.
23640
23641         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
23642
23643         * statement.cs (IsVariableDefined): Re-write.
23644
23645 2001-11-27  Ravi Pratap  <ravi@ximian.com>
23646
23647         * class.cs (TypeContainer::FindMembers): Look for constants
23648         in the case when we are looking for MemberTypes.Field
23649
23650         * expression.cs (MemberAccess::DoResolve): Check that in the
23651         case we are a FieldExpr and a Literal, we are not being accessed
23652         by an instance reference.
23653
23654         * cs-parser.jay (local_constant_declaration): Implement.
23655
23656         (declaration_statement): Implement for constant declarations.
23657
23658 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
23659
23660         * statement.cs (Switch): Catch double defaults.
23661
23662         (Switch): More work on the switch() statement
23663         implementation.  It works for integral values now, need to finish
23664         string support.
23665
23666
23667 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23668
23669         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
23670         integer literals into other integer literals.  To be used by
23671         switch. 
23672
23673 2001-11-24  Ravi Pratap  <ravi@ximian.com>
23674
23675         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
23676         some memory.
23677
23678         (EmitDynamicInitializers): Cope with the above since we extract data
23679         directly from ArrayData now.
23680
23681         (ExpectInitializers): Keep track of whether initializers are mandatory
23682         or not.
23683
23684         (Bounds): Make it a hashtable to prevent the same dimension being 
23685         recorded for every element in that dimension.
23686
23687         (EmitDynamicInitializers): Fix bug which prevented the Set array method
23688         from being found.
23689
23690         Also fix bug which was causing the indices to be emitted in the reverse
23691         order.
23692
23693 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23694
23695         * expression.cs (ArrayCreation): Implement the bits that Ravi left
23696         unfinished.  They do not work, because the underlying code is
23697         sloppy.
23698
23699 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23700
23701         * cs-parser.jay: Remove bogus fixme.
23702
23703         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
23704         on Switch statement.
23705
23706 2001-11-23  Ravi Pratap  <ravi@ximian.com>
23707
23708         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
23709         the same. 
23710
23711         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
23712         parameter. Apparently, any expression is allowed. 
23713
23714         (ValidateInitializers): Update accordingly.
23715
23716         (CheckIndices): Fix some tricky bugs thanks to recursion.
23717
23718         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
23719         I was being completely brain-dead.
23720
23721         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23722         and re-write acordingly.
23723
23724         (DelegateInvocation): Re-write accordingly.
23725
23726         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23727
23728         (MakeByteBlob): Handle types more correctly.
23729
23730         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23731         initialization from expressions but it is incomplete because I am a complete
23732         Dodo :-|
23733
23734 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23735
23736         * statement.cs (If.Emit): Fix a bug that generated incorrect code
23737         on If.  Basically, we have to return `true' (ie, we do return to
23738         our caller) only if both branches of the if return.
23739
23740         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23741         short-circuit operators, handle them as short circuit operators. 
23742
23743         (Cast.DoResolve): Resolve type.
23744         (Cast.Cast): Take an expression as the target type.
23745
23746         * cs-parser.jay (cast_expression): Remove old hack that only
23747         allowed a limited set of types to be handled.  Now we take a
23748         unary_expression and we resolve to a type during semantic
23749         analysis.
23750
23751         Use the grammar productions from Rhys to handle casts (this is
23752         not complete like Rhys syntax yet, we fail to handle that corner
23753         case that C# has regarding (-x), but we will get there.
23754
23755 2001-11-22  Ravi Pratap  <ravi@ximian.com>
23756
23757         * class.cs (EmitFieldInitializer): Take care of the case when we have a
23758         field which is an array type.
23759
23760         * cs-parser.jay (declare_local_variables): Support array initialization too.
23761
23762         * typemanager.cs (MakeKey): Implement.
23763
23764         (everywhere): Use the above appropriately.
23765
23766         * cs-parser.jay (for_statement): Update for array initialization while
23767         declaring variables.
23768
23769         * ecore.cs : The error message was correct, it's the variable's names that
23770         were misleading ;-) Make the code more readable.
23771
23772         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23773         the correct type etc.
23774
23775         (ConvertExplicit): Handle Enum types by examining the underlying type.
23776
23777 2001-11-21  Ravi Pratap  <ravi@ximian.com>
23778
23779         * parameter.cs (GetCallingConvention): Always return
23780         CallingConventions.Standard for now.
23781
23782 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23783
23784         * expression.cs (Binary.ResolveOperator): Update the values of `l'
23785         and `r' after calling DoNumericPromotions.
23786
23787         * ecore.cs: Fix error message (the types were in the wrong order).
23788
23789         * statement.cs (Foreach.ProbeCollectionType): Need to pass
23790         BindingFlags.Instance as well 
23791
23792         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23793         implicit int literal conversion in an empty cast so that we
23794         propagate the right type upstream.
23795
23796         (UnboxCast): new class used to unbox value types.
23797         (Expression.ConvertExplicit): Add explicit type conversions done
23798         by unboxing.
23799
23800         (Expression.ImplicitNumericConversion): Oops, forgot to test for
23801         the target type before applying the implicit LongLiterals to ULong
23802         literal cast.
23803
23804 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
23805
23806         * cs-parser.jay (for_statement): Reworked the way For works: now
23807         we declare manually any variables that are introduced in
23808         for_initializer to solve the problem of having out-of-band code
23809         emition (that is what got for broken).
23810
23811         (declaration_statement): Perform the actual variable declaration
23812         that used to be done in local_variable_declaration here.
23813
23814         (local_variable_declaration): Do not declare anything, just pass
23815         the information on a DictionaryEntry
23816
23817 2001-11-20  Ravi Pratap  <ravi@ximian.com>
23818
23819         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23820         re-write of the logic to now make it recursive.
23821
23822         (UpdateIndices): Re-write accordingly.
23823
23824         Store element data in a separate ArrayData list in the above methods.
23825
23826         (MakeByteBlob): Implement to dump the array data into a byte array.
23827
23828 2001-11-19  Ravi Pratap  <ravi@ximian.com>
23829
23830         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23831         into CheckIndices.
23832
23833         * constant.cs (Define): Implement.
23834
23835         (EmitConstant): Re-write fully.
23836
23837         Pass in location info.
23838
23839         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23840         respectively.
23841
23842         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23843         DictionaryEntry since we need location info too.
23844
23845         (constant_declaration): Update accordingly.
23846
23847         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23848         code into another method : UpdateIndices.
23849
23850 2001-11-18  Ravi Pratap  <ravi@ximian.com>
23851
23852         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23853         some type checking etc.
23854
23855 2001-11-17  Ravi Pratap  <ravi@ximian.com>
23856
23857         * expression.cs (ArrayCreation::ValidateInitializers): Implement
23858         bits to provide dimension info if the user skips doing that.
23859
23860         Update second constructor to store the rank correctly.
23861
23862 2001-11-16  Ravi Pratap  <ravi@ximian.com>
23863
23864         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23865         and try to implement.
23866
23867         * ../errors/cs0150.cs : Add.
23868
23869         * ../errors/cs0178.cs : Add.
23870
23871 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
23872
23873         * statement.cs: Implement foreach on multi-dimensional arrays. 
23874
23875         * parameter.cs (Parameters.GetParameterByName): Also lookup the
23876         name of the params argument.
23877
23878         * expression.cs: Use EmitStoreOpcode to get the right opcode while
23879         initializing the array.
23880
23881         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23882         we can use this elsewhere.
23883
23884         * statement.cs: Finish implementation of foreach for single
23885         dimension arrays.
23886
23887         * cs-parser.jay: Use an out-of-band stack to pass information
23888         around, I wonder why I need this.
23889
23890         foreach_block: Make the new foreach_block the current_block.
23891
23892         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23893         function used to return a static Parameters structure.  Used for
23894         empty parameters, as those are created very frequently.
23895
23896         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23897
23898 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23899
23900         * interface.cs : Default modifier is private, not public. The
23901         make verify test passes again.
23902
23903 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23904
23905         * support.cs (ReflectionParameters): Fix logic to determine
23906         whether the last parameter is a params one. Test 9 passes again.
23907
23908         * delegate.cs (Populate): Register the builders we define with
23909         RegisterParameterForBuilder. Test 19 passes again.
23910
23911         * cs-parser.jay (property_declaration): Reference $6 instead
23912         of $$ to get at the location.
23913
23914         (indexer_declaration): Similar stuff.
23915
23916         (attribute): Ditto.
23917
23918         * class.cs (Property): Register parameters for the Get and Set methods
23919         if they exist. Test 23 passes again.
23920
23921         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23922         call to EmitArguments as we are sure there aren't any params arguments. 
23923         Test 32 passes again.
23924
23925         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23926         IndexOutOfRangeException. 
23927
23928         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23929         Test 33 now passes again.
23930
23931 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
23932
23933         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23934         broke a bunch of things.  Will have to come up with a better way
23935         of tracking locations.
23936
23937         * statement.cs: Implemented foreach for single dimension arrays.
23938
23939 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23940
23941         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23942         an error.  This removes the lookup from the critical path.
23943
23944         * cs-parser.jay: Removed use of temporary_loc, which is completely
23945         broken. 
23946
23947 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
23948
23949         * support.cs (ReflectionParameters.ParameterModifier): Report
23950         whether the argument is a PARAMS argument or not.
23951
23952         * class.cs: Set the attribute `ParamArrayAttribute' on the
23953         parameter argument.
23954
23955         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23956         and cons_param_array_attribute (ConstructorInfo for
23957         ParamArrayAttribute)., 
23958
23959         * codegen.cs: Emit the return using the `Return' statement, that
23960         way we can report the error correctly for missing return values. 
23961
23962         * class.cs (Method.Emit): Clean up.
23963
23964         * expression.cs (Argument.Resolve): Take another argument: the
23965         location where this argument is used.  Notice that this is not
23966         part of the "Argument" class as to reduce the size of the
23967         structure (we know the approximate location anyways).
23968
23969         Test if the argument is a variable-reference, if not, then
23970         complain with a 206.
23971
23972         (Argument.Emit): Emit addresses of variables.
23973
23974         (Argument.FullDesc): Simplify.
23975
23976         (Invocation.DoResolve): Update for Argument.Resolve.
23977
23978         (ElementAccess.DoResolve): ditto.
23979
23980         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23981         method should be virtual, as this method is always virtual.
23982
23983         (NewDelegate.DoResolve): Update for Argument.Resolve.
23984
23985         * class.cs (ConstructorInitializer.DoResolve): ditto.
23986
23987         * attribute.cs (Attribute.Resolve): ditto.
23988
23989 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
23990
23991         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23992
23993         * expression.cs (ParameterReference): Drop IStackStorage and implement
23994         IAssignMethod instead. 
23995
23996         (LocalVariableReference): ditto.
23997
23998         * ecore.cs (FieldExpr): Drop IStackStorage and implement
23999         IAssignMethod instead. 
24000
24001 2001-11-13  Miguel de Icaza <miguel@ximian.com>
24002
24003         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
24004         enumerations that are used in heavily used structures derive from
24005         byte in a laughable and pathetic attempt to reduce memory usage.
24006         This is the kind of pre-optimzations that you should not do at
24007         home without adult supervision.
24008
24009         * expression.cs (UnaryMutator): New class, used to handle ++ and
24010         -- separatedly from the other unary operators.  Cleans up the
24011         code, and kills the ExpressionStatement dependency in Unary.
24012
24013         (Unary): Removed `method' and `Arguments' from this class, making
24014         it smaller, and moving it all to SimpleCall, so I can reuse this
24015         code in other locations and avoid creating a lot of transient data
24016         strucutres when not required.
24017
24018         * cs-parser.jay: Adjust for new changes.
24019
24020 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
24021
24022         * enum.cs (Enum.Populate): If there is a failure during
24023         definition, return
24024
24025         * cs-parser.jay (opt_enum_base): we used to catch type errors
24026         here, but this is really incorrect.  The type error should be
24027         catched during semantic analysis.
24028
24029 2001-12-11  Ravi Pratap  <ravi@ximian.com>
24030
24031         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
24032         current_local_parameters as expected since I, in my stupidity, had forgotten
24033         to do this :-)
24034
24035         * attribute.cs (GetValidPlaces): Fix stupid bug.
24036
24037         * class.cs (Method::Emit): Perform check on applicability of attributes.
24038
24039         (Constructor::Emit): Ditto.
24040
24041         (Field::Emit): Ditto.
24042
24043         (Field.Location): Store location information.
24044
24045         (Property, Event, Indexer, Operator): Ditto.
24046
24047         * cs-parser.jay (field_declaration): Pass in location for each field.
24048
24049         * ../errors/cs0592.cs : Add.
24050
24051 2001-11-12  Ravi Pratap  <ravi@ximian.com>
24052
24053         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
24054
24055         (InitCoreTypes): Update accordingly.
24056
24057         (RegisterAttrType, LookupAttr): Implement.
24058
24059         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
24060         info about the same.
24061
24062         (Resolve): Update to populate the above as necessary.
24063
24064         (Error592): Helper.
24065
24066         (GetValidPlaces): Helper to the above.
24067
24068         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
24069
24070         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
24071
24072 2001-11-12  Ravi Pratap  <ravi@ximian.com>
24073
24074         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
24075
24076         * ../errors/cs0617.cs : Add.
24077
24078 2001-11-11  Ravi Pratap  <ravi@ximian.com>
24079
24080         * enum.cs (Emit): Rename to Populate to be more consistent with what
24081         we expect it to do and when exactly it is called.
24082
24083         * class.cs, rootcontext.cs : Update accordingly.
24084
24085         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
24086         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
24087
24088         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
24089
24090         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
24091         of a fieldinfo using the above, when dealing with a FieldBuilder.
24092
24093 2001-11-10  Ravi Pratap  <ravi@ximian.com>
24094
24095         * ../errors/cs0031.cs : Add.
24096
24097         * ../errors/cs1008.cs : Add.
24098
24099         * ../errrors/cs0543.cs : Add.
24100
24101         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
24102         enum type.
24103
24104         (FindMembers): Implement.
24105
24106         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
24107         enums and delegates too.
24108
24109         (enum_types): Rename to builder_to_enum.
24110
24111         (delegate_types): Rename to builder_to_delegate.
24112
24113         * delegate.cs (FindMembers): Implement.
24114
24115 2001-11-09  Ravi Pratap  <ravi@ximian.com>
24116
24117         * typemanager.cs (IsEnumType): Implement.
24118
24119         * enum.cs (Emit): Re-write parts to account for the underlying type
24120         better and perform checking etc.
24121
24122         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
24123         of the underlying type.
24124
24125         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
24126         value
24127
24128         * enum.cs (error31): Helper to report error #31.
24129
24130         * cs-parser.jay (enum_declaration): Store location of each member too.
24131
24132         * enum.cs (member_to_location): New hashtable. 
24133
24134         (AddEnumMember): Update location hashtable.
24135
24136         (Emit): Use the location of each member while reporting errors.
24137
24138 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
24139
24140         * cs-parser.jay: A for_initializer if is a
24141         local_variable_declaration really ammount to have an implicit
24142         block with the variable declaration and no initializer for for.
24143
24144         * statement.cs (For.Emit): Cope with null initializers.
24145
24146         This fixes the infinite loop on for initializers.
24147
24148 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
24149
24150         * enum.cs: More cleanup.
24151
24152         * ecore.cs: Remove dead code.
24153
24154         * class.cs (Property.Emit): More simplification.
24155         (Event.Emit): ditto.
24156
24157         Reworked to have less levels of indentation.
24158
24159 2001-11-08  Ravi Pratap  <ravi@ximian.com>
24160
24161         * class.cs (Property): Emit attributes.
24162
24163         (Field): Ditto.
24164
24165         (Event): Ditto.
24166
24167         (Indexer): Ditto.
24168
24169         (Operator): Ditto.
24170
24171         * enum.cs (Emit): Ditto.
24172
24173         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
24174         Enums too.
24175
24176         * class.cs (Field, Event, etc.): Move attribute generation into the
24177         Emit method everywhere.
24178
24179         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
24180         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
24181         as we had no way of defining nested enums !
24182
24183         * rootcontext.cs : Adjust code accordingly.
24184
24185         * typemanager.cs (AddEnumType): To keep track of enum types separately.
24186
24187 2001-11-07  Ravi Pratap  <ravi@ximian.com>
24188
24189         * expression.cs (EvalConstantExpression): Move into ecore.cs
24190
24191         * enum.cs (Enum): Rename some members and make them public and readonly
24192         according to our convention.
24193
24194         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
24195         nothing else.
24196
24197         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
24198
24199         (Enum::Emit): Write a simple version for now which doesn't try to compute
24200         expressions. I shall modify this to be more robust in just a while.
24201
24202         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
24203
24204         (TypeContainer::CloseType): Create the Enum types too.
24205
24206         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
24207
24208         * expression.cs (EvalConstantExpression): Get rid of completely.
24209
24210         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
24211         user-defined values and other cases.
24212
24213         (IsValidEnumLiteral): Helper function.
24214
24215         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
24216         out there in the case we had a literal FieldExpr.
24217
24218         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
24219
24220         (Literalize): Revamp a bit to take two arguments.
24221
24222         (EnumLiteral): New class which derives from Literal to wrap enum literals.
24223
24224 2001-11-06  Ravi Pratap  <ravi@ximian.com>
24225
24226         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
24227
24228         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
24229
24230         (Resolve): Use the above to ensure we have proper initializers.
24231
24232 2001-11-05  Ravi Pratap  <ravi@ximian.com>
24233
24234         * expression.cs (Expression::EvalConstantExpression): New method to 
24235         evaluate constant expressions.
24236
24237         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
24238
24239 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
24240
24241         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
24242         in an array.
24243
24244         (Binary.ResolveOperator): Handle operator != (object a, object b)
24245         and operator == (object a, object b);
24246
24247         (Binary.DoNumericPromotions): Indicate whether the numeric
24248         promotion was possible.
24249
24250         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
24251         Implement.  
24252
24253         Made the ArrayAccess implement interface IAssignMethod instead of
24254         IStackStore as the order in which arguments are passed reflects
24255         this.
24256
24257         * assign.cs: Instead of using expr.ExprClass to select the way of
24258         assinging, probe for the IStackStore/IAssignMethod interfaces.
24259
24260         * typemanager.cs: Load InitializeArray definition.
24261
24262         * rootcontext.cs (RootContext.MakeStaticData): Used to define
24263         static data that can be used to initialize arrays. 
24264
24265 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
24266
24267         * expression.cs: Handle operator== and operator!= for booleans.
24268
24269         (Conditioal.Reduce): Implement reducer for the ?: operator.
24270
24271         (Conditional.Resolve): Implement dead code elimination.
24272
24273         (Binary.Resolve): Catch string literals and return a new
24274         concatenated string.
24275
24276         (Unary.Reduce): Implement reduction of unary expressions.
24277
24278         * ecore.cs: Split out the expression core handling here.
24279
24280         (Expression.Reduce): New method used to perform constant folding
24281         and CSE.  This is needed to support constant-expressions. 
24282
24283         * statement.cs (Statement.EmitBoolExpression): Pass true and false
24284         targets, and optimize for !x.
24285
24286 2001-11-04  Ravi Pratap  <ravi@ximian.com>
24287
24288         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
24289         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
24290         set custom atttributes.
24291
24292         * literal.cs (Literal::GetValue): New abstract method to return the actual
24293         value of the literal, cast as an object.
24294
24295         (*Literal): Implement GetValue method.
24296
24297         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
24298         expressions to the arraylist but objects of type Argument.
24299
24300         * class.cs (TypeContainer::Emit): Emit our attributes too.
24301
24302         (Method::Emit, Constructor::Emit): Ditto.
24303
24304         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
24305         to be ignoring earlier.
24306
24307 2001-11-03  Ravi Pratap  <ravi@ximian.com>
24308
24309         * attribute.cs (AttributeSection::Define): Implement to do the business
24310         of constructing a CustomAttributeBuilder.
24311
24312         (Attribute): New trivial class. Increases readability of code.  
24313
24314         * cs-parser.jay : Update accordingly.
24315
24316         (positional_argument_list, named_argument_list, named_argument): New rules
24317
24318         (attribute_arguments): Use the above so that we are more correct.
24319
24320 2001-11-02  Ravi Pratap  <ravi@ximian.com>
24321
24322         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
24323         to perform all checks for a method with a params parameter.
24324
24325         (Invocation::OverloadResolve): Update to use the above method and therefore
24326         cope correctly with params method invocations.
24327
24328         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
24329         params too.
24330
24331         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
24332         constructors in our parent too because we can't afford to miss out on 
24333         protected ones ;-)
24334
24335         * attribute.cs (AttributeSection): New name for the class Attribute
24336
24337         Other trivial changes to improve readability.
24338
24339         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
24340         use the new class names.
24341
24342 2001-11-01  Ravi Pratap  <ravi@ximian.com>
24343
24344         * class.cs (Method::Define): Complete definition for params types too
24345
24346         (Indexer::Define): Ditto.
24347
24348         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
24349         Cope everywhere with a request for info about the array parameter.
24350
24351 2001-11-01  Ravi Pratap  <ravi@ximian.com>
24352
24353         * tree.cs (RecordNamespace): Fix up to check for the correct key.
24354
24355         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
24356         local_variable_type to extract the string corresponding to the type.
24357
24358         (local_variable_type): Fixup the action to use the new helper method.
24359
24360         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
24361         go.
24362
24363         * expression.cs : Clean out code which uses the above.
24364
24365 2001-10-31  Ravi Pratap  <ravi@ximian.com>
24366
24367         * typemanager.cs (RegisterMethod): Check if we already have an existing key
24368         and bale out if necessary by returning a false.
24369
24370         (RegisterProperty): Ditto.
24371
24372         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
24373         and print out appropriate error messages.
24374
24375         * interface.cs (everywhere): Ditto.
24376
24377         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
24378         location to constructor.
24379
24380         * class.cs (Property, Event, Indexer): Update accordingly.
24381
24382         * ../errors/cs111.cs : Added.
24383
24384         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
24385         of a method, as laid down by the spec.
24386
24387         (Invocation::OverloadResolve): Use the above method.
24388
24389 2001-10-31  Ravi Pratap  <ravi@ximian.com>
24390
24391         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
24392         now take a TypeContainer and a Parameters object.
24393
24394         (ParameterData): Modify return type of ParameterModifier method to be 
24395         Parameter.Modifier and not a string.
24396
24397         (ReflectionParameters, InternalParameters): Update accordingly.
24398
24399         * expression.cs (Argument::GetParameterModifier): Same here.
24400
24401         * support.cs (InternalParameters::ParameterType): Find a better way of determining
24402         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
24403         symbol in it at all so maybe this is only for now.
24404
24405 2001-10-30  Ravi Pratap  <ravi@ximian.com>
24406
24407         * support.cs (InternalParameters): Constructor now takes an extra argument 
24408         which is the actual Parameters class.
24409
24410         (ParameterDesc): Update to provide info on ref/out modifiers.
24411
24412         * class.cs (everywhere): Update call to InternalParameters to pass in
24413         the second argument too.
24414
24415         * support.cs (ParameterData): Add ParameterModifier, which is a method 
24416         to return the modifier info [ref/out etc]
24417
24418         (InternalParameters, ReflectionParameters): Implement the above.
24419
24420         * expression.cs (Argument::ParameterModifier): Similar function to return
24421         info about the argument's modifiers.
24422
24423         (Invocation::OverloadResolve): Update to take into account matching modifiers 
24424         too.
24425
24426         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
24427         a new SetFormalParameters object which we pass to InternalParameters.
24428
24429 2001-10-30  Ravi Pratap  <ravi@ximian.com>
24430
24431         * expression.cs (NewArray): Merge into the ArrayCreation class.
24432
24433 2001-10-29  Ravi Pratap  <ravi@ximian.com>
24434
24435         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
24436         NewUserdefinedArray into one as there wasn't much of a use in having
24437         two separate ones.
24438
24439         * expression.cs (Argument): Change field's name to ArgType from Type.
24440
24441         (Type): New readonly property which returns the proper type, taking into 
24442         account ref/out modifiers.
24443
24444         (everywhere): Adjust code accordingly for the above.
24445
24446         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
24447         whether we are emitting for a ref or out parameter.
24448
24449         * expression.cs (Argument::Emit): Use the above field to set the state.
24450
24451         (LocalVariableReference::Emit): Update to honour the flag and emit the
24452         right stuff.
24453
24454         * parameter.cs (Attributes): Set the correct flags for ref parameters.
24455
24456         * expression.cs (Argument::FullDesc): New function to provide a full desc.
24457
24458         * support.cs (ParameterData): Add method ParameterDesc to the interface.
24459
24460         (ReflectionParameters, InternalParameters): Implement the above method.
24461
24462         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
24463         reporting errors.
24464
24465         (Invocation::FullMethodDesc): Ditto. 
24466
24467 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
24468
24469         * cs-parser.jay: Add extra production for the second form of array
24470         creation. 
24471
24472         * expression.cs (ArrayCreation): Update to reflect the above
24473         change. 
24474
24475         * Small changes to prepare for Array initialization.
24476
24477 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
24478
24479         * typemanager.cs (ImplementsInterface): interface might be null;
24480         Deal with this problem;
24481
24482         Also, we do store negative hits on the cache (null values), so use
24483         this instead of calling t.GetInterfaces on the type everytime.
24484
24485 2001-10-28  Ravi Pratap  <ravi@ximian.com>
24486
24487         * typemanager.cs (IsBuiltinType): New method to help determine the same.
24488
24489         * expression.cs (New::DoResolve): Get rid of array creation code and instead
24490         split functionality out into different classes.
24491
24492         (New::FormArrayType): Move into NewBuiltinArray.
24493
24494         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
24495         quite useless.
24496
24497         (NewBuiltinArray): New class to handle creation of built-in arrays.
24498
24499         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
24500         account creation of one-dimensional arrays.
24501
24502         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
24503
24504         (NewUserdefinedArray::DoResolve): Implement.
24505
24506         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
24507
24508         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
24509         we maintain inside the TypeManager. This is necessary to perform lookups on the
24510         module builder.
24511
24512         (LookupType): Update to perform GetType on the module builders too.     
24513
24514         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
24515
24516         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
24517
24518 2001-10-23  Ravi Pratap  <ravi@ximian.com>
24519
24520         * expression.cs (New::DoResolve): Implement guts of array creation.
24521
24522         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
24523
24524 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
24525
24526         * expression.cs: Fix bug I introduced lsat night that broke
24527         Delegates. 
24528
24529         (Expression.Resolve): Report a 246 error (can not resolve name)
24530         if we find a SimpleName in the stream.
24531
24532         (Expression.ResolveLValue): Ditto.
24533
24534         (Expression.ResolveWithSimpleName): This function is a variant of
24535         ResolveName, this one allows SimpleNames to be returned without a
24536         warning.  The only consumer of SimpleNames is MemberAccess
24537
24538 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
24539
24540         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
24541         might arrive here.  I have my doubts that this is correct.
24542
24543         * statement.cs (Lock): Implement lock statement.
24544
24545         * cs-parser.jay: Small fixes to support `lock' and `using'
24546
24547         * cs-tokenizer.cs: Remove extra space
24548
24549         * driver.cs: New flag --checked, allows to turn on integer math
24550         checking. 
24551
24552         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
24553         Threading.Monitor.Exit 
24554
24555 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
24556
24557         * expression.cs (IndexerAccess::DoResolveLValue): Set the
24558         Expression Class to be IndexerAccess.
24559
24560         Notice that Indexer::DoResolve sets the eclass to Value.
24561
24562 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
24563
24564         * class.cs (TypeContainer::Emit): Emit code for indexers.
24565
24566         * assign.cs (IAssignMethod): New interface implemented by Indexers
24567         and Properties for handling assignment.
24568
24569         (Assign::Emit): Simplify and reuse code. 
24570
24571         * expression.cs (IndexerAccess, PropertyExpr): Implement
24572         IAssignMethod, clean up old code. 
24573
24574 2001-10-22  Ravi Pratap  <ravi@ximian.com>
24575
24576         * typemanager.cs (ImplementsInterface): New method to determine if a type
24577         implements a given interface. Provides a nice cache too.
24578
24579         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
24580         method.
24581
24582         (ConvertReferenceExplicit): Ditto.
24583
24584         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
24585         various methods, with correct names etc.
24586
24587         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
24588         Operator.UnaryNegation.
24589
24590         * cs-parser.jay (operator_declarator): Be a little clever in the case where
24591         we have a unary plus or minus operator.
24592
24593         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
24594         UnaryMinus.
24595
24596         * everywhere : update accordingly.
24597
24598         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
24599         respectively.
24600
24601         * class.cs (Method::Define): For the case where we are implementing a method
24602         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
24603         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
24604
24605 2001-10-21  Ravi Pratap  <ravi@ximian.com>
24606
24607         * interface.cs (FindMembers): Implement to work around S.R.E
24608         lameness.
24609
24610         * typemanager.cs (IsInterfaceType): Implement.
24611
24612         (FindMembers): Update to handle interface types too.
24613
24614         * expression.cs (ImplicitReferenceConversion): Re-write bits which
24615         use IsAssignableFrom as that is not correct - it doesn't work.
24616
24617         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
24618         and accordingly override EmitStatement.
24619
24620         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
24621         using the correct logic :-)
24622
24623 2001-10-19  Ravi Pratap  <ravi@ximian.com>
24624
24625         * ../errors/cs-11.cs : Add to demonstrate error -11 
24626
24627 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
24628
24629         * assign.cs (Assign::Resolve): Resolve right hand side first, and
24630         then pass this as a hint to ResolveLValue.
24631
24632         * expression.cs (FieldExpr): Add Location information
24633
24634         (FieldExpr::LValueResolve): Report assignment to readonly
24635         variable. 
24636
24637         (Expression::ExprClassFromMemberInfo): Pass location information.
24638
24639         (Expression::ResolveLValue): Add new method that resolves an
24640         LValue. 
24641
24642         (Expression::DoResolveLValue): Default invocation calls
24643         DoResolve. 
24644
24645         (Indexers): New class used to keep track of indexers in a given
24646         Type. 
24647
24648         (IStackStore): Renamed from LValue, as it did not really describe
24649         what this did.  Also ResolveLValue is gone from this interface and
24650         now is part of Expression.
24651
24652         (ElementAccess): Depending on the element access type
24653
24654         * typemanager.cs: Add `indexer_name_type' as a Core type
24655         (System.Runtime.CompilerServices.IndexerNameAttribute)
24656
24657         * statement.cs (Goto): Take a location.
24658
24659 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24660
24661         * delegate.cs (Delegate::VerifyDelegate): New method to verify
24662         if two delegates are compatible.
24663
24664         (NewDelegate::DoResolve): Update to take care of the case when
24665         we instantiate a delegate from another delegate.
24666
24667         * typemanager.cs (FindMembers): Don't even try to look up members
24668         of Delegate types for now.
24669
24670 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24671
24672         * delegate.cs (NewDelegate): New class to take care of delegate
24673         instantiation.
24674
24675         * expression.cs (New): Split the delegate related code out into 
24676         the NewDelegate class.
24677
24678         * delegate.cs (DelegateInvocation): New class to handle delegate 
24679         invocation.
24680
24681         * expression.cs (Invocation): Split out delegate related code into
24682         the DelegateInvocation class.
24683
24684 2001-10-17  Ravi Pratap  <ravi@ximian.com>
24685
24686         * expression.cs (New::DoResolve): Implement delegate creation fully
24687         and according to the spec.
24688
24689         (New::DoEmit): Update to handle delegates differently.
24690
24691         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
24692         because of which we were printing out arguments in reverse order !
24693
24694         * delegate.cs (VerifyMethod): Implement to check if the given method
24695         matches the delegate.
24696
24697         (FullDelegateDesc): Implement.
24698
24699         (VerifyApplicability): Implement.
24700
24701         * expression.cs (Invocation::DoResolve): Update to accordingly handle
24702         delegate invocations too.
24703
24704         (Invocation::Emit): Ditto.
24705
24706         * ../errors/cs1593.cs : Added.
24707
24708         * ../errors/cs1594.cs : Added.
24709
24710         * delegate.cs (InstanceExpression, TargetMethod): New properties.
24711
24712 2001-10-16  Ravi Pratap  <ravi@ximian.com>
24713
24714         * typemanager.cs (intptr_type): Core type for System.IntPtr
24715
24716         (InitCoreTypes): Update for the same.
24717
24718         (iasyncresult_type, asynccallback_type): Ditto.
24719
24720         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24721         correct.
24722
24723         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24724         too.
24725
24726         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24727         the builders for the 4 members of a delegate type :-)
24728
24729         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24730         type.
24731
24732         * expression.cs (New::DoResolve): Implement guts for delegate creation.
24733
24734         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24735
24736 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
24737
24738         * statement.cs (Break::Emit): Implement.   
24739         (Continue::Emit): Implement.
24740
24741         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24742         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24743         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24744         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
24745         end loop
24746
24747         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24748         properties that track the label for the current loop (begin of the
24749         loop and end of the loop).
24750
24751 2001-10-15  Ravi Pratap  <ravi@ximian.com>
24752
24753         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24754         use of emitting anything at all.
24755
24756         * class.cs, rootcontext.cs : Get rid of calls to the same.
24757
24758         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24759
24760         (Populate): Define the constructor correctly and set the implementation
24761         attributes.
24762
24763         * typemanager.cs (delegate_types): New hashtable to hold delegates that
24764         have been defined.
24765
24766         (AddDelegateType): Implement.
24767
24768         (IsDelegateType): Implement helper method.
24769
24770         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24771
24772         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24773         and accordingly handle it.
24774
24775         * delegate.cs (Populate): Take TypeContainer argument.
24776         Implement bits to define the Invoke method. However, I still haven't figured out
24777         how to take care of the native int bit :-(
24778
24779         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
24780         Qualify the name of the delegate, not its return type !
24781
24782         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24783         conversion.
24784
24785         (StandardConversionExists): Checking for array types turns out to be recursive.
24786
24787         (ConvertReferenceExplicit): Implement array conversion.
24788
24789         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24790
24791 2001-10-12  Ravi Pratap  <ravi@ximian.com>
24792
24793         * cs-parser.jay (delegate_declaration): Store the fully qualified
24794         name as it is a type declaration.
24795
24796         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
24797         readonly.
24798
24799         (DefineDelegate): Renamed from Define. Does the same thing essentially,
24800         as TypeContainer::DefineType.
24801
24802         (Populate): Method in which all the definition of the various methods (Invoke)
24803         etc is done.
24804
24805         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24806         see.
24807
24808         (CloseDelegate): Finally creates the delegate.
24809
24810         * class.cs (TypeContainer::DefineType): Update to define delegates.
24811         (Populate, Emit and CloseType): Do the same thing here too.
24812
24813         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24814         delegates in all these operations.
24815
24816 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
24817
24818         * expression.cs: LocalTemporary: a new expression used to
24819         reference a temporary that has been created.
24820
24821         * assign.cs: Handle PropertyAccess back here, so that we can
24822         provide the proper semantic access to properties.
24823
24824         * expression.cs (Expression::ConvertReferenceExplicit): Implement
24825         a few more explicit conversions. 
24826
24827         * modifiers.cs: `NEW' modifier maps to HideBySig.
24828
24829         * expression.cs (PropertyExpr): Make this into an
24830         ExpressionStatement, and support the EmitStatement code path. 
24831
24832         Perform get/set error checking, clean up the interface.
24833
24834         * assign.cs: recognize PropertyExprs as targets, and if so, turn
24835         them into toplevel access objects.
24836
24837 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
24838
24839         * expression.cs: PropertyExpr::PropertyExpr: use work around the
24840         SRE.
24841
24842         * typemanager.cs: Keep track here of our PropertyBuilders again to
24843         work around lameness in SRE.
24844
24845 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
24846
24847         * expression.cs (LValue::LValueResolve): New method in the
24848         interface, used to perform a second resolution pass for LValues. 
24849
24850         (This::DoResolve): Catch the use of this in static methods.
24851
24852         (This::LValueResolve): Implement.
24853
24854         (This::Store): Remove warning, assigning to `this' in structures
24855         is 
24856
24857         (Invocation::Emit): Deal with invocation of
24858         methods on value types.  We need to pass the address to structure
24859         methods rather than the object itself.  (The equivalent code to
24860         emit "this" for structures leaves the entire structure on the
24861         stack instead of a pointer to it). 
24862
24863         (ParameterReference::DoResolve): Compute the real index for the
24864         argument based on whether the method takes or not a `this' pointer
24865         (ie, the method is static).
24866
24867         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24868         value types returned from functions when we need to invoke a
24869         method on the sturcture.
24870
24871
24872 2001-10-11  Ravi Pratap  <ravi@ximian.com>
24873
24874         * class.cs (TypeContainer::DefineType): Method to actually do the business of
24875         defining the type in the Modulebuilder or Typebuilder. This is to take
24876         care of nested types which need to be defined on the TypeBuilder using
24877         DefineNestedMethod.
24878
24879         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
24880         methods in RootContext, only ported to be part of TypeContainer.
24881
24882         (TypeContainer::GetInterfaceOrClass): Ditto.
24883
24884         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24885
24886         * interface.cs (Interface::DefineInterface): New method. Does exactly
24887         what RootContext.CreateInterface did earlier, only it takes care of nested types 
24888         too.
24889
24890         (Interface::GetInterfaces): Move from RootContext here and port.
24891
24892         (Interface::GetInterfaceByName): Same here.
24893
24894         * rootcontext.cs (ResolveTree): Re-write.
24895
24896         (PopulateTypes): Re-write.
24897
24898         * class.cs (TypeContainer::Populate): Populate nested types too.
24899         (TypeContainer::Emit): Emit nested members too.
24900
24901         * typemanager.cs (AddUserType): Do not make use of the FullName property,
24902         instead just use the name argument passed in as it is already fully
24903         qualified.
24904
24905         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24906         to TypeContainer mapping to see if a type is user-defined.
24907
24908         * class.cs (TypeContainer::CloseType): Implement. 
24909
24910         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24911         the default constructor.
24912
24913         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24914         twice.
24915
24916         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24917
24918         * interface.cs (CloseType): Create the type here.
24919
24920         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24921         the hierarchy.
24922
24923         Remove all the methods which are now in TypeContainer.
24924
24925 2001-10-10  Ravi Pratap  <ravi@ximian.com>
24926
24927         * delegate.cs (Define): Re-write bits to define the delegate
24928         correctly.
24929
24930 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
24931
24932         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24933
24934         * expression.cs (ImplicitReferenceConversion): handle null as well
24935         as a source to convert to any reference type.
24936
24937         * statement.cs (Return): Perform any implicit conversions to
24938         expected return type.  
24939
24940         Validate use of return statement.  
24941
24942         * codegen.cs (EmitContext): Pass the expected return type here.
24943
24944         * class.cs (Method, Constructor, Property): Pass expected return
24945         type to EmitContext.
24946
24947 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
24948
24949         * expression.cs: Make DoResolve take an EmitContext instead of a
24950         TypeContainer.
24951
24952         Replaced `l' and `location' for `loc', for consistency.
24953
24954         (Error, Warning): Remove unneeded Tc argument.
24955
24956         * assign.cs, literal.cs, constant.cs: Update to new calling
24957         convention. 
24958
24959         * codegen.cs: EmitContext now contains a flag indicating whether
24960         code is being generated in a static method or not.
24961
24962         * cs-parser.jay: DecomposeQI, new function that replaces the old
24963         QualifiedIdentifier.  Now we always decompose the assembled
24964         strings from qualified_identifier productions into a group of
24965         memberaccesses.
24966
24967 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
24968
24969         * rootcontext.cs: Deal with field-less struct types correctly now
24970         by passing the size option to Define Type.
24971
24972         * class.cs: Removed hack that created one static field. 
24973
24974 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24975
24976         * statement.cs: Moved most of the code generation here. 
24977
24978 2001-10-09  Ravi Pratap  <ravi@ximian.com>
24979
24980         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24981         seem very right.
24982
24983         (ElementAccess): Remove useless bits for now - keep checks as the spec
24984         says.
24985
24986 2001-10-08  Ravi Pratap  <ravi@ximian.com>
24987
24988         * expression.cs (ElementAccess::DoResolve): Remove my crap code
24989         and start performing checks according to the spec.
24990
24991 2001-10-07  Ravi Pratap  <ravi@ximian.com>
24992
24993         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24994         rank_specifiers instead.
24995
24996         (rank_specifiers): Change the order in which the rank specifiers are stored
24997
24998         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24999
25000         * expression.cs (ElementAccess): Implement the LValue interface too.
25001
25002 2001-10-06  Ravi Pratap  <ravi@ximian.com>
25003
25004         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
25005         except that user defined conversions are not included.
25006
25007         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
25008         perform the conversion of the return type, if necessary.
25009
25010         (New::DoResolve): Check whether we are creating an array or an object
25011         and accordingly do the needful.
25012
25013         (New::Emit): Same here.
25014
25015         (New::DoResolve): Implement guts of array creation.
25016
25017         (New::FormLookupType): Helper function.
25018
25019 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
25020
25021         * codegen.cs: Removed most of the code generation here, and move the
25022         corresponding code generation bits to the statement classes. 
25023
25024         Added support for try/catch/finalize and throw.
25025
25026         * cs-parser.jay: Added support for try/catch/finalize.
25027
25028         * class.cs: Catch static methods having the flags override,
25029         virtual or abstract.
25030
25031         * expression.cs (UserCast): This user cast was not really doing
25032         what it was supposed to do.  Which is to be born in fully resolved
25033         state.  Parts of the resolution were being performed at Emit time! 
25034
25035         Fixed this code.
25036
25037 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
25038
25039         * expression.cs: Implicity convert the result from UserCast.
25040
25041 2001-10-05  Ravi Pratap  <ravi@ximian.com>
25042
25043         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
25044         prevented it from working correctly. 
25045
25046         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
25047         merely ConvertImplicit.
25048
25049 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
25050
25051         * typemanager.cs: Make the LookupTypeContainer function static,
25052         and not per-instance.  
25053
25054         * class.cs: Make static FindMembers (the one that takes a Type
25055         argument). 
25056
25057         * codegen.cs: Add EmitForeach here.
25058
25059         * cs-parser.jay: Make foreach a toplevel object instead of the
25060         inline expansion, as we need to perform semantic analysis on it. 
25061
25062 2001-10-05  Ravi Pratap  <ravi@ximian.com>
25063
25064         * expression.cs (Expression::ImplicitUserConversion): Rename to
25065         UserDefinedConversion.
25066
25067         (Expression::UserDefinedConversion): Take an extra argument specifying 
25068         whether we look for explicit user conversions too.
25069
25070         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
25071
25072         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
25073
25074         (ExplicitUserConversion): Make it a call to UserDefinedConversion
25075         with the appropriate arguments.
25076
25077         * cs-parser.jay (cast_expression): Record location too.
25078
25079         * expression.cs (Cast): Record location info.
25080
25081         (Expression::ConvertExplicit): Take location argument.
25082
25083         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
25084         to determine if we are doing explicit conversions.
25085
25086         (UserCast::Emit): Update accordingly.
25087
25088         (Expression::ConvertExplicit): Report an error if everything fails.
25089
25090         * ../errors/cs0030.cs : Add.
25091
25092 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
25093
25094         * modifiers.cs: If the ABSTRACT keyword is present, also set the
25095         virtual and newslot bits. 
25096
25097         * class.cs (TypeContainer::RegisterRequiredImplementations):
25098         Record methods we need.
25099
25100         (TypeContainer::MakeKey): Helper function to make keys for
25101         MethodBases, since the Methodbase key is useless.
25102
25103         (TypeContainer::Populate): Call RegisterRequiredImplementations
25104         before defining the methods.   
25105
25106         Create a mapping for method_builders_to_methods ahead of time
25107         instead of inside a tight loop.
25108
25109         (::RequireMethods):  Accept an object as the data to set into the
25110         hashtable so we can report interface vs abstract method mismatch.
25111
25112 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
25113
25114         * report.cs: Make all of it static.
25115
25116         * rootcontext.cs: Drop object_type and value_type computations, as
25117         we have those in the TypeManager anyways.
25118
25119         Drop report instance variable too, now it is a global.
25120
25121         * driver.cs: Use try/catch on command line handling.
25122
25123         Add --probe option to debug the error reporting system with a test
25124         suite. 
25125
25126         * report.cs: Add support for exiting program when a probe
25127         condition is reached.
25128
25129 2001-10-03  Ravi Pratap  <ravi@ximian.com>
25130
25131         * expression.cs (Binary::DoNumericPromotions): Fix the case when
25132         we do a forcible conversion regardless of type, to check if 
25133         ForceConversion returns a null.
25134
25135         (Binary::error19): Use location to report error.
25136
25137         (Unary::error23): Use location here too.
25138
25139         * ../errors/cs0019.cs : Check in.
25140
25141         * ../errors/cs0023.cs : Check in.
25142
25143         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
25144         case of a non-null MethodInfo object with a length of 0 !
25145
25146         (Binary::ResolveOperator): Flag error if overload resolution fails to find
25147         an applicable member - according to the spec :-)
25148         Also fix logic to find members in base types.
25149
25150         (Unary::ResolveOperator): Same here.
25151
25152         (Unary::report23): Change name to error23 and make first argument a TypeContainer
25153         as I was getting thoroughly confused between this and error19 :-)
25154
25155         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
25156         (::FindMostEncompassedType): Implement.
25157         (::FindMostEncompassingType): Implement.
25158         (::StandardConversionExists): Implement.
25159
25160         (UserImplicitCast): Re-vamp. We now need info about most specific
25161         source and target types so that we can do the necessary conversions.
25162
25163         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
25164         mathematical union with no duplicates.
25165
25166 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
25167
25168         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
25169         in order from base classes to child classes, so that we can in
25170         child classes look up in our parent for method names and
25171         attributes (required for handling abstract, virtual, new, override
25172         constructs: we need to instrospect our base class, and if we dont
25173         populate the classes in order, the introspection might be
25174         incorrect.  For example, a method could query its parent before
25175         the parent has any methods and would determine that the parent has
25176         no abstract methods (while it could have had them)).
25177
25178         (RootContext::CreateType): Record the order in which we define the
25179         classes.
25180
25181 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
25182
25183         * class.cs (TypeContainer::Populate): Also method definitions can
25184         fail now, keep track of this.
25185
25186         (TypeContainer::FindMembers): Implement support for
25187         DeclaredOnly/noDeclaredOnly flag.
25188
25189         (Constructor::Emit) Return the ConstructorBuilder.
25190
25191         (Method::Emit) Return the MethodBuilder. 
25192         Check for abstract or virtual methods to be public.
25193
25194         * rootcontext.cs (RootContext::CreateType): Register all the
25195         abstract methods required for the class to be complete and the
25196         interface methods that must be implemented. 
25197
25198         * cs-parser.jay: Report error 501 (method requires body if it is
25199         not marked abstract or extern).
25200
25201         * expression.cs (TypeOf::Emit): Implement.
25202
25203         * typemanager.cs: runtime_handle_type, new global type.
25204
25205         * class.cs (Property::Emit): Generate code for properties.
25206
25207 2001-10-02  Ravi Pratap  <ravi@ximian.com>
25208
25209         * expression.cs (Unary::ResolveOperator): Find operators on base type
25210         too - we now conform exactly to the spec.
25211
25212         (Binary::ResolveOperator): Same here.
25213
25214         * class.cs (Operator::Define): Fix minor quirk in the tests.
25215
25216         * ../errors/cs0215.cs : Added.
25217
25218         * ../errors/cs0556.cs : Added.
25219
25220         * ../errors/cs0555.cs : Added.
25221
25222 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
25223
25224         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
25225         single integer which is really efficient
25226
25227 2001-10-01  Ravi Pratap  <ravi@ximian.com>
25228
25229         *  expression.cs (Expression::ImplicitUserConversion): Use location
25230         even in the case when we are examining True operators.
25231  
25232         * class.cs (Operator::Define): Perform extensive checks to conform
25233         with the rules for operator overloading in the spec.
25234
25235         * expression.cs (Expression::ImplicitReferenceConversion): Implement
25236         some of the other conversions mentioned in the spec.
25237
25238         * typemanager.cs (array_type): New static member for the System.Array built-in
25239         type.
25240
25241         (cloneable_interface): For System.ICloneable interface.
25242
25243         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
25244         we start resolving the tree and populating types.
25245
25246         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
25247  
25248 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
25249
25250         * expression.cs (Expression::ExprClassFromMemberInfo,
25251         Expression::Literalize): Create literal expressions from
25252         FieldInfos which are literals.
25253
25254         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
25255         type casts, because they were wrong.  The test suite in tests
25256         caught these ones.
25257
25258         (ImplicitNumericConversion): ushort to ulong requires a widening
25259         cast. 
25260
25261         Int32 constant to long requires widening cast as well.
25262
25263         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
25264         for integers because the type on the stack is not i4.
25265
25266 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
25267
25268         * expression.cs (report118): require location argument. 
25269
25270         * parameter.cs: Do not dereference potential null value.
25271
25272         * class.cs: Catch methods that lack the `new' keyword when
25273         overriding a name.  Report warnings when `new' is used without
25274         anything being there to override.
25275
25276         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
25277
25278         * class.cs: Only add constructor to hashtable if it is non-null
25279         (as now constructors can fail on define).
25280
25281         (TypeManager, Class, Struct): Take location arguments.
25282
25283         Catch field instance initialization in structs as errors.
25284
25285         accepting_filter: a new filter for FindMembers that is static so
25286         that we dont create an instance per invocation.
25287
25288         (Constructor::Define): Catch errors where a struct constructor is
25289         parameterless 
25290
25291         * cs-parser.jay: Pass location information for various new
25292         constructs. 
25293
25294         * delegate.cs (Delegate): take a location argument.
25295
25296         * driver.cs: Do not call EmitCode if there were problesm in the
25297         Definition of the types, as many Builders wont be there. 
25298
25299         * decl.cs (Decl::Decl): Require a location argument.
25300
25301         * cs-tokenizer.cs: Handle properly hex constants that can not fit
25302         into integers, and find the most appropiate integer for it.
25303
25304         * literal.cs: Implement ULongLiteral.
25305
25306         * rootcontext.cs: Provide better information about the location of
25307         failure when CreateType fails.
25308
25309 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
25310
25311         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
25312         as well.
25313
25314         * expression.cs (Binary::CheckShiftArguments): Add missing type
25315         computation.
25316         (Binary::ResolveOperator): Add type to the logical and and logical
25317         or, Bitwise And/Or and Exclusive Or code paths, it was missing
25318         before.
25319
25320         (Binary::DoNumericPromotions): In the case where either argument
25321         is ulong (and most signed types combined with ulong cause an
25322         error) perform implicit integer constant conversions as well.
25323
25324 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
25325
25326         * expression.cs (UserImplicitCast): Method should always be
25327         non-null. 
25328         (Invocation::BetterConversion): Simplified test for IntLiteral.
25329
25330         (Expression::ImplicitNumericConversion): Split this routine out.
25331         Put the code that performs implicit constant integer conversions
25332         here. 
25333
25334         (Expression::Resolve): Become a wrapper around DoResolve so we can
25335         check eclass and type being set after resolve.
25336
25337         (Invocation::Badness): Remove this dead function
25338
25339         (Binary::ResolveOperator): Do not compute the expensive argumnets
25340         unless we have a union for it.
25341
25342         (Probe::Emit): Is needs to do an isinst and then
25343         compare against null.
25344
25345         (::CanConvert): Added Location argument.  If the Location argument
25346         is null (Location.Null), then we do not report errors.  This is
25347         used by the `probe' mechanism of the Explicit conversion.  We do
25348         not want to generate an error for something that the user
25349         explicitly requested to be casted.  But the pipeline for an
25350         explicit cast first tests for potential implicit casts.
25351
25352         So for now, if the Location is null, it means `Probe only' to
25353         avoid adding another argument.   Might have to revise this
25354         strategy later.
25355
25356         (ClassCast): New class used to type cast objects into arbitrary
25357         classes (used in Explicit Reference Conversions).
25358
25359         Implement `as' as well.
25360
25361         Reverted all the patches from Ravi below: they were broken:
25362
25363                 * The use of `level' as a mechanism to stop recursive
25364                   invocations is wrong.  That was there just to catch the
25365                   bug with a strack trace but not as a way of addressing
25366                   the problem.
25367
25368                   To fix the problem we have to *understand* what is going
25369                   on and the interactions and come up with a plan, not
25370                   just get things going.
25371
25372                 * The use of the type conversion cache that I proposed
25373                   last night had an open topic: How does this work across
25374                   protection domains.  A user defined conversion might not
25375                   be public in the location where we are applying the
25376                   conversion, a different conversion might be selected
25377                   (ie, private A->B (better) but public B->A (worse),
25378                   inside A, A->B applies, but outside it, B->A will
25379                   apply).
25380
25381                 * On top of that (ie, even if the above is solved),
25382                   conversions in a cache need to be abstract.  Ie, `To
25383                   convert from an Int to a Short use an OpcodeCast', not
25384                   `To convert from an Int to a Short use the OpcodeCast on
25385                   the variable 5' (which is what this patch was doing).
25386
25387 2001-09-28  Ravi Pratap  <ravi@ximian.com>
25388
25389         * expression.cs (Invocation::ConversionExists): Re-write to use
25390         the conversion cache
25391
25392         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
25393         cache all conversions done, not just user-defined ones.
25394
25395         (Invocation::BetterConversion): The real culprit. Use ConversionExists
25396         to determine if a conversion exists instead of acutually trying to 
25397         perform the conversion. It's faster too.
25398
25399         (Expression::ConvertExplicit): Modify to use ConversionExists to check
25400         and only then attempt the implicit conversion.
25401
25402 2001-09-28  Ravi Pratap  <ravi@ximian.com>
25403
25404         * expression.cs (ConvertImplicit): Use a cache for conversions
25405         already found. Check level of recursion and bail out if necessary.
25406
25407 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
25408
25409         * typemanager.cs (string_concat_string_string, string_concat_object_object):
25410         Export standard methods that we expect for string operations.
25411
25412         * statement.cs (Block::UsageWarning): Track usage of variables and
25413         report the errors for not used variables.
25414
25415         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
25416         operator. 
25417
25418 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
25419
25420         * codegen.cs: remove unnneded code 
25421
25422         * expression.cs: Removed BuiltinTypeAccess class
25423
25424         Fix the order in which implicit conversions are
25425         done.  
25426
25427         The previous fixed dropped support for boxed conversions (adding a
25428         test to the test suite now)
25429
25430         (UserImplicitCast::CanConvert): Remove test for source being null,
25431         that code is broken.  We should not feed a null to begin with, if
25432         we do, then we should track the bug where the problem originates
25433         and not try to cover it up here.
25434
25435         Return a resolved expression of type UserImplicitCast on success
25436         rather than true/false.  Ravi: this is what I was talking about,
25437         the pattern is to use a static method as a "constructor" for
25438         objects. 
25439
25440         Also, do not create arguments until the very last minute,
25441         otherwise we always create the arguments even for lookups that
25442         will never be performed. 
25443
25444         (UserImplicitCast::Resolve): Eliminate, objects of type
25445         UserImplicitCast are born in a fully resolved state. 
25446
25447         * typemanager.cs (InitCoreTypes): Init also value_type
25448         (System.ValueType). 
25449
25450         * expression.cs (Cast::Resolve): First resolve the child expression.
25451
25452         (LValue): Add new method AddressOf to be used by
25453         the `&' operator.  
25454
25455         Change the argument of Store to take an EmitContext instead of an
25456         ILGenerator, because things like FieldExpr need to be able to call
25457         their children expression to generate the instance code. 
25458
25459         (Expression::Error, Expression::Warning): Sugar functions for
25460         reporting errors.
25461
25462         (Expression::MemberLookup): Accept a TypeContainer instead of a
25463         Report as the first argument.
25464
25465         (Expression::ResolvePrimary): Killed.  I still want to improve
25466         this as currently the code is just not right.
25467
25468         (Expression::ResolveMemberAccess): Simplify, but it is still
25469         wrong. 
25470
25471         (Unary::Resolve): Catch errors in AddressOf operators.
25472
25473         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
25474         index to a byte for the short-version, or the compiler will choose
25475         the wrong Emit call, which generates the wrong data.
25476
25477         (ParameterReference::Emit, ::Store): same.
25478
25479         (FieldExpr::AddressOf): Implement.
25480
25481         * typemanager.cs: TypeManager: made public variable instead of
25482         property.
25483
25484         * driver.cs: document --fatal.
25485
25486         * report.cs (ErrorMessage, WarningMessage): new names for the old
25487         Error and Warning classes.
25488
25489         * cs-parser.jay (member_access): Turn built-in access to types
25490         into a normal simplename
25491
25492 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25493
25494         * expression.cs (Invocation::BetterConversion): Fix to cope
25495         with q being null, since this was introducing a bug.
25496
25497         * expression.cs (ConvertImplicit): Do built-in conversions first.
25498
25499 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25500
25501         * expression.cs (UserImplicitCast::Resolve): Fix bug.
25502
25503 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25504
25505         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
25506         I had introduced long ago (what's new ?).
25507
25508         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
25509         the work of all the checking. 
25510         (ConvertImplicit): Call CanConvert and only then create object if necessary.
25511         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
25512
25513         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
25514         that is the right way. 
25515
25516         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
25517         overloading resolution. Use everywhere instead of cutting and pasting code.
25518
25519         (Binary::ResolveOperator): Use MakeUnionSet.
25520
25521         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
25522         we have to convert to bool types. Not complete yet.
25523
25524 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
25525
25526         * typemanager.cs (TypeManager::CSharpName): support ushort.
25527
25528         * expression.cs (Expression::TryImplicitIntConversion): Attempts
25529         to provide an expression that performsn an implicit constant int
25530         conversion (section 6.1.6).
25531         (Expression::ConvertImplicitRequired): Reworked to include
25532         implicit constant expression conversions.
25533
25534         (Expression::ConvertNumericExplicit): Finished.
25535
25536         (Invocation::Emit): If InstanceExpression is null, then it means
25537         that we perform a call on this.
25538
25539 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
25540
25541         * expression.cs (Unary::Emit): Remove some dead code.
25542         (Probe): Implement Resolve and Emit for `is'.
25543         (Expression::ConvertImplicitRequired): Attempt to do constant
25544         expression conversions here.  Maybe should be moved to
25545         ConvertImplicit, but I am not sure.
25546         (Expression::ImplicitLongConstantConversionPossible,
25547         Expression::ImplicitIntConstantConversionPossible): New functions
25548         that tell whether is it possible to apply an implicit constant
25549         expression conversion.
25550
25551         (ConvertNumericExplicit): Started work on explicit numeric
25552         conversions.
25553
25554         * cs-parser.jay: Update operator constants.
25555
25556         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
25557         (Parameters::GetSignature): Hook up VerifyArgs here.
25558         (Parameters::VerifyArgs): Verifies that no two arguments have the
25559         same name. 
25560
25561         * class.cs (Operator): Update the operator names to reflect the
25562         ones that the spec expects (as we are just stringizing the
25563         operator names).
25564
25565         * expression.cs (Unary::ResolveOperator): Fix bug: Use
25566         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
25567         previous usage did only work for our methods.
25568         (Expression::ConvertImplicit): Handle decimal implicit numeric
25569         conversions as well.
25570         (Expression::InternalTypeConstructor): Used to invoke constructors
25571         on internal types for default promotions.
25572
25573         (Unary::Emit): Implement special handling for the pre/post
25574         increment/decrement for overloaded operators, as they need to have
25575         the same semantics as the other operators.
25576
25577         (Binary::ResolveOperator): ditto.
25578         (Invocation::ConversionExists): ditto.
25579         (UserImplicitCast::Resolve): ditto.
25580
25581 2001-09-26  Ravi Pratap  <ravi@ximian.com>
25582
25583         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
25584         operator, return after emitting body. Regression tests pass again !
25585
25586         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
25587         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
25588         (Invocation::OverloadResolve): Ditto.
25589         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
25590
25591         * everywhere : update calls to the above methods accordingly.
25592
25593 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
25594
25595         * assign.cs (Assign): Make it inherit from ExpressionStatement.
25596
25597         * expression.cs (ExpressionStatement): New base class used for
25598         expressions that can appear in statements, so that we can provide
25599         an alternate path to generate expression that do not leave a value
25600         on the stack.
25601
25602         (Expression::Emit, and all the derivatives): We no longer return
25603         whether a value is left on the stack or not.  Every expression
25604         after being emitted leaves a single value on the stack.
25605
25606         * codegen.cs (EmitContext::EmitStatementExpression): Use the
25607         facilties of ExpressionStatement if possible.
25608
25609         * cs-parser.jay: Update statement_expression.
25610
25611 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
25612
25613         * driver.cs: Change the wording of message
25614
25615 2001-09-25  Ravi Pratap  <ravi@ximian.com>
25616
25617         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
25618         the type of the expression to the return type of the method if
25619         we have an overloaded operator match ! The regression tests pass again !
25620         (Unary::ResolveOperator): Ditto.
25621
25622         * expression.cs (Invocation::ConversionExists): Correct the member lookup
25623         to find "op_Implicit", not "implicit" ;-)
25624         (UserImplicitCast): New class to take care of user-defined implicit conversions.
25625         (ConvertImplicit, ForceConversion): Take TypeContainer argument
25626
25627         * everywhere : Correct calls to the above accordingly.
25628
25629         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
25630         (ConvertImplicit): Do user-defined conversion if it exists.
25631
25632 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
25633
25634         * assign.cs: track location.
25635         (Resolve): Use implicit conversions on assignment.
25636
25637         * literal.cs: Oops.  Not good, Emit of short access values should
25638         pass (Bytes) or the wrong argument will be selected.
25639
25640         * expression.cs (Unary::Emit): Emit code for -expr.
25641
25642         (Unary::ResolveOperator): Handle `Substract' for non-constants
25643         (substract from zero from the non-constants).
25644         Deal with Doubles as well. 
25645
25646         (Expression::ConvertImplicitRequired): New routine that reports an
25647         error if no implicit conversion exists. 
25648
25649         (Invocation::OverloadResolve): Store the converted implicit
25650         expressions if we make them
25651
25652 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25653
25654         * class.cs (ConstructorInitializer): Take a Location argument.
25655         (ConstructorBaseInitializer): Same here.
25656         (ConstructorThisInitializer): Same here.
25657
25658         * cs-parser.jay : Update all calls accordingly.
25659
25660         * expression.cs (Unary, Binary, New): Take location argument.
25661         Update accordingly everywhere.
25662
25663         * cs-parser.jay : Update all calls to the above to take a location
25664         argument.
25665
25666         * class.cs : Ditto.
25667
25668 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25669
25670         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
25671         (Invocation::BetterConversion): Same here
25672         (Invocation::ConversionExists): Ditto.
25673
25674         (Invocation::ConversionExists): Implement.
25675
25676 2001-09-22  Ravi Pratap  <ravi@ximian.com>
25677
25678         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
25679         Also take an additional TypeContainer argument.
25680
25681         * All over : Pass in TypeContainer as argument to OverloadResolve.
25682
25683         * typemanager.cs (CSharpName): Update to check for the string type and return
25684         that too.
25685
25686         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
25687         a given method.
25688
25689 2001-09-21  Ravi Pratap  <ravi@ximian.com>
25690
25691         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
25692         (Invocation::BetterFunction): Implement.
25693         (Invocation::BetterConversion): Implement.
25694         (Invocation::ConversionExists): Skeleton, no implementation yet.
25695
25696         Okay, things work fine !
25697
25698 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
25699
25700         * typemanager.cs: declare and load enum_type, delegate_type and
25701         void_type. 
25702
25703         * expression.cs (Expression::Emit): Now emit returns a value that
25704         tells whether a value is left on the stack or not.  This strategy
25705         might be reveted tomorrow with a mechanism that would address
25706         multiple assignments.
25707         (Expression::report118): Utility routine to report mismatches on
25708         the ExprClass.
25709
25710         (Unary::Report23): Report impossible type/operator combination
25711         utility function.
25712
25713         (Unary::IsIncrementableNumber): Whether the type can be
25714         incremented or decremented with add.
25715         (Unary::ResolveOperator): Also allow enumerations to be bitwise
25716         complemented. 
25717         (Unary::ResolveOperator): Implement ++, !, ~,
25718
25719         (Invocation::Emit): Deal with new Emit convetion.
25720
25721         * All Expression derivatives: Updated their Emit method to return
25722         whether they leave values on the stack or not.
25723
25724         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25725         stack for expressions that are statements. 
25726
25727 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25728
25729         * expression.cs (LValue): New interface.  Must be implemented by
25730         LValue objects.
25731         (LocalVariableReference, ParameterReference, FieldExpr): Implement
25732         LValue interface.
25733
25734         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25735         interface for generating code, simplifies the code.
25736
25737 2001-09-20  Ravi Pratap  <ravi@ximian.com>
25738
25739         * expression.cs (everywhere): Comment out return statements in ::Resolve
25740         methods to avoid the warnings.
25741
25742 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25743
25744         * driver.cs (parse): Report error 2001 if we can not open the
25745         source file.
25746
25747         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25748         not resolve it.
25749
25750         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25751         object. 
25752
25753         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25754         otherwise nested blocks end up with the same index.
25755
25756         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25757
25758         * expression.cs:  Instead of having FIXMEs in the Resolve
25759         functions, throw exceptions so it is obvious that we are facing a
25760         bug. 
25761
25762         * cs-parser.jay (invocation_expression): Pass Location information.
25763
25764         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25765         Use a basename for those routines because .NET does not like paths
25766         on them. 
25767
25768         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25769         already defined.
25770
25771 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
25772
25773         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25774         are loading the correct data types (throws an exception if not).
25775         (TypeManager::InitCoreTypes): Use CoreLookupType
25776
25777         * expression.cs (Unary::ResolveOperator): return the child
25778         expression for expressions which are just +expr.
25779         (Unary::ResolveOperator): Return negative literals for -LITERAL
25780         expressions (otherwise they are Unary {Literal}).
25781         (Invocation::Badness): Take into account `Implicit constant
25782         expression conversions'.
25783
25784         * literal.cs (LongLiteral): Implement long literal class.
25785         (IntLiteral): export the `Value' of the intliteral. 
25786
25787 2001-09-19  Ravi Pratap  <ravi@ximian.com>
25788
25789         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25790
25791         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
25792         instead of 'Operator'
25793
25794         * expression.cs (Binary::ResolveOperator): Update accordingly.
25795         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25796         and 'Minus'
25797
25798         * cs-parser.jay (unary_expression): Update to use the new names.
25799
25800         * gen-treedump.cs (GetUnary): Same here.
25801
25802         * expression.cs (Unary::Resolve): Implement.
25803         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
25804         operators are found instead of making noise ;-)
25805         (Unary::ResolveOperator): New method to do precisely the same thing which
25806         Binary::ResolveOperator does for Binary expressions.
25807         (Unary.method, .Arguments): Add.
25808         (Unary::OperName): Implement.   
25809         (Unary::ForceConversion): Copy and Paste !
25810
25811         * class.cs (Operator::Define): Fix a small bug for the case when we have 
25812         a unary operator.
25813
25814         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25815         for the inbuilt operators. Only overloading works for now ;-)
25816
25817 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
25818
25819         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25820         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25821
25822         * expression.cs (This::Emit): Implement. 
25823         (This::Resolve): Implement.
25824         (TypeOf:Resolve): Implement.
25825         (Expression::ResolveSimpleName): Add an implicit this to instance
25826         field references. 
25827         (MemberAccess::Resolve): Deal with Parameters and Fields. 
25828         Bind instance variable to Field expressions.
25829         (FieldExpr::Instance): New field used to track the expression that
25830         represents the object instance.
25831         (FieldExpr::Resolve): Track potential errors from MemberLookup not
25832         binding 
25833         (FieldExpr::Emit): Implement.
25834
25835         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25836         the last instruction contains a return opcode to avoid generating
25837         the last `ret' instruction (this generates correct code, and it is
25838         nice to pass the peverify output).
25839
25840         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25841         initializer for static and instance variables.
25842         (Constructor::Emit): Allow initializer to be null in the case of
25843         static constructors.  Only emit initializer for instance
25844         constructors. 
25845
25846         (TypeContainer::FindMembers): Return a null array if there are no
25847         matches.
25848
25849         Also fix the code for the MemberTypes.Method branch, as it was not
25850         scanning that for operators (or tried to access null variables before).
25851
25852         * assign.cs (Assign::Emit): Handle instance and static fields. 
25853
25854         * TODO: Updated.
25855
25856         * driver.cs: Stop compilation if there are parse errors.
25857
25858         * cs-parser.jay (constructor_declaration): Provide default base
25859         initializer for non-static constructors.
25860         (constructor_declarator): Do not provide a default base
25861         initializers if none was specified.
25862         Catch the fact that constructors should not have parameters.
25863
25864         * class.cs: Do not emit parent class initializers for static
25865         constructors, that should be flagged as an error.
25866
25867 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25868
25869         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25870         Move back code into TypeContainer::Populate.
25871
25872 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25873
25874         * class.cs (TypeContainer::AddConstructor): Fix the check to
25875         compare against Name, not Basename. 
25876         (Operator::OpType): Change Plus and Minus to Add and Subtract.
25877
25878         * cs-parser.jay : Update accordingly.
25879
25880         * class.cs (TypeContainer::FindMembers): For the case where we are searching
25881         for methods, don't forget to look into the operators too.
25882         (RegisterMethodBuilder): Helper method to take care of this for
25883         methods, constructors and operators.
25884         (Operator::Define): Completely revamp.
25885         (Operator.OperatorMethod, MethodName): New fields.
25886         (TypeContainer::Populate): Move the registering of builders into
25887         RegisterMethodBuilder.
25888         (Operator::Emit): Re-write.
25889
25890         * expression.cs (Binary::Emit): Comment out code path to emit method
25891         invocation stuff for the case when we have a user defined operator. I am
25892         just not able to get it right !
25893
25894 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25895
25896         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25897         argument. 
25898
25899         (Expression::MemberLookup): Provide a version that allows to
25900         specify the MemberTypes and BindingFlags. 
25901
25902         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25903         so it was not fetching variable information from outer blocks.
25904
25905         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25906         Beforefieldinit as it was buggy.
25907
25908         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25909         that Ravi put here.  
25910
25911         * class.cs (Constructor::Emit): Only emit if block is not null.
25912         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25913         deal with this by semantically definining it as if the user had
25914         done it.
25915
25916         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25917         constructors as we now "emit" them at a higher level.
25918
25919         (TypeContainer::DefineDefaultConstructor): Used to define the
25920         default constructors if none was provided.
25921
25922         (ConstructorInitializer): Add methods Resolve and Emit. 
25923
25924         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25925
25926 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25927
25928         * class.cs (TypeContainer::EmitDefaultConstructor): Register
25929         the default constructor builder with our hashtable for methodbuilders
25930         to methodcores.
25931
25932         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25933         and argument_count is 0 in which case we have a match.
25934         (Binary::ResolveOperator): More null checking and miscellaneous coding
25935         style cleanup.
25936
25937 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25938
25939         * rootcontext.cs (IsNameSpace): Compare against null.
25940
25941         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25942
25943         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25944         and Unary::Operator.
25945
25946         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25947         accordingly.
25948
25949         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25950         we have overloaded operators.
25951         (Binary::ResolveOperator): Implement the part which does the operator overload
25952         resolution.
25953
25954         * class.cs (Operator::Emit): Implement.
25955         (TypeContainer::Emit): Emit the operators we have too.
25956
25957         * expression.cs (Binary::Emit): Update to emit the appropriate code for
25958         the case when we have a user-defined operator.
25959
25960 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25961
25962         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25963
25964 2001-09-16  Ravi Pratap  <ravi@ximian.com>
25965
25966         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25967         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25968         (Constructor::Emit): Implement.
25969         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25970         if we have no work to do. 
25971         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
25972         Emit method.
25973
25974         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25975         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25976
25977         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25978         of parent.parent.
25979
25980 2001-09-15  Ravi Pratap  <ravi@ximian.com>
25981
25982         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25983         in the source.
25984         (Tree::RecordNamespace): Method to do what the name says ;-)
25985         (Tree::Namespaces): Property to get at the namespaces hashtable.
25986
25987         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
25988         keep track.
25989
25990         * rootcontext.cs (IsNamespace): Fixed it :-)
25991
25992 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25993
25994         * class.cs (TypeContainer::FindMembers): Add support for
25995         constructors. 
25996         (MethodCore): New class that encapsulates both the shared aspects
25997         of a Constructor and a Method.  
25998         (Method, Constructor): Factored pieces into MethodCore.
25999
26000         * driver.cs: Added --fatal which makes errors throw exceptions.
26001         Load System assembly as well as part of the standard library.
26002
26003         * report.cs: Allow throwing exceptions on errors for debugging.
26004
26005         * modifiers.cs: Do not use `parent', instead use the real type
26006         container to evaluate permission settings.
26007
26008         * class.cs: Put Ravi's patch back in.  He is right, and we will
26009         have to cope with the
26010
26011 2001-09-14  Ravi Pratap  <ravi@ximian.com>
26012
26013         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
26014         FamORAssem, not FamANDAssem.
26015
26016 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
26017
26018         * driver.cs: Added --parse option that only parses its input files
26019         and terminates.
26020
26021         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
26022         incorrect.  IsTopLevel is not used to tell whether an object is
26023         root_types or not (that can be achieved by testing this ==
26024         root_types).  But to see if this is a top-level *class* (not
26025         necessarly our "toplevel" container). 
26026
26027 2001-09-14  Ravi Pratap  <ravi@ximian.com>
26028
26029         * enum.cs (Enum::Define): Modify to call the Lookup method on the
26030         parent instead of a direct call to GetType.
26031
26032 2001-09-14  Ravi Pratap  <ravi@ximian.com>
26033
26034         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
26035         Modifiers.TypeAttr. This should just be a call to that method.
26036
26037         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
26038         object so that we can determine if we are top-level or not.
26039
26040         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
26041         TypeContainer too.
26042
26043         * enum.cs (Enum::Define): Ditto.
26044
26045         * modifiers.cs (FieldAttr): Re-write.
26046
26047         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
26048         (TypeContainer::HaveStaticConstructor): New property to provide access
26049         to precisely that info.
26050
26051         * modifiers.cs (MethodAttr): Re-write.
26052         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
26053
26054         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
26055         of top-level types as claimed.
26056
26057 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
26058
26059         * expression.cs (MemberLookup): Fruitless attempt to lookup
26060         constructors.  Maybe I need to emit default constructors?  That
26061         might be it (currently .NET emits this for me automatically).
26062         (Invocation::OverloadResolve): Cope with Arguments == null.
26063         (Invocation::EmitArguments): new function, shared by the new
26064         constructor and us.
26065         (Invocation::Emit): Handle static and instance methods.  Emit
26066         proper call instruction for virtual or non-virtual invocations.
26067         (New::Emit): Implement.
26068         (New::Resolve): Implement.
26069         (MemberAccess:Resolve): Implement.
26070         (MethodGroupExpr::InstanceExpression): used conforming to the spec
26071         to track instances.
26072         (FieldExpr::Resolve): Set type.
26073
26074         * support.cs: Handle empty arguments.
26075                 
26076         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
26077         SimpleLookup): Auxiliary routines to help parse a qualifier
26078         identifier.  
26079
26080         Update qualifier_identifier rule.
26081
26082         * codegen.cs: Removed debugging messages.
26083
26084         * class.cs: Make this a global thing, this acts just as a "key" to
26085         objects that we might have around.
26086
26087         (Populate): Only initialize method_builders_to_methods once.
26088
26089         * expression.cs (PropertyExpr): Initialize type from the
26090         PropertyType. 
26091
26092         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
26093         Resolve pattern.  Attempt to implicitly convert value to boolean.
26094         Emit code.
26095
26096         * expression.cs: Set the type for the int32/int32 argument case.
26097         (Binary::ResolveOperator): Set the return type to boolean for
26098         comparission operators
26099
26100         * typemanager.cs: Remove debugging print code.
26101
26102         (Invocation::Resolve): resolve type.
26103
26104         * class.cs: Allocate a MemberInfo of the correct size, as the code
26105         elsewhere depends on the test to reflect the correct contents.
26106
26107         (Method::) Keep track of parameters, due to System.Reflection holes
26108
26109         (TypeContainer::Populate): Keep track of MethodBuilders to Method
26110         mapping here.
26111
26112         (TypeContainer::FindMembers): Use ArrayList and then copy an array
26113         of the exact size and return that.
26114
26115         (Class::LookupMethodByBuilder): New function that maps
26116         MethodBuilders to its methods.  Required to locate the information
26117         on methods because System.Reflection bit us again.
26118
26119         * support.cs: New file, contains an interface ParameterData and
26120         two implementations: ReflectionParameters and InternalParameters
26121         used to access Parameter information.  We will need to grow this
26122         as required.
26123
26124         * expression.cs (Invocation::GetParameterData): implement a cache
26125         and a wrapper around the ParameterData creation for methods. 
26126         (Invocation::OverloadResolve): Use new code.
26127
26128 2001-09-13  Ravi Pratap  <ravi@ximian.com>
26129
26130         * class.cs (TypeContainer::EmitField): Remove and move into 
26131         (Field::Define): here and modify accordingly.
26132         (Field.FieldBuilder): New member.
26133         (TypeContainer::Populate): Update accordingly.
26134         (TypeContainer::FindMembers): Implement.
26135
26136 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
26137
26138         * statement.cs: (VariableInfo::VariableType): New field to be
26139         initialized with the full type once it is resolved. 
26140
26141 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
26142
26143         * parameter.cs (GetParameterInfo): Use a type cache to compute
26144         things only once, and to reuse this information
26145
26146         * expression.cs (LocalVariableReference::Emit): Implement.
26147         (OpcodeCast::Emit): fix.
26148
26149         (ParameterReference::Resolve): Implement.
26150         (ParameterReference::Emit): Implement.
26151
26152         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
26153         that are expressions need to stay as Expressions.
26154
26155         * typemanager.cs (CSharpName): Returns the C# name of a type if
26156         possible. 
26157
26158         * expression.cs (Expression::ConvertImplicit): New function that
26159         implements implicit type conversions.
26160
26161         (Expression::ImplicitReferenceConversion): Implements implicit
26162         reference conversions.
26163
26164         (EmptyCast): New type for transparent casts.
26165
26166         (OpcodeCast): New type for casts of types that are performed with
26167         a sequence of bytecodes.
26168
26169         (BoxedCast): New type used for casting value types into reference
26170         types.  Emits a box opcode.
26171
26172         (Binary::DoNumericPromotions): Implements numeric promotions of
26173         and computation of the Binary::Type.
26174
26175         (Binary::EmitBranchable): Optimization.
26176
26177         (Binary::Emit): Implement code emission for expressions.
26178
26179         * typemanager.cs (TypeManager): Added two new core types: sbyte
26180         and byte.
26181
26182 2001-09-12  Ravi Pratap  <ravi@ximian.com>
26183
26184         * class.cs (TypeContainer::FindMembers): Method which does exactly
26185         what Type.FindMembers does, only we don't have to use reflection. No
26186         implementation yet.
26187
26188         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
26189         typecontainer objects as we need to get at them.
26190         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
26191
26192         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
26193         typecontainer object.
26194
26195         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
26196         of just a Report object.
26197
26198 2001-09-11  Ravi Pratap  <ravi@ximian.com>
26199
26200         * class.cs (Event::Define): Go back to using the prefixes "add_" and
26201         "remove_"
26202         (TypeContainer::Populate): Now define the delegates of the type too.
26203         (TypeContainer.Delegates): Property to access the list of delegates defined
26204         in the type.
26205
26206         * delegates.cs (Delegate::Define): Implement partially.
26207
26208         * modifiers.cs (TypeAttr): Handle more flags.
26209
26210 2001-09-11  Ravi Pratap  <ravi@ximian.com>
26211
26212         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
26213         and not <=
26214         (Operator::Define): Re-write logic to get types by using the LookupType method
26215         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
26216         (Indexer::Define): Ditto.
26217         (Event::Define): Ditto.
26218         (Property::Define): Ditto.
26219
26220 2001-09-10  Ravi Pratap  <ravi@ximian.com>
26221
26222         * class.cs (TypeContainer::Populate): Now define operators too. 
26223         (TypeContainer.Operators): New property to access the list of operators
26224         in a type.
26225         (Operator.OperatorMethodBuilder): New member to hold the method builder
26226         for the operator we are defining.
26227         (Operator::Define): Implement.
26228
26229 2001-09-10  Ravi Pratap  <ravi@ximian.com>
26230
26231         * class.cs (Event::Define): Make the prefixes of the accessor methods
26232         addOn_ and removeOn_ 
26233
26234         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
26235         of the location being passed in too. Ideally, this should go later since all
26236         error reporting should be done through the Report object.
26237
26238         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
26239         (Populate): Iterate thru the indexers we have and define them too.
26240         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
26241         for the get and set accessors.
26242         (Indexer::Define): Implement.
26243
26244 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
26245
26246         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
26247         my previous implementation, did not work.
26248
26249         * typemanager.cs: Add a couple of missing types (the longs).
26250
26251         * literal.cs: Use TypeManager.bool_type instead of getting it.
26252
26253         * expression.cs (EventExpr): New kind of expressions.
26254         (Expressio::ExprClassFromMemberInfo): finish
26255
26256 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
26257
26258         * assign.cs: Emit stores to static fields differently.
26259
26260 2001-09-08  Ravi Pratap  <ravi@ximian.com>
26261
26262         * Merge in changes and adjust code to tackle conflicts. Backed out my
26263         code in Assign::Resolve ;-) 
26264
26265 2001-09-08  Ravi Pratap  <ravi@ximian.com>
26266
26267         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
26268         instead Report.Error and also pass in the location.
26269         (CSharpParser::Lexer): New readonly property to return the reference
26270         to the Tokenizer object.
26271         (declare_local_variables): Use Report.Error with location instead of plain 
26272         old error.
26273         (CheckDef): Ditto.
26274
26275         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
26276         (Operator.CheckBinaryOperator): Ditto.
26277
26278         * cs-parser.jay (operator_declarator): Update accordingly.
26279
26280         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
26281         (CheckBinaryOperator): Same here.
26282
26283         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
26284         on the name without any prefixes of namespace names etc. This is because we
26285         already might have something already fully qualified like 
26286         'System.Console.WriteLine'
26287
26288         * assign.cs (Resolve): Begin implementation. Stuck ;-)
26289
26290 2001-09-07  Ravi Pratap  <ravi@ximian.com>
26291
26292         * cs-tokenizer.cs (location): Return a string which also contains
26293         the file name.
26294
26295         * expression.cs (ElementAccess): New class for expressions of the
26296         type 'element access.'
26297         (BaseAccess): New class for expressions of the type 'base access.'
26298         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
26299         respectively.
26300
26301         * cs-parser.jay (element_access): Implement action.
26302         (base_access): Implement actions.
26303         (checked_expression, unchecked_expression): Implement.
26304
26305         * cs-parser.jay (local_variable_type): Correct and implement.
26306         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
26307
26308         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
26309
26310         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
26311         name and the specifiers.
26312
26313         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
26314
26315         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
26316         making them all public ;-)
26317
26318         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
26319         class anyways.
26320
26321 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
26322
26323         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
26324         PropertyExprs.
26325         (FieldExpr, PropertyExprs): New resolved expressions.
26326         (SimpleName::MemberStaticCheck): Perform static checks for access
26327         to non-static fields on static methods. Maybe this should be
26328         generalized for MemberAccesses. 
26329         (SimpleName::ResolveSimpleName): More work on simple name
26330         resolution. 
26331
26332         * cs-parser.jay (primary_expression/qualified_identifier): track
26333         the parameter index.
26334
26335         * codegen.cs (CodeGen::Save): Catch save exception, report error.
26336         (EmitContext::EmitBoolExpression): Chain to expression generation
26337         instead of temporary hack.
26338         (::EmitStatementExpression): Put generic expression code generation.
26339
26340         * assign.cs (Assign::Emit): Implement variable assignments to
26341         local variables, parameters and fields.
26342
26343 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
26344
26345         * statement.cs (Block::GetVariableInfo): New method, returns the
26346         VariableInfo for a variable name in a block.
26347         (Block::GetVariableType): Implement in terms of GetVariableInfo
26348
26349         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
26350         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
26351
26352 2001-09-06  Ravi Pratap  <ravi@ximian.com>
26353
26354         * cs-parser.jay (operator_declaration): Continue on my quest : update
26355         to take attributes argument.
26356         (event_declaration): Ditto.
26357         (enum_declaration): Ditto.
26358         (indexer_declaration): Ditto.
26359
26360         * class.cs (Operator::Operator): Update constructor accordingly.
26361         (Event::Event): Ditto.
26362
26363         * delegate.cs (Delegate::Delegate): Same here.
26364
26365         * enum.cs (Enum::Enum): Same here.
26366
26367 2001-09-05  Ravi Pratap  <ravi@ximian.com>
26368
26369         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
26370
26371         * ../tests/cs0658.cs : New file to demonstrate error 0658.
26372
26373         * attribute.cs (Attributes): New class to encapsulate all attributes which were
26374         being passed around as an arraylist.
26375         (Attributes::AddAttribute): Method to add attribute sections.
26376
26377         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
26378         (struct_declaration): Update accordingly.
26379         (constant_declaration): Update.
26380         (field_declaration): Update.
26381         (method_header): Update.
26382         (fixed_parameter): Update.
26383         (parameter_array): Ditto.
26384         (property_declaration): Ditto.
26385         (destructor_declaration): Ditto.
26386
26387         * class.cs (Struct::Struct): Update constructors accordingly.
26388         (Class::Class): Ditto.
26389         (Field::Field): Ditto.
26390         (Method::Method): Ditto.
26391         (Property::Property): Ditto.
26392         (TypeContainer::OptAttribute): update property's return type.
26393
26394         * interface.cs (Interface.opt_attributes): New member.
26395         (Interface::Interface): Update to take the extra Attributes argument.
26396
26397         * parameter.cs (Parameter::Parameter): Ditto.
26398
26399         * constant.cs (Constant::Constant): Ditto.
26400
26401         * interface.cs (InterfaceMemberBase): New OptAttributes field.
26402         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
26403         the attributes as a parameter.
26404         (InterfaceProperty): Update constructor call.
26405         (InterfaceEvent): Ditto.
26406         (InterfaceMethod): Ditto.
26407         (InterfaceIndexer): Ditto.
26408
26409         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
26410         pass the attributes too.
26411         (interface_event_declaration): Ditto.
26412         (interface_property_declaration): Ditto.
26413         (interface_method_declaration): Ditto.
26414         (interface_declaration): Ditto.
26415
26416 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
26417
26418         * class.cs (Method::Define): Track the "static Main" definition to
26419         create an entry point. 
26420
26421         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
26422         EntryPoint if we find it. 
26423
26424         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
26425         (EmitContext::ig): Make this variable public.
26426
26427         * driver.cs: Make the default output file be the first file name
26428         with the .exe extension.  
26429
26430         Detect empty compilations
26431
26432         Handle various kinds of output targets.  Handle --target and
26433         rename -t to --dumper.
26434
26435         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
26436         methods inherited from Expression return now an Expression.  This
26437         will is used during the tree rewriting as we resolve them during
26438         semantic analysis.
26439
26440         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
26441         the spec.  Missing entirely is the information about
26442         accessability of elements of it.
26443
26444         (Expression::ExprClassFromMemberInfo): New constructor for
26445         Expressions that creates a fully initialized Expression based on
26446         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
26447         a Type.
26448
26449         (Invocation::Resolve): Begin implementing resolution of invocations.
26450
26451         * literal.cs (StringLiteral):  Implement Emit.
26452
26453 2001-09-05  Ravi Pratap  <ravi@ximian.com>
26454
26455         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
26456         member.
26457
26458 2001-09-04  Ravi Pratap  <ravi@ximian.com>
26459
26460         * cs-parser.jay (attribute_arguments): Implement actions.
26461         (attribute): Fix bug in production. Implement action.
26462         (attribute_list): Implement.
26463         (attribute_target): Implement.
26464         (attribute_target_specifier, opt_target_specifier): Implement
26465         (CheckAttributeTarget): New method to check if the attribute target
26466         is valid.
26467         (attribute_section): Implement.
26468         (opt_attributes): Implement.
26469
26470         * attribute.cs : New file to handle attributes.
26471         (Attribute): Class to hold attribute info.
26472
26473         * cs-parser.jay (opt_attribute_target_specifier): Remove production
26474         (attribute_section): Modify production to use 2 different rules to 
26475         achieve the same thing. 1 s/r conflict down !
26476         Clean out commented, useless, non-reducing dimension_separator rules.
26477
26478         * class.cs (TypeContainer.attributes): New member to hold list
26479         of attributes for a type.
26480         (Struct::Struct): Modify to take one more argument, the attribute list.
26481         (Class::Class): Ditto.
26482         (Field::Field): Ditto.
26483         (Method::Method): Ditto.
26484         (Property::Property): Ditto.
26485
26486         * cs-parser.jay (struct_declaration): Update constructor call to
26487         pass in the attributes too.
26488         (class_declaration): Ditto.
26489         (constant_declaration): Ditto.
26490         (field_declaration): Ditto.
26491         (method_header): Ditto.
26492         (fixed_parameter): Ditto.
26493         (parameter_array): Ditto.
26494         (property_declaration): Ditto.
26495
26496         * constant.cs (Constant::Constant): Update constructor similarly.
26497         Use System.Collections.
26498
26499         * parameter.cs (Parameter::Parameter): Update as above.
26500
26501 2001-09-02  Ravi Pratap  <ravi@ximian.com>
26502
26503         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
26504         (TypeContainer.delegates): New member to hold list of delegates.
26505
26506         * cs-parser.jay (delegate_declaration): Implement the action correctly 
26507         this time as I seem to be on crack ;-)
26508
26509 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
26510
26511         * rootcontext.cs (RootContext::IsNamespace): new function, used to
26512         tell whether an identifier represents a namespace.
26513
26514         * expression.cs (NamespaceExpr): A namespace expression, used only
26515         temporarly during expression resolution.
26516         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
26517         utility functions to resolve names on expressions.
26518
26519 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
26520
26521         * codegen.cs: Add hook for StatementExpressions. 
26522
26523         * class.cs: Fix inverted test for static flag in methods.
26524
26525 2001-09-02  Ravi Pratap  <ravi@ximian.com>
26526
26527         * class.cs (Operator::CheckUnaryOperator): Correct error number used
26528         to make it coincide with MS' number.
26529         (Operator::CheckBinaryOperator): Ditto.
26530
26531         * ../errors/errors.txt : Remove error numbers added earlier.
26532
26533         * ../errors/cs1019.cs : Test case for error # 1019
26534
26535         * ../errros/cs1020.cs : Test case for error # 1020
26536
26537         * cs-parser.jay : Clean out commented cruft.
26538         (dimension_separators, dimension_separator): Comment out. Ostensibly not
26539         used anywhere - non-reducing rule.
26540         (namespace_declarations): Non-reducing rule - comment out.
26541
26542         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
26543         with TypeContainer::AddEnum.
26544
26545         * delegate.cs : New file for delegate handling classes.
26546         (Delegate): Class for declaring delegates.
26547
26548         * makefile : Update.
26549
26550         * cs-parser.jay (delegate_declaration): Implement.
26551
26552 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
26553
26554         * class.cs (Event::Define): Implement.
26555         (Event.EventBuilder): New member.
26556
26557         * class.cs (TypeContainer::Populate): Update to define all enums and events
26558         we have.
26559         (Events): New property for the events arraylist we hold. Shouldn't we move to using
26560         readonly fields for all these cases ?
26561
26562 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
26563
26564         * class.cs (Property): Revamp to use the convention of making fields readonly.
26565         Accordingly modify code elsewhere.
26566
26567         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
26568         the Define method of the Property class.
26569
26570         * class.cs : Clean up applied patch and update references to variables etc. Fix 
26571         trivial bug.
26572         (TypeContainer::Populate): Update to define all the properties we have. Also
26573         define all enumerations.
26574
26575         * enum.cs (Define): Implement.
26576
26577 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
26578
26579         * cs-parser.jay (overloadable_operator): The semantic value is an
26580         enum of the Operator class.
26581         (operator_declarator): Implement actions.
26582         (operator_declaration): Implement.
26583
26584         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
26585         validity of definitions.
26586         (Operator::CheckBinaryOperator): Static method to check for binary operators
26587         (TypeContainer::AddOperator): New method to add an operator to a type.
26588
26589         * cs-parser.jay (indexer_declaration): Added line to actually call the
26590         AddIndexer method so it gets added ;-)
26591
26592         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
26593         already taken care of by the MS compiler ?  
26594
26595 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
26596
26597         * class.cs (Operator): New class for operator declarations.
26598         (Operator::OpType): Enum for the various operators.
26599
26600 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
26601
26602         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
26603         ostensibly handle this in semantic analysis.
26604
26605         * cs-parser.jay (general_catch_clause): Comment out
26606         (specific_catch_clauses, specific_catch_clause): Ditto.
26607         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
26608         (catch_args, opt_catch_args): New productions.
26609         (catch_clause): Rewrite to use the new productions above
26610         (catch_clauses): Modify accordingly.
26611         (opt_catch_clauses): New production to use in try_statement
26612         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
26613         and re-write the code in the actions to extract the specific and
26614         general catch clauses by being a little smart ;-)
26615
26616         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
26617         Hooray, try and catch statements parse fine !
26618
26619 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26620
26621         * statement.cs (Block::GetVariableType): Fix logic to extract the type
26622         string from the hashtable of variables.
26623
26624         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
26625         I end up making that mistake ;-)
26626         (catch_clauses): Fixed gross error which made Key and Value of the 
26627         DictionaryEntry the same : $1 !!
26628
26629 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26630
26631         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
26632
26633         * cs-parser.jay (event_declaration): Correct to remove the semicolon
26634         when the add and remove accessors are specified. 
26635
26636 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26637
26638         * cs-parser.jay (IndexerDeclaration): New helper class to hold
26639         information about indexer_declarator.
26640         (indexer_declarator): Implement actions.
26641         (parsing_indexer): New local boolean used to keep track of whether
26642         we are parsing indexers or properties. This is necessary because 
26643         implicit_parameters come into picture even for the get accessor in the 
26644         case of an indexer.
26645         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
26646
26647         * class.cs (Indexer): New class for indexer declarations.
26648         (TypeContainer::AddIndexer): New method to add an indexer to a type.
26649         (TypeContainer::indexers): New member to hold list of indexers for the
26650         type.
26651
26652 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26653
26654         * cs-parser.jay (add_accessor_declaration): Implement action.
26655         (remove_accessor_declaration): Implement action.
26656         (event_accessors_declaration): Implement
26657         (variable_declarators): swap statements for first rule - trivial.
26658
26659         * class.cs (Event): New class to hold information about event
26660         declarations.
26661         (TypeContainer::AddEvent): New method to add an event to a type
26662         (TypeContainer::events): New member to hold list of events.
26663
26664         * cs-parser.jay (event_declaration): Implement actions.
26665
26666 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26667
26668         * cs-parser.jay (dim_separators): Implement. Make it a string
26669         concatenating all the commas together, just as they appear.
26670         (opt_dim_separators): Modify accordingly
26671         (rank_specifiers): Update accordingly. Basically do the same
26672         thing - instead, collect the brackets here.
26673         (opt_rank_sepcifiers): Modify accordingly.
26674         (array_type): Modify to actually return the complete type string
26675         instead of ignoring the rank_specifiers.
26676         (expression_list): Implement to collect the expressions
26677         (variable_initializer): Implement. We make it a list of expressions
26678         essentially so that we can handle the array_initializer case neatly too.
26679         (variable_initializer_list): Implement.
26680         (array_initializer): Make it a list of variable_initializers
26681         (opt_array_initializer): Modify accordingly.
26682
26683         * expression.cs (New::NType): Add enumeration to help us
26684         keep track of whether we have an object/delegate creation
26685         or an array creation.
26686         (New:NewType, New::Rank, New::Indices, New::Initializers): New
26687         members to hold data about array creation.
26688         (New:New): Modify to update NewType
26689         (New:New): New Overloaded contructor for the array creation
26690         case.
26691
26692         * cs-parser.jay (array_creation_expression): Implement to call
26693         the overloaded New constructor.
26694
26695 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
26696
26697         * class.cs (TypeContainer::Constructors): Return member
26698         constructors instead of returning null.
26699
26700 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
26701
26702         * typemanager.cs (InitCoreTypes): Initialize the various core
26703         types after we have populated the type manager with the user
26704         defined types (this distinction will be important later while
26705         compiling corlib.dll)
26706
26707         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
26708         on Expression Classification.  Now all expressions have a method
26709         `Resolve' and a method `Emit'.
26710
26711         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
26712         generation from working.     Also add some temporary debugging
26713         code. 
26714
26715 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
26716
26717         * codegen.cs: Lots of code generation pieces.  This is only the
26718         beginning, will continue tomorrow with more touches of polish.  We
26719         handle the fundamentals of if, while, do, for, return.  Others are
26720         trickier and I need to start working on invocations soon.
26721
26722         * gen-treedump.cs: Bug fix, use s.Increment here instead of
26723         s.InitStatement. 
26724
26725         * codegen.cs (EmitContext): New struct, used during code
26726         emission to keep a context.   Most of the code generation will be
26727         here. 
26728
26729         * cs-parser.jay: Add embedded blocks to the list of statements of
26730         this block.  So code generation proceeds in a top down fashion.
26731
26732 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
26733
26734         * statement.cs: Add support for multiple child blocks.
26735
26736 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
26737
26738         * codegen.cs (EmitCode): New function, will emit the code for a
26739         Block of code given a TypeContainer and its ILGenerator. 
26740
26741         * statement.cs (Block): Standard public readonly optimization.
26742         (Block::Block constructors): Link children. 
26743         (Block::Child): Child Linker.
26744         (Block::EmitVariables): Emits IL variable declarations.
26745
26746         * class.cs: Drop support for MethodGroups here, delay until
26747         Semantic Analysis.
26748         (Method::): Applied the same simplification that I did before, and
26749         move from Properties to public readonly fields.
26750         (Method::ParameterTypes): Returns the parameter types for the
26751         function, and implements a cache that will be useful later when I
26752         do error checking and the semantic analysis on the methods is
26753         performed.
26754         (Constructor::GetCallingConvention): Renamed from CallingConvetion
26755         and made a method, optional argument tells whether this is a class
26756         or a structure to apply the `has-this' bit.
26757         (Method::GetCallingConvention): Implement, returns the calling
26758         convention. 
26759         (Method::Define): Defines the type, a second pass is performed
26760         later to populate the methods.
26761
26762         (Constructor::ParameterTypes): implement a cache similar to the
26763         one on Method::ParameterTypes, useful later when we do semantic
26764         analysis. 
26765
26766         (TypeContainer::EmitMethod):  New method.  Emits methods.
26767
26768         * expression.cs: Removed MethodGroup class from here.
26769
26770         * parameter.cs (Parameters::GetCallingConvention): new method.
26771
26772 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
26773
26774         * class.cs (TypeContainer::Populate): Drop RootContext from the
26775         argument. 
26776
26777         (Constructor::CallingConvention): Returns the calling convention.
26778         (Constructor::ParameterTypes): Returns the constructor parameter
26779         types. 
26780
26781         (TypeContainer::AddConstructor): Keep track of default constructor
26782         and the default static constructor.
26783
26784         (Constructor::) Another class that starts using `public readonly'
26785         instead of properties. 
26786
26787         (Constructor::IsDefault): Whether this is a default constructor. 
26788
26789         (Field::) use readonly public fields instead of properties also.
26790
26791         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26792         track of static constructors;  If none is used, turn on
26793         BeforeFieldInit in the TypeAttributes. 
26794
26795         * cs-parser.jay (opt_argument_list): now the return can be null
26796         for the cases where there are no arguments. 
26797
26798         (constructor_declarator): If there is no implicit `base' or
26799         `this', then invoke the default parent constructor. 
26800
26801         * modifiers.cs (MethodAttr): New static function maps a set of
26802         modifiers flags into a MethodAttributes enum
26803         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
26804         MethodAttr, TypeAttr to represent the various mappings where the
26805         modifiers are used.
26806         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
26807
26808 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
26809
26810         * parameter.cs (GetParameterInfo): Fix bug where there would be no
26811         method arguments.
26812
26813         * interface.cs (PopulateIndexer): Implemented the code generator
26814         for interface indexers.
26815
26816 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
26817
26818         * interface.cs (InterfaceMemberBase): Now we track the new status
26819         here.  
26820
26821         (PopulateProperty): Implement property population.  Woohoo!  Got
26822         Methods and Properties going today. 
26823
26824         Removed all the properties for interfaces, and replaced them with
26825         `public readonly' fields. 
26826
26827 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
26828
26829         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26830         initialize their hashtables/arraylists only when they are needed
26831         instead of doing this always.
26832
26833         * parameter.cs: Handle refs and out parameters.
26834
26835         * cs-parser.jay: Use an ArrayList to construct the arguments
26836         instead of the ParameterCollection, and then cast that to a
26837         Parameter[] array.
26838
26839         * parameter.cs: Drop the use of ParameterCollection and use
26840         instead arrays of Parameters.
26841
26842         (GetParameterInfo): Use the Type, not the Name when resolving
26843         types. 
26844
26845 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
26846
26847         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26848         and instead use public readonly fields.
26849
26850         * class.cs: Put back walking code for type containers.
26851
26852 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
26853
26854         * class.cs (MakeConstant): Code to define constants.
26855
26856         * rootcontext.cs (LookupType): New function.  Used to locate types 
26857
26858
26859 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
26860
26861         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
26862         this System.Reflection code is.  Kudos to Microsoft
26863
26864         * typemanager.cs: Implement a type cache and avoid loading all
26865         types at boot time.  Wrap in LookupType the internals.  This made
26866         the compiler so much faster.  Wow.  I rule!
26867
26868         * driver.cs: Make sure we always load mscorlib first (for
26869         debugging purposes, nothing really important).
26870
26871         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
26872         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
26873
26874         * rootcontext.cs: Lookup types on their namespace;  Lookup types
26875         on namespaces that have been imported using the `using' keyword.
26876
26877         * class.cs (TypeContainer::TypeAttr): Virtualize.
26878         (Class::TypeAttr): Return attributes suitable for this bad boy.
26879         (Struct::TypeAttr): ditto.
26880         Handle nested classes.
26881         (TypeContainer::) Remove all the type visiting code, it is now
26882         replaced with the rootcontext.cs code
26883
26884         * rootcontext.cs (GetClassBases): Added support for structs. 
26885
26886 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
26887
26888         * interface.cs, statement.cs, class.cs, parameter.cs,
26889         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26890         Drop use of TypeRefs, and use strings instead.
26891
26892 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
26893
26894         * rootcontext.cs: 
26895
26896         * class.cs (Struct::Struct): set the SEALED flags after
26897         checking the modifiers.
26898         (TypeContainer::TypeAttr): new property, returns the
26899         TypeAttributes for a class.  
26900
26901         * cs-parser.jay (type_list): Oops, list production was creating a
26902         new list of base types.
26903
26904         * rootcontext.cs (StdLib): New property.
26905         (GetInterfaceTypeByName): returns an interface by type name, and
26906         encapsulates error handling here.
26907         (GetInterfaces): simplified.
26908         (ResolveTree): Encapsulated all the tree resolution here.
26909         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26910         types. 
26911
26912         * driver.cs: Add support for --nostdlib, to avoid loading the
26913         default assemblies.
26914         (Main): Do not put tree resolution here. 
26915
26916         * rootcontext.cs: Beginning of the class resolution.
26917
26918 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
26919
26920         * rootcontext.cs: Provide better error reporting. 
26921
26922         * cs-parser.jay (interface_base): set our $$ to be interfaces.
26923
26924         * rootcontext.cs (CreateInterface): Handle the case where there
26925         are no parent interfaces.
26926
26927         (CloseTypes): Routine to flush types at the end.
26928         (CreateInterface): Track types.
26929         (GetInterfaces): Returns an array of Types from the list of
26930         defined interfaces.
26931
26932         * typemanager.c (AddUserType): Mechanism to track user types (puts
26933         the type on the global type hash, and allows us to close it at the
26934         end). 
26935
26936 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
26937
26938         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26939         RecordInterface instead.
26940
26941         * cs-parser.jay: Updated to reflect changes above.
26942
26943         * decl.cs (Definition): Keep track of the TypeBuilder type that
26944         represents this type here.  Not sure we will use it in the long
26945         run, but wont hurt for now.
26946
26947         * driver.cs: Smaller changes to accomodate the new code.
26948
26949         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26950         when done. 
26951
26952         * rootcontext.cs (CreateInterface):  New method, used to create
26953         the System.TypeBuilder type for interfaces.
26954         (ResolveInterfaces): new entry point to resolve the interface
26955         hierarchy. 
26956         (CodeGen): Property, used to keep track of the code generator.
26957
26958 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
26959
26960         * cs-parser.jay: Add a second production for delegate_declaration
26961         with `VOID'.
26962
26963         (enum_body): Put an opt_comma here instead of putting it on
26964         enum_body or enum_member_declarations so we can handle trailing
26965         commas on enumeration members.  Gets rid of a shift/reduce.
26966
26967         (type_list): Need a COMMA in the middle.
26968
26969         (indexer_declaration): Tell tokenizer to recognize get/set
26970
26971         * Remove old targets.
26972
26973         * Re-add the parser target.
26974
26975 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26976
26977         * cs-parser.jay: Add precendence rules for a number of operators
26978         ot reduce the number of shift/reduce conflicts in the grammar.
26979
26980 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
26981
26982         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26983         and put it here.
26984
26985         Get rid of old crufty code.
26986
26987         * rootcontext.cs: Use this to keep track of the parsed
26988         representation and the defined types available to the program. 
26989
26990         * gen-treedump.cs: adjust for new convention.
26991
26992         * type.cs: Split out the type manager, and the assembly builder
26993         from here. 
26994
26995         * typemanager.cs: the type manager will live here now.
26996
26997         * cil-codegen.cs: And the code generator here. 
26998
26999 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
27000
27001         * makefile: Fixed up for easy making.
27002
27003 2001-07-13  Simon Cozens <simon@simon-cozens.org>
27004
27005         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
27006         the 
27007
27008         (unary_expression): Expand pre_increment_expression and
27009         post_decrement_expression to reduce a shift/reduce.
27010
27011 2001-07-11  Simon Cozens
27012
27013         * cs-tokenizer.cs: Hex numbers should begin with a 0.
27014
27015         Improve allow_keyword_as_indent name.
27016
27017 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
27018
27019         * Adjustments for Beta2. 
27020
27021 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
27022
27023         * decl.cs: Added `Define' abstract method.
27024         (InTransit): new property, used to catch recursive definitions. 
27025
27026         * interface.cs: Implement `Define'. 
27027
27028         * modifiers.cs: Map Modifiers.constants to
27029         System.Reflection.TypeAttribute flags.
27030
27031         * class.cs: Keep track of types and user-defined types.
27032         (BuilderInit): New method for creating an assembly
27033         (ResolveType): New function to launch the resolution process, only
27034         used by interfaces for now.
27035
27036         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
27037         that are inserted into the name space. 
27038
27039 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
27040
27041         * ARGH.  I have screwed up my tree so many times due to the use of
27042         rsync rather than using CVS.  Going to fix this at once. 
27043
27044         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
27045         load types.
27046
27047 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
27048
27049         * Experiment successful: Use System.Type rather that our own
27050         version of Type.  
27051
27052 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
27053
27054         * cs-parser.jay: Removed nsAliases from here.
27055
27056         Use new namespaces, handle `using XXX;' 
27057
27058         * namespace.cs: Reimplemented namespace handling, use a recursive
27059         definition of the class.  Now we can keep track of using clauses
27060         and catch invalid using clauses.
27061
27062 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
27063
27064         * gen-treedump.cs: Adapted for all the renaming.
27065
27066         * expression.cs (Expression): this class now has a Type property
27067         which returns an expression Type.
27068
27069         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
27070         `Type', as this has a different meaning now in the base
27071
27072 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
27073
27074         * interface.cs, class.cs: Removed from all the sources the
27075         references to signature computation, as we can not do method
27076         signature computation during the parsing time, as we are not
27077         trying to solve at that point distinguishing:
27078
27079         class X {
27080                 void a (Blah x) {}
27081                 void a (NS.Blah x) {}
27082         }
27083
27084         Which depending on the context might be valid or not, as we do not
27085         know if Blah is the same thing as NS.Blah at that point.
27086
27087         * Redid everything so the code uses TypeRefs now instead of
27088         Types.  TypeRefs are just temporary type placeholders, that need
27089         to be resolved.  They initially have a pointer to a string and the
27090         current scope in which they are used.  This is used later by the
27091         compiler to resolve the reference to an actual Type. 
27092
27093         * DeclSpace is no longer a CIR.Type, and neither are
27094         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
27095         are all DeclSpaces, but no Types. 
27096
27097         * type.cs (TypeRefManager): This implements the TypeRef manager,
27098         which keeps track of all the types that need to be resolved after
27099         the parsing has finished. 
27100
27101 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
27102
27103         * ARGH.  We are going to have to store `foreach' as a class rather
27104         than resolving it, as we need to verify error 1579 after name
27105         resolution.   *OR* we could keep a flag that says `This request to
27106         IEnumerator comes from a foreach statement' which we can then use
27107         to generate the error.
27108
27109 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
27110
27111         * class.cs (TypeContainer.AddMethod): we now add methods to the
27112         MethodGroup instead of the method hashtable.  
27113
27114         * expression.cs: Add MethodGroup abstraction, which gets us one
27115         step closer to the specification in the way we handle method
27116         declarations.  
27117
27118         * cs-parser.jay (primary_expression): qualified_identifier now
27119         tried to match up an identifier to a local variable reference or
27120         to a parameter reference.
27121
27122         current_local_parameters is now a parser global variable that
27123         points to the current parameters for the block, used during name
27124         lookup.
27125
27126         (property_declaration): Now creates an implicit `value' argument to
27127         the set accessor.
27128
27129 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
27130
27131         * parameter.cs: Do not use `param' arguments as part of the
27132         signature, per the spec.
27133
27134 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
27135
27136         * decl.cs: Base class for classes, structs and interfaces.  This
27137         is the "Declaration Space" 
27138
27139         * cs-parser.jay: Use CheckDef for checking declaration errors
27140         instead of having one on each function.
27141
27142         * class.cs: Factor out some code for handling error handling in
27143         accordance to the "Declarations" section in the "Basic Concepts"
27144         chapter in the ECMA C# spec.
27145
27146         * interface.cs: Make all interface member classes derive from
27147         InterfaceMemberBase.
27148
27149 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
27150
27151         * Many things: all interfaces are parsed and generated in
27152         gen-treedump.  Support for member variables, constructors,
27153         destructors, properties, constants is there.
27154
27155         Beginning of the IL backend, but very little done, just there for
27156         testing purposes. 
27157
27158 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
27159
27160         * cs-parser.jay: Fix labeled statement.
27161
27162         * cs-tokenizer.cs (escape): Escape " and ' always.
27163         ref_line, ref_name: keep track of the line/filename as instructed
27164         by #line by the compiler.
27165         Parse #line.
27166
27167 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
27168
27169         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
27170         to match the values in System.CodeDOM.
27171
27172         Divid renamed to Divide.
27173
27174         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
27175         statements. 
27176         (Statements.set): remove.
27177
27178         * System.CodeDOM/CodeCatchClause.cs: always have a valid
27179         statements. 
27180
27181         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
27182         falseStatements always have valid values. 
27183
27184         * cs-parser.jay: Use System.CodeDOM now.
27185