2007-06-14 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / gmcs / ChangeLog
1 2007-06-14  Marek Safar  <marek.safar@gmail.com>
2
3         * cs-parser.jay: Assembly and module attributes must precede all other
4         elements except using clauses and extern alias declarations.
5
6 2007-06-08  Marek Safar  <marek.safar@gmail.com>
7
8         * cs-parser.jay: Uses newly defined GroupBy class.
9         
10         * linq.cs (GroupBy): Implemented.
11         (AQueryClause.BuildQueryClause): Refactored to allow customize query
12         method arguments.
13
14 2007-06-08  Marek Safar  <marek.safar@gmail.com>
15
16         * generics.cs (InferTypeArguments): Uses AnonymousMethodExpression
17         InferTypeArguments.
18
19 2007-06-06  Marek Safar  <marek.safar@gmail.com>
20
21         * generics.cs (TypeArguments): New contructor fow known number of
22         arguments.
23
24 2007-06-04  Raja R Harinath  <rharinath@novell.com>
25
26         * linq.cs (Select.DoResolve): Pass the created parameters to the
27         ToplevelBlock too.
28
29 2007-05-29  Raja R Harinath  <rharinath@novell.com>
30
31         * cs-parser.jay: Update to changes in ToplevelBlock.
32         (top_current_block): Remove.
33
34 2007-05-27  Raja R Harinath  <harinath@gmail.com>
35
36         * cs-parser.jay: Update to new ExplicitBlock invariant.
37
38         * cs-parser.jay: Update to changes introduced in Block and
39         ExplicitBlock.
40
41 2007-05-25  Raja R Harinath  <rharinath@novell.com>
42
43         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
44         modifying current_block directly.
45
46 2007-05-22  Scott Peterson  <lunchtimemama@gmail.com>
47         
48         * cs-parser.jay: Implemented automatic properties (C# 3.0)
49
50 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
51         
52         * cs-parser.jay: Improved grammar for object and collection
53           initialization.
54
55 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
56
57         This code is contributed under the MIT X11 license
58         
59         * cs-parser.jay: Added support for C# 3.0 language features:
60           Variable type inference (the "var" keyword)
61           Anonymous types
62           Array type inference
63           Object initialization
64           Collection initialization
65
66 2007-05-06  Marek Safar  <marek.safar@gmail.com>
67
68         A fix for bug #81500
69         * cs-parser.jay: Add special handling for coalescing operator.
70
71 2007-05-02  Raja R Harinath  <rharinath@novell.com>
72
73         Fix regression in cs0631-3.cs
74         * cs-parser.jay (operator_declarator): Add opt_attributes to error
75         fallback.  Make error fallback catch more cases.
76
77 2007-05-01  Miguel de Icaza  <miguel@novell.com>
78
79         * cs-parser.jay: Allow parameters in operator declarations to have
80         attributes. 
81
82 2007-04-27  Miguel de Icaza  <miguel@novell.com>
83
84         * generic.cs (TypeManager.LambdaInfer): now this routine will
85         make only one inference from the list of lambda expression that
86         have not participated in inferring a type.
87
88         (TypeManager.InferTypeArguments): The logic that drives the type
89         inference in lambda expressions is now driven here. 
90
91 2007-04-23  Miguel de Icaza  <miguel@novell.com>
92
93         * generic.cs: Large update to LambdaInfer, this is merely an
94         update to start the lambda type inference.   It is by no means
95         complete.  It is currently merely able to build a sample program
96         (with no iteration for the type parameters).
97
98 2007-04-12  Duncan Mak  <duncan@a-chinaman.com>
99
100         * cs-parser.jay (interface_method_declaration_body): Fixed typo.
101
102 2007-04-08  Marek Safar  <marek.safar@gmail.com>
103
104         * cs-parser.jay, linq.cs: First select implementation (hacky).
105
106         * generic.cs (InferTypeArguments): Simplified.
107
108 2007-03-31  Marek Safar  <marek.safar@gmail.com>
109
110         * generic.cs (InferTypeArguments): Restored validation check.
111         (InferTypeArguments): Move all logic to Compatible method for re-usability.
112
113 2007-03-25  Marek Safar  <marek.safar@gmail.com>
114
115         * generic.cs (InferTypeArguments): Infer arguments before they are used
116         for compatibility check.
117
118 2007-03-15  Marek Safar  <marek.safar@gmail.com>
119
120         * generic.cs (InflatedConstraints): Fixed the check order.
121         (TypeArguments.Resolve): Small optimization for generic parameters.
122         (InferTypeArguments): Add infering support for anonymous methods.
123
124 2007-03-15  Martin Baulig  <martin@ximian.com>
125
126         Fix #79984.
127
128         * generic.cs
129         (TypeParameter.HasConstructorConstraint): Removed.
130         (ConstraintChecker.HasDefaultConstructor): Removed the
131         `TypeBuilder' argument here; correctly check for the ctor
132         constraint on type parameters.
133
134 2007-03-15  Martin Baulig  <martin@ximian.com>
135
136         Fix #79302.
137
138         * generic.cs
139         (TypeParameter): Create a `MemberCache' here as well.  Note that
140         we need to create this on-demand when it's actually used.
141
142 2007-03-10  Marek Safar  <marek.safar@gmail.com>
143
144         * generic.cs (TypeArguments.Resolve): Avoid redundant checks.
145
146 2007-03-09  Raja R Harinath  <rharinath@novell.com>
147
148         * cs-parser.jay (WHERE): Move before QUERY_FIRST_TOKEN.  'where'
149         is a valid keyword outside a linq expression too.
150
151 2007-03-03  Marek Safar  <marek.safar@gmail.com>
152
153         * cs-parser.jay: Implemented basic linq grammar.
154
155         * linq.cs: New file for hosting query specific classes.
156
157 2007-02-26  Marek Safar  <marek.safar@gmail.com>
158
159         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
160
161 2007-02-20  Marek Safar  <marek.safar@gmail.com>
162
163         A fix for bug #80650
164         * cs-parser.jay: Anonymous container starts at constructor declaration
165         and not at block beginning because it has to be usable in constructor
166         initializer.
167
168 2007-02-18  Marek Safar  <marek.safar@gmail.com>
169
170         A fix for bug #80493 by Atsushi Enomoto
171         * cs-parser.jay: Ignore invalid attribute target.
172
173 2007-02-15  Miguel de Icaza  <miguel@novell.com>
174
175         * Remove the call to SetExpression for lambda expressions, we do
176         not actually need it.
177
178         Remove expression tracking code as its not needed.
179
180 2007-02-11  Miguel de Icaza  <miguel@novell.com>
181
182         * cs-parser.jay (lambda_expression_body): when the body is an
183         expression add a statement of the form:
184
185                 contextual-return expression.
186
187         Where `contextual-return' is similar to `return', the difference
188         being that if the delegate that the lambda will be converted to
189         has a void return type, it will check that the result is a
190         ExpressionStatement and the result is a plain ret (no return
191         values on the stack).  If the return type of the delegate is of a
192         given type, this turns into a return with a value and does the
193         regular checking to check that the computed value can be
194         implicitly converted to the delegate return.
195
196 2007-01-30  Miguel de Icaza  <miguel@novell.com>
197
198         * cs-parser.jay (anonymous_method_expression): move the
199         before/after productions to the start_anonymous and end_anonymous
200         methods so the code can be reused for lambda functions.
201
202         (lambda_expression_body): wrap expressions implicitly into a
203         block.
204
205         (block): factor out the setup/teardown of parsing a block so we
206         can reuse that in lambda_expression_body
207
208         (lambda_expression): use new anonymous method helper methods.
209
210 2007-01-29  Miguel de Icaza  <miguel@novell.com>
211
212         * cs-parser.jay: oob_stack make it static (am guessing that is why
213         we no longer initialize it anymore) and reuse it across
214         instances.
215
216 2007-01-28  Miguel de Icaza  <miguel@novell.com>
217
218         * cs-parser.jay (open_parens): Introduce new non-terminal that
219         abstracts OPEN_PARENS and OPEN_PARENS_LAMBDA as the later can now
220         be returned in places where types are followed by identifiers
221         (this is expected in declaration, fixed, using, foreach and catch
222         clauses). 
223
224         Use open_parens in those places, keep OPEN_PARENS in the
225         expressions.  
226
227         cs-parser.jay: New grammar bits for parsing lambda expressions. 
228
229 2007-01-28  Raja R Harinath  <rharinath@novell.com>
230
231         Fix #80534, gtest-309.cs
232         * generic.cs (UnifyType): Rename from InferType.  Make unification
233         of generic insts simpler and don't insist on inferring all generic
234         parameters in a single generic inst unification.
235         (UnifyTypes): New.
236         (InferGenericInstance): Remove.
237         Analysis and initial patch by David Mitchell <dmitchell@logos.com>.
238
239 2007-01-20  Marek Safar  <marek.safar@gmail.com>
240
241         * cs-parser.jay: Better parameter error handling.
242
243 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
244             Raja R Harinath  <rharinath@novell.com>
245
246         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
247         Note the order in which accessors are declared in the source.
248
249 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
250
251         * generic.cs (TypeParameter.FindMembers): Use the generic
252         constraints, not the constraints to check for methods (first fix
253         of 80518).
254
255 2006-12-30  Marek Safar  <marek.safar@gmail.com>
256
257         * cs-parser.jay: Better syntax errors handling.
258
259 2006-11-21  Marek Safar  <marek.safar@gmail.com>
260
261         * cs-parser.jay: Tiny change to work with mcs tokenizer.
262
263         * cs-tokenizer.cs: Remove after unification with mcs.
264
265 2006-10-28  Marek Safar  <marek.safar@gmail.com>
266
267         A fix for bug #78998
268         * generic.cs (ConstructedType.AsAccessible): Check accessibility of type
269         arguments as well.
270
271 2006-10-26  Marek Safar  <marek.safar@gmail.com>
272
273         A fix for bug #76591
274         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous methods.
275
276 2006-10-25  Brian Crowell  <brian@fluggo.com>
277
278         Fix #79703
279         * generic.cs (CheckConstraints): Allow generic parameters with
280         inheritance constraints to satisfy reference type constraints.
281
282 2006-10-09  Martin Baulig  <martin@ximian.com>
283
284         * generic.cs
285         (NullCoalescingOperator.DoResolve): Fix #78964; added gtest-294.cs.
286
287 2006-09-25  Martin Baulig  <martin@ximian.com>
288
289         * class.cs: Remove after unification with mcs source.
290
291 2006-09-24  Raja R Harinath  <harinath@gmail.com>
292
293         * convert.cs: Remove after unification with mcs source.
294
295 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
296
297         * class.cs (MemberBase.VerifyClsCompliance): When method has type
298         parameters verify them as well.
299
300         * generic.cs (Constraints.VerifyClsCompliance): Verify CLS-Compliance of
301         the type parameter constraints.
302         (Generics.VerifyClsCompliance): Ditto.
303
304 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
305
306         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
307         for anonymous block with out argument.
308
309 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
310
311         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
312         not used private events only.
313
314 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
315
316         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
317
318         * cs-parser.jay: Parse correctly cast of default (T).
319
320         * generic.cs (DefaultValueExpression.DoResolve): Check for void type.
321         Store original type via EmptyConstantCast.
322
323 2006-09-22  Martin Baulig  <martin@ximian.com>
324
325         * delegate.cs: Removed; this file is now shared with mcs.
326
327         * attribute.cs: Removed; this file is now shared with mcs.
328
329 2006-09-22  Martin Baulig  <martin@ximian.com>
330
331         * ecore.cs: Removed; this file is now shared with mcs.
332
333 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
334
335         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
336
337         * ecore.cs (NullCast): Derives from NullConstant.
338
339         * generic.cs (DefaultValueExpression): Fixed to cope with the constant
340         results.
341
342 2006-09-21  Martin Baulig  <martin@ximian.com>
343
344         * decl.cs: Removed; this file is now shared with mcs.
345
346 2006-09-21  Raja R Harinath  <rharinath@novell.com>
347
348         * rootcontext.cs: Remove after unification with mcs source.
349
350         * report.cs: Remove after unification with mcs source.
351         * generic.cs (AddTypeParameter, LookupTypeParameter): Move to
352         mcs/typemanager.cs.
353         (InitGenerics, CleanUpGenerics): Remove.
354
355         * support.cs: Remove after unification with mcs source.
356
357 2006-09-20  Raja R Harinath  <rharinath@novell.com>
358
359         * codegen.cs: Remove after unification with mcs source.
360
361 2006-09-19  Martin Baulig  <martin@ximian.com>
362
363         * expression.cs: Removed; this file is now shared with mcs.
364
365 2006-09-19  Martin Baulig  <martin@ximian.com>
366
367         * generic.cs
368         (TypeManager.IsEqual): Moved into ../mcs/typemanager.cs.
369         (TypeManager.DropGenericTypeArguments): Likewise.
370         (TypeManager.DropGenericMethodArguments): Likewise.
371         (TypeManager.GetTypeArguments): Likewise.
372         (TypeManager.HasGenericArguments): Likewise.
373
374 2006-09-19  Martin Baulig  <martin@ximian.com>
375
376         * ecore.cs (PropertyExpr.InstanceResolve): Fix the CS1540 check.
377
378 2006-09-19  Martin Baulig  <martin@ximian.com>
379
380         * typemanager.cs: Removed; this file is now shared with mcs.
381
382 2006-09-16  Raja R Harinath  <rharinath@novell.com>
383
384         * Makefile (LOCAL_MCS_FLAGS): Use instead of PROFILE_MCS_FLAGS.
385         * AssemblyInfo.cs, driver.cs: Remove after unification with mcs source.
386
387 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
388
389         A fix for #79401
390         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
391         only if parent type is class.
392         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
393         update.
394
395 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
396
397         * cs-parser.jay,
398         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
399         keywords are used.
400         * typemanager.cs(CSharpName): Converts NullType to null.
401
402 2006-09-15  Martin Baulig  <martin@ximian.com>
403
404         * pending.cs: Removed; this file is now shared with mcs.
405
406 2006-09-15  Martin Baulig  <martin@ximian.com>
407
408         * statement.cs: Removed; this file is now shared with mcs.
409
410 2006-09-15  Martin Baulig  <martin@ximian.com>
411
412         * rootcontext.cs (RootContext.BrokenCircularDeps): Removed.
413
414         * driver.cs: Removed the `--broken-cycles' argument.
415
416 2006-09-15  Martin Baulig  <martin@ximian.com>
417
418         * namespace.cs: Removed; this file is now shared with mcs.
419
420 2006-09-15  Martin Baulig  <martin@ximian.com>
421
422         * decl.cs (MemberName): Minor code cleanups.
423
424 2006-09-15  Martin Baulig  <martin@ximian.com>
425
426         * parameter.cs: Removed; this file is now shared with mcs.
427
428 2006-09-15  Martin Baulig  <martin@ximian.com>
429
430         * enum.cs: Removed; this file is now shared with mcs.
431
432 2006-09-15  Martin Baulig  <martin@ximian.com>
433
434         * Makefile: Define `GMCS_SOURCE'.
435
436         * flowanalysis.cs: Removed; this file is now shared with mcs.
437
438 2006-09-15  Martin Baulig  <martin@ximian.com>
439
440         Removed modifiers.cs, literal.cs, location.cs, roottypes.cs,
441         assign.cs, const.cs, cfold.cs, constant.cs, symbolwriter.cs and
442         doc.cs - they are now shared with mcs.
443
444         * gmcs.exe.sources: Include these files from ../mcs/.
445
446 2006-09-15  Martin Baulig  <martin@ximian.com>
447
448         * old-code.cs, gen-il.cs, gen-treedump.cs: Removed old stuff.
449         * g1.cs, sample-hello.cs, sample-stack.il: Likewise.
450
451 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
452
453         * assign.cs, ecore.cs, expression.cs: Share error message text.
454         * class.cs (FieldMember.Define): Check for variable of static type.
455         * decl.cs (check_type_parameter): Report correct type name.
456         * driver.cs (LoadAssembly): Uses error output for errors.
457         * generic.cs (Constraints.Resolve): Add check for constraint accessibility
458         (TypeArguments.Resolve): Static class cannot be used as an argument.
459         * statement.cs (ResolveMeta): Constants cannot be generic types.
460
461 2006-09-12  Martin Baulig  <martin@ximian.com>
462
463         * generic.cs (TypeManager.IsIList): Moved into convert.cs.
464
465         * convert.cs (Convert.Array_To_IList): Moved here and correctly
466         implement it; fixes #79345.
467
468 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
469
470         * decl.cs (DeclSpace.SetParameterInfo): Check for nonexistent type
471         parameter.
472         * expression.cs (TypeOf.GetAttributableValue): Check for open generic
473         types.
474         * generic.cs: Improved error messages.
475         * typemanager.cs (RemoveGenericArity): Made public.
476
477 2006-09-08  Martin Baulig  <martin@ximian.com>
478
479         * typemanager.cs (TypeManager.interlocked_type): New public field.
480         (TypeManager.int_interlocked_compare-exchange): New public field.
481         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
482         enumerator types here and call InitGenericCoreTypes().
483         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
484         after calling InitEnumUnderlyingTypes().
485
486         * rootcontext.cs
487         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
488         `classes_second_stage'. 
489
490 2006-09-07  Marek Safar  <marek.safar@seznam.cz>
491  
492         * class.cs, generic.cs (GenericMethod.Define): Check for type parameter
493         collisions.
494         * statement.cs (Block.Variables): Made public.
495
496 2006-09-07  Martin Baulig  <martin@ximian.com>
497
498         * driver.cs
499         (MainDriver): Revert r62663 from Marek; see #70506 for details.
500
501 2006-09-01  Martin Baulig  <martin@ximian.com>
502
503         * generic.cs
504         (TypeManager.IsIList): Also handle base classes and interfaces. 
505
506 2006-09-01  Raja R Harinath  <rharinath@novell.com>
507
508         Fix #79238
509         * expression.cs (Invocation.MoreSpecific): Check for reference
510         types earlier.
511
512 2006-08-29  Miguel de Icaza  <miguel@novell.com>
513
514         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
515
516 2006-08-17  Miguel de Icaza  <miguel@novell.com>
517
518         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
519         #52019 and #79064, the use of the \uXXXX sequence in source code
520         to represent unicode characters.
521
522 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
523  
524         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
525         support.
526         * class.cs, ecore.cs, statement.cs: Merged to one error message.
527
528 2006-08-14  Raja R Harinath  <rharinath@novell.com>
529
530         Fix #79067
531         * cs-tokenizer.cs (parse_less_than): Allow '*' to appear in a type
532         parameter too.  This only avoids a parse error -- the semantic
533         error is caught elsewhere.
534
535 2006-08-13  Miguel de Icaza  <miguel@novell.com>
536
537         * assign.cs: Catch attempts to assign to a method groups in += and
538         report as 1656
539
540 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
541
542         A fix for #79056
543         * cs-parser.jay: Don't destroy current array type by typeof of array's.
544
545 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
546
547         * cs-parser.jay: Check whether a constraint clause has already been
548         specified for type parameter.
549         * generic.cs (Constraints): Exposed location.
550
551 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
552
553         * class.cs (Method.Define): Issue a warning when generic method looks like
554         an entry point.
555         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
556         as well.
557         * report.cs: New warning number.
558
559 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
560  
561         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
562         looking for ctor.
563         * decl.cs (MemberCache.FindMembers): When container is interface we need to
564         search all base interfaces as a member can be ambiguous.
565         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
566         Constructor member type filter. 
567         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
568         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
569         reporting for returned memberinfos.
570         * report.cs: Updated.
571         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
572         version to work on all runtimes.
573         (TypeManager.RealMemberLookup): Removed members filtering.
574
575 2006-08-08  Raja R Harinath  <rharinath@novell.com>
576
577         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
578         (PropertyExpr.EmitAssign): Likewise.
579         * expression.cs (Indirection.EmitAssign): Likewise.
580         (LocalVariableReference.EmitAssign): Likewise.
581         (ParameterReference.EmitAssign): Likewise.
582         (Invocation.EmitArguments): Likewise.
583         (ArrayAccess.EmitAssign): Likewise.
584         (IndexerAccess.EmitAssign): Likewise.
585         (This.EmitAssign): Likewise.
586         (ConditionalLogicalOperator.Emit): Likewise.
587
588         Fix #79026
589         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
590         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
591         leave it in after returning it.
592         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
593
594 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
595
596         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
597         message.
598
599 2006-08-05  Marek Safar  <marek.safar@seznam.cz>
600
601         * class.cs (TypeContainer.AddPartial): Add check for partial declarations
602         with different type names.
603         (TypeContainer.UpdateTypeParameterConstraints): Updated an error message.
604
605 2006-08-03  Raja R Harinath  <rharinath@novell.com>
606
607         Fix cs0146-3.cs and cs0146-4.cs.
608         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
609         enclosing types don't depend on the current type.
610
611 2006-08-02  Raja R Harinath  <rharinath@novell.com>
612
613         Fix #77963
614         * class.cs (TypeContainer.DoDefineMembers): Use
615         FindBaseMemberWithSameName on Parent, since we're interested in
616         whether we hide inherited members or not.
617         (FindBaseMemberWithSameName): Make slightly more robust.
618
619         Fix #77396
620         * codegen.cs (IResolveContext.GenericDeclContainer): New.
621         (EmitContext): Implement new interface requirement.
622         * namespace.cs (UsingEntry, LocalAliasEntry): Likewise.
623         * decl.cs (MemberCore): Likewise.
624         (DeclSpace.GenericDeclContainer): Rename from DeclContainer.
625         * ecore.cs (SimpleName.ResolveAsTypeTerminal): Use
626         ec.GenericDeclContainer to check for generic parameters.
627         (SimpleName.DoSimpleNameResolve): Likewise.
628         * generic.cs (TypeParameter.DeclContainer): Remove override.
629
630         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
631         declspaces for doppelgangers too.
632         (UsingEntry): Implement IResolveContext.
633         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
634         'this' as the resolve context.
635         (LocalAliasEntry): Likewise.
636
637         Implement parts of #77403
638         * roottypes.cs (RootDeclSpace): New.  Used to represent the
639         toplevel declaration space.  Each namespace declaration introduces
640         a "partial" root declaretion space.
641         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
642         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
643         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
644         from 'current_namespace.SlaveDeclSpace'.
645         (namespace_declaration): Likewise.
646         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
647         check.  It can't happen now.
648         * decl.cs (DeclSpace.LookupType): Likewise.
649         * driver.cs (MainDriver): Sanity check.
650
651 2006-08-01  Raja R Harinath  <rharinath@novell.com>
652
653         * decl.cs (DeclSpace.FindNestedType): Remove.
654         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
655         LookupTypeContainer to get the container of the nested type.
656         * class.cs (TypeContainer.FindNestedType): Make non-override.
657
658 2006-07-31  Raja R Harinath  <rharinath@novell.com>
659
660         * decl.cs (DeclSpace.PartialContainer): Move field from ...
661         * class.cs (TypeContainer.PartialContainer): ... here.
662         (TypeContainer.AddBasesForPart): New helper.
663         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
664         instead.
665         * cs-parser.jay (current_class): Convert to DeclSpace.
666         (struct_declaration, interface_declaration, class_declaration):
667         Use AddBasesForPart instead of .Bases directly.
668         * const.cs, iterators.cs: Update to changes.
669
670 2006-07-28  Raja R Harinath  <rharinath@novell.com>
671
672         * class.cs (TypeContainer.AddMemberType): Rename from
673         AddToTypeContainer.
674         (TypeContainer.AddMember): Rename from AddToMemberContainer.
675         (AddTypeContainer): New.  Combine AddClassOrStruct and
676         AddInterface.
677         (AddPartial): Update.  Add 'is_partial' argument.
678         * roottypes.cs: Update to changes.
679         * cs-parser.jay (push_current_class): New helper for handling
680         current_container and current_class.
681         (struct_declaration, interface_declaration, class_declaration):
682         Use it.
683
684 2006-07-26  Raja R Harinath  <rharinath@novell.com>
685
686         * roottypes.cs: Rename from tree.cs.
687
688         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
689         * tree.cs (Tree, ITreeDump): Remove types.
690         * rootcontext.cs (tree, Tree): Remove fields.
691         (root, ToplevelTypes): New.
692         * *.cs: Update to rename.
693
694         * tree.cs (Tree.RecordDecl): Remove.
695         (RootTypes.AddToTypeContainer): Record the toplevel type in its
696         namespace here.
697         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
698
699 2006-07-23  Raja R Harinath  <harinath@gmail.com>
700
701         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
702         DoFlowAnalysis and OmitStructFlowAnalysis here.
703         (ec.With): Rename from WithUnsafe and generalize.
704         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
705         (ec.WithFlowAnalyis): New.
706         * ecore.cs, expression.cs, statement.cs: Update.
707
708 2006-07-22  Raja R Harinath  <harinath@gmail.com>
709
710         * statement.cs (Block.ResolveMeta): Simplify slightly.
711
712         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
713         multiple boolean fields.  Convert InUnsafe, constant_check_state,
714         check_state to flags.
715         (CheckState, ConstantCheckState): Update.
716         (InUnsafe): New read-only property.
717         (FlagsHandle): Rename from CheckStateHandle and convert to handle
718         arbitrary flags.
719         (WithUnsafe): New helper similar to WithCheckState.
720         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
721         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
722
723 2006-07-21  Raja R Harinath  <rharinath@novell.com>
724
725         Make comparisons use the same IL irrespective of whether they're
726         in a 'checked' or 'unchecked' context: one of the issues in #78899
727         * codegen.cs (EmitContext.CheckState): Make read-only property.
728         (EmitContext.ConstantCheckState): Likewise.
729         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
730         helper that implement a save/restore stack for CheckState
731         values.  This is the only way to change check-state.
732         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
733         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
734         (CheckedExpr.EmitBranchable): New forwarding method.
735         (UnCheckedExpr): Likewise.
736         * statement.cs (Block.ResolveMeta): Use WithCheckState.
737         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
738         (Checked.Resolve, checked.DoEmit): Likewise.
739
740 2006-07-21  Martin Baulig  <martin@ximian.com>
741
742         * generic.cs (TypeManager.InferType): When inferring an array
743         type, also allow IList<T> and ICollection<T>.  Fixes #78900.
744
745 2006-07-21  Martin Baulig  <martin@ximian.com>
746
747         * generic.cs (TypeManager.IsIEnumerable): Renamed into IsIList()
748         and allow IList`1 and all its base interfaces.
749
750         * convert.cs (Convert.ImplicitReferenceConversion): Allow
751         converting from an array-type of T to IList<T>.
752
753 2006-07-21  Martin Baulig  <martin@ximian.com>
754
755         * ecore.cs (SimpleName.DoSimpleNameResolve): Added CS0307 check.
756
757 2006-07-20  Miguel de Icaza  <miguel@novell.com>
758
759         * anonymous.cs: Cache the resolved anonymous delegate, and return
760         this so that the ResolveTopBlock is only triggered once, not
761         twice.
762
763         Currently we trigger ResolvetopBlock twice due to a first pass of
764         argument check compatibility, and a second pass that does the
765         actual resolution.   
766
767 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
768
769         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
770         modifiers.
771         * rootcontext.cs (Reset): Add helper_classes.
772
773 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
774
775         A fix for #78860
776         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
777         correctly.
778
779 2006-07-13  Miguel de Icaza  <miguel@novell.com>
780
781         * statement.cs (Lock): Handle expressions of type
782         TypeManager.null_type specially.  Fixes #78770
783
784 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
785
786         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
787         to an event.
788
789 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
790
791         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
792         for accessors as well.
793         * ecore.cs (EventExpr): Add AccessorTable.
794
795 2006-07-03  Martin Baulig  <martin@ximian.com>
796
797         * ecore.cs (UnboxCast.Emit): Also use `Unbox_Any' for generic
798         instances of value types.
799
800         * convert.cs (Convert.ExplicitConversion): Correctly handle
801         object->nullable conversions.   
802
803 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
804
805         A fix for #78738
806         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
807         for CS0122 where appropriate.
808         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
809         level attributes.
810         (Filter): Assembly can be null in the case of top level attributes.
811
812 2006-06-28  Raja R Harinath  <rharinath@novell.com>
813
814         Fix #78716
815         * generic.cs (TypeManager.InferParamsTypeArguments): If there are
816         no arguments, return 'false': nothing can be inferred.
817
818 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
819
820         A fix for #78690
821
822         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
823         is done at global level.
824
825 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
826
827         A fix for #77002, Implemented TypeForwarder support.
828
829         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
830         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Add TypeForwarder
831         attribute handling.
832         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
833         * typemanager.cs (): Add type_forwarder_attr_type.
834
835 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
836
837         * report.cs: Add CS0469 warning.
838
839 2006-06-22  Martin Baulig  <martin@ximian.com>
840
841         * class.cs
842         (TypeContainer.GetNormalBases): Also use ResolveAsBaseTerminal()
843         for interfaces; fixes #78686, which is a modification of #78380
844         with interfaces instead of classes.
845
846 2006-06-21  Martin Baulig  <martin@ximian.com>
847
848         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
849         the `try'-block, so we also report CS0016 etc. there.
850
851 2006-06-21  Martin Baulig  <martin@ximian.com>
852
853         * ecore.cs (FieldExpr.EmitAssign, FieldExpr.AddressOf): Correctly
854         handle SetAssigned() and SetMemberIsUsed() for generic types;
855         fixes #77545.
856
857 2006-06-21  Martin Baulig  <martin@ximian.com>
858
859         * delegate.cs
860         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
861
862 2006-06-21  Martin Baulig  <martin@ximian.com>
863
864         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
865         also report CS1686 for parameters.
866
867 2006-06-21  Martin Baulig  <martin@ximian.com>
868
869         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
870         instead of an error if the value is not implicitly convertible to
871         the switch types; fixes #77964.
872
873 2006-06-21  Raja R Harinath  <rharinath@novell.com>
874
875         Fix #78673
876         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
877         FieldBuilder is null.
878
879         Fix #78662
880         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
881         'left' and 'right' before error-checking.
882
883 2006-06-19  Martin Baulig  <martin@ximian.com>
884
885         * convert.cs
886         (Convert.ImplicitConversionStandard): Cleanup and correctly
887         implement nullable conversions.
888         (Convert.ImplicitStandardConversionExists): Likewise.
889         (Convert.ExplicitConversion): Likewise.
890
891 2006-06-19  Martin Baulig  <martin@ximian.com>
892
893         * generic.cs
894         (Nullable.Wrap.Create, Nullable.Unwrap.Create): New public static
895         methods; make the ctors protected.
896
897 2006-06-19  Martin Baulig  <martin@ximian.com>
898
899         Fixed #78380; added gtest-273.cs.
900
901         * ecore.cs
902         (Expression.ResolveAsBaseTerminal): Move the constraint checking
903         into ResolveAsTypeTerminal().
904
905         * generic.cs
906         (ConstraintChecker.HasDefaultConstructor): Use the non-cache based
907         TypeManager.FindMembers() to check for the default ctor.
908
909 2006-06-18  Marek Safar  <marek.safar@seznam.cz>
910
911         * generic.cs: Fixed NullableInfo accessibility.
912
913 2006-06-16  Martin Baulig  <martin@ximian.com>
914
915         * generic.cs
916         (Constraints.InflatedConstraints.inflate): Correctly inflate
917         generic types; fixes #78400.
918
919 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
920
921         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
922         Fixed bug #78601.
923         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
924         (FieldExpr.DoResolve): likewise.
925         (PropertyExpr.InstanceResolve): likewise.
926         (EventExpr.InstanceResolve): likewise. 
927
928 2006-06-15  Martin Baulig  <martin@ximian.com>
929
930         * statement.cs
931         (SwitchLabel.ResolveAndReduce): Added `bool allow_nullable'
932         argument; always allow a `null' label if true.
933         (Switch.SwitchGoverningType): Take an `Expression expr' argument.
934         (Switch.TableSwitchEmit, Switch.SimpleSwitchEmit): Check whether
935         we have a `null' label and mark the new `null_target' label;
936         default to the `default' label.
937         (Switch.Resolve): Add support for nullable types.  Fixes #78630.
938
939 2006-06-15  Martin Baulig  <martin@ximian.com>
940
941         * class.cs (Operator.Define): Allow an implicit/explicit operator
942         to convert to/from a nullable value of the enclosing type.
943
944         * generic.cs (TypeManager.IsNullableTypeOf): New public method.
945         (Nullable.Unwrap, Nullable.Wrap): Make these classes public.
946
947         * convert.cs
948         (Convert.ImplicitStandardConversionExists): Add support for lifted
949         implicit/explicit conversions.
950         (Convert.ImplicitConversionStandard): Likewise.
951
952 2006-06-13  Martin Baulig  <martin@ximian.com>
953
954         * ecore.cs (SimpleName.DoSimpleNameResolve): Check whether we have
955         type arguments and create a ConstructedType if necessary.  Fixes #78400.
956
957 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
958
959         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
960         attribute applicable tests for attribute argument.
961
962 2006-06-02  Raja R Harinath  <rharinath@novell.com>
963
964         Fix #78079
965         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
966         (Binary.OverloadResolve_PredefinedIntegral): New.
967         (Binary.OverloadResolve_PredefinedFloating): New.
968         (Binary.OverloadResolve_PredefinedString): New.
969         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
970         Follow the standard more closely, and treat numeric promotions in
971         terms of overload resolution.
972         (Binary.CheckShiftArguments): Simplify.
973
974 2006-06-01  Raja R Harinath  <rharinath@novell.com>
975
976         * flowanalysis.cs (MyBitVector): Simplify representation.
977         (MyBitVector.Clone): Avoid allocating BitArray.
978         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
979         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
980         (*): Update.  Change all references to MyBitVector.And and
981         MyBitVector.Or to &= and |=.
982
983 2006-05-31  Raja R Harinath  <rharinath@novell.com>
984
985         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
986         Use bne.un instead of ceq+brfalse.
987
988         Fix cs0208-[23].cs
989         * typemanager.cs (IsUnmanagedType): Disallow generic types and
990         generic parameters.
991
992 2006-05-29  Raja R Harinath  <rharinath@novell.com>
993
994         Fix cs0231-[34].cs.
995         * cs-parser.jay (formal_parameter_list): Extend the pattern below
996         to param arguments too.
997
998 2006-05-26  Miguel de Icaza  <miguel@novell.com>
999
1000         * cs-parser.jay: Catch another parsing form for arglist being
1001         followed by other arguments.  Fixes #78313.
1002
1003 2006-05-25  Raja R Harinath  <rharinath@novell.com>
1004
1005         Fix #78324
1006         * expression.cs (Binary.DoResolve): Use Nullable.LiftedBinaryOperator
1007         also when one of the operands is a null literal.
1008         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality): Rewrite
1009         to improve clarity, and generate slightly better code.
1010
1011 2006-05-24  Raja R Harinath  <rharinath@novell.com>
1012
1013         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
1014         checking of out parameters to ...
1015         (FlowBranchingToplevel.Merge): ... here.
1016         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
1017         set, propagate the origin upward, and only complain if there was
1018         no other error.
1019         (FlowBranchingException.AddContinueOrigin): Likewise.
1020         (FlowBranchingException.AddReturnOrigin): Likewise.
1021         (FlowBranchingException.AddGotoOrigin): Likewise.       
1022
1023 2006-05-23  Raja R Harinath  <rharinath@novell.com>
1024
1025         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
1026         unreachable, skip it.
1027         (FlowBranchingException.Merge): Always propagate jumps, even if
1028         the finally block renders subsequent code unreachable.
1029
1030 2006-05-18  Raja R Harinath  <rharinath@novell.com>
1031
1032         Fix #77601
1033         * statement.cs (Goto.Resolve): Move responsibility for resolving
1034         'goto' to FlowBranching.AddGotoOrigin.
1035         (Goto.SetResolvedTarget): New.  Callback to set the
1036         LabeledStatement that's the target of the goto.
1037         (Goto.DoEmit): Use Leave instead of Br when crossing an
1038         unwind-protect boundary.
1039         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
1040         LookupLabel and adjust to new semantics.
1041         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
1042         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
1043         Goto.SetResolvedTarget to update target.
1044         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
1045         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
1046         AddBreakOrigin & co.  Delay propagation until ...
1047         (FlowBranchingException.Merge): ... this.
1048
1049         * statement.cs (Block.Resolve): Always depend on flow-branching to
1050         determine unreachability.  Kill workaround that originally emitted
1051         only one statement after an "unreachable" label (see infloop in
1052         test-515.cs).
1053
1054         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
1055         This is still "wrong", but anything better would probably need a
1056         multi-pass algorithm.
1057         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
1058         usage vector.  Force current usage vector to be reachable, to
1059         optimistically signify backward jumps.
1060         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
1061         detected.
1062         (FlowBranchingLabeled.Merge): New.  If no backward jump was
1063         detected, return the original salted-away usage vector instead,
1064         updated with appropriate changes.  Print unreachable warning if
1065         necessary.
1066         * statement.cs (Block.Resolve): Don't print unreachable warning on
1067         a labeled statement.
1068
1069 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
1070
1071         * driver.cs: Pass filename without path to AssemblyBuilder's
1072         AddResourceFile. Fixes bug #78407.
1073
1074 2006-05-17  Raja R Harinath  <rharinath@novell.com>
1075
1076         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
1077         * flowanalysis.cs (FlowBranchingLabeled): ... here.
1078         (FlowBranching.MergeChild): Overwrite
1079         reachability information from Labeled branchings too.
1080
1081 2006-05-16  Raja R Harinath  <rharinath@novell.com>
1082
1083         * statement.cs (Goto.Resolve): Merge jump origins here ...
1084         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
1085
1086         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
1087         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
1088         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
1089         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
1090         here, ...
1091         * statement.cs (Goto.Resolve): ... not here.
1092         (Goto.Emit): Remove CS1632 check.
1093
1094 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
1095
1096         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
1097         error message.
1098
1099 2006-05-11  Raja R Harinath  <rharinath@novell.com>
1100
1101         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
1102         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
1103         (FlowBranchingException.Label): Likewise.
1104
1105         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
1106         given value.
1107         (MyBitVector.Or): Use it to avoid losing information (Count).
1108         (FlowBranching.MergeOrigins): Likewise.
1109
1110         * flowanalysis.cs (UsageVector.IsDirty): Remove.
1111         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
1112         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
1113         (UsageVector.ToString): Simplify.
1114         (UsageVector.MergeSiblings): Move here from ...
1115         (FlowBranching.Merge): ... here.
1116         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
1117         not a MyBitVector.
1118
1119 2006-05-10  Raja R Harinath  <rharinath@novell.com>
1120
1121         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
1122         null bitvector is treated as all-true.
1123
1124         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
1125         (MyBitVector): Rationalize invariants.  'vector != null' implies
1126         that we have our own copy of the bitvector.  Otherwise,
1127         'InheritsFrom == null' implies all inherited bits are true.
1128
1129 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
1130
1131         * statement.cs (LocalInfo): Add IsConstant.
1132         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
1133         local variable for constants.
1134
1135 2006-05-09  Raja R Harinath  <rharinath@novell.com>
1136
1137         * flowanalysis.cs (MyBitVector.Empty): New.
1138         (MyBitVector): Don't allow InheritedFrom to be null.
1139         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
1140         (UsageVector, FlowBranching): Update to changes.
1141
1142         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
1143         recursion.  The 'Parent == null' condition isn't sufficient for
1144         anonymous methods.
1145         (FlowBranching.AddBreakOrigin): Likewise.
1146         (FlowBranching.AddContinueOrigin): Likewise.
1147         (FlowBranching.AddReturnOrigin): Likewise.
1148         (FlowBranching.StealFinallyClauses): Likewise.
1149         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
1150         (FlowBranching.CheckOutParameters): Likewise.
1151         (FlowBranchingToplevel): Terminate all the above recursions here.
1152         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
1153         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
1154
1155         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
1156         toplevel block.
1157         (FlowBranchingToplevel): New.  Empty for now.
1158         (FlowBranching.MergeTopBlock): Update.
1159         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1160         branching for the anonymous delegate.
1161         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1162
1163         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1164         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1165         information at the start of the merge.  Reorganize.
1166
1167 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1168
1169         * class.cs (MethodData.Define): Method cannot implement interface accessor.
1170
1171 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1172
1173         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1174         to newly introduced ctor.
1175
1176         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1177         message to one place.
1178         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1179         global namespace.
1180
1181 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1182
1183         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1184
1185         * ecore.cs (Expression.ResolveAsConstant): Updated.
1186
1187         * statement.cs (ResolveMeta): Updated.
1188
1189 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1190
1191         * cs-parser.jay: __arglist cannot be used in initializer.
1192
1193 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1194
1195         A fix for #77879
1196         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1197         private types.
1198
1199 2006-05-05  Raja R Harinath  <rharinath@novell.com>
1200
1201         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1202         (LabeledStatement): Add 'name' parameter.
1203         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1204         (Block.AddLabel): Update to changes.
1205         * cs-parser.jay (labeled_statement): Likewise.
1206
1207         * flowanalysis.cs (BranchingType.Labeled): New.
1208         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1209         (FlowBranchingLabeled): New.  Does nothing for now, but will
1210         eventually handle 'goto' flows.
1211         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1212         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1213         that's terminated ...
1214         (Block.Resolve): ... here.
1215
1216         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1217         (UsageVector.MergeFinallyOrigins): Likewise.
1218         (FlowBranching.InTryOrCatch): Likewise.
1219         (FlowBranching.AddFinallyVector): Likewise.
1220         (FlowBranchingException): Update to changes.
1221
1222         Fix #78290
1223         * statement.cs (Return.Resolve): Move error checking to ...
1224         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1225         (FlowBranchingException): Handle return origins like break and
1226         continue origins.
1227         (FlowBranching.UsageVector.CheckOutParameters): Remove.
1228
1229 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1230
1231         A fix for #76122
1232         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1233         filter.
1234
1235 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1236
1237         A fix for #77543
1238         * class.cs (MethodData.Define): Do public accessor check only when method
1239         implements an interface.
1240
1241 2006-05-04  Raja R Harinath  <rharinath@novell.com>
1242
1243         Remove special handling of 'break'
1244         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1245         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
1246         (UsageVector.Break): Remove.
1247         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1248         reachability.
1249         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1250
1251         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1252         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
1253
1254 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1255
1256         A fix for #75726
1257         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1258         be the interface member.
1259
1260 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1261
1262         A fix for #60069
1263         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1264         for emitting small (int) values.
1265
1266 2006-05-03  Raja R Harinath  <rharinath@novell.com>
1267
1268         Fix #59427
1269         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1270         control-flow passes through the 'finally' after merging-in all the
1271         control-flows from 'try' and the 'catch' clauses.
1272
1273         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1274         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
1275         always true at the only non-recursive entry point.
1276         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1277         FlowBranchingBreakable.
1278         (FlowBranchingLoop): Remove.
1279         * statement.cs (Return.DoResolve): Update to changes.
1280
1281         Fix #76471, #76665
1282         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1283         (FlowBranching.CreateBranching): Handle it: create a
1284         FlowBranchingContinuable.
1285         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1286         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1287         except that it handles the 'continue' command.
1288         (FlowBranching.UsageVector.MergeOrigins): Rename from
1289         MergeBreakOrigins.
1290         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1291         except that it overrides AddContinueOrigin.
1292         (FlowBranchingException): Override AddContinueOrigin, similar to
1293         AddBreakOrigin.
1294         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1295         Create a new branching around the embedded statement.
1296         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
1297         control flow after the embedded statement.
1298         (Continue.Resolve): Move all error checking to AddContinueOrigin.
1299
1300         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1301         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1302         FlowBranchingBreakable.
1303         (FlowBranchingSwitch): Remove.
1304
1305         Fix test-503.cs
1306         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
1307         error reporting to ...
1308         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1309         Rename from 'AddBreakVector'.  Add new location argument.  Return
1310         a bool indicating whether the 'break' crosses an unwind-protect.
1311         (FlowBranchingException.AddBreakOrigin): Add.
1312         (FlowBranchingException.Merge): Propagate 'break's to surrounding
1313         flowbranching after updating with the effects of the 'finally'
1314         clause.
1315         (FlowBranchingBreakable): New common base class for
1316         FlowBranchingLoop and FlowBranchingSwitch.
1317
1318         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1319         embedded statement.
1320         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1321
1322 2006-05-02  Raja R Harinath  <rharinath@novell.com>
1323
1324         * statement.cs (Do.Resolve): If the loop is infinite, set the
1325         barrier.
1326         (While.Resolve, For.Resolve): Set a barrier after the embedded
1327         statement.  There's no direct control flow that goes from the end
1328         of the embedded statement to the end of the loop.
1329         * flowanalysis.cs (FlowBranching.Infinite): Remove.
1330         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
1331         above ensure that the reachability is correctly computed.
1332
1333         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1334         (UsageVector.MergeBreakOrigins): If the current path is
1335         unreachable, treat it as if all parameters/locals are initialized.
1336         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
1337         infinite loops before merging-in break origins.
1338
1339         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1340         (Reachability.Reachable): Split part into ...
1341         (Reachability.Unreachable): ... this.  Simplify.
1342         (Reachability.IsUnreachable): Use 'Unreachable' instead.
1343
1344         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1345         (Reachability.SetThrowsSometimes): Likewise.
1346         (FlowBranchingBlock.MergeTopBlock): Don't compare against
1347         TriState.Always, use corresponding property.
1348         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1349         (Block.Resolve): Likewise.  Remove some redundant checks.
1350
1351 2006-05-02  Raja R Harinath  <harinath@gmail.com>
1352
1353         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1354         (Reachability.Meet): Don't bother checking AlwaysThrows --
1355         barrier is always set.
1356         (FlowBranchingBlock.Merge): Likewise.
1357
1358 2006-05-01  Rafael Teixeira <rafaelteixeirabr@hotmail.com>
1359
1360         * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
1361         defined, so it's references should also compile only for NET_2_0
1362         (as occurs in mcs version)
1363
1364 2006-05-01  Raja R Harinath  <harinath@gmail.com>
1365
1366         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1367         checks for unreachable.
1368
1369 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
1370
1371         A fix for #77980
1372         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1373
1374         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1375         whether field is really assigned.
1376
1377 2006-04-30  Raja R Harinath  <harinath@gmail.com>
1378
1379         * flowanalysis.cs (Reachability): Make 4-argument constructor
1380         private.
1381         (Reachability.Meet): Rename from 'And'.  Remove static variant.
1382         (Reachability.Always): Rename from the highly misleading
1383         'Reachability.Never'.
1384         (FlowBranching.Merge): Update to changes.  Mark an impossible
1385         situation with a 'throw'.
1386         (*): Update to changes.
1387
1388 2006-04-29  Raja R Harinath  <harinath@gmail.com>
1389
1390         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1391         Remove 'Undefined'.
1392         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1393         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1394         (*): Update to changes.
1395         * statement.cs: Update to changes.
1396
1397 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
1398
1399         A fix for #78049
1400         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1401
1402 2006-04-28  Raja R Harinath  <harinath@gmail.com>
1403
1404         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1405         dummy UsageVector.
1406
1407         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1408         argument to two arguments: an usage-vector and a bool.  Move call
1409         to FlowBranching.Merge () ...
1410         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1411
1412         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1413         handling of loop and switch reachability to ...
1414         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1415
1416 2006-04-27  Raja R Harinath  <harinath@gmail.com>
1417
1418         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1419         handling to FlowBranchingLoop.InLoop.
1420         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1421
1422 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
1423
1424         A fix for #78115
1425         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1426         anonymous method is allowed from AnonymousContainer here.
1427
1428         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1429
1430 2006-04-24  Raja R Harinath  <rharinath@novell.com>
1431
1432         Fix #78156
1433         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1434
1435 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
1436
1437         A fix for #49011.
1438         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1439         (DoubleConstant.Reduce): Ditto.
1440
1441 2006-04-23  Raja R Harinath  <rharinath@novell.com>
1442
1443         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1444         Remove 'lvalue_right_side' argument.  Move parts to ...
1445         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1446         (LocalVariable.DoResolveLValue): ... these.
1447
1448 2006-04-21  Raja R Harinath  <rharinath@novell.com>
1449
1450         Fix cs1655.cs
1451         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1452         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1453         (LocalVariableReference.DoResolveBase): Use it to implement new
1454         CS1655 check.
1455         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1456         (Argument.Resolve): Simplify.  Move CS1510 check ...
1457         * ecore.cs (Expression.ResolveLValue): ... here.
1458         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1459         (PropertyExpr.DoResolveLValue): Likewise.
1460         (FieldExpr.Report_AssignToReadonly): Likewise.
1461         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
1462         LValueMemberAccess or LValueMemberOutAccess on instance depending
1463         on it.
1464         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1465         DoResolve as appropriate.
1466
1467 2006-04-20  Raja R Harinath  <rharinath@novell.com>
1468
1469         Fix #75800
1470         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1471         implicit conversions on 'out' and 'ref' arguments.
1472
1473         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1474         improve clarity.  Remove dead code.
1475
1476         Fix #66031
1477         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1478         (Catch.Resolve): Resolve VarBlock if it exists.
1479
1480 2006-04-19  Miguel de Icaza  <miguel@novell.com>
1481
1482         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1483         twice, this was some residual code, the enumerator was emitted
1484         properly in the two branche of if later.
1485
1486         Fixes #78031
1487         
1488         Thanks to Martin for finding the source of the problem
1489         
1490 2006-04-19  Raja R Harinath  <rharinath@novell.com>
1491
1492         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
1493         cast is never an lvalue.
1494         (Cast.DoResolve, Cast.ResolveRest): Combine.
1495         (Argument.Emit): Simplify slightly.  Move 'Expr is
1496         IMemoryLocation' check ...
1497         (Argument.Resolve): ... here.
1498         (Argument.Error_LValueRequired): Remove.  Inline into only user.
1499
1500         Simplifications.  Fix cs0191-2.cs
1501         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1502         CS1649 and CS1651 to ...
1503         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
1504         the actual selection of the error code and message to a lookup
1505         table.  Add a dummy return value to simplify callsites.
1506         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1507         readonly fields of other instances of the same type.  Move CS0197
1508         warning from ...
1509         * expression.cs (Argument.Resolve): ... here.  Simplify code.
1510         Ensure that ec.InRefOutArgumentResolving is only set during LValue
1511         resolution of an out or ref argument.  The code simplification
1512         above uses this invariant.
1513
1514 2006-04-18  Raja R Harinath  <rharinath@novell.com>
1515
1516         Possibly fix #77752.  Fix cs1690-[4-7].cs.
1517         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1518         CheckMarshallByRefAccess.  Drop parameter.
1519         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
1520         warning.
1521         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1522         InstanceExpression.
1523         * report.cs (AllWarnings): Add CS1690.
1524         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1525         for ref access too.
1526         (LocalVariableReference.DoResolveBase): Update.
1527
1528 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1529
1530         * class.cs (MethodOrOperator): Moved common parts from method class.
1531         detect obsolete attributes.
1532         (Method.Define): Simplified as it reuses code from base.
1533         (Constructor.ValidAttributeTargets): Fixed issue found during
1534         refactoring.
1535         (Destructor.ValidAttributeTargets): Fixed issue found during
1536         refactoring.
1537         (Operator): Finished refactoring set off by #78020. Operator class is now
1538         ordinary method class.
1539
1540         * anonymous.cs: Updated.
1541
1542 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1543
1544         * class.cs (Constructor.Emit): Don't emit the attributes twice.
1545
1546 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1547
1548         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1549         detect obsolete attributes.
1550         (Method.CreateEmitContext): Moved to MethodOrOperator.
1551
1552 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1553
1554         A fix for #78048.
1555         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1556         customized exception to make crash detection easier.
1557         (MethodOrOperator): Started to work on new base class for methods and
1558         operators.
1559         (Method): Derives from MethodOrOperator.
1560         (Constructor.Emit): Emits its own attributes.
1561         (AbstractPropertyEventMethod.Emit): Ditto.
1562         (Operator): Derives from MethodOrOperator, will refactor fully in extra
1563         patch.
1564         (Operator.Emit): It's temporary more tricky than should be.
1565         
1566         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1567
1568         * report.cs (InternalErrorException): Add ctor with inner exception.
1569
1570 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
1571
1572         A fix for #76744.
1573         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1574         only not visible.
1575
1576 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
1577
1578         A fix for #77916.
1579         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1580         array.
1581
1582 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1583
1584         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1585         attribute is present and Guid not.
1586         (Interface.ApplyAttributeBuilder): Ditto.
1587
1588         * attribute.cs: Add error message.
1589
1590 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1591
1592         A fix for #78020.
1593
1594         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1595         sources (it's composite) so hold them in extra array as they are used in
1596         Emit phase only. It worked in the previous versions by mistake.
1597         (Attribute.Emit): Emit attribute for more owners when exist.
1598
1599         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1600         it has now different behaviour.
1601
1602 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
1603
1604         * constant.cs (Constant.IsDefaultInitializer): New method.
1605
1606         * class.cs: Updated.
1607
1608         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1609         re-initialize default values. It saves KBs almost for every assembly.
1610         Thanks Zoltan for the idea.
1611         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1612         (ArrayCreation.DoResolve): Resolve only once.
1613         (ArrayCreation.Emit): Emit static initializer only when it is faster.
1614         (ArrayCreation.GetAttributableValue): Cope with optimized values.
1615
1616 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
1617
1618         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1619         From #77961.
1620
1621 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1622
1623         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1624         in an embedded statement too.
1625
1626 2006-04-01  Raja R Harinath  <rharinath@novell.com>
1627
1628         Fix #77929
1629         * typemanager.cs (IsNestedChildOf): Drop generic arguments before
1630         testing.
1631
1632         Fix #77958
1633         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1634
1635         Fix #77962
1636         * report.cs (SymbolRelatedToPreviousError): Drop generic type
1637         arguments before checking whether a type is reflected or not.
1638
1639         Fix #77954
1640         * expression.cs (Invocation.IsApplicable): Ensure a generic method
1641         definition doesn't take part in overload resolution.
1642         (Invocation.IsParamsMethodApplicable): Likewise.
1643         (Invocation.OverloadResolve): When replacing a reflected override
1644         method with its base definition, ensure that type arguments are
1645         applied.
1646
1647 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1648
1649         A fix for #77966.
1650
1651         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1652         was not specified.
1653
1654         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1655
1656 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
1657
1658         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1659         phase.
1660
1661         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1662         LocalTemporary change.
1663
1664         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1665         TypeContainer.
1666         (ClassOrStruct.DefineFieldInitializers): Implemented static field
1667         initializers optimization.
1668         (ClassOrStruct.TypeAttr): Moved from modifiers.
1669         (Constructor.CheckBase): Don't crash when static ctor has parameters.
1670         (FieldBase.ResolveInitializer): Resolves initializer.
1671         (FieldBase.HasDefaultInitializer): New property.
1672
1673         * cs-parser.jay: Removed message.
1674
1675         * expression.cs (CompilerGeneratedThis): New specialization.
1676
1677         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1678
1679 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
1680
1681         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1682
1683 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1684
1685         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1686         be now EnumConstants only.
1687
1688 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1689
1690         * attribute.cs, driver.cs: Reset more caches.
1691
1692 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1693
1694         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1695
1696 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1697
1698         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1699         for easier reuse. Updated all overrides.
1700         (IntegralConstant): New base class for all integral constants.
1701         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1702         of the constant range, report custom error.
1703         (UIntConstant.Reduce): Fixed uint conversion.
1704
1705         * ecore.cs, literal.cs: Reduce updates.
1706
1707 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1708
1709         A fix for #75813.
1710
1711         * class.cs (Constructor.Define): Removed extra if for default ctors.
1712         A patch from Atsushi Enomoto.
1713
1714 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1715
1716         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1717         GetAttributableValue.
1718
1719         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1720         when required.
1721
1722         * convert.cs (ImplicitConversionRequired): Error message moved to
1723         DoubleLiteral.
1724
1725         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1726         automatic implicit conversion of an output value.
1727         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1728
1729         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1730         conversion.
1731         (TypeOf.GetAttributableValue): Add extra handling for object type.
1732
1733         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1734         special error message.
1735
1736 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
1737
1738         * class.cs (Constructor.Emit): Don't crash when struct ctor is
1739         InternalCall.
1740         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1741         compatible with MS runtime.
1742
1743 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
1744
1745         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1746         attribute arguments here.
1747
1748         * class.cs (Indexer.Define): The check was moved to attribute class.
1749
1750 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1751
1752         * expression.cs (StringConcat.Append): Reverted back to no warning state.
1753
1754 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1755
1756         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1757
1758         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1759         the blocks too.
1760
1761 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
1762
1763         * doc-bootstrap.cs : fix build.
1764
1765 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1766
1767         * expression.cs (StringConcat.Append): Issue a warning when empty string
1768         is going to append.
1769
1770 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1771
1772         * assign.cs (CompoundAssign.ResolveSource): Removed.
1773
1774         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1775         clean up.
1776
1777         * class.cs (TypeContainer.FindMethods): Removed.
1778         (TypeContainer.CheckMemberUsage): Made static.
1779
1780         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1781
1782         * constant.cs (CheckRange): Removed unused type argument.
1783         (CheckUnsigned): Removed unused type argument.
1784
1785         * cs-parser.jay: Updated after MemberAccess clean up.
1786         Uses Length for empty string test.
1787
1788         * cs-tokenizer.cs: Uses Length for empty string test.
1789         (IsCastToken): Made static.
1790         (is_hex): Made static.
1791         (real_type_suffix): Made static.
1792
1793         * decl.cs (SetupCache): Made static.
1794         (OnGenerateDocComment): Removed unused ds argument.
1795
1796         * delegate.cs (VerifyDelegate): Removed unused argument.
1797
1798         * doc.cs: Uses Length for empty string test.
1799
1800         * driver.cs: Uses Length for empty string test.
1801
1802         * enum.cs (IsValidEnumType): Made static
1803
1804         * expression.cs (EnumLiftUp): Removed unused argument.
1805         (ResolveMethodGroup): Ditto.
1806         (BetterConversion): Ditto.
1807         (GetVarargsTypes): Ditto.
1808         (UpdateIndices): Ditto.
1809         (ValidateInitializers): Ditto.
1810         (MemberAccess.ctor): Ditto.
1811         (GetIndexersForType): Ditto.
1812
1813         * flowanalysis.cs: (MergeFinally): Removed unused argument.
1814
1815         * iterators.cs: Updated after MemberAccess clean up.
1816
1817         * location.cs: Uses Length for empty string test.
1818
1819         * namespace.cs: Uses Length for empty string test.
1820
1821          * report.cs (CheckWarningCode): Made static.
1822
1823         * statement.cs (LabeledStatement): Removed unused argument.
1824
1825         * typemanager.cs (FilterNone): Removed.
1826
1827 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1828
1829         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1830         obsolete.
1831
1832         * class.cs: Updated.
1833
1834 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1835
1836         * cs-parser.jay.cs: __arglist is not allowed for delegates.
1837
1838 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1839
1840         A fix for #77816.
1841
1842         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
1843         host container.
1844         (AnonymousMethod.ImplicitStandardConversionExists): New method.
1845         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1846         Add more error reporting; Fixed issue with params.
1847
1848         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1849
1850         * cs-parser.jay: AnonymousMethod requires host container.
1851
1852         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1853
1854 2006-03-18  Raja R Harinath  <harinath@gmail.com>
1855
1856         * class.cs: Change 'TypeContainer ds' constructor argument to
1857         'DeclSpace parent'.  Some classes were missed below due to
1858         different naming convention.
1859
1860         * class.cs (MemberCore.Parent): Delete.  This makes the
1861         ParentContainer changes below enforceable by the compiler.
1862
1863         Treat pointers to enclosing declaration space as 'DeclSpace', not
1864         'TypeContainer'.
1865         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1866         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1867
1868         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1869         of TypeContainer.
1870         (Block.AddThisVariable): Likewise.
1871         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1872         (AbstractPropertyEventMethod.Emit): Likewise.
1873         (AbstractPropertyEventMethod.EmitMethod): Likewise.
1874         (GetMethod.Define, SetMethod.Define): Likewise.
1875         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1876         (DelegateMethod.EmitMethod): Likewise.
1877
1878         Fix regression test-partial-13.cs.
1879         Rationalize use of PartialContainer.  Ensure that the partial
1880         class semantics can be tied to type-correctness, i.e., any
1881         violation will cause a compile error.
1882         * class.cs, const.cs: Access all fields that belong to class
1883         TypeContainer via ParentContainer.  Arguments of EmitContexts and
1884         Resolve()-like functions still use 'Parent'.
1885
1886         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1887         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1888         (PropertyMethod.CheckModifiers): Remove unused argument.
1889         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1890         DeclSpace.
1891
1892 2006-03-28  Raja R Harinath  <rharinath@novell.com>
1893
1894         * decl.cs (DeclSpace.LookupGeneric): Update to changes.
1895
1896 2006-03-17  Raja R Harinath  <harinath@gmail.com>
1897
1898         Make semantics of PartialContainer simpler.
1899         * decl.cs (DeclSpace.IsPartial): Remove.
1900         * class.cs (TypeContainer.IsPartial): Likewise.
1901         (TypeContainer..ctor): Set PartialContainer to point to self.
1902         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1903         (TypeContainer.FindNestedType): Likewise.
1904         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
1905
1906 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
1907
1908         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1909
1910 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1911
1912         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1913         classes.
1914
1915 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1916
1917         * class.cs (Operator.Define): An error for base conversion was not
1918         reported correctly.
1919
1920 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
1921
1922         A fix for #77593, #77574.
1923
1924         * class.cs (MethodCore.CheckBase): Another if for operator.
1925
1926 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1927
1928         A fix for #77822.
1929
1930         * expression.cs (VerifyArgumentsCompat): Reverted to double error
1931         reporting, it's more tricky than I thought.
1932
1933 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
1934
1935         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1936         were not resolved
1937
1938         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1939         (DelegateCreation.ImplicitStandardConversionExists): New method for just
1940         conversion test.
1941         
1942         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1943         not needed.
1944
1945 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
1946
1947         A fix for #77353.
1948
1949         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1950         (Event.Define): ditto
1951         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1952
1953         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1954         Removed redundant code and set NewSlot for Invoke method too.
1955
1956         * parameter.cs (Parameters.ctor): Add custom, type ctor.
1957         (Parameters.MergeGenerated): New method. Use this method when you merge
1958         compiler generated argument with user arguments.
1959
1960 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
1961
1962         * attribute.cs (ResolveAsTypeTerminal): Removed.
1963
1964         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1965         specialization for predefined types; 30% speed up.
1966         Finally placed obsolete check to right place.
1967         (Expression.ResolveType): Removed.
1968
1969         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1970         Updated after ResolveType was removed.
1971
1972         * expression.cs (Cast.ctor): Check void cast.
1973         (Binary.ResolveAsTypeTerminal): Is never type.
1974         (Conditional.ResolveAsTypeTerminal): Is never type.
1975
1976         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1977
1978 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1979
1980         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
1981
1982 2006-03-23  Martin Baulig  <martin@ximian.com>
1983
1984         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
1985         type check if either of the types is an open generic type.
1986
1987 2006-03-23  Martin Baulig  <martin@ximian.com>
1988
1989         * convert.cs
1990         (Convert.ExplicitTypeParameterConversion): New method; implement
1991         explicit type parameter conversions.
1992
1993 2006-03-23  Martin Baulig  <martin@ximian.com>
1994
1995         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
1996         blindly allow all conversions if we do not have any constraints.
1997
1998 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
1999
2000         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
2001         these two separated members to simplify the code.
2002         (Attribute.Resolve): Refactored to use new fields and methods.
2003         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
2004         implemented obsolete attribute checking.
2005         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
2006         implemented obsolete checking again. It look line never ending quest ;-)
2007         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
2008
2009         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
2010
2011         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
2012
2013         *class.cs (Property.Define): Add RegisterProperty call.
2014
2015         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
2016         argument groups (only 2).
2017
2018         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
2019         encoding expression to arguments.
2020         (Expression.ExprClassToResolveFlags): Just turned to property.
2021
2022         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
2023         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
2024         optimized as well as implemented support for zero-length attributes.
2025
2026         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
2027         Add caching of PropertyInfo's.
2028
2029 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
2030
2031         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
2032         error multiple times.
2033
2034 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
2035
2036         New partial class implementation.
2037         A fix for #77027, #77029, #77403
2038
2039         * attribute.cs (Attributable): Made attributes protected.
2040
2041         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
2042         the replacements of ClassPart and PartialContainer.
2043         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
2044         (TypeContainer.AddInterface): Ditto.
2045         (TypeContainer.AddPartial): The main method for partial classes. It checks
2046         for errors and merges ModFlags and attributes. At the end class is added to
2047         partial_parts list.
2048         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
2049         required here.
2050         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
2051         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
2052         from the rest of partial classes.
2053         (TypeContainer.GetClassBases): Simplified.
2054         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
2055         DefineType.
2056         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
2057         (TypeContainer.HasExplicitLayout): Uses Flags now.
2058         (PartialContainer): Removed.
2059         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
2060         (StaticClass): Was merged with Class.
2061         (Class.GetClassBases): class and static class bases are verified here.
2062         (Class.TypeAttr): Added static attributes when class is static.
2063         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
2064         (MemberBase): In some cases we need to call parent container for partial
2065         class. It should be eliminated but it's not easy now.
2066
2067         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
2068
2069         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
2070         partial classed to accumulate class comments.
2071         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
2072
2073         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
2074
2075         * driver.cs (MainDriver): Tree.GetDecl was removed.
2076
2077         * modifiers.cs (Modifiers): Add partial modifier.
2078
2079         * tree.cs (Tree.decl): Removed.
2080         (RootTypes): Started to use this class more often for root types
2081         specializations.
2082
2083 2006-03-23  Raja R Harinath  <rharinath@novell.com>
2084
2085         * generic.cs (TypeParameter.UpdateConstraints): Update
2086         'constraints' if null.
2087
2088 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
2089
2090         A fix for #77615
2091
2092         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
2093         external interface does not have an attribute.
2094
2095 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
2096
2097         Another prerequisites for new partial classs implementation.
2098         
2099         * attribute.cs (Attribute.Equal): Implemented.
2100         (Attribute.Emit): Changed as attributes can be applied more than twice.
2101         (Attributes.Emit): Check for duplicate attributes here.
2102
2103         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
2104         as a parameter, clean-up.
2105
2106 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2107
2108         A fix for #77485
2109
2110         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
2111         contains obsolete attribute check which can in some cases look for base
2112         type of current class which is not initialized yet.
2113         (TypeContainer.BaseType): Replacement of ptype.
2114
2115         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2116
2117 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2118
2119         First of prerequisites for new partial classs implemention.
2120         
2121         * attribute.cs (Attributable): Extended by ResolveContext;
2122         Attributes finally have correct context for resolving in all cases.
2123         (AttachTo): Attribute owner is assigned here.
2124
2125         * codegen.cs (IResolveContext): Introduce new interface to hold
2126         all information needed in resolving phase.
2127         (EmitContext): Implements IResolveContext; more clean-up needed here.
2128         
2129         * decl.cs (MemberCore): Implemented IResolveContext.
2130
2131         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
2132         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
2133         parameter.cs, statement.cs, tree.cs, typemanager.cs:
2134         Refactored to use new IResolveContext instead of EmitContext; cleanup
2135
2136 2006-03-22  Raja R Harinath  <rharinath@novell.com>
2137
2138         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
2139         mcs to keep code differences small.
2140         * attribute.cs (Attribute.GetParameterDefaultValue): New.
2141         * typemanager.cs (parameter_default_value_attribute_type): New.
2142         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
2143         CS1908 check.
2144
2145 2006-03-22  Martin Baulig  <martin@ximian.com>
2146
2147         * generic.cs
2148         (Nullable.NullableLiteral): Derive from `NullLiteral'.
2149
2150         * convert.cs
2151         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
2152         instead of the normal `NullLiteral'.
2153
2154 2006-03-21  Martin Baulig  <martin@ximian.com>
2155
2156         Fix #77583.
2157         * generic.cs (TypeManager.InferType): If `pt' is a generic
2158         parameter, don't check whether `pt == at'.
2159
2160 2006-03-20  Raja R Harinath  <rharinath@novell.com>
2161
2162         Fix #77852
2163         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
2164         (TypeParameter.Resolve): Update to change.
2165         (ConstraintChecker.CheckConstraints): Resolve type-argument
2166         constraints before use.
2167
2168 2006-03-16  Martin Baulig  <martin@ximian.com>
2169
2170         * generic.cs
2171         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
2172         and don't have any instance constructors, also lookup in the base class.
2173         (TypeManager.IsNullableValueType): New public method.
2174
2175         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
2176         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
2177         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
2178
2179         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
2180         instead of just TypeManager.IsNullableType() to determine whether
2181         a lifted operator exists.
2182         (UnaryMutator.DoResolve): Likewise.
2183         (Conditional.DoResolve): Likewise.
2184         (Binary.DoResolve): A lifted operator only exists if both operands
2185         are valuetypes and at least one of them is a nullable type.
2186
2187 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
2188
2189         * iterator.cs : yield break is allowed in try statement which has
2190           catch clauses. Fixed bug #77767.
2191
2192 2006-03-12  Martin Baulig  <martin@ximian.com>
2193
2194         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
2195         private IsSignatureEqual() to compare types; see the comment in
2196         that method; fixes #77674.
2197
2198 2006-03-10  Raja R Harinath  <rharinath@novell.com>
2199
2200         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
2201         (Expression.ResolveAsTypeTerminal): Likewise.
2202         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
2203         * expression.cs, generic.cs, iterators.cs: Likewise.
2204         * parameter.cs, statement.cs, typemanager.cs: Likewise.
2205
2206 2006-03-09  Martin Baulig  <martin@ximian.com>
2207
2208         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
2209         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
2210
2211 2006-03-09  Martin Baulig  <martin@ximian.com>
2212
2213         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
2214         `prepared' flag is set.
2215
2216         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
2217         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
2218         issues; see gtest-254.cs.
2219
2220 2006-03-07  Martin Baulig  <martin@ximian.com>
2221
2222         * generic.cs (TypeManager.InferType): Allow infering
2223         `IEnumerable<T>' with an array of T; see gtest-251.cs.
2224
2225 2006-03-06  Martin Baulig  <martin@ximian.com>
2226
2227         * generic.cs
2228         (TypeManager.InferType): Fix gtest-250.cs.
2229
2230         * typemanager.cs
2231         (TypeManager.IsSubclassOf): Also check the base class.
2232
2233         * expression.cs
2234         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
2235         fixes gtest-249.cs.
2236
2237 2006-03-01  Raja R Harinath  <rharinath@novell.com>
2238
2239         Fix #77679.
2240         * expression.cs (ParameterReference.DoResolveBase): Change return
2241         type to bool.
2242         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2243         Update.
2244
2245         Fix #77628.
2246         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2247
2248         Fix #77642.
2249         * typemanager.cs (GetFullNameSignature): Don't nullref on
2250         protected accessors.
2251
2252 2006-02-16  Martin Baulig  <martin@ximian.com>
2253
2254         * generic.cs
2255         (TypeManager.GetGenericFieldDefinition): New public method; use it
2256         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
2257
2258 2006-02-14  Martin Baulig  <martin@ximian.com>
2259
2260         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
2261
2262 2006-02-14  Martin Baulig  <martin@ximian.com>
2263
2264         * generic.cs
2265         (TypeManager.DropGenericMethodArguments): New public method; don't
2266         use GetGenericMethodDefinition() on something which is not a
2267         generic method.
2268
2269 2006-02-14  Martin Baulig  <martin@ximian.com>
2270
2271         * generic.cs
2272         (ConstraintChecker.CheckConstraints): If a type parameter has the
2273         `struct' constraint, the type must be a non-nullable valuetype.
2274
2275 2006-02-10  Martin Baulig  <martin@ximian.com>
2276
2277         * typemanager.cs
2278         (TypeManager.IsOverride): Make this work for instantiated methods
2279         in a generic class; fixes #77509.
2280         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
2281         rather than calling it directly; fixes #77488.  
2282
2283 2006-02-08  Martin Baulig  <martin@ximian.com>
2284
2285         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
2286         reporting into CheckConstraint() so we can use the correctly
2287         instantiated type.
2288
2289 2006-02-08  Martin Baulig  <martin@ximian.com>
2290
2291         * expression.cs (BaseAccess): Add support for generic methods.
2292
2293         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
2294         the new MethodGroupExpr.
2295
2296 2006-02-07  Martin Baulig  <martin@ximian.com>
2297
2298         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
2299         also reference types; fixes #77483.
2300
2301 2006-02-07  Martin Baulig  <martin@ximian.com>
2302
2303         * generic.cs
2304         (TypeManager.IsGenericMethod): We now return whether something is
2305         an instantiated generic method (and not a generic method def).
2306         (TypeManager.IsGenericMethodDefinition): New public method.
2307
2308         * typemanager.cs
2309         (TypeManager.CSharpSignature): Only include type arguments for
2310         "real" generic methods, not for any instantiated method.
2311         (TypeManager.GetMethodName): Likewise, but also allow generic
2312         method definitions here.
2313
2314 2006-02-06  Miguel de Icaza  <miguel@novell.com>
2315
2316         * codegen.cs (EmitScopeInitFromBlock): check here the
2317         capture_context, there is no need to make two calls to the
2318         EmitContext. 
2319
2320         * anonymous.cs: Add some debugging messages that might help me
2321         track other instances of this problem in the future (the
2322         regression of test 467).
2323
2324         * cs-parser.jay: track the variable block, as we need to initalize
2325         any captured variables declared in this block for the "catch"
2326         portion of the "Try" statement.
2327
2328         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2329         scope initialization for captured variables. 
2330
2331         Also, move the emit for the variables after the block location has
2332         been marked.
2333
2334 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
2335
2336        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2337         
2338 2006-02-06  Martin Baulig  <martin@ximian.com>
2339
2340         * class.cs (TypeContainer.DefineType): If we're a struct, pass
2341         `TypeManager.value_type' as parent type to
2342         ModuleBuilder.DefineType().  Fixes #77358.      
2343
2344 2006-02-02  Miguel de Icaza  <miguel@novell.com>
2345
2346         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2347         commit yesterday, the initialization for the roots is necessary.
2348         What is not necessary is the scope activation.
2349
2350 2006-02-02  Raja R Harinath  <rharinath@novell.com>
2351
2352         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2353         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2354         CS0206 checks.
2355         (Argument.Resolve): Remove CS0206 checks.
2356
2357 2006-02-01  Miguel de Icaza  <miguel@novell.com>
2358
2359         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2360         scopes for all the roots, the scopes will now be emitted when the
2361         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
2362
2363         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2364         code.  This reduces a lot of existing cruft.
2365         
2366         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2367         that the ScopeInfo is generated as we enter the scope, not at the
2368         time of use, which is what we used to do before.
2369
2370         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2371         every time a Block is about to be emitted if we have a
2372         CaptureContext. 
2373
2374 2006-02-01  Raja R Harinath  <rharinath@novell.com>
2375
2376         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
2377         attribute for mscorlib too.
2378
2379         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2380         (Reset): Update.
2381         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2382
2383         * typemanager.cs (cons_param_array_attribute): Make private.
2384         (Reset): Set it to null.
2385         (InitCoreHelpers): Don't initialize it.
2386         (ConsParamArrayAttribute): New.  Initialize it as needed.
2387         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2388
2389 2006-01-31  Miguel de Icaza  <miguel@novell.com>
2390
2391         * expression.cs: There might be errors reported during the
2392         selection of applicable methods.  If there are errors, do not
2393         continue execution as it will lead the compiler to crash.
2394
2395 2006-01-30  Miguel de Icaza  <miguel@novell.com>
2396
2397         * expression.cs: Member access is not allowed on anonymous
2398         methods.  Fixes #77402.
2399
2400 2006-01-30  Raja R Harinath  <rharinath@novell.com>
2401
2402         Fix #77401
2403         * cs-parser.jay (VariableDeclaration): Don't set
2404         current_array_type to null.
2405         (field_declaration, event_declaration, declaration_statement):
2406         Set it to null here.
2407
2408 2006-01-29  Raja R Harinath  <harinath@gmail.com>
2409
2410         Fix part of #77397
2411         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
2412
2413 2006-01-28  Raja R Harinath  <harinath@gmail.com>
2414
2415         * typemanager.cs (GenericParameterPosition): New.
2416         * doc.cs: Use it.
2417
2418 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
2419
2420         * doc.cs : To process "include" elements, first we should create
2421           another list than XmlNodeList, because it could result in node
2422           removal, which could result in that the XmlNodeList gives up
2423           yielding next node.
2424
2425 2006-01-25  Miguel de Icaza  <miguel@novell.com>
2426
2427         * expression.cs: Introduce an error report that we were not
2428         catching before.   Gonzalo ran into it.
2429
2430 2006-01-23  Miguel de Icaza  <miguel@novell.com>
2431
2432         A fix for bug: #76957
2433         
2434         * iterators.cs (MoveNextMethod.CreateMethodHost): call
2435         ComputeMethodHost before creating the method, this is a new
2436         requirement. 
2437
2438         * anonymous.cs (AnonymousContainer): Now we track all the scopes
2439         that this method references (RegisterScope).  The actual scope
2440         where the method is hosted is computed with the ComputeMethodHost
2441         before we create the method.
2442
2443         Moved the Deepest routine here.
2444
2445         (AnonymousContainer.ComputeMethodHost): New routine used to
2446         compute the proper ScopeInfo that will host the anonymous method.
2447
2448         (ScopeInfo): Deal with multiple roots.  The problem was that we
2449         did not have a unique root where all ScopeInfos could be hanged
2450         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
2451         of roots.  
2452
2453         Remove AdjustMethodScope which is now computed at the end.  Remove
2454         LinkScope which did a partial link, instead link all ScopeInfos
2455         before code generation from the new "LinkScopes" routine. 
2456
2457         Simplify all the Add* routines as they no longer need to maintain
2458         the tree, they just need to record that they are using variables
2459         from a ScopeInfo.
2460
2461         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2462         routines to produce the forest of ScopeInfo trees.
2463
2464         * class.cs (TypeContainer.AppendMethod): This is just like
2465         AddMethod, but ensures that an interface implementation method
2466         (IEnumerable.XXX) is not inserted at the beginning of the queue of
2467         methods, but at the end.
2468
2469         We use this functionality to ensure that the generated MoveNext
2470         method in the iterator class is resolved/emitted before the
2471         enumerator methods created.   
2472
2473         This is required because the MoveNext method computes the right
2474         ScopeInfo for the method.  And the other methods will eventually
2475         need to resolve and fetch information computed from the anonymous
2476         method. 
2477
2478         
2479 2006-01-23  Raja R Harinath  <rharinath@novell.com>
2480
2481         Improve implementation of section 14.4.2.2 (Better function member).
2482         * expression.cs (Invocation.MoreSpecific): Compare all type
2483         arguments before deciding if one type is more specific than
2484         another.  Handle array types too.  Return the more specific type.
2485         (Invocation.BetterFunction): Add more tie-breaking rules from
2486         section 14.4.2.2.  Perform "more specific" check after
2487         other tie-breaking rules.  Compare all parameter types before
2488         choosing the "more specific" method.
2489
2490 2006-01-21  Raja R Harinath  <harinath@gmail.com>
2491             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
2492
2493         Fix rest of #76995.
2494         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2495         the 'aliases' hash.
2496         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2497         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2498
2499 2006-01-18  Martin Baulig  <martin@ximian.com>
2500
2501         * class.cs (TypeContainer.AddToMemberContainer): Use
2502         `symbol.MemberName.MethodName' instead of just `symbol.Name';
2503         fixes #77124.
2504
2505 2006-01-18  Martin Baulig  <martin@ximian.com>
2506
2507         Fix #76417: a generic class may now have methods which may unify
2508         for some type parameter substitutions.
2509
2510         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
2511         for methods which may unify anymore.
2512
2513         * expression.cs (Invocation.MoreSpecific): New private static
2514         method; checks whether one method is more specific than another
2515         according to 14.4.2.2 of the spec.
2516         (Invocation.BetterFunction): Implement the tie-breaking rules from
2517         14.4.2.2 of the spec: if two methods unify for some type parameter
2518         substitution, we need to pick the more specific one.
2519
2520 2006-01-18  Raja R Harinath  <rharinath@novell.com>
2521
2522         Fix #76656, cs0231-2.cs.
2523         * cs-parser.jay (formal_parameter_list): Make error case catch
2524         more issues.
2525         (parenthesized_expression_0): Add CS1026 check.
2526         (invocation_expression): Remove unused { $$ = lexer.Location }.
2527
2528 2006-01-17  Raja R Harinath  <rharinath@novell.com>
2529
2530         Fix #76824.
2531         * cs-parser.jay (statement_expression): Don't list out the
2532         individual statement-expressions.  Convert syntax error into
2533         CS0201 check.
2534
2535 2006-01-16  Raja R Harinath  <rharinath@novell.com>
2536
2537         Fix #76874.
2538         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2539         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
2540         CheckIntermediateModification.
2541         (FieldExpr.DoResolve): Add new two-argument version that
2542         allows us to resolve the InstanceExpression as an lvalue.
2543         The one-argument variant is now just a wrapper.
2544         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2545         Resolve the lhs as an lvalue if the it has a value type.
2546         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2547         from Assign.DoResolve.
2548         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2549         resolved as an lvalue.
2550         (PropertyExpr.DoResolve): Update.
2551         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2552         has a value type.  Move CS1612 check here from
2553         CheckIntermediateModification.
2554         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2555         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
2556         'right_side' of a ResolveLValue on an 'out' argument.
2557         (EmptyExpression.LValueMemberAccess): New.  Used as the
2558         'right_side' of a propagated ResolveLValue on a value type.
2559         (LocalVariableReference.DoResolveBase): Recognize
2560         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2561         Add CS1654 check.
2562         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2563         EmptyExpression.Null.
2564
2565 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
2566
2567         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
2568           Type.IsGenericParameter(). Fixed bug #77183.
2569         * doc.cs : it is now identical to doc.cs in mcs.
2570
2571 2006-01-16  Martin Baulig  <martin@ximian.com>
2572
2573         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
2574
2575 2006-01-16  Martin Baulig  <martin@ximian.com>
2576
2577         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
2578         ctors; fixes #77250.
2579
2580 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2581
2582         This fixes the problem where we used ldfld instead of ldflda to
2583         load the "THIS" pointer on captured parameters, when THIS is a
2584         value type.  See bug #77205.
2585         
2586         * iterators.cs (CapturedThisReference.Emit): Pass false to
2587         EmitThis (we do not need the address).
2588
2589         * codegen.cs (EmitThis): it needs to know whether we need the
2590         address of `this' or not.  This is used by value types.  
2591
2592         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2593         every other call passes false.
2594
2595 2006-01-12  Raja R Harinath  <rharinath@novell.com>
2596
2597         Fix #77221.
2598         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2599         GetOverride.
2600         * expression.cs (Invocation.OverloadResolve): Update.
2601         (Invocation.DoResolve): Avoid double resolution of invocation.
2602
2603 2006-01-11  Raja R Harinath  <rharinath@novell.com>
2604
2605         Fix #77180.
2606         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2607         unary negation of floating point types as 0-expr; negation cannot
2608         overflow in floating point types.
2609
2610         Fix #77204.
2611         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2612         on operands of 'void' type.
2613
2614         Fix #77200.
2615         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2616         and ExclusiveOr for boolean constants too.
2617
2618 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
2619
2620         * expression.cs: Fix Console.WriteLine ((this = x).foo);
2621
2622 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2623
2624         * cs-tokenizer.cs (Position): New class used to save and restore
2625         the position state in the tokenizer.  Before this patch the save
2626         and restore was not complete enough so the line and columns would
2627         start to drift and the debugger and stack traces will get the
2628         wrong data.
2629
2630 2006-01-10  Martin Baulig  <martin@ximian.com>
2631
2632         * generic.cs
2633         (TypeParameter.InflateConstraints): New public method.
2634
2635         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
2636         constraints; fixes #77042.
2637
2638 2006-01-10  Martin Baulig  <martin@ximian.com>
2639
2640         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
2641         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
2642         #77061. 
2643
2644 2006-01-09  Raja R Harinath  <rharinath@novell.com>
2645
2646         Fix #75636.
2647         * expression.cs (Invocation.OverloadResolve): Replace reflected
2648         override methods with their base virtual methods, rather than
2649         skipping over them.
2650         * typemanager.cs (TypeManager.GetOverride): New.
2651
2652 2005-12-21  Miguel de Icaza  <miguel@novell.com>
2653
2654         * driver.cs: Report the case of no source files and no -out:
2655         argument provided.
2656
2657 2005-12-20  Raja R Harinath  <rharinath@novell.com>
2658
2659         Fix #77035.
2660         * expression.cs (ComposedCast.GetSignatureForError): Define.
2661
2662 2006-01-05  Jb Evain  <jbevain@gmail.com>
2663
2664         * class.cs (Property.Define, Indexer.Define): do not tag the
2665         properties as SpecialName | RTSpecialName.
2666
2667 2006-01-04  Miguel de Icaza  <miguel@novell.com>
2668
2669         * class.cs (MethodCore.IsDuplicateImplementation): This method was
2670         doing a low-level comparission of parameter types.  It was lacking
2671         a check for __argslist. 
2672
2673 2005-12-30  Miguel de Icaza  <miguel@novell.com>
2674
2675         * expression.cs (ParameterReference.DoResolveBase): Allow
2676         reference parameters if they are local to this block. 
2677
2678         This allows the ref and out parameters of a delegate to be used in
2679         an anonymous method, for example:
2680
2681         delegate void set (out int x);
2682
2683         set s = delegate (out int x){
2684                 x = 0;
2685         };
2686
2687         This is used by functionality introduced late in the C# language.
2688         
2689         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2690         method that take ref and out parameters. 
2691
2692         Fixes #77119 which was a late change in the spec.
2693
2694 2005-12-23  Miguel de Icaza  <miguel@novell.com>
2695
2696         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2697         parent if its the same scope.  Fixes #77060.
2698
2699 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
2700
2701         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
2702
2703 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2704
2705         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
2706         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
2707         that doesn't contain the full public key. This is a update of the
2708         friend assemblies in .Net 2.0 release.
2709         
2710 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2711
2712         Fix #76995
2713
2714         * namespace.cs (NamespaceEntry): Add extern_aliases as a
2715         ListDictionary, to contain the ExternAliasEntry entries (in
2716         addition to the NamespaceEntry.aliases hashtable). This field is
2717         shared between the original entry and its doppelganger (bodyless 
2718         copy of it).
2719         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2720         extern_aliases field.
2721         (NamespaceEntry.Lookup): Move the IsImplicit check after the
2722         lookup in extern_aliases.
2723
2724 2005-12-16  Raja R Harinath  <rharinath@novell.com>
2725
2726         Fix #77006.
2727         * class.cs (TypeContainer.Mark_HasEquals): New.
2728         (TypeContainer.Mark_HasGetHashCode): New.
2729         (ClassPart): Override them.
2730         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2731
2732         * generic.cs (GenericMethod.DefineMembers): Update to changes.
2733         (TypeParameter.TypeParameter): Change type of 'parent' argument to
2734         DeclSpace.
2735
2736         Fix #77008.
2737         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2738         'parent' argument to the base constructor.
2739
2740         Remove all mention of TypeContainer from decl.cs.
2741         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2742         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2743         (DeclSpace.DeclSpace): Likewise.
2744         (DeclSpace.DefineMembers): Remove unused argument.
2745         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
2746         debugging check -- we don't care if the debug code throws an
2747         InvalidCastException instead of an InternalErrorException.
2748         * class.cs (TypeContainer.DefineMembers): Update to changes.
2749         (TypeContainer.DoDefineMembers): Likewise.
2750         (TypeContainer.GetMethods): Likewise.
2751         (PropertyMember.Define): Likewise.
2752         (MemberBase.Parent): New property that forwards to
2753         MemberCore.Parent, but ensures that we get a TypeContainer.
2754         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2755         (RootContext.PopulateTypes): Likewise.  Remove special case code
2756         for !RootContext.StdLib: DefineMembers is idempotent.
2757
2758 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
2759
2760         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2761
2762 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
2763
2764         * doc.cs : The search for referenced namespace was insufficient to
2765           get global one as it used to do. Fixed bug #76965.
2766
2767 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
2768
2769         * doc.cs : check name in cref in the last phase that whether it is
2770           namespace or not.
2771
2772 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2773
2774         * cs-tokenizer.cs : reverted the latest change: it somehow broke
2775           Mono.C5.
2776
2777 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2778
2779         * doc.cs : so it turned out that we cannot skip override check for 
2780           interface members. Fixed bug #76954.
2781
2782 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2783
2784         * cs-tokenizer.cs : fixed bug #75984:
2785           - #warning and #error should not be handled when the source line
2786             is disabled.
2787           - #line is not checked strictly when the source line is disabled.
2788           - #define and #undef is on the other hand checked strictly at any
2789             state.
2790
2791 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
2792
2793         * cs-tokenizer.cs : missing Location (actually, filename) in one of
2794           CS1027 report.
2795
2796 2005-12-15  Raja R Harinath  <rharinath@novell.com>
2797
2798         * generic.cs (TypeManager.IsGeneric): Remove unused method.
2799
2800         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
2801         nested types.
2802
2803 2005-12-14  Martin Baulig  <martin@ximian.com>
2804
2805         * typemanager.cs (TypeManager.GetFullName): Make this public;
2806         `Type.Fullname' now never returns null.
2807
2808         * class.cs (Method.Define): Use TypeManager.GetFullName() for
2809         explicit interface implementations; we're now using the same
2810         naming convention than csc does.
2811
2812 2005-12-14  Miguel de Icaza  <miguel@novell.com>
2813
2814         * convert.cs (ExplicitConversionCore): Check the return value from
2815         ExplicitConversionCore which can return null on failure.  Fixes #76914
2816
2817 2005-12-09  Raja R Harinath  <rharinath@novell.com>
2818
2819         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
2820         instead of IsGenericInstance.
2821         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
2822         code that's now covered by the more general test.
2823         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
2824
2825         * generic.cs (DropGenericTypeArguments): New.  Captures the common
2826         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
2827         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
2828         * generic.cs, report.cs, typemanager.cs: Likewise.
2829
2830 2005-12-08  Martin Baulig  <martin@ximian.com>
2831
2832         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
2833
2834         * typemanager.cs (TypeManager.CSharpSignature): Include type
2835         arguments in the signature of a generic method.
2836
2837 2005-12-07  Martin Baulig  <martin@ximian.com>
2838
2839         Add support for custom attributes on type parameters.
2840
2841         * cs-parser.jay (type_arguments): Added `opt_attributes'.
2842
2843         * generic.cs (TypeParameterName): New public class; we use this
2844         instead of a `string' to store the name of a type parameter, so we
2845         can also have `Attributes'.
2846         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
2847         array instead of a `string[]' array.
2848         (TypeParameter.ctor): We now also take an `Attributes' argument.
2849         (TypeParameter.EmitAttributes): New public method; emit our
2850         `OptAttributes' here.
2851         (GenericMethod.EmitAttributes): New public method; emit the custom
2852         attributes on all our type parameters.
2853
2854         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
2855         our type parameters.
2856         (MethodData.Define): If we're a generic method, call
2857         EmitAttributes() on it.
2858
2859 2005-12-07  Martin Baulig  <martin@ximian.com>
2860
2861         * generic.cs
2862         (ConstraintChecker): New public abstract class; move the
2863         constraint checking here from `ConstructedType' and also do
2864         constraint checking for generic methods here.
2865
2866         * expression.cs (Invocation.OverloadResolve): Use
2867         ConstraintChecker.CheckConstraints() if we resolved to a generic
2868         method.  Fix #76806.
2869
2870 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2871
2872         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2873
2874         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2875         event initializers.
2876         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2877         (FieldBase.Initializer): Initializer is now optional.
2878         (EventField.Define): Only event field can have initializer.
2879
2880         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2881
2882         * const.cs (Const): Reuse initializer.
2883
2884         * cs-parser.jay: Updated after FieldBase changes.
2885         Added current_array_type to simplify array initializers.
2886
2887         * ecore.cs (NullCast.IsDefaultValue): Implemented.
2888
2889         * expression.cs, iterators.cs: Updated.
2890
2891         * namespace.cs (NamespaceEntry): Made UsingFound private.
2892
2893 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2894
2895         * parameterCollection.cs: Obsolete, removed.
2896         * parser.cs: Obsolete, removed.
2897
2898 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2899
2900         Fix #76849.
2901         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2902
2903         * enum.cs (Enum.Define): Set obsolete context here.
2904
2905 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2906
2907         * doc.cs :
2908           - FindDocumentedMember() now expects 1) paramList as null
2909             when "we don't have to check the number of parameters" and
2910             2) Type.EmptyTypes when "there is no arguments".
2911           - Introduced FoundMember struct to hold the exact type which was
2912             used to find the documented member (the above change broke
2913             test-xml-044; it might be better just to use DeclaringType than
2914             what MS does, like this change does, but it depends on usage.)
2915
2916 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2917
2918         * doc.cs : documented member might be from DeclaringType for nested
2919           types. Fixed bug #76782.
2920
2921 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
2922
2923         * anonymous.cs: Have the param code handle leaving copies on the
2924         stack etc. Allows anonymous params to take part in the assignment
2925         code (++, +=, etc). Fixes bug #76550
2926
2927         * expression.cs: Handle the prepare_for_load/leave_copy by passing
2928         it down to the anon code.
2929
2930         * iterators.cs: Use dummy var here
2931
2932         * codegen.cs: Handle new vars
2933
2934 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2935
2936         Fix #76849.
2937         * class.cs (MethodData.Define): Set proper Obsolete context.
2938
2939         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2940         obsolete context.
2941         (FieldExpr.DoResolve): Ditto.
2942
2943 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2944
2945         Fix #76849.
2946         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2947         parent is not obsolete.
2948
2949 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
2950
2951         * doc.cs : (FindDocumentedMember) find parameterless members first
2952           and get CS0419 in the early stage. Fixed first case of bug #76727.
2953
2954 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
2955
2956         Fix #76859.
2957         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2958         no error was reported.
2959
2960         *expression.cs (Binary.DoResolve): left can be null.
2961
2962 2005-12-06  Raja R Harinath  <rharinath@novell.com>
2963
2964         * class.cs (MethodCore.CheckGenericOverride): Delete unused
2965         abstract method and all overrides.
2966         * support.cs (ParameterData.GenericConstraints): Delete.
2967         (ReflectionParameters.type_params): Delete.
2968         (ReflectionParameters.ReflectionParameters): Make private.
2969         (ReflectionParameters.GetConstaints): New factory method.
2970         * generic.cs (TypeParameterDefineType): Use it.
2971         (TypeManager.GetTypeParameterConstraints): Likewise.
2972
2973 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
2974
2975         Fix #76783.
2976         * class.cs (MethodData.Emit): Parameters should be labeled first.
2977
2978 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
2979
2980         Fix #76761.
2981         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2982
2983 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
2984
2985         * attribute.cs (AreParametersCompliant): Moved to Parameter.
2986
2987         * class.cs (MethodCore): Parameter clean up.
2988         (IMethodData): Added ParameterInfo.
2989         (MethodData): Parameter clean up.
2990         (Indexer.Define): Parameter clean up.
2991
2992         * anonymous.cs,
2993         * codegen.cs,
2994         * cs-parser.jay,
2995         * decl.cs,
2996         * doc.cs,
2997         * ecore.cs,
2998         * flowanalysis.cs,
2999         * iterators.cs,
3000         * pending.cs,
3001         * statement.cs,
3002         * typemanager.cs: Parameter clean up.
3003
3004         * delegate.cs (Define): Get rid of duplicated code.
3005
3006         * expression.cs (ParameterReference): Removed useless parameters
3007         and simplified.
3008         (Invocation): Ditto.
3009
3010         * parameter.cs (ParamsParameter): New class, params specialization.
3011         (ArglistParameter): Attemp to separate arglist.
3012         (Parameter): Refactored to be reusable and faster.
3013         (Parameter.Modifier): Made understandable.
3014         (Parameters): Changed to be used as a class for `this' assembly
3015         parameters. Refactored to use new specialized classes.
3016
3017         * support.cs (ParameterData): Added Types property.
3018         (InternalParameters): Deleted.
3019
3020 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3021
3022         * doc.cs : the previous patch does not actually fix the bug.
3023           PropertyInfo override check is now implemented and really fixed it.
3024         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
3025
3026 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3027
3028         * doc.cs : apply "override filter" also to properties.
3029           Fixed bug #76730.
3030
3031 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3032
3033         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
3034           no need to check overrides. For classes, omit those results from 
3035           interfaces since they must exist in the class. Fixed bug #76726.
3036
3037 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3038
3039         * typemanager.cs : (GetFullNameSignature) differentiate indexers
3040           with different parameters. Fixed the second problem in #76685.
3041
3042 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3043
3044         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
3045           get expected 'protected' access in CheckValidFamilyAccess()).
3046           Fixed bug #76692.
3047
3048 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3049
3050         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
3051           Fixed bug #76705.  CS1569 was incorrectly commented out.
3052
3053 2005-11-23  Martin Baulig  <martin@ximian.com>
3054
3055         * generic.cs (Constraints.Define): Removed.
3056         (TypeParameter.DefineConstraints): Removed.
3057         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
3058         on the GenericTypeParameterBuilder here.
3059
3060 2005-11-23  Martin Baulig  <martin@ximian.com>
3061
3062         * typemanager.cs (TypeManager.GetProperty): Make this public.
3063
3064         * generic.cs (Nullable.NullableInfo.ctor): Use
3065         TypeManager.GetProperty() rather than using reflection directly.
3066
3067 2005-11-17  Martin Baulig  <martin@ximian.com>
3068
3069         * expression.cs (Indexers.GetIndexersForType): Added support for
3070         generic parameters; fixes #76587.
3071
3072 2005-11-17  Martin Baulig  <martin@ximian.com>
3073
3074         * anonymous.cs
3075         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
3076         inherit the scope from our parent.  Fixes #76653.
3077
3078 2005-11-15  Martin Baulig  <martin@ximian.com>
3079
3080         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
3081         instead of `ScopeTypeBuilder' to refer to the "current" type.
3082         (AnonymousMethod.CreateScopeType): Correctly create the helper
3083         class if we're inside a generic type definition.
3084
3085 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
3086
3087         * doc.cs : use Invocation.IsOverride() to do real override check.
3088         * expression.cs : made Invocation.IsOverride() internal.
3089
3090 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
3091
3092         * doc.cs : use TypeManager.FindMembers() instead of (possible)
3093           TypeBuilder.FindMembers() and filter overriden base members out.
3094           Fixed bug #76990.
3095
3096 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3097
3098         * doc.cs : ref/out parameters are represented as '@' (instead of
3099           '&' in type FullName). Fixed bug #76630 (additionally crefs).
3100
3101 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3102
3103         * doc.cs : when there was no '.' in cref to methods in doc comment,
3104           then parameters were missing in the output. Fixed bug #76691.
3105
3106 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3107
3108         * driver.cs : don't output docs when there is an error.
3109           Fixed bug #76693.
3110
3111 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3112
3113         * doc.cs :
3114           Now it should detect indexers. Fixed primary concern in bug #76685.
3115           Fixed CS0419 message to not show the identical member signature in
3116           the message.
3117
3118 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3119
3120         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
3121           instead of Type.FindMembers() since it does not handle events.
3122           Fixed bug #71604.
3123
3124 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
3125
3126         * codegen.cs: Fixed typo (speficied -> specified).
3127
3128 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3129
3130         Fix #76369.
3131         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3132
3133 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3134
3135         * attribute.cs: Changed error message.
3136
3137         * cs-tokenizer.cs: One more check.
3138
3139 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3140
3141         * statement.cs (Block.Resolve): Ignore empty statement.
3142
3143 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3144
3145         * report.cs: Made error/warning methods more strict to avoid
3146         their misuse.
3147
3148         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3149         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3150         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3151         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3152
3153 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3154
3155         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
3156         Use the more explicit AssemblyName.FullName instead of 
3157         AssemblyName.Name to report errors.
3158         
3159 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3160
3161         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
3162         with mcs.
3163
3164 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3165
3166         * class.cs,
3167         * convert.cs,
3168         * cs-parser.jay,
3169         * decl.cs,
3170         * enum.cs,
3171         * expression.cs,
3172         * generic.cs,
3173         * pending.cs,
3174         * report.cs: Fixed error reporting and typos.
3175
3176         * generic.cs (TypeParameter.GetSignatureForError): New method.
3177         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
3178
3179         * typemanager.cs (GetFullName): Refactored.
3180
3181 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
3182
3183         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3184         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3185
3186         * class.cs (TypeContainer.IsComImport): New property.
3187         (Constructor.Define): Create proper ctor for ComImport types.
3188
3189         * expression.cs (New.CheckComImport): Fixed.
3190
3191 2005-11-07  Miguel de Icaza  <miguel@novell.com>
3192
3193         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3194         that a parameter has been captured does not mean that we do not
3195         have to do the rest of the processing.  This fixes the second part
3196         of #76592.  If there was another anonymous method capturing
3197         values in the past, the Scope would never be set for the second
3198         method that captured the same parameter.
3199
3200         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3201         properly manipulate the stack.   Second part of fix for #76592.
3202
3203         * expression.cs (New): Add support for invoking "new" on
3204         interfaces that have been flagged with the ComImport attribute and
3205         the CoClass.  Fixes #76637 
3206
3207         * statement.cs (Try.DoEmit): When a variable is captured, do not
3208         try to emit the vi.LocalBuilder variable as it has been captured.
3209         Create a temporary variable and store the results on the
3210         FieldBuilder.  Fixes #76642
3211
3212 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3213
3214         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3215
3216         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3217
3218         * expression.cs (Binary.DoResolve): Added && optimalization.
3219     
3220         * typemanager.cs (AddUserType): Removed useless argument.
3221
3222 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
3223
3224         * statement.cs (Block.variables): Uses ListDictionary.
3225
3226 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3227
3228         Fix #75969.
3229         * class.cs (PartialContainer.EmitType): Customized to emit
3230         security attributes.
3231         (ClassPart.ApplyAttributeBuilder): Transform security attribute
3232         for partial classes.
3233
3234 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3235
3236         Fix #76599.
3237         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3238         access has to be fixed.
3239         
3240         * typemanager.cs (IsUnmanagedType): Wrong common field type.
3241
3242 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
3243
3244         Fix #76590.
3245         * ecore.cs (NullCast.Reduce): Implemented.
3246
3247         * expression.cs (ArrayCreation.CheckIndices): Correcly check
3248         constant type.
3249         
3250         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3251         properly.
3252         (Foreach.Resolve): Catch null properly.
3253
3254 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3255  
3256         * cs-tokenizer.cs: Warning text fix.
3257
3258         * driver.cs: AllWarningNumbers exposed on public interface.
3259
3260         * report.cs (): Reviewed warning numbers.
3261         (IsValidWarning): Use binary search.
3262
3263 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3264  
3265         * driver.cs: Implemeted resource visibility.
3266         (Resources): New class for code sharing between /res: and
3267         /linkres:
3268  
3269 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3270
3271         decl.cs (CurrentTypeParameters): Fixed to be public.
3272
3273 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3274
3275         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
3276
3277 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3278
3279         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
3280
3281 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
3282
3283         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
3284
3285 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3286
3287         Add friend assembly access support.
3288         * typemanager.cs: assembly_internals_vis_attrs
3289         cache for friend assembly access. 
3290         (TypeManager.IsFriendAssembly): New method for
3291         checking friend assembly access.
3292         (TypeManager.Error_FriendAccessNameNotMatching): New
3293         helper method.
3294         (TypeManager.CompareKeyTokens): Likewise.
3295         (TypeManager.Filter): Handle friend accessible
3296         members.
3297
3298         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
3299         friend accessible types.
3300
3301         * ecore.cs (Expression.IsAccessorAccessible): Handle
3302         friend accessible properties.
3303
3304         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
3305         accessible types.
3306         
3307 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
3308
3309         Fix #76568.
3310         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3311         folding.
3312         
3313         * convert (Convert.ImplicitReferenceConversion): NullCast holds
3314         contants only.
3315         
3316         * ecore.cs (NullCast): Child is contant only.
3317         
3318         * literal.cs (NullLiteral.Reduce): null can be converted to any
3319         reference type.
3320
3321 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
3322
3323         * driver.cs: Use Encoding.Default as default code page instead
3324           of ISO-28591.
3325
3326 2005-10-27  Raja R Harinath  <rharinath@novell.com>
3327
3328         Fix #76085.
3329         * expression.cs (Invocation.Error_InvalidArguments): Handle
3330         __arglist parameters.
3331         (Invocation.VerifyArgumentsCompat): Likewise.
3332         * support.cs (ReflectionParameters.GetSignatureForError): Print
3333         __arglist parameters.
3334         (InternalParamters.GetSignatureForError): Likewise.
3335         * parameter.cs (Parameters.GetSignatureForError): Likewise.
3336
3337 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
3338
3339         * attribute.cs (GetPropertyValue): Made public.
3340
3341         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3342         Resolve.
3343         Add new property WrapNonExceptionThrows to handle 2.0 assembly
3344         attribute.
3345         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3346         is not defined.
3347         
3348         * driver.cs: Reflect method name change.
3349         
3350         * statement.cs (Try.Resolve): Warn when try has both general
3351         exception handlers.
3352         
3353         * typemanager.cs: runtime_compatibility_attr_type new predefined
3354         type.
3355
3356 2005-10-26  Raja R Harinath  <harinath@gmail.com>
3357
3358         Fix #76419.
3359         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3360         treat it as an empty parameter list.
3361
3362 2005-10-26  Raja R Harinath  <rharinath@novell.com>
3363
3364         Fix #76271.     
3365         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
3366         ResolveAsTypeStep silent.
3367         * statement.cs (Block.AddConstant): Mark block as used.
3368         (Block.ResolveMeta): Avoid piling on error messages
3369         if a constant initializer resolution fails.
3370
3371 2005-10-25  Raja R Harinath  <rharinath@novell.com>
3372
3373         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3374         Remove.
3375         (NamespaceEntry.VerifyAllUsing): New.
3376         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
3377         behaviour.  Delegates actual resolution of alias to ...
3378         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
3379         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3380         Update.
3381         * driver.cs (Driver.MainDriver): Update.
3382         
3383         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3384         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3385         property.
3386         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3387         Remove.
3388         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3389         RootNamespace.DefineNamespacesForAll.
3390
3391 2005-10-24  Raja R Harinath  <harinath@gmail.com>
3392
3393         * typemanager.cs (assemblies, external_aliases, modules)
3394         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3395         (ComputeNamespaces, GetRootNamespace): Remove extra staging
3396         overhead.  Move resposibility ...
3397         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
3398         * driver.cs, attribute.cs, codegen.cs: Update to changes.
3399
3400 2005-10-23  Raja R Harinath  <harinath@gmail.com>
3401
3402         * namespace.cs (RootNamespace.all_namespaces): Renamed from
3403         cached_namespaces.  Improve usage.
3404         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3405         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3406         Move from GlobalRootNamespace and simplify.
3407         (RootNamespace.Global): Make instance variable.
3408         (RootNamespace.RootNamespace): Add "alias name" parameter.
3409         (GlobalRootNamespace): Simplify drastically.
3410         (Namespace.Lookup): Don't use GetNamespace.
3411         * typemanager.cs (GetRootNamespace): Rename from
3412         ComputeNamespaceForAlias.
3413         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3414
3415 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3416
3417         * anonymous.cs (AnonymousContainer): Don't crash when container
3418         doesn't exist.
3419
3420 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3421
3422         * expression.cs (Binary.DoResolve): Warn when comparing same
3423         values.
3424
3425 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3426
3427         Fix #76486.
3428         * expression.cs (Binary.DoResolve): It looks like there are no
3429         convetsion rules in enum context.
3430
3431 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3432
3433         Add support for extern alias qualifiers.
3434         * typemanager.cs: Move some LookupTypeReflection code
3435         to namespace.cs, to have cleaner code. Added some methods
3436         to help us keep track of the extern aliased references.
3437         * driver.cs: Add suport for extern alias assemblies on command
3438         line and check for their warnings/errors. Also keep track of the
3439         extern aliased assemblies.
3440         * namespace.cs: Move the global functionality of Namespace
3441         to GlobalRootNamespace/RootNamespace. Now the global namespace
3442         is GlobalRootNamespace.Globa. Also the code moved from 
3443         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
3444         Finally added LocalAliasEntry (AliasEntry before) and
3445         ExternAliasEntry, to handle alias statements.
3446         * cs-parser.jay: Add support in the grammar for extern alias
3447         statement.
3448         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
3449         Update callings to Namespace (now in GlobalRootNamespace).
3450
3451 2005-10-25  Martin Baulig  <martin@ximian.com>
3452
3453         * convert.cs (ImplicitTypeParameterConversion): Make base
3454         interfaces actually work; fixes #76557.
3455
3456 2005-10-25  Martin Baulig  <martin@ximian.com>
3457
3458         * generic.cs
3459         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
3460         all the type parameters; fixes #76551.
3461
3462 2005-10-25  Martin Baulig  <martin@ximian.com>
3463
3464         Fix #76472.
3465
3466         * generic.cs
3467         (GenericMethod.ctor): Added `Expression return_type' and
3468         `Parameters parameters' arguments.
3469         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
3470         parameter and return types to check their constraints if they're
3471         generic types.
3472
3473         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
3474         boolean field.
3475
3476         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3477         constraints of a generic type if `ec.ResolvingGenericMethod'.
3478
3479         * class.cs (MethodCore.DoDefineParameters): Set
3480         `ec.ResolvingGenericMethod' if we're a generic method.
3481         (MemberBase.MemberType): Likewise.
3482
3483 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3484
3485         * typemanager.cs (TypeManager): Added 
3486         TypeManager.internals_visible_attr_type to cache
3487         S.R.CompilerServices.InternalsVisibleToAttribute.
3488
3489         * codegen.cs (AssemblyClass): Added checks for 
3490         InternalsVisibleToAttribute in new method 
3491         CheckInternalsVisibleAttribute () and also cache the
3492         AssemblyName in AssemblyClass.Name.
3493         
3494 2005-10-24  Martin Baulig  <martin@ximian.com>
3495
3496         * typemanager.cs
3497         (TypeManager.ExpandInterfaces): Added overloaded version which
3498         just takes a `Type[]' array.
3499
3500         * generic.cs
3501         (Constraints.Resolve): Don't expand the interfaces here; ie. we
3502         just use the interfaces which were explicitly specified and not
3503         the interfaces they inherit.  Fixes #76482.
3504         (TypeParameter.FindMembers): Expand the interfaces here.
3505
3506 2005-10-21  Martin Baulig  <martin@ximian.com>
3507
3508         * generic.cs
3509         (Constraints.Resolve): Also resolve the actual types here.
3510         (Constraints.ResolveTypes): Just check the constraints here.
3511         Fixes #76363; see gtest-218.cs.
3512
3513 2005-10-21  Martin Baulig  <martin@ximian.com>
3514
3515         * convert.cs
3516         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
3517         instead of a `BoxedCast'; fixes gtest-217.cs.
3518
3519 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
3520
3521         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
3522           1) "new()" is specified as generic parameter constraint and 2) the
3523           type is TypeBuilder and 3) the type is abstract even if it has a
3524           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
3525
3526 2005-10-20  Martin Baulig  <martin@ximian.com>
3527
3528         * generic.cs
3529         (GenericConstraints.TypeParameter): New public property.
3530         (TypeParameter.ctor): Also take a `DeclSpace' argument.
3531         (TypeParameter.DeclSpace): New public property.
3532         (TypeParameter.DefineType): Inflate the constraints if our
3533         `DeclSpace' is an `Iterator'.   
3534
3535 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
3536
3537         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
3538           GenericMethod argument to compare methods' generic type arguments.
3539           Fixed bug #76382.
3540
3541 2005-10-19  Martin Baulig  <martin@ximian.com>
3542
3543         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
3544         not ResolveType() when resolving the base type, so we're not
3545         checking the constraints here.
3546         (TypeContainer.ResolveType): Call ResolveType() on our base_type
3547         if we have any.
3548
3549 2005-10-19  Martin Baulig  <martin@ximian.com>
3550
3551         * generic.cs (ConstructedType.CheckConstraints): Committing
3552         untested fix for #76441.
3553
3554 2005-10-18  Raja R Harinath  <rharinath@novell.com>
3555
3556         Fix #76371.
3557         * class.cs (TypeContainer.DefineType): Move updating of
3558         topological sort earlier in the code.
3559         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3560
3561 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
3562
3563         Fix #76273.
3564         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3565         
3566         * constant.cs (Constant.TryReduce): Moved from Cast class.
3567         (Reduce): Made little bit more OO and fixed missing conversions.
3568         
3569         * ecore.cs (Reduce): Implemented.
3570         (Binary.EnumLiftUp): New method to upgrade values to enum values.
3571         
3572         * literal.cs (Reduce): Implemented.
3573         
3574         * class.cs: Reverted Miguel's wrong commit.
3575
3576 2005-10-14  Miguel de Icaza  <miguel@novell.com>
3577
3578         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3579
3580 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
3581
3582         * cs-parser.jay, expression.cs : CS0214 was missing error location
3583           for constants. Fixed bug #76404.
3584
3585 2005-10-10  Raja R Harinath  <rharinath@novell.com>
3586
3587         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3588         InstanceExpression.
3589         (PropertyExpr.EmitCall): Likewise.
3590         * expression.cs (Invocation.EmitArguments): Handle case where
3591         arguments == null.
3592         (Invocation.EmitCall): Avoid allocating temporary variable if
3593         there are no arguments.
3594
3595 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
3596
3597         Fix #76370.
3598         * convert.cs (ExplicitConversionCore): Fixed object->enum
3599         conversion.
3600
3601 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3602
3603         Fix #76323.
3604         * convert.cs (ImplicitConversionStandard): Move conversion of
3605         void* to arbitrary pointer types ...
3606         (ExplicitConversionStandard): .. here.
3607         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3608         error to always print typenames.
3609
3610 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3611
3612         * convert.cs (GetConversionOperator): Rename from
3613         GetConversionOperators.  Move operator selection code from ...
3614         (UserDefinedConversion): ... here.
3615
3616 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
3617
3618         * convert.cs (ExplicitConversionCore): Removed duplicate enum
3619         conversion.
3620
3621 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
3622
3623         * assign.cs (Assign.DoResolve): Error method changed.
3624
3625         * cfold.cs (DoConstantNumericPromotions): Error method changed.
3626         
3627         * const.cs (ResolveValue): Reset in_transit immediately.
3628         
3629         * constant.cs: Error method changed.
3630         
3631         * convert.cs: Removed useless location parameter.
3632         (ExplicitNumericConversion): Don't do double enum check.
3633         (ExplicitConversionCore): Renamed from ExplicitConversion.
3634         (ExplicitUnsafe): Extracted from ExplicitConversion.
3635         (ExplicitConversion): Uses for error reporting.
3636         
3637         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3638         error messages.
3639         (ResolveBoolean): Uses common error method.
3640         (CastToDecimal): Get rid of ec.
3641         (CastFromDecimal): Optimized.
3642         (ConvCast): Get rid of ec.
3643         
3644         * enum.cs (ResolveValue): Reset in_transit immediately.
3645         (Emit): Return after first error.
3646         
3647         * expression.cs: Convert changes.
3648         
3649         * literal.cs: Error method changed.
3650         
3651         * statement.cs: Error method changed.
3652
3653 2005-10-06  Raja R Harinath  <rharinath@novell.com>
3654
3655         Fix gtest-131.cs and gtest-211.cs.
3656         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
3657         Only emit code for a label if it is used.  Unreachable code can
3658         violate ECMA evaluation stack invariants.
3659
3660 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3661
3662         * anonymous.cs: Implemented ExprClassName.
3663         
3664         * assign.cs (Assign.DoResolve): Don't chrash when type is not
3665         delegate.
3666         
3667         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3668         check.
3669         
3670         * class.cs (StaticClass.DefineContainerMembers): Report protected
3671         members as error.
3672         
3673         * codegen.cs: if(ed) PRODUCTION.
3674         
3675         * convert.cs (Error_CannotImplicitConversion): Better error
3676         distinction.
3677         
3678         * cs-parser.jay: More error checks.
3679         
3680         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3681         
3682         * driver.cs (CSCParseOption): Enabled wrong option check.
3683         
3684         * ecore.cs (Expression.ExprClassName): Turned to property.
3685         (MemberExpr.CheckIntermediateModification): For checking boxed
3686         value types     modification.
3687         
3688         * statement.cs (Fixed.Resolve): Expression type must be
3689         convertible to fixed type.
3690         (CollectionForeach.GetEnumeratorFilter,TryType):
3691         Small refactoring for easier error checking.
3692
3693 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
3694
3695         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3696         attributes.
3697         
3698         * class.cs (GeneratedBaseInitializer): New class for customization
3699         compiler generated initializers.
3700         (MemberBase.DoDefine): Check Obsolete attribute here.
3701         (FieldMember.DoDefine): Ditto.
3702         
3703         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3704         constants.
3705         
3706         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3707         (MemberCore.GetObsoleteAttribute): Removed argument.
3708         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3709         (MemberCore.CheckObsoleteType): New helper.
3710         
3711         * delegate.cs,
3712         * enum.cs,
3713         * statement.cs: Updates after MemberCore changes.
3714         
3715         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3716         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3717         
3718         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3719         obsolete attribute for compiler construct.
3720         (As.DoResolve): Cache result.
3721         
3722         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3723
3724 2005-10-01  Miguel de Icaza  <miguel@novell.com>
3725
3726         * expression.cs (Probe): instead of having a "Type probe_type"
3727         keep the extra information as a TypeExpr probe_type_expr since the
3728         "As" operator needs to perform some type checks.
3729
3730         * (As.DoResolve): If the type is a type parameter, ensure that it
3731         is constrained by a class.
3732
3733 2005-09-22  Miguel de Icaza  <miguel@novell.com>
3734
3735         * statement.cs (Lock): Use the TemporaryVariable class instead of
3736         manually using local variables as those do not work when variables
3737         are captured.
3738
3739         * ecore.cs: Moved the TemporaryVariable class from being a nested
3740         class inside Foreach to be a public class that can be employed in
3741         other places. 
3742
3743 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
3744
3745         * cs-parser.jay: interface_accessors replaced by
3746         accessor_declarations.
3747
3748         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3749         location.
3750         
3751         * statement.cs (GotoCase.Resolve): Convert null constant to
3752         null case.
3753         (SwitchLabel.ResolveAndReduce): Ditto.
3754         (SwitchLabel.NullStringCase): Custom null stamp.
3755         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3756         
3757         typemanager.cs (CSharpSignature): Don't skip first argument
3758         for full names.
3759
3760 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
3761
3762         * cfold.cs, constant.cs, convert.cs, ecore.cs,
3763         expression.cs, iterators.cs, literal.cs: Store constants and
3764         literals location.
3765         
3766         * class.cs (MemberBase.ShortName): Pass location.
3767         
3768         * cs-parser.jay: Some location fixes.
3769         
3770         * ecore.cs (Expression.Location): Made virtual.
3771
3772 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3773
3774         Fix #72930.
3775         * const.cs (Const.ResolveValue): Check for assigning non-null
3776         value to reference type.
3777
3778 2005-09-26  Raja R Harinath  <rharinath@novell.com>
3779
3780         Fix #76133.
3781         * expression.cs (This.VerifyFixed): In a value type T, the type of
3782         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
3783         value type R, 'this' is treated as a value parameter.
3784
3785 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3786
3787         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3788         if the underlying types are the same, otherwise we need to produce
3789         code that will do the proper cast.
3790
3791         This was exposed by Marek's constant rewrite which produced
3792         invalid code for the call site:
3793
3794         enum X : long { a }
3795         void Method (X v) {}
3796
3797         Method ((X) 5)
3798
3799         This fixes test-49.cs
3800
3801 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3802
3803         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3804           Type/Object should be allowed as well. Fixed bug #75968.
3805
3806 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3807
3808         * expression.cs : (Binary.DoResolve): when one is enum constant and
3809           another is constant 0, then return enum one *as enum type*.
3810           Fixed bug 74846.
3811
3812 2005-10-04  Martin Baulig  <martin@ximian.com>
3813
3814         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
3815         `SetMemberIsUsed()' work for generics, too.
3816
3817 2005-10-04  Martin Baulig  <martin@ximian.com>
3818
3819         * expression.cs (DelegateInvocation.EmitStatement): Make this work
3820         for corlib.  Fixes #75691.
3821
3822 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
3823
3824         Fix #76255.
3825         * driver.cs: Fix compilation files with full root path.
3826
3827 2005-09-25  Miguel de Icaza  <miguel@novell.com>
3828
3829         * report.cs (SymbolRelatedToPreviousError): Format the output so
3830         it does not use an open parenthesis that is never closed. 
3831
3832         * driver.cs: Follow coding guidelines
3833
3834 2005-09-18  Miguel de Icaza  <miguel@novell.com>
3835
3836         * driver.cs: Set InEmacs based on the environment variable EMACS. 
3837
3838         * location.cs (InEmacs): in this mode, do not report column
3839         location as it confuses Emacs.
3840
3841 2005-10-03  Raja R Harinath  <rharinath@novell.com>
3842
3843         * support.cs (SeekableStreamReader.Position): Don't error out when
3844         the requested position is just beyond the end of the current
3845         buffered data.
3846
3847 2005-09-28  Raja R Harinath  <rharinath@novell.com>
3848
3849         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
3850         try to keep in sync with the byte count of the underlying Stream.
3851         However, this limits us to a window size of 2048 characters: i.e.,
3852         the maximum lookahead of our lexer/parser can be 2048 characters.
3853
3854 2005-09-22  Martin Baulig  <martin@ximian.com>
3855
3856         * driver.cs: Removed a debugging FIXME.
3857
3858 2005-09-21  Raja R Harinath  <rharinath@novell.com>
3859
3860         * cs-parser.jay (type_arguments): Add CS1644 check.
3861         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
3862
3863 2005-09-15  Raja R Harinath  <rharinath@novell.com>
3864
3865         * Makefile (PROGRAM): Make profile specific.
3866         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
3867         the current directory.
3868
3869         Fix test-455.cs.
3870         * expression.cs (Invocation.EmitCall): Remove optimization on
3871         this_call since it doesn't handle 'this' being a value type.
3872
3873 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
3874
3875         * driver.cs: Ensure file handles are closed after parsing
3876
3877 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3878
3879         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3880         if the underlying types are the same, otherwise we need to produce
3881         code that will do the proper cast.
3882
3883         This was exposed by Marek's constant rewrite which produced
3884         invalid code for the call site:
3885
3886         enum X : long { a }
3887         void Method (X v) {}
3888
3889         Method ((X) 5)
3890
3891         This fixes test-49.cs
3892
3893 2005-09-05  Martin Baulig  <martin@ximian.com>
3894
3895         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
3896         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
3897
3898         * cs-parser.jay (delegate_declaration): Small fix for #75852.
3899
3900 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3901
3902         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
3903           to be a pointer type due to the spec 25.2, so check if declaring
3904           type is generic type definition. Fixed bug #75772.
3905
3906 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3907
3908         Fixed bug #75957.
3909         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
3910           both types are not defined by methods.
3911         * expression.cs : (Invocation.IsApplicable): it should work when
3912           the argument type is equal to the parameter type, not only when
3913           ImplicitConversionExists() returns true.
3914
3915 2005-09-02  Raja R Harinath  <rharinath@novell.com>
3916
3917         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3918         internal.
3919
3920         Fix #75941.
3921         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3922         flow-branching for LocalVariableReferences in case we were invoked
3923         from a MemberAccess.
3924         * expression.cs (LocalVariableReference.VerifyAssigned): New.
3925         Carved out of ...
3926         (LocalVariableReference.DoResolveBase): ... this.
3927         (MemberAccess.Resolve): Do the check that was disabled during
3928         SimpleNameResolve.
3929
3930 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3931
3932         * class.cs :
3933           (PartialContainer.Create): check abstract/sealed/static strictly
3934           but abstract/sealed can exist only at one side. Fixed bug #75883.
3935
3936 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
3937
3938         Fix #75945.
3939         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3940         specified, don't default to UnmanagedType.I4.
3941
3942 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3943
3944         * expression.cs : conditional operator should check possibly
3945           incorrect assign expression. Fixed bug #75946.
3946
3947 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3948
3949         Fix #75934.
3950         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3951         (ScopeInfo.EmitScopeType): Use it to construct field names from
3952         names of captured locals.
3953
3954         Fix #75929.
3955         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3956         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3957         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
3958         (ExplicitConversion): Remove enum cases already handled by
3959         implicit conversion.  Move implicit conversion check to the beginning.
3960         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3961         * expression.cs (ArrayCreation.EmitDynamicInitializers):
3962         Don't treat System.Enum as a struct.
3963
3964 2005-08-30  Jb Evain  <jbevain@gmail.com>
3965
3966         * attribute.cs: handles as expression in parameters.
3967
3968 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3969
3970         Fix #75802.
3971         * class.cs (TypeContainer.VerifyClsName): Don't use a
3972         PartialContainer when verifying CLS compliance.
3973         (AbstractPropertyEventMethod): Set Parent here, ...
3974         (PropertyMethod): ... not here.
3975
3976 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
3977
3978         * attribute.cs : escaped attribute name should not be allowed to be
3979           resolved (e.g. @class as classAttribute). Fixed bug #75930.
3980
3981 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3982
3983         Fix #75927.
3984         * convert.cs (ImplicitStandardConversionExists): Allow zero also
3985         when converting a long constant to unsigned long.
3986         * expression.cs (Invocation.OverloadResolve): Add sanity check to
3987         detect where IsApplicable and VerifyArgumentsCompat disagree.
3988
3989 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3990         and Carlos Alberto Cortez  <carlos@unixmexico.org>
3991
3992         Fix #75848.
3993         * class.cs (TypeContainer.CanElideInitializer): New helper.
3994         (TypeContainer.EmitFieldInitializers): Use it to determine if we
3995         can safely emitting the initializer of a field.
3996
3997 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3998
3999         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
4000           allowed inside a switch (without loop). Fixed bug #75433.
4001
4002 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
4003
4004         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4005         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4006
4007 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4008
4009         * driver.cs : kinda reverting the default encoding changes (not exact 
4010           revert since I noticed that "codepage:reset" might not work fine).
4011
4012 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4013
4014         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
4015           Location. Now getter and setter store location correctly.
4016           (errors/cs0111-12.cs now reports the expected location.)
4017
4018 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4019
4020         * driver.cs : Use default encoding on the environment.
4021           Removed (now that) extra parameter for SeekableStreamReader.
4022         * support.cs : (SeekableStreamReader) third .ctor() argument for
4023           StreamReader is not required (always true). preamble size could
4024           be acquired in simpler and safe way.
4025
4026 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
4027
4028         * cs-parser.jay: report CS0642 at warning level 3
4029           and report CS0642 for an if else statement also
4030           fixes bug #74745. Patch by John Luke (and a bit
4031           modified by me).
4032           Removed extra CS0642 warning check for "while",
4033           "for" and "fixed".
4034         * statement.cs: In Block.Resolve(), CS0642 check
4035           is reimplemented to check a sequence of an empty
4036           statement and a block.
4037
4038           Both fix bug #66777.
4039
4040 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
4041
4042         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
4043         detection until I fix it.
4044         
4045         * cs-tokenizer.cs: Changed error message.
4046         
4047         * cs-parser.jay: Fixed 2 error locations.
4048         
4049         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
4050         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
4051         properties.
4052         
4053         * enum.cs (GetSignatureForError): Fixed.
4054         
4055         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
4056         method detection.
4057         
4058         * class.cs,
4059         * typemanager.cs (RegisterProperty): Removed.
4060         
4061         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
4062
4063 2005-08-24  Raja R Harinath  <rharinath@novell.com>
4064
4065         Fix #75874.
4066         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
4067         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
4068
4069 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4070
4071         * expression.cs : tiny fix is required for not warning positive ulong.
4072           See test-441.cs.
4073
4074 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4075
4076         * expression.cs : add CS0652 check for constant and integral
4077           expression. Fixed bug #53974.
4078
4079 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4080
4081         * expression.cs : in DoNumericPromotions(), check if there is implicit
4082           conversion overload for string (to check CS0034). Fixed bug #52492.
4083
4084 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4085
4086         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
4087
4088 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4089
4090         * ecore.cs : report location when it is *not* Null.
4091
4092 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4093
4094         * codegen.cs,
4095           ecore.cs,
4096           flowanalysis.cs,
4097           expression.cs:
4098           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
4099           correctly. Fixed bug #75721.
4100
4101 2005-08-23  Raja R Harinath  <rharinath@novell.com>
4102
4103         * support.cs (SeekableStreamReader.Position): Avoid an expensive
4104         loop that performs 'min (pos, char_count)'.
4105
4106         Fix #75862.
4107         * expression.cs (Unary.ResolveOperator): Don't discard implicit
4108         converted value in Operator.OnesComplement.
4109
4110 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
4111
4112         * anonymous.cs: If the anon method is pulled into a helper class,
4113         it needs to be `internal' not `private'. Fixes runtime behavior on
4114         msft. bug #75704
4115
4116 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
4117
4118         Fix #75803
4119         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
4120         is a partial class.
4121
4122 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
4123
4124         The big constants rewrite
4125         Fix #75746, #75685 and more
4126         As a side effect saved 1MB for MWF ;-)
4127         
4128         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
4129         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
4130         enum based for corlib compilation.
4131         
4132         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
4133         subtractions.
4134         
4135         * class.cs (FixedField.Define): Use ResolveAsConstant.
4136         
4137         * const.cs (IConstant): Interface constants and enums.
4138         (Const.ResolveValue): New method for constant resolvning.
4139         (ExternalConstant): Constants from imported assemblies.
4140         
4141         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
4142         conversion; like enums.
4143         (Constant.ToType): Converts this constant to different type.
4144         (Constant.Increment): Adds 1.
4145         
4146         * convert.cs (ImplicitConversionRequired): Simplified.
4147         
4148         * cs-parser.jay: Create EnumMember directly.
4149         
4150         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
4151         
4152         * doc.cs (GenerateEnumDocComment): Removed.
4153         
4154         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
4155         (ConvertIntLiteral): Removed.
4156         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4157         
4158         * enum.cs (EnumMember): Implement IConstant.
4159         (Enum.IsValidEnumConstant): Removed.
4160         (Enum.GetNextDefaultValue): Removed.
4161         (Enum.FindMembers): Updated.
4162         (Enum.GenerateDocComment): Iterate enum members.
4163         
4164         * expression.cs (Cast.TryReduce): Handle enums correctly.
4165         (New.Constantify): Made public.
4166         (MemberAccess.DoResolve): Removed contant specific if(s).
4167         
4168         * literal.cs (NullLiteral): Implement new abstract methods.
4169         
4170         * statement.cs (GotoCase.Resolve): Use new constant methods.
4171         (SwitchLabel.ResolveAndReduce): Use new constant methods.
4172         
4173         * typemanager.cs (LookupEnum): Removed.
4174         (IsEnumType): Fixed to work with corlib.
4175         (RegisterConstant): Removed.
4176         (LookupConstant): Removed.
4177         (GetConstant): Changed to work with IConstant.
4178
4179 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
4180
4181         * location.cs : Fixed overflown (>255) column number.
4182
4183 2005-08-03  Raja R Harinath  <rharinath@novell.com>
4184
4185         First cut of the qualified-alias-member feature.
4186         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4187         token.
4188         * cs-parser.jay (DOUBLE_COLON): New token.
4189         (namespace_or_type_name): Add rule for recognizing
4190         qualified-alias-members.
4191         (primary_expression): Likewise.
4192         (element_access): Allow QualifiedAliasMember as a possible
4193         type-bearing expression.
4194         (local_variable_type, local_variable_pointer_type): Likewise.
4195         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
4196         aliases in the current and enclosing namespace declarations.
4197         (NamespaceEntry.UsingAlias): Add CS0440 warning.
4198         * decl.cs (MemberName.is_double_colon): New.
4199         (MemberName.MemberName): Add new constructor for alias-member.
4200         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4201         * expression.cs (QualifiedAliasMember): New expression type.
4202
4203 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4204
4205         * location.cs : it borked when no argument was specified.
4206
4207 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4208
4209         * location.cs : tiny ToString() format fix.
4210
4211 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4212
4213         * statement.cs : oops, it was missing.
4214
4215 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4216
4217         A set of fixes for precise line/column location.
4218
4219         * location.cs :
4220           "token" field now holds a file/line "delta", a line number offset 
4221           from the segment, and a column number. See also:
4222           http://lists.ximian.com/pipermail/mono-devel-list/2004-
4223           December/009508.html
4224           Removed static IsNull. Use instance IsNull property instead.
4225         * cs-tokenizer.cs :
4226           For some tokens it stores Location. For Identifier it stores
4227           LocatedToken which is a pair of string name and location.
4228           Column numbers are adjusted only at getChar().
4229         * report.cs :
4230           Use Location.ToString() for reporting (it now contains column).
4231         * cs-parser.jay :
4232           Largely modified to use LocatedToken instead of
4233           string (IDENTIFIER), and to acquire Location from some tokens.
4234         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4235           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4236           codegen.cs :
4237           Now MemberName holds Location. DeclSpace.ctor() receives Location
4238           as a parameter. Removed extra parameters to all derived classes.
4239           Replaced Location.IsNull() with instance property.
4240         * assign.cs, expression.cs :
4241           Added .ctor() overload that omits Location.
4242         * attribute.cs :
4243           Added "nameEscaped" flag that indicates the identifier was escaped
4244           in the source file. This fixes bug #57047.
4245
4246 2005-09-02  Martin Baulig  <martin@ximian.com>
4247
4248         * class.cs: Make CS3005 a warning, not an error.
4249
4250 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
4251
4252         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4253         New method, looking for lo-case imported cls type.
4254
4255         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4256         here.
4257
4258         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4259
4260         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4261
4262         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4263         all_imported_types.
4264         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4265
4266         Optimized to save 3.5 MB for SWF compilation.
4267
4268 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4269
4270         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4271         (PartialContainer.Create): Moved logic AddToContainer.
4272         (PartialContainer.MarkForDuplicationCheck): Shares name.
4273         
4274         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4275         place.
4276         
4277         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4278         initialization.
4279         (Namespace.GetSignatureForError): New method.
4280         
4281         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4282         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4283
4284 2005-08-01  Raja R Harinath  <rharinath@novell.com>
4285
4286         Fix #75669.
4287         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4288         member lookup rather than qualifier_type, since qualifier_type can
4289         be null.
4290
4291 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4292
4293         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4294         enum member.
4295
4296 2005-07-31  Miguel de Icaza  <miguel@novell.com>
4297
4298         * statement.cs: Copy the local exception into the exception
4299         captured local.  Fixes 75674
4300
4301 2005-07-31  Raja R Harinath  <harinath@gmail.com>
4302
4303         Fix #75658.
4304         * expression.cs (Invocation.OverloadResolve): Don't report error
4305         CS1501 if error CS1502 has been reported.
4306         (New.DoResolve): Delegate CS1501 reporting to
4307         Invocation.OverloadResolve.
4308
4309         Fix #75656.
4310         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4311         invariant-meaning-in-block property in an enclosing block if
4312         necessary.
4313
4314 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
4315
4316         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4317         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4318         (Switch.CheckSwitch): Just save 50kb for SWF.
4319
4320 2005-07-27  Martin Baulig  <martin@ximian.com>
4321
4322         * anonymous.cs (CaptureContext.AddField): Added
4323         `AnonymousContainer am' argument; compute its toplevel scope if
4324         it's not already computed.  Fixes #75649.
4325
4326 2005-07-26  Raja R Harinath  <rharinath@novell.com>
4327
4328         Fix #75628.
4329         * class.cs (Constructor.Emit): Reset block to null if the block
4330         resolve fails.
4331
4332 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4333
4334         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4335
4336 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4337
4338         * class.cs (MethodData.Define): Check whether accessor implementing
4339         interface is public.
4340
4341         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4342
4343 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
4344
4345         Fix #57245
4346         * namespace.cs (LookupType): Moved same type check to...
4347         
4348         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4349         with the same name.
4350
4351 2005-07-21  Raja R Harinath  <rharinath@novell.com>
4352
4353         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4354         already found a typebuilder.
4355         * class.cs (MethodCore.IsDuplicateImplementation): Compare
4356         MemberNames, not strings.
4357
4358         * const.cs (Error_ExpressionMustBeConst): 
4359         Rename from Error_EpressionMustBeConst.
4360         * const.cs, class.cs, statement.cd: Update.
4361
4362 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
4363
4364         Fix #65573
4365
4366         * const.cs (Const.LookupConstantValue): Report missing contant expression
4367         everytime.
4368         (Error_EpressionMustBeConstant): Only one error method.
4369
4370         * class.cs, statement.c: Updated.
4371
4372 2005-07-20  Raja R Harinath  <rharinath@novell.com>
4373
4374         * statement.cs (Block.Flags): Add back HasVarargs.
4375         (Block.flags): Make protected.
4376         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4377
4378         * typemanager.cs (types, typecontainers, user_types): Remove.
4379         (UserTypes, TypeContainers): Likewise.
4380         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4381         (CleanUp, Reset): Update.
4382         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
4383         (GetNestedType): Use Type.GetNestedType.
4384         (CoreLookupType): Take two arguments, the namespace and the
4385         basename of the type.  Update to use the Namespace.Lookup
4386         mechanism.
4387         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4388         (RealMemberLookup): Use IsNestedChildOf instead of playing with
4389         string concatenation and substring matches.
4390         * class.cs, enum.cs, delegate.cs: Update to changes.
4391
4392 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
4393
4394         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4395         Expression and made virtual.
4396
4397         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4398         (ImplicitStandardConversionExists): Fixed `byte' typo ?
4399
4400         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4401
4402         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4403         error message.
4404
4405         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4406         change.
4407
4408 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
4409
4410         Fix #57707
4411         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4412         AssemblyCultureAttribute is not used on executable.
4413
4414         * rootcontext.cs,
4415         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4416
4417 2005-07-16  Raja R Harinath  <rharinath@novell.com>
4418
4419         Fix #60638.
4420         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4421         New.  Reports CS0252/CS0253.
4422         Mostly taken from preliminary patch by Duncak Mak.
4423         (Binary.DoResolveOperator): Store results of operator lookup.
4424         Use them to detect if we need to warn about unintended reference
4425         comparisons.
4426
4427 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4428
4429         Fix #72969.
4430         * namespace.cs (Namespace.Lookup): Add back location parameter.
4431         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
4432         * delegate.cs, ecore.cs, expression.cs: Update to changes.
4433
4434         * codegen.cs (EmitContext.DeclSpace): Make readonly.
4435         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4436         (Namespace.LookupType): ... this.
4437         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4438         of namespaces.
4439         * typemanager.cs (LookupTypeReflection): Remove buggy code that
4440         purported to handle pointers.
4441         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4442         CoreLookupType.
4443
4444 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
4445
4446         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4447         type as namespace.
4448
4449 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4450
4451         * namespace.cs (Namespace.Lookup): Drop location parameter.
4452         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
4453         (NamespaceEntry.Lookup): ... this.
4454         (NamespaceEntry.Error_AmbiguousTypeReference):
4455         Move here from DeclSpace.
4456         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4457         names ...
4458         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4459         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4460         Move to NamespaceEntry.
4461         * delegate.cs, expression.cs: Update to changes.
4462
4463 2005-08-31  Martin Baulig  <martin@ximian.com>
4464
4465         Committing a patch from Atsushi Enomoto for #75850.
4466
4467         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
4468         Prefer a generic enumerator over a non-generic one.
4469
4470 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
4471
4472         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4473         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4474
4475 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4476
4477         * driver.cs : reverting default encoding change as well as mcs.
4478
4479 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4480
4481         * driver.cs, support.cs : merged r48826.
4482           Marek Safer wrote:
4483           > could you integrate your mcs changes to gmcs otherwise
4484           > gmcs cannot compile some files.
4485
4486 2005-08-20  Martin Baulig  <martin@ximian.com>
4487
4488         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4489         scope if we don't already have it.
4490
4491         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4492         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4493         fixes #75867.
4494
4495 2005-07-31  Miguel de Icaza  <miguel@novell.com>
4496
4497         * statement.cs: Copy the local exception into the exception
4498         captured local.  Fixes 75674
4499
4500 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
4501
4502         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4503         type as namespace.
4504
4505 2005-08-12  Martin Baulig  <martin@ximian.com>
4506
4507         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
4508         for nested types here to avoid hitting the cache too early.
4509
4510 2005-08-09  Miguel de Icaza  <miguel@novell.com>
4511
4512         * enum.cs: On the new compiler CLS error 3005 is now a warning not
4513         an error. 
4514
4515 2005-08-03  Martin Baulig  <martin@ximian.com>
4516
4517         Make iterators in generic methods work; see gtest-191.cs.
4518
4519         * generic.cs
4520         (Constraints.Resolve): Protect against being called twice.
4521
4522         * class.cs
4523         (TypeContainer.GetClassBases): Make this `protected virtual'.
4524
4525         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
4526         (Iterator.GetClassBases): Override this and compute the base
4527         classes here.
4528         (Iterator.DefineNestedTypes): If we're a generic method, all our
4529         method type parameters become class type parameters on the proxy
4530         class.
4531
4532         * statement.cs
4533         (ToplevelBlock.Parameters): Make this a property, not a field.
4534         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
4535
4536 2005-08-03  Martin Baulig  <martin@ximian.com>
4537
4538         * typemanager.cs (TypeManager.IsSubclassOf): Use
4539         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
4540         (TypeManager.GetFullName_recursed): Improved.
4541
4542 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4543
4544         Fix #75417
4545         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
4546         Private accessor case, using TypeManager.IsPrivateAccessible instead of
4547         invocation_type == mi.DeclaringType, since the first one also checks
4548         other condition used by generic instances.
4549         
4550 2005-07-27  Martin Baulig  <martin@ximian.com>
4551
4552         * anonymous.cs (CaptureContext.AddField): Added
4553         `AnonymousContainer am' argument; compute its toplevel scope if
4554         it's not already computed.  Fixes #75649.
4555
4556 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
4557
4558         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4559         CheckAttributeType and refactored.
4560         (Attribute.ResolvePossibleAttributeType): Changed to reuse
4561         ResolveAsTypeTerminal error handling.
4562         (ResolveAsTypeTerminal): Introduced because of global attributes extra
4563         handling.
4564         (GetSignatureForError): Print errors in same way.
4565
4566         * class.cs,
4567         * codegen.cs: Reflect attribute GetSignatureForError change.
4568
4569         * ecore.cs,
4570         * expression.cs: Add silent parameter to ResolveAsTypeStep.
4571
4572         * namespace.cs (UsingEntry): Refactored to make fields private.
4573
4574         * assign.cs,
4575         statement.cs: Error_UnexpectedKind has extra parameter.
4576
4577 2005-07-14  Raja R Harinath  <rharinath@novell.com>
4578
4579         * ecore.cs (IAlias): Remove.
4580         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
4581         that implement the interface.
4582         * namespace.cs (Namespace): Likewise.
4583         (Namespace.declspaces): Renamed from 'defined_names'.
4584         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
4585         DeclSpace instead of an IAlias.
4586         * tree.cs (Tree.AddDecl): Update.
4587
4588 2005-07-12  Raja R Harinath  <rharinath@novell.com>
4589
4590         * statement.cs (Block.Flags); Remove HasVarargs.
4591         (Block.HasVarargs): Move to ToplevelBlock.
4592         (Block.ThisVariable, Block.AddThisVariable): Likewise.
4593         (Block.Variables): Make protected.  Initialize variable hashtable
4594         if necessary.
4595         (Block.AddVariable): Update.
4596         (Block.Resolve): Update to changes.
4597         (ToplevelBlock.HasVarargs): New boolean.
4598         (ToplevelBlock.ThisVariable): Move here from Block.
4599         (ToplevelBlock.AddThisVariable): Likewise.
4600         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
4601         * expression.cs (This.ResolveBase): Update to changes.
4602         (ArglistAccess.DoResolve): Likewise.
4603
4604 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4605
4606         Fix #75321
4607         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4608
4609         * class.cs (TypeContainer.VerifyMembers): Distinguish between
4610         not used and not used & assigned.
4611         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4612
4613 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4614
4615         Fix #75053
4616         * expression.cs (Is.DoResolve): null is never provided type.
4617
4618 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
4619
4620         Fix #52496
4621         * cs-parser.jay: Less strict event error rule to catch more errors.
4622
4623 2005-07-11  Martin Baulig  <martin@ximian.com>
4624
4625         * generic.cs (ConstructedType.CheckConstraints): Improve the check
4626         for the constructor constraint: we do not only have to check
4627         whether the class has a public constructor, but also ensure that
4628         it's parameterless.  Fixes #75492.
4629
4630 2005-07-11  Martin Baulig  <martin@ximian.com>
4631
4632         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
4633         between type parameters if they either have the reference type
4634         constraint or the class constraint.
4635
4636 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
4637
4638         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
4639
4640 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
4641
4642         Fix #74975
4643         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4644         (ExtractSecurityPermissionSet): Cope with self referencing security
4645         attributes properly.
4646
4647         * driver.cs (SetOutputFile): Made public property OutputFile.
4648
4649 2005-07-07  Raja R Harinath  <rharinath@novell.com>
4650
4651         Fix #75486.
4652         * class.cs (TypeContainer.first_nonstatic_field): Rename from
4653         has_nonstatic_fields.  Make into a FieldBase pointer.
4654         (TypeContainer.AddField): Add CS0282 check.
4655         (TypeContainer.EmitType): Update.
4656
4657 2005-07-06  Miguel de Icaza  <miguel@novell.com>
4658
4659         * cs-tokenizer.cs (consume_identifier): Do not create strings to
4660         compare if they start with __.
4661
4662 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4663
4664         * statement.cs (Switch.SwitchGoverningType): Only look at
4665         UserCasts that don't need implicit standard conversions to one of
4666         the allowed switch types (Fixes test-322.cs).
4667         (LocalInfo.Resolve): Re-enable sanity-test.
4668
4669 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
4670
4671         * cs-tokenizer.cs (consume_identifier): Detect double undescores
4672         
4673         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4674         
4675         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4676
4677 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4678
4679         Fix #75472.
4680         * ecore.cs (SimpleName.GetSignatureForError): Add.
4681         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4682         (MemberAccess.GetSignatureForError): Add.
4683
4684 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
4685  
4686         The big error and warning messages review.
4687         
4688         * anonymous.cs,
4689         * assign.cs,
4690         * attribute.cs,
4691         * class.cs,
4692         * codegen.cs,
4693         * convert.cs,
4694         * cs-parser.jay,
4695         * cs-tokenizer.cs,
4696         * decl.cs,
4697         * delegate.cs,
4698         * doc.cs,
4699         * driver.cs,
4700         * ecore.cs,
4701         * enum.cs,
4702         * expression.cs,
4703         * flowanalysis.cs,
4704         * iterators.cs,
4705         * literal.cs,
4706         * location.cs,
4707         * modifiers.cs,
4708         * namespace.cs,
4709         * parameter.cs,
4710         * pending.cs,
4711         * report.cs,
4712         * rootcontext.cs,
4713         * statement.cs,
4714         * support.cs,
4715         * tree.cs,
4716         * typemanager.cs: Updated.
4717         
4718         * class.cs: (MethodCore.SetYields): Moved here to share.
4719         (PropertyMethod.Define): Moved iterator setup here.
4720         
4721         * iterators.cs: Add orig_method to have full access to parent
4722         container.
4723
4724 2005-07-05  Raja R Harinath  <rharinath@novell.com>
4725
4726         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4727         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4728         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4729         variable of struct type.
4730         * expression.cs (Unary.ResolveOperator): Update to change.
4731         (Indirection.VerifyFixed): Likewise.
4732         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4733         (ParameterReference.VerifyFixed): Value parameters are fixed.
4734         (This.VerifyFixed): Treat 'this' as a value parameter.
4735         * statement.cs (LocalInfo.IsFixed): Remove.
4736
4737 2005-07-01  Martin Baulig  <martin@ximian.com>
4738
4739         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4740         `ec.EmitThis ()' to get the correct scope.
4741
4742 2005-07-01  Martin Baulig  <martin@ximian.com>
4743
4744         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4745         instance is a ParameterReference; fixes #75299.
4746
4747 2005-06-30  Raja R Harinath  <rharinath@novell.com>
4748
4749         Fix #75412.
4750         * expression.cs (Indexers.map): Remove.
4751         (Indexers.Append): Filter out inaccessible setters and getters.
4752         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4753
4754         Fix #75283.
4755         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
4756         Refactored from ...
4757         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4758         (FieldExpr.Emit, PropertyExpr.Emit): Update.
4759         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4760         * expression.cs (Invocation.EmitCall): Add CS0120 check.
4761
4762 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
4763
4764         Fix #75322
4765         * class.cs (FieldBase.GetInitializerExpression): One more field
4766         for backup.
4767
4768 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4769
4770         * pending.cs: Do not define a proxy if the base method is virtual,
4771         it will be picked up by the runtime (bug 75270).
4772
4773 2005-07-08  Martin Baulig  <martin@ximian.com>
4774
4775         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4776         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4777
4778 2005-07-07  Martin Baulig  <martin@ximian.com>
4779
4780         * generic.cs (ConstructedType.CheckConstraint): Use
4781         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
4782         called recursively; fixes #75329.
4783
4784 2005-07-06  Martin Baulig  <martin@ximian.com>
4785
4786         * generic.cs (TypeManager.InferTypeArguments): Added support for
4787         anonymous methods; fixes #75461.
4788
4789 2005-07-01  Martin Baulig  <martin@ximian.com>
4790
4791         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4792         `ec.EmitThis ()' to get the correct scope.
4793
4794 2005-07-01  Martin Baulig  <martin@ximian.com>
4795
4796         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
4797         instance is `This'; fixes #75299.
4798
4799 2005-06-30  Martin Baulig  <martin@ximian.com>
4800
4801         * class.cs (Indexer): Implement IIteratorContainer; added support
4802         for iterators in indexers.
4803
4804         * codegen.cs
4805         (EmitContext.CurrentIterator): Make this a property, not a field.
4806
4807         * anonymous.cs (AnonymousContainer.Iterator): New public property.
4808
4809 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4810
4811         * pending.cs: Do not define a proxy if the base method is virtual,
4812         it will be picked up by the runtime (bug 75270).
4813
4814 2005-06-28  Martin Baulig  <martin@ximian.com>
4815
4816         * cs-parser.jay (interface_method_declaration): Avoid a
4817         reduce/reduce conflict by moving some of the code into a separate
4818         `interface_method_declaration_body' rule; fixes #75368.
4819
4820 2005-06-28  Martin Baulig  <martin@ximian.com>
4821
4822         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
4823         array check after the check for TypeBuilder's.
4824
4825 2005-06-21  Raja R Harinath  <rharinath@novell.com>
4826
4827         * convert.cs (FindMostEncompassedType): Add two trivial special
4828         cases (number_of_types == 0 || number_of_types == 1).
4829         (FindMostEncompasingType): Likewise.
4830
4831 2005-06-17  Raja R Harinath  <rharinath@novell.com>
4832
4833         Some cleanups preparing for the fix of #75283.
4834         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4835         error testing.
4836         (EventExpr.InstanceResolve): Likewise.
4837         (EventExpr.DoResolve): Remove redundant checks.
4838
4839 2005-06-08  Miguel de Icaza  <miguel@novell.com>
4840
4841         * class.cs: Small fix.
4842
4843 2005-06-08  Raja R Harinath  <rharinath@novell.com>
4844
4845         Fix #75160.
4846         * class.cs (GetPartialBases): Fix return value check of
4847         part.GetClassBases.
4848
4849 2005-06-07  Raja R Harinath  <rharinath@novell.com>
4850
4851         Ensure that partial classes are registered in their enclosing
4852         namespace.  Initial part of fix of #75160.
4853         * tree.cs (Tree.RecordDecl): Add new namespace argument.
4854         Register declspace with namespace here, not in
4855         DeclSpace.RecordDecl.
4856         * cs-parser.jay: Pass namespace to RecordDecl.
4857         * class.cs (PartialContainer.Create): Likewise.
4858         (ClassPart.DefineType): New sanity-check.  Throws an exception if
4859         called.
4860         * decl.cs (Declspace.RecordDecl): Remove.
4861         * namespace.cs (NamespaceEntry.DefineName): Remove.
4862
4863 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4864
4865         * rootcontext.cs: Reset TargetExt as well.
4866
4867 2005-06-03  Raja R Harinath  <rharinath@novell.com>
4868
4869         * ecore.cs (Expression.Resolve): Emit CS0654 error when
4870         -langversion:ISO-1.
4871
4872 2005-06-02  Raja R Harinath  <rharinath@novell.com>
4873
4874         Fix #75080, cs0119.cs.
4875         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
4876         of ...
4877         (Expression.Resolve): ... this.  Use it.  Remove bogus code
4878         allowing ExprClass.Type and ExprClass.Namespace for
4879         ResolveFlags.VariableOrValue.
4880         (Expression.Resolve) [1-argument variant]: Change default resolve
4881         flags based on language version.
4882         (Expression.Error_UnexpectedKind): Use a simple string array
4883         rather than an ArrayList.
4884         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4885         not ExprClass.Type.
4886         (TypeOfVoid.DoResolve): Likewise.
4887         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
4888         flags argument -- it always has the same value.
4889
4890 2005-05-31  Raja R Harinath  <rharinath@novell.com>
4891
4892         Fix #75081.
4893         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4894         Use it in the error message.
4895         * assign.cs, expression.cs, statement.cs: Update.
4896
4897 2005-05-30  Raja R Harinath  <rharinath@novell.com>
4898
4899         Fix #75088.
4900         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4901         the "almostMatchedMember" case too.
4902         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4903         that failed the accessibility checks to 'almost_match'.
4904
4905 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
4906
4907         * attribute.cs: Use internal MethodBuilder methods to set
4908         ExactSpelling and SetLastError on PInvoke methods, instead
4909         of passing them via charset.  Fixes #75060.
4910
4911 2005-05-27  Raja R Harinath  <rharinath@novell.com>
4912
4913         * parameter.cs (Parameter): Remove TODO comment.
4914         (Parameter.DefineParameter): Remove Location parameter.
4915         (Parameters.LabelParameters): Likewise.
4916         * class.cs (Constructor.Emit): Update to change.
4917         (MethodData.Emit): Likewise.
4918         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
4919         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4920
4921 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
4922
4923         * parameter.cs,
4924           Removed Parameters.Location and added Parameter.Location instead.
4925           Removed Location parameter from Emit() and GetSignature().
4926         * anonymous.cs,
4927           class.cs,
4928           cs-parser.jay,
4929           delegate.cs,
4930           iterators.cs,
4931           statement.cs :
4932           Modified all related calls.
4933
4934 2005-06-21  Martin Baulig  <martin@ximian.com>
4935
4936         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
4937         left-hand side is not a nullable type; fixes #75328.
4938
4939 2005-06-21  Martin Baulig  <martin@ximian.com>
4940
4941         * typemanager.cs
4942         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
4943         (TypeManager.GetFullNameSignature): Likewise.
4944
4945         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
4946         `source.FullName' and `target.FullName' to check whether there are
4947         two conflicting definitions.
4948
4949 2005-06-21  Martin Baulig  <martin@ximian.com>
4950
4951         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
4952         a BoxedCast - also for reference types - to be compatible with csc.
4953
4954 2005-06-21  Martin Baulig  <martin@ximian.com>
4955
4956         * expression.cs (MemberAccess.DoResolve): Add support for nested
4957         types in a generic instance; fixes #75320.
4958
4959 2005-06-20  Martin Baulig  <martin@ximian.com>
4960
4961         * generic.cs (TypeManager.InferType): Also walk the class
4962         hierarchy for generic instances; fixes #75261.
4963
4964 2005-06-17  Martin Baulig  <martin@ximian.com>
4965
4966         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
4967         to make things work for corlib.
4968
4969 2005-06-15  Martin Baulig  <martin@ximian.com>
4970
4971         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
4972         obsolete `SecurityAction' values.
4973
4974 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4975
4976         * rootcontext.cs: Reset TargetExt as well.
4977         
4978 2005-06-09  Martin Baulig  <martin@ximian.com>
4979
4980         * delegate.cs (Delegate.VerifyMethod): Added
4981         `MethodGroupExpr old_mg' argument; inherit its
4982         `HasTypeParameters'; fix #75085.
4983
4984 2005-06-09  Martin Baulig  <martin@ximian.com>
4985
4986         * expression.cs (Invocation.OverloadResolve): Correctly handle
4987         generic methods for the SetMemberIsUsed(); fix #75064.
4988
4989 2005-06-09  Martin Baulig  <martin@ximian.com>
4990
4991         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
4992         fixes #75062.
4993
4994 2005-06-08  Martin Baulig  <martin@ximian.com>
4995
4996         * cs-parser.jay (nullable_type_or_conditional): If we put the
4997         nullable back and our `type' is a `ComposedCast', remove the
4998         nullable from it.  Fixes #75156.
4999
5000         * expression.cs (ComposedCast.RemoveNullable): New public method.
5001
5002 2005-06-08  Martin Baulig  <martin@ximian.com>
5003
5004         The big Iterators rewrite :-)
5005
5006         * iterators.cs: Rewrite this to use the anonymous methods framework.
5007
5008         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
5009         before the TypeContainers; see 2test-21.cs.
5010
5011         * class.cs
5012         (TypeContainer.DefineType): Don't create a new EmitContext if we
5013         already have one (this only happens if we're an Iterator).
5014         (TypeContainer.Define): Also call Define() on all our iterators.
5015         (Method.CreateEmitContext): Added support for iterators.
5016
5017         * anonymous.cs
5018         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
5019         (AnonymousContainer.CreateMethodHost): Moved here from
5020         AnonymousMethod and made abstract.
5021         (AnonymousContainer.CreateScopeType): New abstract method.
5022         (AnonymousContainer.IsIterator): New public property.
5023         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
5024         get the ScopeTypeBuilder rather than manually defining it here. 
5025         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
5026         iterators here.
5027
5028         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
5029         before RootContext.DefineTypes().
5030
5031         * codegen.cs (EmitContext.RemapToProxy): Removed.
5032         (EmitContext.CurrentAnonymousMethod): Changed type from
5033         AnonymousMethod -> AnonymousContainer.
5034         (EmitContext.ResolveTopBlock): Protect from being called twice.
5035         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
5036         (EmitContext.EmitThis): Removed the iterators hacks; use the
5037         anonymous methods framework for that.
5038
5039         * statement.cs
5040         (ToplevelBlock.Container): Make this a property, not a field.
5041         (ToplevelBlock.ReParent): New public method; move the
5042         ToplevelBlock into a new container.
5043         (Foreach.TemporaryVariable): Simplify.
5044
5045 2005-06-05  Martin Baulig  <martin@ximian.com>
5046
5047         * statement.cs (LocalInfo.CompilerGenerated): New flag.
5048         (Block.AddTemporaryVariable): New public method; creates a new
5049         `LocalInfo' for a temporary variable.
5050         (Block.EmitMeta): Create the LocalBuilders for all the temporary
5051         variables here.
5052         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
5053         non-iterator variables.
5054
5055 2005-06-05  Martin Baulig  <martin@ximian.com>
5056
5057         * statement.cs (Foreach.TemporaryVariable): Create the
5058         LocalBuilder in the Emit phase and not in Resolve since in some
5059         situations, we don't have an ILGenerator during Resolve; see
5060         2test-19.cs for an example.
5061
5062 2005-06-04  Martin Baulig  <martin@ximian.com>
5063
5064         The big Foreach rewrite - Part II.
5065
5066         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
5067         with `PropertyInfo ienumerator_getcurrent'.
5068
5069         * codegen.cs (VariableStorage): Removed.
5070
5071         * statement.cs
5072         (Foreach): Derive from Statement, not ExceptionStatement.
5073         (Foreach.CollectionForeach): New nested class.  Moved all the code
5074         dealing with collection foreach here.
5075         (Foreach.ForeachHelperMethods): Removed.
5076         (Foreach.TemporaryVariable): Implement IMemoryLocation.
5077
5078 2005-05-23  Martin Baulig  <martin@ximian.com>
5079
5080         * statement.cs (Try.DoResolve): Don't create a `finally' if we
5081         don't need to.  Fix #75014.
5082
5083 2005-05-26  Raja R Harinath  <rharinath@novell.com>
5084
5085         Improve user-defined conversion handling.
5086         * convert.cs (GetConversionOperators): Rewrite.  Return only the
5087         applicable operators.
5088         (AddConversionOperators): New.  Helper for GetConversionOperators.
5089         (FindMostEncompassedType, FindMostEncompassingType): Verify that
5090         there is only one most encompassed/encompassing type.
5091         (FindMostSpecificSource, FindMostSpecificTarget): Remove
5092         "applicable operator" handling.
5093         (UserConversion): Move cache here from GetConversionOperators.
5094         Directly cache the chosen operator, rather than the whole
5095         MethodGroup.
5096         (ExplicitNumericConversion): Fix buggy implementation of Decimal
5097         case.  Allow conversion of decimal to sbyte and byte too.
5098         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5099         New static methods.  Used to avoid allocating EmptyExpressions in
5100         convert.cs.
5101
5102 2005-05-24  Duncan Mak  <duncan@novell.com>
5103
5104         * ecore.cs (CastFromDecimal): New class for casting a decimal to
5105         another class, used in Convert.ExplicitNumericConversion.
5106         (CastToDecimal): New class, similar to above, but casts to
5107         System.Decimal, used in Convert.ImplicitNumericConversion and also
5108         in explicit convesion from double/float to decimal.
5109
5110         * convert.cs (ImplicitNumericConversion): Handle implicit
5111         conversions to System.Decimal.
5112         (ExplicitNumericConversion): handle explicit conversions to
5113         System.Decimal.
5114
5115         This fixes #68711.
5116         
5117 2005-05-20  Miguel de Icaza  <miguel@novell.com>
5118
5119         * typemanager.cs: Do not throw an exception in the TypeBuilder
5120         case, we take care of it on the TypeCode.
5121
5122 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
5123         
5124         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
5125         is back.
5126         
5127         * cs-parser.jay: Catch more lexical errors.
5128         
5129         * report.cs: Add one more Error method.
5130         
5131         * rootcontext.cs,
5132         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
5133
5134 2005-05-20  Martin Baulig  <martin@ximian.com>
5135
5136         * class.cs (TypeContainer.CircularDepException): Removed.
5137         (TypeContainer.DefineType): Removed the `InTransit' stuff.
5138         (TypeContainer.CheckRecursiveDefinition): Check for circular class
5139         (CS0146) and interface (CS0529) dependencies here.
5140
5141 2005-05-20  Martin Baulig  <martin@ximian.com>
5142
5143         * expression.cs (New.DoResolve): Move the CS0712 check above the
5144         CS0144 check; otherwise it can never be reached.
5145
5146 2005-05-20  Martin Baulig  <martin@ximian.com>
5147
5148         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
5149
5150 2005-05-20  Martin Baulig  <martin@ximian.com>
5151
5152         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
5153
5154         * typemanager.cs (TypeManager.IsAttributeType): New public method.
5155
5156 2005-05-19  Martin Baulig  <martin@ximian.com>
5157
5158         * delegate.cs
5159         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
5160         to disable error reporting.
5161
5162         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
5163         here since we don't want to report an error; see the new test-336.cs.
5164
5165 2005-05-19  Raja R Harinath  <rharinath@novell.com>
5166
5167         * statement.cs (ToplevelBlock.GetParameterReference)
5168         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
5169         Move here from class Block.
5170         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
5171         * expression.cs (ParameterReference.DoResolveBase): Likewise.
5172
5173 2005-05-18  Martin Baulig  <martin@ximian.com>
5174
5175         Fix #74978.
5176
5177         * flowanalysis.cs
5178         (FlowBranching.Reachability): Add non-static public And() and Or()
5179         methods.
5180         (FlowBranchingSwitch): New class; do the `break_origins' thing
5181         like in FlowBranchingLoop.
5182         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5183         reachability, not just locals and parameters.
5184         (FlowBranching.MergeChild): Remove some of the hacks for loop and
5185         switch; MergeBreakOrigins() now takes care of that.
5186
5187 2005-05-18  Martin Baulig  <martin@ximian.com>
5188
5189         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5190         a loop and may leave it, reset the barrier; fixes #74974.
5191
5192 2005-05-16  Raja R Harinath  <rharinath@novell.com>
5193
5194         Fix test-382.cs.  Emit values of decimal constants.
5195         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5196         Carved out of ...
5197         (TypeContainer.AddField): ... this.
5198         (TypeContainer.EmitFieldInitializers): Allow the list of fields
5199         with initializers to include 'Const's.
5200         (ClassPart.RegisterFieldForInitialization): Forward to
5201         PartialContainer.
5202         * const.cs (Const.Const): Pass initializer to base class.
5203         (Const.Define): In case of decimal constants, register them for
5204         initialization in a static constructor.
5205
5206 2005-05-14  Martin Baulig  <martin@ximian.com>
5207
5208         * statement.cs (Block.Resolve): Correctly handle unreachable code;
5209         do not call ResolveUnreachable() on unreachable statements in
5210         here, see the comment in the source code.
5211
5212 2005-05-13  Raja R Harinath  <rharinath@novell.com>
5213
5214         Fix #74934.
5215         * expression.cs (BinaryResolveOperator): If one of the operands of
5216         an equality comparison is 'null' and the other is a pointer type,
5217         convert the null to a NullPointer.
5218         * convert.cs (ImplicitReferenceConversion): If the expression is a
5219         NullLiteral and the target type is a pointer type, return a
5220         NullPointer instead.
5221         (ImplicitConversionStandard): Likewise.
5222
5223 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
5224         
5225         * cs-parser.jay: Set readonly context based on special constructs.
5226         
5227         * expression.cs (LocalVariableReference.DoResolveBase): Improved
5228         readonly variable error handling.
5229         
5230         * rootcontext.cs (EmitCode): Don't verify members when error
5231         occurred.
5232         
5233         * statement.cs (LocalInfo): Add reaodnly context information.
5234         (SetReadOnlyContext, GetReadOnlyContext): New methods.
5235
5236 2005-05-17  Martin Baulig  <martin@ximian.com>
5237
5238         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5239         #70970. 
5240
5241 2005-05-13  Martin Baulig  <martin@ximian.com>
5242
5243         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
5244         handle unreachable blocks.
5245
5246 2005-05-13  Martin Baulig  <martin@ximian.com>
5247
5248         * class.cs
5249         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
5250         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
5251         #74905. 
5252
5253 2005-05-13  Martin Baulig  <martin@ximian.com>
5254
5255         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5256         instance variable, not a local.  Fix #74873.
5257         (Block.ResolveUnreachable): Set it to true here.
5258
5259 2005-05-12  Martin Baulig  <martin@ximian.com>
5260
5261         * cs-parser.jay (property_declaration): Pass the `current_class',
5262         not the `current_container' to Property's .ctor.  Fixes #74912.
5263
5264 2005-05-11  Martin Baulig  <martin@ximian.com>
5265
5266         * typemanager.cs (Closure): Copy this from MCS and merge all the
5267         GMCS-specific changes into it.
5268
5269 2005-05-12  Raja R Harinath  <harinath@gmail.com>
5270
5271         Fix #74920.
5272         * typemanager.cs (unmanaged_enclosing_types): New.
5273         (IsUnmanagedType): Avoid infloops by using
5274         'unmanaged_enclosing_types' to talk with recursive invocations.
5275
5276 2005-05-11  Duncan Mak  <duncan@novell.com>
5277
5278         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5279         continuing to process for 'arg'.
5280         (handle_preprocessing_directive): Check the argument of the #endif
5281         directive and report error CS1025 if there are any trailing
5282         characters.
5283
5284         According to the C# spec, having even whitespace after the #endif
5285         directive is illegal; however, because we call arg.TrimEnd ()
5286         beforehand, we have the same behavior as csc, allowing whitespace
5287         after the directive.
5288
5289         Fixes #74892.
5290
5291 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
5292
5293         Fix #74863.
5294         
5295         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5296         (Constructor.GetObsoleteAttribute): Implemented correctly.
5297
5298 2005-05-10  Martin Baulig  <martin@ximian.com>
5299
5300         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
5301         resolve the type; fixes #74864.
5302         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
5303         in DoResolve(); fixes #74862.
5304
5305 2005-05-10  Martin Baulig  <martin@ximian.com>
5306
5307         * support.cs (ReflectionParameters.ParameterModifier): Use
5308         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5309         and `ParameterAttributes.In'.  Fixes #74884.
5310
5311 2005-05-10  Martin Baulig  <martin@ximian.com>
5312
5313         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
5314         the cache if we're just looking for `MemberTypes.NestedType' in a
5315         generic instance.
5316
5317         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
5318         constraints if we're still resolving the type tree.
5319         (Expression.MemberLookup): If we're resolving the type tree, only
5320         look for `MemberTypes.NestedType' since we're only interested in
5321         getting types.
5322
5323         * class.cs (TypeContainer.DefineType): Don't resolve the type
5324         parameters here; do this later in ResolveType() after the type
5325         tree has been resolved.
5326         (TypeContainer.ResolveType): New public method; this is called
5327         after the type tree is resolved and before the types are being
5328         populated.  We resolve the generic constraints here.
5329         (TypeContainer.DoDefineMember): Check the constraints on our base
5330         class and interfaces.
5331
5332         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
5333         set the `ResolvingTypeTree' flag on the EmitContext.
5334
5335         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
5336
5337 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
5338
5339         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5340         
5341         * expression.cs (Argument.GetParameterModifier): Turned to property.
5342         (Invocation.Error_InvalidArguments): Add more descriptive errors.
5343         
5344         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5345         its C# equivalent.
5346         
5347 2005-05-09  Raja R Harinath  <rharinath@novell.com>
5348
5349         Fix #74852.
5350         * decl.cs (MemberCache.AddMethods): Register override methods,
5351         rather than non-override methods.
5352         * typemanager.cs (RegisterOverride): New.
5353         (IsOverride): Update.
5354
5355 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
5356
5357         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
5358
5359 2005-05-06  Martin Baulig  <martin@ximian.com>
5360
5361         * attribute.cs
5362         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
5363         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
5364
5365 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
5366
5367         Fix #73105.
5368         
5369         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5370         recursive declaration.
5371         
5372         * statement.cs (Block.ResolveMeta): Report any error in resolving.
5373         
5374 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
5375
5376         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5377         
5378         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5379
5380 2005-05-05  Raja R Harinath  <rharinath@novell.com>
5381
5382         Fix #74797.
5383         * decl.cs (DeclSpace.FamilyAccessible): 
5384         Use TypeManager.IsNestedFamilyAccessible.
5385
5386         Fix reopened #64812.
5387         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5388         internal'.
5389
5390 2005-05-04  Raja R Harinath  <rharinath@novell.com>
5391             Abin Thomas  <projectmonokochi@rediffmail.com>
5392             Anoob V E  <projectmonokochi@rediffmail.com>
5393             Harilal P R  <projectmonokochi@rediffmail.com>
5394
5395         Fix #64812.
5396         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5397         allow access to all static members.
5398
5399 2005-05-04  Martin Baulig  <martin@ximian.com>
5400
5401         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5402
5403 2005-05-04  Martin Baulig  <martin@ximian.com>
5404
5405         Fix #74655.
5406
5407         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5408         section at the end; make things work if `default' is not the last
5409         section.        
5410
5411 2005-05-04  Martin Baulig  <martin@ximian.com>
5412
5413         Fix #70400.
5414
5415         * statement.cs (Switch): Replaced the `got_default' field with a
5416         `default_section' one.
5417         (Switch.CheckSwitch): Set `default_section' here.
5418         (Switch.Resolve): If we're a constant switch and the constant is
5419         not found, use the default section.
5420
5421 2005-05-03  Martin Baulig  <martin@ximian.com>
5422
5423         * expression.cs (ArrayAccess.EmitGetLength): New public method.
5424
5425         * statement.cs (Foreach.ArrayForeach): New nested class.
5426         (Foreach.TemporaryVariable): New nested class.
5427         (Foreach.EmitArrayForeach): Removed; this is now in the new
5428         ArrayForeach class.
5429
5430 2005-05-03  Raja R Harinath  <rharinath@novell.com>
5431
5432         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
5433         more conservative.
5434         (VerifyPendingMethods): Revert change below.
5435
5436         * typemanager.cs (IsOverride, RegisterNonOverride): New.
5437         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5438         that used to trigger warning -28.  Remove warning -28.
5439         * expression.cs (Invocation.OverloadResolve): Use
5440         TypeManager.IsOverride to distinguish override methods.
5441
5442         Fix #74773.
5443         * pending.cs (VerifyPendingMethods): If a base type implements the
5444         requested interface, don't bother checking individual methods of
5445         the base type.  As a side-effect, this prevents the creation of
5446         unnecessary proxies.
5447
5448 2005-05-02  Martin Baulig  <martin@ximian.com>
5449
5450         Fix #70182.
5451
5452         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5453         Also `And' the locals if the old vector is null.
5454         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5455         null; in this case we basically reset all the variables.        
5456
5457 2005-05-02  Martin Baulig  <martin@ximian.com>
5458
5459         Fix #74529.
5460
5461         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5462         Added `FlowBranching branching' argument; always `and' the
5463         variables instead of `or'ing them unless we're an infinite loop.
5464
5465         * statement.cs (While.Resolve): Create a new sibling unless we're
5466         infinite.       
5467
5468 2005-05-02  Martin Baulig  <martin@ximian.com>
5469
5470         Fix #70140.
5471
5472         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5473         arguments; use it instead of creating a new TopLevelBlock.
5474         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5475         our ConstructorInitializer.
5476
5477         * statement.cs
5478         (TopLevelBlock.TopLevelBranching): New public property.
5479         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5480         and create our `TopLevelBranching'.
5481
5482         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5483         anonymous method host, use `block.TopLevelBranching' rather than
5484         creating a new branching.
5485
5486 2005-04-20  Miguel de Icaza  <miguel@novell.com>
5487
5488         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5489         a ScopeInfo, if any of the current children is a child of the new
5490         entry, move those children there.
5491
5492 2005-04-30  Martin Baulig  <martin@ximian.com>
5493
5494         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5495         at the beginning of a SwitchSection.  Fix #73335.
5496
5497 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
5498
5499         Fix #74378
5500         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5501         
5502         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5503         (FieldExpr.DoResolve): Obsolete members are ignored for field
5504         initializers.
5505         
5506 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
5507
5508         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5509         of arrays detection.
5510
5511         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5512         verification.
5513         (Field.VerifyClsCompliance): Volatile fields are not compliant.
5514
5515         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5516         arrays report.
5517
5518 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
5519
5520         * cs-parser.jay: Use the prefered version of -unsafe in error
5521         message.
5522
5523 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
5524
5525         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5526         circumstances.
5527
5528 2005-04-20  John Luke  <john.luke@gmail.com>
5529
5530         * driver.cs: fix typo in error message, --outout to --output
5531
5532 2005-04-30  Martin Baulig  <martin@ximian.com>
5533
5534         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
5535         handle the .NET 2.x security attributes.
5536
5537 2005-04-30  Martin Baulig  <martin@ximian.com>
5538
5539         * typemanager.cs
5540         (TypeManager.ExpandInterfaces): Don't add things twice.
5541
5542         * class.cs
5543         (TypeContainer.VerifyClsCompliance): Allow generic instances.
5544
5545 2005-04-29  Martin Baulig  <martin@ximian.com>
5546
5547         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
5548
5549         * anonymous.cs: Added support for anonymous generic methods.
5550
5551 2005-04-29  Martin Baulig  <martin@ximian.com>
5552
5553         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
5554         generic instances.
5555
5556 2005-04-29  Martin Baulig  <martin@ximian.com>
5557
5558         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
5559
5560         * expression.cs (New.DoResolve): Fix the CS0304 check.
5561
5562 2005-04-29  Martin Baulig  <martin@ximian.com>
5563
5564         * typemanager.cs (TypeManager.GetFullName): Updated to the new
5565         naming schema.
5566
5567         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
5568         explicit interface implementation, compare the interface types.
5569         (MethodData.Define): Use the new naming scheme from the latest
5570         .NET 2.x beta2.
5571         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
5572
5573         * decl.cs (MemberName.GetMemberName): Removed.
5574         (MemberName.MethodName, FullName): New properties.
5575
5576 2005-04-25  Raja R Harinath  <rharinath@novell.com>
5577
5578         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
5579
5580 2005-04-22  Martin Baulig  <martin@ximian.com>
5581
5582         * generic.cs (GenericMethod): Create the EmitContext in the
5583         `Define()'; in `Define(MethodBuilder)', create the type parameters
5584         before calling `Define()'.  Fixes #73933.
5585
5586 2005-04-22  Martin Baulig  <martin@ximian.com>
5587
5588         * generic.cs
5589         (Constraints.Resolve): Make things work wrt. the new type lookup system.
5590         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
5591
5592         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
5593         ConstructedType, check its constraints.
5594
5595 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
5596
5597         * codegen.cs (InRefOutArgumentResolving): New field.
5598         
5599         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5600         fields outside contructor.
5601         
5602         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5603         
5604 2005-04-19  Miguel de Icaza  <miguel@novell.com>
5605
5606         * anonymous.cs (CaptureContext.EmitParameterInstance): The
5607         parameter code was not completed ever, so it was not as up-to-date
5608         as local variables.  Must finish it.
5609
5610         The bug fix was to compare the Toplevel of the block, not the
5611         current block.  Thanks for Ben for pointing this out. 
5612
5613 2005-04-19  Raja R Harinath  <rharinath@novell.com>
5614
5615         * decl.cs (AddMethods): Use the declaring type of the problem
5616         method to determine if we want to squash a warning.
5617
5618 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
5619
5620         * attribute.cs: Removed debug output.
5621
5622         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5623         
5624         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5625         Report.Stderr.
5626         
5627 2005-04-18  Raja R Harinath  <rharinath@novell.com>
5628
5629         Fix #74481.
5630         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5631         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5632         all null comparisons against reference types.
5633
5634 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
5635
5636         Fix# 74565
5637         * class.cs (TypeContainer.CircularDepException) New nested
5638         exception class.
5639         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5640         (TypeContainer.DefineType): Removed error, reset InTransit before
5641         exit.
5642         (Class.DefineType): Throw exception when is in Transit.
5643         Catch exception and report error.
5644         (Struct.DefineType): Throw exception when is in Transit.
5645         Catch exception and report error.
5646         (Interface.DefineType): Throw exception when is in Transit.
5647         Catch exception and report error.
5648
5649         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5650         handle nested exception handlers.
5651
5652         * flowanalysis.cs (InTryWithCatch): New method, search for try with
5653         a catch.
5654
5655         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5656         InFinally and InCatch storage.
5657
5658         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5659         (Catch.Resolve): Set and Restore ec.InCatch.
5660         (Try.Resolve): Set and Restore ec.InFinally.
5661         (Try.HasCatch): True when try has catch.
5662
5663 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
5664
5665         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5666           for the same event member, so exclude such cases from warning 419.
5667           Fixed bug #74633.
5668
5669 2005-04-16  Miguel de Icaza  <miguel@novell.com>
5670
5671         * expression.cs (Binary.ResolveOperator): Apply patch from John
5672         Luke to fix bug 59864: operators &, | and ^ on enumerations
5673         require that the same enum type on both sides.
5674
5675         * driver.cs: Add warnings to old flag usage, this is to assist
5676         people who produce Makefiles and hope that the Makefiles will be
5677         used on Windows.
5678
5679         * class.cs (TypeContainer.EmitType): Moved the definition of the
5680         special $PRIVATE$ field from the resolve phase to the Emit phase.
5681         During resolve we do not know if we are a struct with
5682         HasExplicitLayout, we know this only after the attributes for the
5683         type are emitted.
5684
5685         Set the FieldOffset to zero on the dummy field that we create for
5686         the class.   Fixes 74590.
5687
5688 2005-04-16  Raja R Harinath  <rharinath@novell.com>
5689
5690         Fix #73834.
5691         * ecore.cs (PropertyExpr.resolved): New.
5692         (DoResolve): Use it to handle a case of double resolution here.
5693         Handle a case of identical-name-and-type-name.
5694         * expression.cs (ArrayCreation.CheckIndices): Avoid double
5695         resolution by storing the results of expression resolution back
5696         into the "probes" array.
5697
5698 2005-04-15  Raja R Harinath  <rharinath@novell.com>
5699
5700         Fix cs0208-7.cs and cs0208-8.cs.
5701         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5702         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
5703         error reporting to point out the reason a struct is not unmanaged.
5704
5705 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5706
5707         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
5708           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5709
5710 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5711
5712         Fix #74528.
5713         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5714         IdenticalNameAndTypeName here.
5715         (EventExpr.InstanceResolve): Likewise.
5716
5717 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
5718
5719         C# 2.0 DefaultCharSetAttribute implementation
5720         
5721         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5722         which allows us to set GlobalNamespace for every resolve.
5723         (Attribute.ResolveArguments): Cut from Resolve.
5724         (Attribute.GetCharSetValue): Returns CharSet named argument.
5725         (Attribute.DefinePInvokeMethod): Gets default charset from
5726         module settings.
5727         (GlobalAttribute.ResolveAsTypeStep): Override.
5728         (GlobalAttribute.ResolveArguments): Override.
5729         
5730         * class.cs (TypeAttr): Is protected.
5731         
5732         * codegen.cs (ModuleClass.DefaultCharSet): New member.
5733         (ModuleClass.DefaultCharSetType): New memeber.
5734         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5735         
5736         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5737         charset from module.
5738         
5739         * delegate.cs (TypeAttr): Override.
5740         (Delegate.DefineType): Use this TypeAttr.
5741         
5742         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5743         at very early stage (before types are defined) to resolve model
5744         module attributes. It will probably not work with corlib but it
5745         should be ok.
5746         
5747         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5748         charset from module.
5749         
5750         * typemanager.cs (default_charset_type): New type.
5751
5752 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5753
5754         * decl.cs (MemberCache.AddMethods): Don't warn if
5755         System.Object.Finalize has buggy MethodAttributes.
5756
5757         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5758         removed below.
5759
5760 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5761
5762         * doc.cs : detect ambiguous reference to overloaded members.
5763           Fixed bug #71603. MS 1.1 csc does not detect it.
5764
5765 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5766
5767         * doc.cs : delegates must not be referenced with parameters.
5768           Fixed bug #71605.
5769
5770 2005-04-12  Miguel de Icaza  <miguel@novell.com>
5771
5772         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5773
5774 2005-04-10  Miguel de Icaza  <miguel@novell.com>
5775
5776         * driver.cs (MainDriver): Stop processing if the CLS stage found
5777         errors. 
5778
5779         (CompilerCallableEntryPoint.InvokeCompiler): Always
5780         reset after execution;   Take a TextWriter argument for the
5781         output.
5782
5783         * report.cs: Use the error stream instead of hardcoding stderr. 
5784
5785 2005-04-09  Miguel de Icaza  <miguel@novell.com>
5786
5787         * class.cs: Reduce code paths to test, too small of an
5788         optimization to make it worth the extra testing.  Always perform
5789         it. 
5790
5791 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5792
5793         Fix #74510.
5794         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5795         operators that had errors reported on them.
5796
5797 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
5798
5799         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5800         argument types.
5801         (Attribute.Resolve): Add named argument type checking.
5802         
5803         * class.cs (FixedField.Define): Use IsPrimitiveType
5804         
5805         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5806         
5807         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5808         unsafe parameter types.
5809         
5810         * statement.cs (Using.ResolveExpression): Add better error description.
5811         
5812         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5813         
5814 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5815
5816         Fix #74484.
5817         * attribute.cs (Attribute.GetAttributeUsage): Resolve
5818         AttributeUsageAttribute in the emitcontext of the attribute class,
5819         not in the emitcontext of the attributable entity it was attached to.
5820         * cs-parser.jay: Use 'current_class', not 'current_container',
5821         when creating a GlobalAttribute.
5822
5823 2005-04-08  Alp Toker  <alp@atoker.com>
5824
5825         * pending.cs: The fix to #58413 failed to compile methods implementing
5826         interfaces with/without params modifiers and vice versa, even though
5827         params modifiers aren't part of the signature. Make the modifier check
5828         less strict as in csc.
5829
5830 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
5831             Anoob V E  <projectmonokochi@rediffmail.com>
5832             Harilal P R  <projectmonokochi@rediffmail.com>
5833
5834         Fix #58413.
5835         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
5836         modifiers of pending methods.
5837         (PendingImplementation.PendingImplementation): Initialize it.
5838         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5839         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5840         with ParameterData.  Add check for modifiers.
5841         * class.cs (MethodData.Define): Update to changes.
5842
5843 2005-04-07  Raja R Harinath  <rharinath@novell.com>
5844
5845         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5846
5847 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
5848
5849         * class.cs (PropertyMethod.Define): Check private accessor in abstract
5850         property.
5851         
5852         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5853         
5854         * rootcontext.cs,
5855         * typemanager.cs: Registered RequiredAttributeAttribute.
5856         
5857 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
5858
5859         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5860         Warning CS0169 is back at level 3.
5861         (IMethodData.SetMemberIsUsed): New method.
5862         
5863         * decl.cs (IsUsed): New value; moved from FieldBase.Status
5864         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5865         
5866         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5867
5868         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5869         contants.
5870         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5871         is used.
5872         
5873         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5874         is used.
5875         
5876         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5877         to avoid the problems with nested types.
5878
5879 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
5880             Anoob V.E  <projectmonokochi@rediffmail.com>
5881             Harilal P.R  <projectmonokochi@rediffmail.com>
5882             Raja R Harinath  <rharinath@novell.com>
5883
5884         Fix #73820.
5885         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5886         attribute.
5887         * typemanager (GetConstructor): Make public.
5888
5889 2005-04-05  John Luke  <john.luke@gmail.com>
5890             Raja R Harinath  <rharinath@novell.com>
5891
5892         Fix #62232.
5893         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5894         struct too.  Return false quicker in a few cases.
5895         (VerifyUnManaged): Use it.
5896
5897 2005-04-05  Raja R Harinath  <rharinath@novell.com>
5898
5899         Fix #74041.
5900         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5901         not 'unreachable_seen'.
5902
5903 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
5904
5905         * attribute.cs (Attribute.GetValue): Removed unused.
5906         
5907         * codegen.cs (CodeGen.TrimExt): Removed unused.
5908         
5909         * cs-parser.jay (output): Removed unused.
5910         
5911         * cs-tokenizer.cs (hex_digits): Removed unused.
5912         
5913         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5914         
5915         * expression.cs (Indirection.LoadExprValue): Removed unused.
5916         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5917         
5918         * iterators.cs (Iterator.param_types): Removed unused.
5919         
5920         * statement.cs (Goto.block): Removed unused.
5921         (ToplevelBlock.did): Removed unused.
5922         (Switch.ResolveConstantSwitch): Removed unused.
5923
5924 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
5925
5926         * rootcontext.cs: Allow mcs to bootstrap with the compilation
5927         resetting thingy.
5928
5929 2005-04-19  Martin Baulig  <martin@ximian.com>
5930
5931         Merged r42462 from MCS and made it work for GMCS.
5932
5933         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
5934
5935         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
5936
5937 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5938
5939         Fix #74232 and cs0208-3.cs.
5940         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5941         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5942         unmanaged type.  Don't use FieldBuilders when 't' is a
5943         TypeBuilder.  Use ModFlags and MemberType fields.
5944         * class.cs (MemberBase.member_type): Rename from MemberType.
5945         (MemberBase.MemberType): New property.  Determines member_type on
5946         demand.
5947         (MemberBase.DoDefine): Don't initialize MemberType here.
5948         (FieldMember.Define): Likewise.
5949
5950 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
5951
5952         Fix #74241
5953         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5954         Attributes are emitted there.
5955         
5956 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5957
5958         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5959         keyword in 'partial enum' too.
5960         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5961         is not allowed).
5962         Report from Kamil Skalski <nazgul@omega.pl>.
5963
5964         Fix #74309.
5965         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5966         have partial containers too.
5967
5968         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5969         in block' checks to Block.CheckInvariantMeaningInBlock.
5970         * statement.cs (Block.GetKnownVariableInfo): Make private.
5971         (Block.IsVariableUsedInChildBlock): Remove.
5972         (Block.IsVariableUsedInBlock): Likewise.
5973         (Block.CheckInvariantMeaningInBlock): New.  Show location of
5974         conflicting declaration.
5975         (Block.AddVariable): Make error messages less long-winded and more
5976         specific.  Show location of conflicting declaration.
5977         * parameter.cs (Parameters.Location): New readonly property.
5978
5979 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5980
5981         Clean up semantics of invoking ResolveMemberAccess.
5982         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5983         can have an instance, ensure that we pass in a non-TypeExpression
5984         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
5985         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5986         argument.  Update to changes and simplify.
5987         (FieldExpr.Emitinstance): Remove CS0120 check.
5988         (PropertyExpr.EmitInstance): Likewise.
5989         * expression.cs (Argument.Resolve): Likewise.
5990         (Invocation.DoResolve): Update to changes in semantics of
5991         InstanceExpression.
5992
5993 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
5994
5995         Fix #74241
5996         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5997         customization.
5998         
5999         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
6000
6001 2005-03-31  Raja R Harinath  <rharinath@novell.com>
6002
6003         Fix difference in behaviour with commandline invocation.
6004         * driver.cs (Driver.Reset): New.
6005         (CompilerCallableEntryPoint): Call it.
6006
6007         * statement.cs (If.Resolve): Avoid spurious "uninitialized
6008         variable" warnings if the boolean expression failed to resolve.
6009
6010 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
6011
6012         * attribute.cs: Fix the union of several permissions when some of them
6013         are unrestricted (so the result isn't an unrestricted permission set).
6014         Fix #74036.
6015
6016 2005-03-30  Raja R Harinath  <rharinath@novell.com>
6017
6018         * ecore.cs (MemberExpr): New class.  Convert from interface
6019         IMemberExpr.
6020         (MemberExpr.ResolveMemberAccess): Refactor and move here from
6021         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
6022         error checks.
6023         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
6024         (MethodGroupExpr.IsExplicitImpl): Remove.
6025         (Expression.GetFieldFromEvent): Remove.
6026         (SimpleName.MemberStaticCheck): Remove.
6027         (SimpleName.DoSimpleNameResolve): Update to changes.
6028         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
6029         (MemberAccess.IdenticalNameAndTypeName): Remove.
6030         (MemberAccess.error176): Move to MemberExpr.
6031         (MemberAccess.DoResolve): Update to changes.
6032         (BaseAccess.DoResolve): Likewise.
6033
6034 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
6035
6036         C# 2.0 Conditional attribute class implementation
6037         
6038         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
6039         Analyzes class whether it has attribute which has ConditionalAttribute
6040         and its condition is not defined.
6041         
6042         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
6043         (Class.IsExcluded): New method. Search for at least one defined
6044         condition in ConditionalAttribute of attribute class.
6045
6046 2005-03-30  Raja R Harinath  <rharinath@novell.com>
6047
6048         * ecore.cs (PropertyExpr): Derive from Expression, not
6049         ExpressionStatement.
6050         (PropertyExpr.EmitStatement): Remove.
6051
6052 2005-03-29  Raja R Harinath  <rharinath@novell.com>
6053
6054         Fix #74060.
6055         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
6056         internal field "value__" of an enum be private.  The examples for
6057         "value__" that I found on MSDN all used FieldAttributes.Private.
6058
6059         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
6060         Don't mention IL method attribute names.
6061
6062         Fix #47991.  Remove a TODO.
6063         * statement.cs (Block.Toplevel): Make into a field.
6064         (Block.Parameters): Move into ToplevelBlock.
6065         (Block.known_variables): Rename from child_variable_names.
6066         (Block.Block): Remove variants that take Parameters.  Initialize
6067         'Toplevel' with the immediately surrounding toplevel block.
6068         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
6069         LocalInfo parameter.
6070         (Block.GetKnownVariableInfo): New.
6071         (Block.IsVariableNameUsedInChildBlock): Update.
6072         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
6073         the block, even though it may not be in scope.
6074         (Block.AddVariable): Remove Parameters parameter.  Use
6075         Toplevel.Parameters instead.
6076         (Block.AddConstant): Remove Parameters parameter.
6077         (Block.GetParameterReference): Update to use Toplevel.Parameters.
6078         (Block.IsParamaterReference): Likewise.
6079         (Block.IsLocalParameter): Likewise.  Simplify a lot.
6080         (ToplevelBlock.Parameters): New.  Moved from Block.
6081         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
6082         initialize Parameters to a non-null value.
6083         * cs-parser.jay: Update to changes.
6084         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
6085         simple names that mean different things in the same block.  Use
6086         Block.IsVariableNameUsedInBlock.
6087
6088 2005-03-28  Raja R Harinath  <rharinath@novell.com>
6089
6090         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
6091
6092 2005-03-26  Raja R Harinath  <harinath@acm.org>
6093
6094         Fix #73038.
6095         * assign.cs (Assign.DoResolve): When the RHS of an assignment
6096         fails to resolve, ensure that the LHS is still resolved as an
6097         lvalue.
6098
6099 2005-03-25  Raja R Harinath  <harinath@acm.org>
6100
6101         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
6102         ec.ContainerType.
6103         (Enum.current_ec): Remove.
6104         (Enum.LookupEnumValue): Remove EmitContext argument.
6105         Just uses the one created during DefineType.
6106         (Enum.FindMembers): Update.
6107         * expression.cs (MemberAccess.DoResolve): Update.
6108
6109 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
6110
6111         * assign.cs (Assign.DoResolve): Check for CS1717 when
6112         source and target are same (uses Equals).
6113
6114         * expression.cs (LocalVariableReference, ParameterReference,
6115         This): Implemented Equals, GetHashCode.
6116
6117         * statement.cs (Block.GetParameterReference): Removed useless
6118         local variable.
6119
6120 2005-03-22  Raja R Harinath  <rharinath@novell.com>
6121
6122         Fix cs0128.cs
6123         * statement.cs (Block.AddVariable): Ensure that we skip implicit
6124         blocks before deciding whether the error is cs0136 or cs0128.
6125
6126         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
6127         (using_alias_directive, using_namespace_directive): Pass
6128         MemberName, not an expression to Namespace.UsingAlias and
6129         Namespace.Using.
6130         (MakeName): Use the MemberName of the namespace.
6131         * namespace.cs (Namespace.MemberName): New.
6132         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
6133         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
6134         Likewise.
6135         * decl.cs (MemberName.Name): Make readonly.
6136         (MemberName.FromDotted): New "constructor".
6137         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
6138         (MemberCore.Name): Compute from MemberName on demand.
6139         (MemberCore.SetMemberName): Provide a way to change the
6140         MemberName.
6141         (MemberCore.AddToContainer): Don't take a fullname parameter.
6142         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
6143         fully qualified name of the container to the member name.
6144         (TypeContainer.AddToTypeContainer): Use a fully qualified name
6145         only if the type is a member of the root container.
6146         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
6147         MemberName.Left rather than searching for an embedded ".".
6148         (PartialContainer.CreatePart): Update to changes in RootContext.
6149         (MemberBase.ShortName): Turn into a property.  Use
6150         MemberCore.SetMemberName.
6151         (MemberBase.ExplicitInterfaceName): Remove.
6152         (MemberBase.UpdateMemberName): Remove.
6153         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
6154         (PropertyBase.SetMemberName): New override.
6155         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
6156         (Tree.GetDecl): New.
6157         (Tree.AllDecls): Rename from Decls.
6158         * attribute.cs, enum.cs, report.cs: Update to changes.
6159         * driver.cs (MainDriver): Use MemberName.FromDotted on
6160         RootContext.MainClass.
6161
6162 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
6163
6164         * class.cs (FixedField.Define): Check for CS1664 and more sanity
6165         checks.
6166
6167         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
6168
6169 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
6170
6171         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
6172         property accessor modifiers.
6173
6174         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
6175         fixed buffer attribute (CS1716).
6176         (PropertyMethod.HasCustomAccessModifier): When property accessor
6177         has custom modifier.
6178
6179         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6180         modifiers.
6181         (PropertyExpr.DoResolveLValue): Add CS0272.
6182
6183 2005-03-17  Miguel de Icaza  <miguel@novell.com>
6184
6185         * convert.cs: When converting to a pointer, use the proper Conv.U
6186         or Conv.I depending on the source data type.
6187
6188         * cs-tokenizer.cs: Make the size for large decimal constants,
6189         fixes #72957.
6190
6191 2005-03-17  Martin Baulig  <martin@ximian.com>
6192
6193         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6194         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
6195
6196 2005-03-17  Martin Baulig  <martin@ximian.com>
6197
6198         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6199         to bool so we can return an error condition.
6200         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6201         returned an error.
6202
6203 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
6204
6205         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6206         attributes.
6207
6208 2005-03-16  Raja R Harinath  <rharinath@novell.com>
6209
6210         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6211         Refactor to avoid traversing the list of assemblies, and to avoid
6212         string concatenation.
6213         * typemanager.cs (guid_attr_type): Remove.
6214         (negative_hits, pointers, references): Remove hashes.
6215         (type_hash): New.
6216         (GetConstructedType): New.  Uses type_hash to handle constructed
6217         types (arrays, references, pointers).
6218         (GetReferenceType, GetPointerType): Use it.
6219         (GetNestedType): New.  Uses type_hash to handle nested types of
6220         reflected types.
6221         (LookupType, LookupTypeDirect): Remove.
6222         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
6223         'types' hash and LookupTypeReflection directly.
6224         (params_string, params_object): Use GetConstructedType.
6225         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
6226         top-level types.
6227         (Namespace.Lookup): Use cached_types.
6228         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6229         provided by old TypeManager.LookupType.
6230         * rootcontext.cs (MakeFQN): Remove.
6231         * decl.cs (DeclSpace.MakeFQN): Likewise.
6232         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
6233         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6234         TypeManager.GetConstructedType.
6235         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
6236
6237 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
6238
6239         * cs-parser.jay: Fix build.
6240
6241 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
6242
6243         * class.cs (TypeContainer.CircularDepException) New nested
6244         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
6245
6246         * cs-parser.jay: Reports CS1527 for any namespace element.
6247
6248         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
6249         Added CS0407.
6250
6251         * expression.cs (ParameterReference.IsAssigned): Changed error to
6252         CS0269.
6253         (Error_WrongNumArguments): Moved CS0245 detection here.
6254
6255         * statement.cs (Return.Resolve): Add CS1622 report.
6256
6257 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
6258
6259         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
6260
6261 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
6262
6263         * attribute.cs expression.cs: Get rid of some allocations.
6264
6265 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
6266
6267         * doc.cs : just eliminate the latest change.
6268
6269 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6270
6271         * doc.cs : commented out the latest change. It breaks xml-030.cs
6272
6273 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6274
6275         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6276           fail. So invoke CreateType() in FindDocumentedType().
6277
6278 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6279
6280         * cs-tokenizer.cs : added IsKeyword().
6281         * doc.cs : Detect keyword incorrectly used as identifier.
6282           Allow identifiers prefixed by @.
6283
6284 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
6285
6286         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6287         It caused exception in namespace resolving (again!).
6288         
6289         * class.cs (Class.ctor): Removed exit.
6290         (PropertyMethod.ctor): ditto.
6291         
6292         * codegen.cs (Codegen.Reset): Reset static data.
6293         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6294         
6295         * cs-tokenizer.cs (Cleanup): Removed.
6296         
6297         * driver.cs (GetSystemDir): Rewrote to one line command.
6298         It caused problem with unloaded dynamic modules.
6299         (UnixParseOption): Removed Exit.
6300         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6301         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6302         Now can be mcs used as library.
6303         
6304         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6305         empty location.
6306         
6307         * location.cs (Reset): Reset static data.
6308         
6309         * namespace.cs (Reset): Reset static data.
6310         
6311         * report.cs (Report.Reset): Reset static data.
6312         
6313         * rootcontext.cs (RootContext.Reset): Reset static data.
6314         
6315         * tree.cs (RootTypes.ctor): Use Location.Null
6316         
6317         * typemanager.cs (TypeManager.Reset): Reset static data.
6318         (CoreLookupType): Removed Exit.
6319         (TypeHandle.Reset): Reset static data.
6320         
6321 2005-03-10  Raja R Harinath  <rharinath@novell.com>
6322
6323         Fix #73516.
6324         * typemanager.cs (ComputeNamespaces): Import namespaces from
6325         referenced modules too.
6326
6327 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6328
6329         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6330         than '.'.
6331
6332 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6333
6334         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6335         enclosing DeclSpace.  This ensures that a name-lookup populates
6336         more caches and there are fewer 'TypeExpression's.  Carve out
6337         nested type lookup into ...
6338         (LookupNestedTypeInHierarchy): ... this.
6339
6340 2005-04-15  Martin Baulig  <martin@ximian.com>
6341
6342         Merged r41590 from MCS and make it work in the generics land.
6343
6344         * generic.cs (TypeParameter.UpdateConstraints): Removed the
6345         `check' argument.
6346
6347         * class.cs (PartialContainer.UpdateConstraints): Removed.
6348         (PartialContainer.CheckConstraints): Removed.
6349         (PartialContainer.SetParameterInfo): Store the constraints here.
6350         (PartialContainer.DefineTypeParameters): New public method;
6351         resolve the type parameter's constraints here.  Note that the
6352         PartialContainer doesn't have an EmitContext anymore, so we must
6353         do this in the ClassPart.
6354
6355 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6356
6357         Clean up a few partial-class semantics.  
6358         Fixes test-357.cs and cs1618-2.cs.
6359         * cs-parser.jay (struct_declaration): Use 'current_class' as
6360         parent of newly-created struct.  Remove call to Register ().
6361         Use 'pop_current_class' to complete handing the current struct.
6362         (interface_declaration): Likewise.
6363         (class_declaration): Likewise.
6364         (enum_declaration): Use 'current_class' as parent of newly created
6365         enum.
6366         (delegate_declaration): Likewise.
6367         (pop_current_class): New function.  This is used to handle closing
6368         up the 'current_class' and 'current_container', and pointing them
6369         to the enclosing class/container.
6370         (CSharpParser): Initialize 'current_class' too.
6371         * decl.cs (MemberCore): Add check for invariant: a partial
6372         container is not a parsed entity, and thus does not enclose any
6373         parsed members.
6374         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6375         (DeclSpace.BaseTypeExpr): Use it.
6376         (DeclSpace.LookupType): Add check for invariant.
6377         * class.cs (TypeContainer): Add check for invariant: a nested
6378         class should have the same NamespaceEntry as its enclosing class.
6379         (TypeContainer.EmitFieldInitializers): Make virtual.
6380         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6381         MemberCore.
6382         (TypeContainer.Register): Remove.
6383         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6384         null.  Use TypeResolveEmitContext for resolving base types and
6385         interfaces.  Move initialization of Parts.TypeBuilder here from
6386         ...
6387         (TypeContainer.DefineNestedTypes): ... here.
6388         (PartialContainer): Take a Namespace not a NamespaceEntry.
6389         (PartialContainer.Create): Don't use Register.  Call the
6390         appropriate Add... function directly.
6391         (ClassPart): Take both the PartialContainer and the enclosing
6392         class as constructor arguments.
6393         (ClassPart.EmitFieldInitializers): Override.
6394         (ClassPart.PartFindNestedTypes): Remove.
6395         (FieldBase.GetInitializerExpression): Resolve the initializer
6396         expression in the emit context of the enclosing class.
6397         * tree.cs (RootTypes): Remove Register ().
6398         
6399 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
6400
6401         * cs-parser.jay: Removed CS0134.
6402         
6403         * driver.cs: Removed CS1901.
6404         
6405         * expression.cs (SizeOf.DoResolve): Don't report CS0233
6406         for predefined types.
6407
6408 2005-03-07  Duncan Mak  <duncan@novell.com>
6409
6410         * codegen.cs (Save):  Catch UnauthorizedAccessException as
6411         well. Fixes bug #73454.
6412
6413 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
6414
6415         * cs-tokenizer.cs (xtoken): Add CS1035.
6416         
6417         * class.cs (MethodData.Define): Add CS0683.
6418         (FieldMember.ctor): Add CS0681.
6419
6420 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6421
6422         * ecore.cs (SimpleName.DoResolve): Rename from
6423         SimpleName.DoResolveAllowStatic.
6424         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6425         Pass 'intermediate' flag to MemberStaticCheck.
6426         (SimpleName.MemberStaticCheck): Skip "static check" only in case
6427         of "intermediate" lookups via MemberAccess.
6428         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
6429         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6430
6431 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6432
6433         Fix #73394.
6434         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6435         slipped in because of variable names that are identical to a
6436         builtin type's BCL equivalent ('string String;', 'int Int32;').
6437         (PropertyExpr.EmitInstance): Likewise.
6438
6439 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
6440
6441         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6442         
6443         * report.cs (warning_ignore_table): Made public.
6444
6445 2005-03-04  Raja R Harinath  <rharinath@novell.com>
6446
6447         Fix #73282.
6448         * class.cs (MethodData.Emit): Pass 'container' to
6449         container.GetObsoleteAttribute instead of 'container.Parent'.
6450
6451 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
6452
6453         * cs-parser.jay: Add 1534 error test.
6454
6455         * iterators.cs (Yield.CheckContext): Add error 1629.
6456         (Iterator.ctor): Save unsafe modifier.
6457         (MoveNextMethod.DoEmit): Restore unsafe context.
6458
6459         * namespace.cs (UsingAlias): Better error message.
6460
6461 2005-03-03  Dan Winship  <danw@novell.com>
6462
6463         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6464         the warning message [#73219]
6465
6466 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6467
6468         Fix compile with MCS 1.0.0.0.
6469         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6470         w_restore to not depend on string constant folding.
6471
6472 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6473
6474         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
6475         CS0246 check to users who passed 'silent = false'.
6476         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6477         check.
6478         (SimpleName.SimpleNameResolve): Update.
6479         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6480         (MemberAccess.IdenticalNameAndTypeName): Update.
6481         * doc.cs (FindDocumentedTypeNonArray): Update.
6482
6483 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
6484
6485         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6486         * parameters.cs (ComputeAndDefineParameters): Remove.
6487         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6488         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6489         Use GetParameterInfo.
6490
6491 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
6492
6493         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6494
6495 2005-03-02  Raja R Harinath  <rharinath@novell.com>
6496
6497         Unify DeclSpace.LookupType and DeclSpace.FindType.
6498         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
6499         is in charge of defining nested types on demand.
6500         (DeclSpace.LookupType): Use it when the current_type is a
6501         TypeBuilder.  Use LookupTypeDirect for reflected types.
6502         (DeclSpace.FindType): Remove.
6503         (DeclSpace.LookupInterfaceOrClass): Likewise.
6504         (DeclSpace.DefineTypeAndParents): Likewise.
6505         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6506         DeclSpace.LookupType.
6507         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6508         * typemanager.cs (LookupType): Simplify.
6509         (AddUserType): Remove type from negative_hits.
6510         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6511         * class.cs (TypeContainer.FindMembers): Move handling of nested
6512         types ...
6513         (TypeContainer.FindMembers_NestedTypes): ... here.
6514         (TypeContainer.FindNestedType): Implement override.
6515         (ClassPart.FindNestedType): Delegate to PartialContainer.
6516         (ClassPart.PartFindNestedType): Looks up the nested types of the
6517         part alone.
6518
6519 2005-04-14  Martin Baulig  <martin@ximian.com>
6520
6521         * generic.cs (ConstructedType): Moved all the type lookup and
6522         nested class logic into SimpleName.
6523         (ConstructedType.ResolveConstructedType): Our underlying type is
6524         already fully resolved; all the type lookup stuff is in
6525         SimpleName.
6526
6527         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
6528         constructed types here instead of in ConstructedType.
6529
6530         * decl.cs (MemberName.GetTypeExpression): Always create a
6531         SimpleName, not a ConstructedType.
6532         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
6533
6534 2005-03-02  Martin Baulig  <martin@ximian.com>
6535
6536         * class.cs (TypeContainer.DoDefineMembers): We also need a default
6537         static constructor in static classes.
6538
6539 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
6540
6541         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6542         sizeParamIndex is not specified.
6543
6544 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
6545
6546         Fix #73117
6547         * report.cs (WarningMessage.IsEnabled): Missing null check.
6548
6549 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6550
6551         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6552         in the fields and not in the properties.
6553
6554 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
6555
6556         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
6557         fields as well.
6558
6559 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6560
6561         * attribute.cs: Small refactoring (improved robustness).
6562         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6563         (ValidateGuid): Removed.
6564         (Resolve): Removed referenced to above mentioned.
6565         (GetAttributeUsage): Made private and changed to work without
6566         class assistance.
6567         (GetIndexerAttributeValue): Don't crash.
6568         (GetConditionalAttributeValue): Ditto.
6569         (GetClsCompliantAttributeValue): Ditto.
6570         (ExtractSecurityPermissionSet): All attributes exceptions are
6571         error 648.
6572         (GetPropertyValue): New helper.
6573         (GetMethodImplOptions): New method.
6574         (DefinePInvokeMethod): Reuse common code. Implemented handling of
6575         some missing properties.
6576         
6577         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6578         (Method.ApplyAttributeBuilder): Updated.
6579         
6580         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6581         exception.
6582
6583 2005-02-28  Raja R Harinath  <rharinath@novell.com>
6584
6585         Fix #73052.
6586         * report.cs (Report.SymbolRelatedToPreviousError): Handle
6587         non-simple types (array, pointer, reference).
6588
6589 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6590
6591         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6592
6593         * class.cs (MethodCore.IsDuplicateImplementation): Special error
6594         for operators.
6595         (Method.CheckBase): Catch wrong destructor here.
6596         (MethodData.Define): Add errors 550, 668.
6597
6598         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6599
6600         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6601
6602         * pending.cs (VerifyPendingMethods): Add error 551.
6603
6604         * typemanager.cs (CSharpName): Next error report helper.
6605
6606 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
6607
6608         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6609         attributes. Removed useless attribute double check.
6610         It saves almost 2MBs for corlib.
6611
6612 2005-02-25  Raja R Harinath  <rharinath@novell.com>
6613
6614         Fix #72924.
6615         * statement.cs (ExpressionStatement.Resolve): Make robust to being
6616         called twice in case of error.
6617
6618 2005-02-23  Chris Toshok  <toshok@ximian.com>
6619
6620         Fix compiler portions of #72827.
6621         * statement.cs (Block.Emit): call Begin/EndScope on the
6622         EmitContext instead of the ILGenerator.
6623
6624         * codegen.cs (EmitContext.BeginScope): new method, call
6625         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6626         we have one.)
6627         (EmitContext.BeginScope): same, but EndScope and CloseScope
6628
6629         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6630         offset and call the superclass's OpenScope(int) with it.
6631         (SymbolWriter.CloseScope): get the current il
6632         offset and call superclass's CloseScope(int) with it.
6633
6634 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
6635
6636         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6637         CS1677 for out and ref as well.
6638
6639         * class.cs (Method.Define): Add error CS1599 detection.
6640         
6641         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6642         
6643         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6644         
6645         * delegate.cs (Delegate.Define): Add error CS1599 detection.
6646         
6647         * support.cs.cs (ModifierDesc): New helper method.
6648
6649 2005-02-23  Raja R Harinath  <rharinath@novell.com>
6650             Abin Thomas  <projectmonokochi@rediffmail.com>
6651             Anoob V E  <projectmonokochi@rediffmail.com>
6652             Harilal P R  <projectmonokochi@rediffmail.com>
6653
6654         Fix #57851, #72718.
6655         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6656         MemberLookup (used for error reporting) actually returns a result.
6657         Fix error report number (122, not 112).
6658
6659 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
6660             Anoob V E  <projectmonokochi@rediffmail.com>
6661             Harilal P R  <projectmonokochi@rediffmail.com>
6662
6663         Fix #71134.
6664         * pending.cs (PendingImplementation.GetAbstractMethods):
6665         Find NonPublic members too.
6666
6667 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
6668
6669         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6670         Fixed error 217.
6671         
6672         * class.cs (MethodCore.CheckMethodAgainstBase):
6673         Add error 239 report.
6674
6675 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6676
6677         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6678         
6679         * class.cs (Operator.Define): Add error 217 report.
6680         
6681 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6682
6683         Fix #68955.
6684         * expression.cs (Invocation.IsApplicable): Make public.
6685         (Invocation.IsParamsMethodApplicable): Likewise.
6686         * delegate.cs (Delegate.VerifyApplicability): Don't use
6687         Invocation.VerifyArgumentCompat for parameter applicability
6688         testing.  Use Invocation.IsApplicable and
6689         Invocation.IsParamsMethodApplicable.
6690
6691 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6692
6693         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6694         
6695         * class.cs (Operator.Define): Add error 217 report.
6696         
6697 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6698
6699         * namespace.cs (UsingEntry.Resolve): Undo change below.
6700
6701 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6702
6703         Fix #72756.
6704         * ecore.cs (Expression.MemberLookupFailed): Add argument to
6705         disable the error message when the extended MemberLookup also
6706         fails.
6707         (Expression.MemberLookupFinal): Update.
6708         (SimpleName.DoSimpleNameResolve): Update.
6709         * expression.cs (MemberAccess.ResolveNamespaceOrType):
6710         Don't use MemberLookupFinal.
6711         (New.DoResolve): Update.
6712         (BaseAccess.CommonResolve): Update.
6713
6714 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6715
6716         Fix #72732.
6717         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6718         occured previously, don't resolve again.
6719
6720 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6721
6722         Fix #69949
6723         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6724         argument. Call ResolveAttributeUsage for unresolved.
6725         when types doesn't match ctor arguments.
6726         
6727         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6728         for nested attribute classes.
6729         (Class.attribute_usage): Removed.
6730         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6731         for attribute class.
6732         
6733         * ecore.cs (IsAttribute): Removed.
6734         
6735         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6736         
6737         * rootcontext.cs (RegisterAttribute): Removed, attributes are
6738         now normal types.
6739         (attribute_types): Removed.
6740         (EmitCode): Global attributes are emited as the latest.
6741
6742 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
6743
6744         * class.cs (EmitFieldInitializers): Don't emit field initializer
6745         for default values when optimilization is on.
6746         
6747         * constant.cs (Constant.IsDefaultValue): New property.
6748         
6749         * driver.cs: Add /optimize handling.
6750         
6751         * constant.cs,
6752         * ecore.cs,
6753         * literal.cs: Implement new IsDefaultValue property.
6754         
6755         * rootcontext.cs (Optimize): New field, holds /optimize option.
6756
6757 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6758
6759         Fix crasher in re-opened #72347.
6760         * namespace.cs (Namespace.Lookup): Return null if
6761         DeclSpace.DefineType returns null.
6762
6763         Fix #72678.
6764         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6765
6766 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6767
6768         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
6769         now returns null if it cannot resolve to an lvalue.
6770         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6771         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6772         returned null.  Remove check for SimpleName.
6773         (EventExpr.DoResolveLValue): New.
6774         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6775         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
6776         error from ...
6777         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
6778         avoid CS0131 error.
6779         (Unary.ResolveOperator): Move CS0211 check ...
6780         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
6781         CS0131 error.
6782         (Unary.DoResolveLValue): Simplify.
6783         (AddressOf.DoResolveLValue): New.
6784         (ArrayAccess.DoResolveLValue): New.
6785
6786 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
6787
6788         * attribute.cs (Attribute.Resolve): Add arguments casting for
6789         when types doesn't match ctor arguments.
6790
6791 2005-02-16  Raja R Harinath  <rharinath@novell.com>
6792
6793         Fix parts of #63202.
6794         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6795         lookup of operator in base type.  Ensure that all checks happen
6796         when the operator resolves to an "op_..." method.
6797
6798 2005-02-15  Raja R Harinath  <rharinath@novell.com>
6799
6800         Fix #71992.
6801         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6802         'ignore_cs0104' parameter.  Pass it to ...
6803         (NamespaceEntry.Lookup): ... this.
6804         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6805         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6806         (TypeLookupExpression.DoResolveAsTypeStep): Update.
6807         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6808         Update.  Request that cs0104 errors be ignored.
6809         (ComposedCast.ResolveAsTypeStep): Update.
6810
6811 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6812
6813         Fix #59209.
6814         * expression.cs (Invocation.BetterFunction): Remove support for
6815         comparing virtual functions and their overrides.
6816         (Invocation.IsOverride): New.
6817         (Invocation.OverloadResolve): Don't consider 'override' functions
6818         during candidate selection.  Store them in a lookaside list.
6819         If the selected method is a 'virtual' function, use the list to
6820         find any overrides that are closer to the LHS type.
6821
6822 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
6823
6824         * expression.cs (New.DoResolve): Add complex core type reduction.
6825         (New.Constantify): Converts complex core type syntax like 'new int ()'
6826         to simple constant.
6827         
6828 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6829
6830         * decl.cs (EntryType.EntryType): New constructor to create an
6831         updated copy of a cache entry.
6832         (MemberCache.AddMethods): Use it.
6833         (MemberCache.ClearDeclaredOnly): Remove.
6834         (MemberCache.MemberCache): Update.
6835
6836 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6837
6838         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6839         variable.  This one is represents the actual low-level declaration
6840         of the method, as opposed to the semantic level `IsStatic'.   
6841
6842         An anonymous method which is hosted into a static method might be
6843         actually an instance method.  IsStatic would reflect the
6844         container, while MethodIsStatic represents the actual code
6845         generated.
6846
6847         * expression.cs (ParameterReference): Use the new MethodIsStatic
6848         instead of IsStatic.
6849
6850         * anonymous.cs (AnonymousMethod.Compatible): Pass the
6851         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6852         set on the current EmitContext. 
6853
6854         * expression.cs (Cast): Overload DoResolveLValue so we can pass
6855         resolve our casted expression as an LValue.  This triggers the
6856         proper LValue processing that is later required by Assign.
6857
6858         This fixes 72347.
6859
6860         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6861
6862 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
6863
6864         C# 2.0 Fixed buffer implementation
6865
6866         * anonymous.cs: Update after RegisterHelperClass renaming.
6867
6868         * attribute.cs (AttributeTester.fixed_buffer_cache):
6869         Cache of external fixed buffers.
6870         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6871         implementation if field is fixed buffer else null.
6872
6873         * class.cs
6874         (TypeContainer.AddField): Accept FieldMember instead of Field.
6875         (FieldBase.IsFieldClsCompliant): Extracted code from
6876         VerifyClsCompliance descendant customization.
6877         (FixedField): New class handles fixed buffer fields.
6878         (FixedFieldExternal): Keeps information about imported fixed
6879         buffer.
6880         (IFixedField): Make access to internal or external fixed buffer
6881         same.
6882
6883         * cs-parser.jay: Add fixed buffer parsing.
6884
6885         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6886         buffer.
6887
6888         * expression.cs (Indirection): Extended implementation to accept
6889         fixed buffer field.
6890         (PointerArithmetic.Emit): Get element from fixed buffer as well.
6891         (ElementAccess.MakePointerAccess): Get type as parameter.
6892         (DoResolve): Add fixed buffer field expression conversion.
6893         (DoResolveLValue): Ditto.
6894         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6895         (ArrayPtr): Derives from FixedBufferPtr.
6896         (ArrayPtr.Emit): Add extra emit for array elements.
6897
6898         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6899
6900         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6901         for compiler generated types.
6902         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6903
6904         * statement.cs (Fixed): Refactored to be easier add fixed buffer
6905         and consume less memory.
6906         (Fixed.Resolve): Add fixed buffer case.
6907
6908         * typemanager.cs (compiler_generated_attr_ctor,
6909         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6910         (HasElementType): Add our own implementation to work on every
6911         runtime.
6912
6913 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6914
6915         * anonymous.cs (CaptureContext): Track whether `this' has been
6916         referenced.   
6917
6918         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
6919         only captured `this' if it was implicitly done (instance
6920         methods/variables were used). 
6921
6922         * codegen.cs (EmitContext.CaptureThis): New method to flag that
6923         `this' must be captured.
6924
6925 2005-01-30  Miguel de Icaza  <miguel@novell.com>
6926  
6927         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6928         is null it means that there has been no need to capture anything,
6929         so we just create a sibling.
6930
6931         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6932
6933         Just a partial fix.  The other half is fairly elusive.
6934         
6935 2005-02-10  Raja R Harinath  <rharinath@novell.com>
6936
6937         Fix #52586, cs0121-4.cs.
6938         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
6939         and return a hashtable.
6940         (MemberCache.ClearDeclaredOnly): New.
6941         (MemberCache.MemberCache): Update to change.  Make a deep copy of
6942         the method_hash of a base type too.
6943         (MemberCache.AddMethods): Adapt to having a deep copy of the base
6944         type methods.  Overwrite entries with the same MethodHandle so
6945         that the ReflectedType is correct.  The process leaves in base
6946         virtual functions and their overrides as distinct entries.
6947         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
6948         matters since it was boxed in a ArrayList before.
6949         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6950         modifier.
6951         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
6952         case of a virtual function and its override (choose the overload
6953         as better).
6954         (Invocation.OverloadResolve): Avoid 'override' members during
6955         'applicable_type' calculation.
6956
6957 2005-03-28  Raja R Harinath  <rharinath@novell.com>
6958
6959         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6960         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6961         GetTypeHandle.  It is possible for a reflected type to derive from
6962         a TypeBuilder (e.g., int[] derives from the TypeBuilder
6963         System.Array during mscorlib compilation).
6964         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6965         contain a method_hash, don't create one either.  Don't create a
6966         deep copy of the base cache's method_hash.
6967         (MemberCache.SetupCache): Rename back from DeepCopy.
6968         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6969         already initialized.  If we see an override function, add its
6970         underlying base virtual function to the member_hash too.
6971
6972 2005-02-09  Raja R Harinath  <rharinath@novell.com>
6973
6974         Combine two near-redundant caches.
6975         * typemanager.cs (method_params): Rename from method_internal_params.
6976         (TypeManager.GetParameterData): New.  Replace
6977         Invocation.GetParameterData.
6978         (TypeManager.LookupParametersByBuilder): Remove.
6979         * expression.cs (Invocation.method_parameter_cache): Remove.
6980         (Invocation.GetParameterData): Remove.
6981         Update to changes.
6982         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6983         Update to changes.
6984
6985 2005-02-08  Raja R Harinath  <rharinath@novell.com>
6986
6987         Fix #72015.
6988         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6989         TypeManager.multicast_delegate_type is null, resolve it by looking
6990         up "System.MulticastDelegate".
6991         * rootcontext.cs (RootContext.ResolveCore): Simplify.
6992
6993 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
6994             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
6995             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
6996
6997         Fix cs0164.cs.
6998         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6999         (LabeledStatement.AddReference): New.  Set 'referenced'.
7000         (Goto.Resolve): Use it.
7001
7002 2005-02-05  John Luke  <john.luke@gmail.com>
7003
7004         * driver.cs: remove duplicate -doc line in Usage ()
7005
7006 2005-02-04  Raja R Harinath  <rharinath@novell.com>
7007
7008         * location.cs (Location.AddFile): Fix CS2002 error report.
7009
7010 2005-02-02  Martin Baulig  <martin@ximian.com>
7011
7012         * delegate.cs (Delegate.DefineType): Report an internal error if
7013         TypeManager.multicast_delegate_type is null.  See bug #72015 for
7014         details.        
7015
7016 2005-02-02  Raja R Harinath  <rharinath@novell.com>
7017
7018         Fix a crasher in a variant of #31984.
7019         * const.cs (Constant.CheckBase): New override that defers the
7020         new-or-override check in case the base type hasn't been populated
7021         yet.
7022         (Constant.Define): Ensure the new-or-override check is performed.
7023
7024 2005-02-01  Duncan Mak  <duncan@ximian.com>
7025
7026         * const.cs (LookupConstantValue): Check that `ce' is not null
7027         before calling GetValue ().
7028
7029 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7030
7031         Fix test-334.cs (#69519).
7032         * cs-parser.jay (using_alias_directive): Pass in an expression to
7033         NamespaceEntry.UsingAlias.
7034         (using_namespace_directive): Pass in an expression to
7035         NamespaceEntry.Using.
7036         (namespace_name): Don't flatten to a string.
7037         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
7038         (NamespaceEntry.AliasEntry.Resolve): Lookup using
7039         ResolveAsTypeStep.
7040         (NamespaceEntry.UsingEntry): Likewise.
7041         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
7042         changes.
7043         (NamespaceEntry.LookupForUsing): Remove.
7044         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
7045         names.
7046         (NamespaceEntry.Lookup): Remove support for dotted names.
7047
7048 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7049
7050         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
7051         split into two.
7052         (NamespaceEntry.ImplicitParent): Compute on demand.
7053         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
7054         parallels the current.
7055         (NamespaceEntry.LookupForUsing): Use it.
7056         (NamespaceEntry.Lookup): If the current namespace-entry is
7057         implicit, don't search aliases and using tables.
7058
7059 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7060
7061         Fix #31984.
7062         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
7063         BaseCache here.
7064         (TypeContainer.BaseCache): Compute on demand.
7065         (TypeContainer.FindMembers): Define constants and types if they're
7066         not already created.
7067         (FieldMember.Define): Move resetting of ec.InUnsafe before error
7068         check.
7069         * const.cs (Constant.Define): Make idempotent.
7070
7071 2005-01-29  Miguel de Icaza  <miguel@novell.com>
7072
7073         * pending.cs: Produce better code (no nops produced by using Ldarg
7074         + value).
7075         
7076         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7077         i - 1' it should be arg + 1.
7078
7079         Fixes bug #71819.
7080
7081 2005-01-28  Raja R Harinath  <rharinath@novell.com>
7082
7083         * attribute.cs (Attribute.CheckAttributeType): Make private
7084         non-virtual.
7085         (Attribute.ResolveType): Make virtual.
7086         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
7087         handling of RootContext.Tree.Types.
7088
7089 2005-01-27  Raja R Harinath  <rharinath@novell.com>
7090
7091         Update attribute-handling to use the SimpleName/MemberAccess
7092         mechanisms.
7093         * cs-parser.jay (attribute): Pass in an expression to the
7094         constructors of Attribute and GlobalAttribute.
7095         * attribute.cs (Attribute): Take an expression for the name.
7096         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
7097         passed in attribute name expression.
7098         (Attribute.CheckAttributeType): Use it.
7099         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
7100         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
7101         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
7102         argument to prevent error messages if the lookup fails.
7103
7104 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
7105
7106         * expression.cs (Indirection): Implemented IVariable interface
7107         to support indirection in AddressOf operator.
7108         (PointerArithmetic.Emit): Add optimalization for case where
7109         result can be precomputed.
7110
7111 2005-01-26  Martin Baulig  <martin@ximian.com>
7112
7113         * class.cs (TypeContainer.AttributeTargets): Return the correct
7114         AttributeTargets depending on our `Kind' instead of throwing an
7115         exception; fixes #71632.
7116
7117 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
7118
7119         Fix #71257
7120         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
7121         constant members.
7122
7123 2005-03-17  Martin Baulig  <martin@ximian.com>
7124
7125         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
7126         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
7127
7128 2005-03-17  Martin Baulig  <martin@ximian.com>
7129
7130         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
7131         to bool so we can return an error condition.
7132         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
7133         returned an error.
7134
7135 2005-03-17  Martin Baulig  <martin@ximian.com>
7136
7137         * generic.cs (TypeMananager.IsIEnumerable): New public method.
7138
7139         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
7140         converting from an array-type of T to `IEnumerable<T>'.
7141
7142 2005-03-16  Martin Baulig  <martin@ximian.com>
7143
7144         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
7145         (Nullable.LiftedUnaryMutator): New public class.
7146
7147         * expression.cs (UnaryMutator.DoResolve): Added support for
7148         Nullable Types.
7149
7150 2005-03-14  Martin Baulig  <martin@ximian.com>
7151
7152         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
7153
7154 2005-03-14  Martin Baulig  <martin@ximian.com>
7155
7156         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
7157         the comparision operators `<', `>', `<=' and `>='.
7158
7159 2005-03-13  Martin Baulig  <martin@ximian.com>
7160
7161         * generic.cs
7162         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
7163         avoid confusion with the `NullLiteral'.
7164         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
7165
7166 2005-03-13  Martin Baulig  <martin@ximian.com>
7167
7168         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
7169         comparing arbitrary types with the null literal.
7170
7171 2005-03-13  Martin Baulig  <martin@ximian.com>
7172
7173         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
7174         boolean operators '&&', '||', '&' and '|'.
7175         (Nullable.OperatorTrueOrFalse): New public class.
7176
7177         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
7178         instead of a `StaticCallExpr'; added support for nullables.
7179
7180 2005-03-10  Martin Baulig  <martin@ximian.com>
7181
7182         * expression.cs
7183         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
7184         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
7185
7186 2005-03-07  Martin Baulig  <martin@ximian.com>
7187
7188         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
7189         it work if `expr' is not an IMemoryLocation.
7190         (Nullable.Lifted): Implement IMemoryLocation.
7191         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
7192         target type.
7193
7194 2005-03-05  Martin Baulig  <martin@ximian.com>
7195
7196         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
7197         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
7198         (Nullable): Added support for lifted unary and binary operators.
7199
7200         * expression.cs (Unary.DoResolve): Added support for nullable types.
7201         (Binary.DoResolve): Likewise.
7202         (Conditional.DoResolve): Likewise.
7203
7204 2005-03-02  Martin Baulig  <martin@ximian.com>
7205
7206         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
7207
7208         * class.cs (ClassPart.SetParameterInfo): Override this.
7209         (PartialContainer.SetParameterInfo): Override this.
7210         (TypeContainer.CheckConstraints): New protected method.
7211         (PartialContainer.CheckConstraints): Override this and check
7212         whether the same contraints were specified in all parts of a
7213         partial generic type definition.
7214         (PartialContainer.UpdateConstraints): New public method.
7215
7216         * generic.cs (TypeParameter.UpdateConstraints): New public method.
7217
7218 2005-03-02  Martin Baulig  <martin@ximian.com>
7219
7220         Committing a patch from Carlos Alberto Cortez to fix #72887.
7221
7222         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
7223         casts from `T []' to `int []'.
7224
7225 2005-03-02  Martin Baulig  <martin@ximian.com>
7226
7227         * generic.cs (TypeManager.IsEqual): Make this symmetric.
7228
7229         * expression.cs (Binary.ResolveOperator): When resolving a
7230         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
7231         `=='.  Fixes #71866.  See gen-127.cs.
7232
7233 2005-03-02  Martin Baulig  <martin@ximian.com>
7234
7235         * class.cs (TypeContainer.DoDefineMembers): We also need a default
7236         static constructor in static classes.
7237
7238 2005-03-02  Martin Baulig  <martin@ximian.com>
7239
7240         * generic.cs
7241         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
7242         (Nullable.LiftedConversion): Added support for user-defined
7243         conversions.
7244
7245         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
7246
7247         * cs-parser.jay: Use ComposedCast everywhere instead of
7248         NullableType, so we don't need to check for NullableType
7249         everywhere.
7250         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
7251         case where we'll be resolved into a `parenthesized_expression_0'
7252         afterwards.
7253
7254         * convert.cs
7255         (Convert.UserDefinedConversion): Added nullable conversions.
7256
7257 2005-02-28  Martin Baulig  <martin@ximian.com>
7258
7259         * generic.cs (TypeManager.IsNullableType): New static method.
7260         (Nullable): New abstract class.
7261         (Nullable.NullLiteral): New public class.
7262         (Nullable.LiftedConversion): New public class.
7263
7264         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
7265         `builtin_types opt_nullable'.
7266
7267         * convert.cs
7268         (Convert.ImplicitConversionStandard): Added nullable conversions.
7269         (Convert.ExplicitConversionStandard): Likewise.
7270         (Convert.ExplicitConversion): Likewise.
7271
7272 2005-02-26  Martin Baulig  <martin@ximian.com>
7273
7274         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
7275         begin with a "?", for instance "?[]".  Don't do a type lookup if
7276         `dim' is empty.
7277
7278 2005-02-25  Martin Baulig  <martin@ximian.com>
7279
7280         The first part of Nullable Types :-)
7281
7282         * generic.cs (NullableType): New public class.
7283         (NullCoalescingOperator): New public class.
7284         (TypeArguments.Resolve): Add a CS0306 check.
7285
7286         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
7287         (opt_nullable): New rule.
7288         (type): Added `opt_nullable' to `namespace_or_type_name',
7289         `builtin_types' and `pointer_type'.
7290         (array_type): Added `opt_nullable'.
7291         (opt_rank_specifier_or_nullable): New rule; this is the
7292         combination of `opt_rank_specifier' and `opt_nullable'.
7293         (opt_error): New rule; catch errors here.
7294         (nullable_type_or_conditional): New rule; we use this to check for
7295         nullable and still detect the conditional operator.
7296         (local_variable_type): Use `opt_rank_specifier_or_nullable'
7297         instead `opt_rank_specifier'.
7298
7299         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
7300         for nullables.
7301
7302 2005-02-24  Martin Baulig  <martin@ximian.com>
7303
7304         * README, README.Changes: Removed; they're old and obsolete.
7305
7306 2005-02-22  Martin Baulig  <martin@ximian.com>
7307
7308         * generic.cs (TypeParameter.Resolve): If resolving the constraints
7309         returned an error, set `constraints' to null to avoid a crash
7310         later on.
7311         (TypeParameter.ResolveType): Likewise.
7312
7313 2005-02-22  Martin Baulig  <martin@ximian.com>
7314
7315         * generic.cs
7316         (Constraints.ResolveTypes): Protect against being called twice.
7317         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
7318         (TypeParameter.ResolveType): New public method; calls
7319         constraints.ResolveTypes().
7320         (TypeParameter.DefineType): Moved constraints.ResolveType() out
7321         into the new ResolveType().
7322         (GenericMethod.Define): Call ResolveType() on all our
7323         TypeParameter's.        
7324
7325 2005-02-21  Martin Baulig  <martin@ximian.com>
7326
7327         * generic.cs
7328         (TypeManager.generic_nullable_type): New static public field.
7329         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
7330
7331         * rootcontext.cs
7332         (RootContext.ResolveCore): Resolve "System.Nullable`1".
7333
7334 2005-02-15  Martin Baulig  <martin@ximian.com>
7335
7336         * generic.cs (ConstructedType.Constraints): Correctly check
7337         constraints if the argument type is a type parameter; fixes
7338         #72326. 
7339
7340 2005-02-02  Martin Baulig  <martin@ximian.com>
7341
7342         * delegate.cs (Delegate.DefineType): Report an internal error if
7343         TypeManager.multicast_delegate_type is null.  See bug #72015 for
7344         details.        
7345
7346 2005-01-29  Miguel de Icaza  <miguel@novell.com>
7347
7348         * pending.cs: Produce better code (no nops produced by using Ldarg
7349         + value).
7350         
7351         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7352         i - 1' it should be arg + 1.
7353
7354         Fixes bug #71819.
7355         
7356 2005-01-26  Martin Baulig  <martin@ximian.com>
7357
7358         * cs-parser.jay (indexer_declarator): Don't report an error if we
7359         have type parameters since we can be an explicit interface
7360         implementation; fixes #71449.
7361
7362 2005-01-26  Martin Baulig  <martin@ximian.com>
7363
7364         * class.cs (TypeContainer.AttributeTargets): Return the correct
7365         AttributeTargets depending on our `Kind' instead of throwing an
7366         exception; fixes #71632.
7367
7368 2005-01-26  Martin Baulig  <martin@ximian.com>
7369
7370         * delegate.cs (Delegate.DefineType): Correctly define our type
7371         parameters.  Fixes #71483.
7372
7373 2005-01-25  Raja R Harinath  <rharinath@novell.com>
7374
7375         Fix #71602.
7376         * expression.cs (MemberAccess.DoResolve): Don't complain with
7377         cs0572 when the LHS of a member access has identical name and type
7378         name.
7379
7380 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
7381
7382         Fix #71651, #71675
7383         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7384         CreatePermission.
7385         Create custom PermissionSet only for PermissionSetAttribute.
7386
7387 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
7388
7389         Fix #71649
7390         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7391         delegates in static class.
7392
7393 2005-01-24  Martin Baulig  <martin@ximian.com>
7394
7395         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7396         merging an implicit block, just use its reachability.
7397
7398         * statement.cs (Block.Resolve): Make the unreachable code check
7399         work wrt. implicit blocks; see test-337 from #63842.
7400
7401 2005-01-21  Alp Toker  <alp@atoker.com>
7402  
7403         * cs-parser.jay: destructor_declaration's container is PartialContainer
7404         not Class when partial types are used, so use Kind prop instead of
7405         'is'.
7406         
7407 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
7408
7409         * cs-parser.jay: Improve error reporting when an interface
7410         declares new types.
7411
7412 2005-01-20  Dick Porter  <dick@ximian.com>
7413
7414         * support.cs: SeekableStreamReader fix from Sandor Dobos
7415         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7416         chars are read.  Fixes bug 70369.
7417
7418 2005-01-20  Raja R Harinath  <rharinath@novell.com>
7419
7420         * cs-parser.jay (catch_clause): Simplify current_block handling
7421         somewhat.
7422
7423 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
7424
7425         * convert.cs (ImplicitStandardConversionExists): Synchronize the
7426         code with ImplicitStandardConversion to handle the implicit
7427         conversion of method groups into valid delegate invocations. 
7428
7429         The problem is that in parameter handling we were using this code
7430         path.  Fixes bug #64698
7431
7432 2005-01-19  Raja R Harinath  <rharinath@novell.com>
7433
7434         * cs-parser.jay: Fix several infelicities.
7435         - Avoid assigning to the parser value stack.  Code like 
7436           '$3 = null' is unclean.  Synthesize a value for the code block
7437           instead. 
7438         - Avoid using oob_stack for storing location information.  Use ...
7439         (_mark_): ... this.  New (empty) rule.  Saves the current location
7440         in $$.
7441         (foreach_statement): Avoid using oob_stack for current_block
7442         handling.  Use technique used in for_statement and
7443         using_statement.  Synthesize a value for the code block to store
7444         additional intermediate information.
7445
7446 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
7447
7448         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7449         of a different type is only allowed to private fields of a
7450         containing type, not on fields of a base class.
7451
7452         See test-174.cs and error cs0122-9.cs
7453
7454 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7455
7456         Fix test-335.cs (bug #58126).
7457         * cs-parser.jay (argument): Split out non-expression parts of the
7458         rule into 'non_simple_argument'.
7459         (invocation_expression): Support parenthesized invocations with
7460         multiple arguments, and with single non-simple arguments.
7461
7462 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7463
7464         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7465         places.
7466
7467 2005-01-12  Raja R Harinath  <rharinath@novell.com>
7468
7469         Fix cs0038-1.cs, cs1640-6.cs.
7470         * ecore.cs (Expression.Resolve): Remove special-case for
7471         SimpleName in error-handling.
7472         (Expression.almostMatchedMembers): Relax access permission to
7473         protected.
7474         (Expression.MemberLookupFailed): Handle duplicates in
7475         almostMatchedMembers list.
7476         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7477         * expression.cs (New.DoResolve): Report CS1540 for more cases.
7478         * typemanager.cs (GetFullNameSignature): Use the MethodBase
7479         overload if the passed in MemberInfo is a MethodBase.
7480
7481 2005-01-25  Martin Baulig  <martin@ximian.com>
7482
7483         * doc.cs
7484         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
7485
7486 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
7487
7488         Fix #70749
7489         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7490         for non-CAS & merge permission sets properly.
7491
7492 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7493
7494         Improve standard-compliance of simple name and member access 
7495         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
7496         * ecore.cs (FullNamedExpression): New abstract base class 
7497         for Namespaces and TypeExpressions.
7498         (ResolveFlags.SimpleName): Remove.
7499         (SimpleName): Remove support for dotted names.
7500         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
7501         DeclSpace.FindType and DeclSpace.LookupType.
7502         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7503         (Expression.ExprClassName): Make member function.
7504         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7505         a namespace.  Remove creation of dotted "SimpleName"s.
7506         (MemberAccess.DoResolve): Likewise.
7507         * decl.cs (DeclSpace.Cache): Make private.
7508         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7509         (DeclSpace.FindType): Update.
7510         (DeclSpace.LookupType): Move here from RootContext.  Return a 
7511         FullNamedExpression.
7512         * namespace.cs (Namespace): Derive from FullNamedExpression
7513         so that it can be part of expression resolution.
7514         (Namespace.Lookup): Return an FullNamedExpression.
7515         (NamespaceEntry.LookupAlias): Lookup aliases only in current
7516         namespace.
7517         * rootcontext.cs (NamespaceLookup): Remove.
7518         (LookupType): Move to DeclSpace.
7519         * attribute.cs (CheckAttributeType): Update.
7520         * doc.cs (FindDocumentedType): Remove allowAlias argument.
7521         (FindDocumentedTypeNonArray): Likewise.
7522
7523 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7524
7525         Fix cs0509.cs, cs1632.cs.
7526         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7527         is the same as IsInterface.
7528         (TypeContainer.GetClassBases): Likewise.
7529         * statement.cs (LabeledStatement.ig): New field.
7530         (LabeledStatement.LabelTarget): Save ILGenerator which created the
7531         label.
7532         (LabeledStatement.DoEmit): Check that the label was created with
7533         the same ILGenerator.
7534
7535 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7536
7537         Fix #71058
7538         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7539         accessors to its properties.
7540
7541         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
7542         from accessors to property.
7543         
7544 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7545
7546         Fix #70722
7547         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
7548         only for overrides.
7549         
7550 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
7551
7552         * attribute.cs: Check for null and empty strings.  
7553
7554         I have lost another battle to Paolo.
7555
7556 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
7557
7558         Fix #70942
7559         * class.cs (PropertyMethod): Set Parent field in ctors.
7560         (SetMethod.InternalParameters): Add unsafe switch hack.
7561         Override MarkForDuplicationCheck where it is appropriate.
7562
7563         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
7564         It says whether container allows members with the same name.
7565         Base default is no.
7566         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
7567         Removed is_method parameter.
7568
7569 2005-01-06  Duncan Mak  <duncan@ximian.com>
7570
7571         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
7572         because the previous change led to incorrect reporting of CS1032
7573         ("Cannot define/undefine preprocessor symbols after first token in
7574         file"). Instead of using `tokens_seen' as the only flag that
7575         triggers CS1040, introduce `comments_seen'. This new flag is used
7576         to signify having seen comments on the current line, so it is
7577         unset after a newline.
7578
7579 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7580
7581         * doc.cs : When searching for a type, find nested type too.
7582           This fixes bug #71040.
7583
7584 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7585
7586         * doc.cs :
7587           - Warn missing member comment on those classes which also does not
7588             have doc comments. Fixed bug #71041.
7589           - Don't warn missing doc comment on default constructor.
7590             Fixed bug #71042.
7591
7592 2005-01-06  Duncan Mak  <duncan@ximian.com>
7593
7594         * cs-tokenizer.cs (xtoken): After handling traditional C-style
7595         comments, set `tokens_seen' to true. This allows us to detect
7596         misplaced preprocessor directives (i.e. not at the beginning of
7597         the a line, nor after whitespaces). In that case, report error
7598         CS1040. This fixes bug #56460.
7599
7600         * cs-parser.jay (interface_member_declaration): Add checks for
7601         IsExplicitImpl, and report CS0541 error if an interface member is
7602         defined as an explicit interface declaration.
7603
7604 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
7605
7606         Fix #70817
7607         * class.cs (PropertyMethod): Set Parent field in ctors.
7608         (SetMethod.InternalParameters): Add unsafe switch hack.
7609         
7610         * decl.cs (MemberCore.Parent): Cannot be readonly.
7611
7612 2005-01-06  Raja R Harinath  <rharinath@novell.com>
7613
7614         * decl.cs (DeclSpace.ResolveType): Remove.
7615         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7616         Merge in code from ...
7617         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
7618         * class.cs, enum.cs: Update to changes.
7619
7620 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
7621
7622         * anonymous.cs: Ensure that we init the scope of our parent if it
7623         has not been initialized yet.
7624
7625 2004-12-30  Duncan Mak  <duncan@ximian.com>
7626
7627         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7628         if field.FieldBuilder is null. Fixes #70758.
7629
7630         * convert.cs: Fixed some typos and updated some of the comments.
7631         (ImplicitStandardConversionExists):
7632         (TryImplicitIntConversion): If `target_type' is an interface and
7633         the type of `ic' implements this interface, return true or a new
7634         BoxedCast instead of null. This fixes #70468.
7635
7636 2004-12-29  Duncan Mak  <duncan@ximian.com>
7637
7638         * expression.cs (Argument.Emit): Check that Expr is
7639         IMemoryLocation before casting to it, and report CS1510 otherwise.
7640
7641         This fixes #70402.
7642
7643 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
7644
7645         * statement.cs (Block.ThisVariable): remove the recursion here, to
7646         make the --profile more sane.
7647
7648 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
7649
7650         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7651         assembly, by JB Evain.
7652
7653 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7654
7655         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
7656           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7657         "parent" refers to enclosing type/class.  "base" refers to superclass.
7658
7659 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7660
7661         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7662         Ensure that we only have GlobalAttributes.
7663         * attribute.cs (Attribute.Emit): Make non-virtual.
7664         (GlobalAttribute.Emit): Remove.
7665         (Attribute.Resolve): Make virtual.
7666         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
7667         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7668         the argument. Don't create one.
7669         (Attribute.GetObsoleteAttribute): Likewise.
7670         (Attribute.GetClsCompliantAttributeValue): Likewise.
7671         * class.cs, decl.cs: Update to changes.
7672
7673 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
7674
7675         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7676         
7677         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7678         
7679         * statement.cs (Foreach.Resolve): Add error 186 report.
7680
7681 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
7682
7683         * expression.cs (Conditional.DoResolve): Add warning 429.
7684         
7685         * statement.cs (If.Resolve): Add warning 665.
7686
7687 2004-12-16  Raja R Harinath  <rharinath@novell.com>
7688
7689         New invariant: RootContext.Tree.Types.NamespaceEntry == null
7690         except when in the parser, and in GlobalAttribute.
7691         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7692         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7693         RootContext.Tree.Types.NamespaceEntry once work is done.
7694         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
7695         and resets RootContext.Tree.Types.NamespaceEntry.
7696
7697 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
7698
7699         * cs-parser.jay: Don't create a block for every variable.
7700
7701 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
7702
7703         * location.cs: Provide extra information.
7704
7705         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7706         variables from the captured environment, it is the ldarg_0.
7707
7708 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7709
7710         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7711         find a conclusion.
7712         
7713         * class.cs: Changed warning level for 169 to avoid developer
7714         displeasure from warning flooding. It will be changed back when they
7715         fix most of current BCL warnings.
7716         
7717         * RootContext.cs: Pushed default WarningLevel to 3.
7718         
7719         * statement.cs: Removed unused variable.
7720
7721 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7722
7723         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7724         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7725         Add error 502 report.
7726         (StaticClass.DefineType): Add error 441 report.
7727         (Class.AllowedModifiersProp): New virtual property as temporary
7728         extension to AllowedModifiers.
7729         (Class.DefineType): Add error 418 report. Moved ModFlags check here
7730         to share implementation with StaticClass and don't call virtual
7731         methods from ctor.
7732         
7733         * driver.cs (MainDriver): Add error 1558 test.
7734
7735         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7736         report. Moved error 36 test here.
7737
7738         * statement.cs (Throw.Resolve): Add error 724 report.
7739
7740         * typemanager.cs: Add out_attribute_type core type.
7741         
7742 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
7743
7744         * class.cs (TypeContainer.VerifyClsCompliance): Add error
7745         3018 report.
7746         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7747
7748         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7749         3017 report.
7750         
7751         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7752
7753         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
7754         Add error 3023 report.
7755         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7756
7757         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7758         implementation.
7759
7760 2004-12-12  John Luke  <john.luke@gmail.com>
7761
7762         * driver.cs (AddArgs): take -- into account when
7763         adding arguments, fixes bug 65710 
7764
7765 2004-12-12  Martin Baulig  <martin@ximian.com>
7766
7767         * expression.cs (Unary.TryReduceNegative): Added support for
7768         SByteConstant and ByteConstant.
7769         (Unary.Reduce): Check error values from TryReduceNegative().
7770
7771 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
7772
7773         * attributes.cs (Attribute.Resolve): Avoid multiple error report
7774         and report exception as error 182.
7775
7776 2004-12-10  Raja R Harinath  <rharinath@novell.com>
7777
7778         * driver.cs (Main): Fix message when there are warnings.
7779
7780 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
7781
7782         * delegate.cs: Fixed my fix from yesterday, sorry about that.
7783
7784 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
7785
7786         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
7787         Reduced number of warnings.
7788         
7789         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7790
7791 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
7792
7793         * driver.cs: Removed message.
7794
7795         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7796
7797 2004-12-08    <vargaz@freemail.hu>
7798
7799         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7800
7801 2004-12-08  Martin Baulig  <martin@ximian.com>
7802
7803         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7804         instead of a CS3002 for properties and indexer.
7805
7806 2004-12-08  Martin Baulig  <martin@ximian.com>
7807
7808         * decl.cs (MemberName.ToString): Make this work again.
7809
7810 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
7811
7812         * attribute.cs (Resolve): Add error 591 detection.
7813
7814         * class.cs (FieldMember.Define): Add error 1547 detection.
7815         (Indexer.Define): Add error 620 detection.
7816         (Operator.Define): Add error 590 detection.
7817
7818         * ecore.cs: Missing argument for error 79.
7819
7820         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7821         detection.
7822
7823 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
7824
7825         Fix #70106
7826         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7827         only.
7828
7829 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7830
7831         * cs-parser.jay : handle doc comments on implicit/explicit operators.
7832           Some operator comments were suppressed.
7833         * doc.cs : Implicit/explicit operator name in doc comments are like
7834           "op_Explicit(type)~returnType", so added suffix handling.
7835
7836 2005-01-21  Alp Toker  <alp@atoker.com>
7837
7838         * cs-parser.jay: destructor_declaration's container is PartialContainer
7839         not Class when partial types are used, so use Kind prop instead of 'is'.
7840
7841 2004-12-12  Martin Baulig  <martin@ximian.com>
7842
7843         * expression.cs (Unary.TryReduceNegative): Added support for
7844         SByteConstant and ByteConstant.
7845         (Unary.Reduce): Check error values from TryReduceNegative().
7846
7847 2004-12-11  Martin Baulig  <martin@ximian.com>
7848
7849         * support.cs (ReflectionParameters.ParameterName): If we have a
7850         `gpd', call `ParameterName' on it.
7851
7852         * parameter.cs (Parameter.GetParameterAttributes): New static method.
7853
7854         * pending.cs (PendingImplementation.DefineProxy): Call
7855         DefineParameter() for all of the MethodBuilder's arguments.
7856
7857 2004-12-09  Martin Baulig  <martin@ximian.com>
7858
7859         * doc.cs (DocUtil): Make this a static class.
7860
7861 2004-12-09  Martin Baulig  <martin@ximian.com>
7862
7863         * expression.cs (Invocation.InferType): Moved the type inference
7864         implementation into TypeManager.
7865
7866         * generics.cs (TypeManager): Moved the type inference
7867         implementation here.
7868
7869 2004-12-09  Martin Baulig  <martin@ximian.com>
7870
7871         * typemanager.cs (TypeManager): Make this a partial class.
7872
7873         * generics.cs
7874         (TypeManager): Move the generics part of `TypeManager' here.
7875
7876 2004-12-08  Martin Baulig  <martin@ximian.com>
7877
7878         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7879         instead of a CS3002 for properties and indexer.  Added CS3024
7880         check for generic interfaces.
7881
7882         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
7883         instances are not CLS-compliant.
7884
7885 2004-12-08  Martin Baulig  <martin@ximian.com>
7886
7887         * cs-parser.jay
7888         (void_pointer_expression): New rule for `void*', `void**' etc.
7889         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
7890
7891 2004-12-08  Martin Baulig  <martin@ximian.com>
7892
7893         * expression.cs (Invocation.InferType): Removed the hack for
7894         MethodCore.MayUnify().  
7895
7896         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
7897         this actually work.
7898
7899         * class.cs (MethodCore.MayUnify): Use
7900         TypeManager.MayBecomeEqualGenericTypes().       
7901
7902 2004-12-08  Martin Baulig  <martin@ximian.com>
7903
7904         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
7905         parameter, box it.  Fixes #69233.
7906
7907 2004-12-08  Martin Baulig  <martin@ximian.com>
7908
7909         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
7910         have the ctor constraint.  Fixes #68326.
7911
7912 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7913
7914         * cs-parser.jay : interface comment was not consumed because of
7915           extra opt_semicolon before doc handling.
7916
7917 2004-12-03  Raja R Harinath  <rharinath@novell.com>
7918
7919         Fix test-327.cs, test-328.cs, and put in early infrastructure
7920         for eventually fixing #52697.
7921         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7922         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7923         from other methods.
7924         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7925         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7926         (VerifyUsing, error246): Update.
7927         * rootcontext.cs (RootContext.NamespaceLookup): Just use
7928         'NamespaceEntry.LookupNamespaceOrType'.
7929
7930 2004-12-07  Martin Baulig  <martin@ximian.com>
7931
7932         * driver.cs: Call it "BETA SOFTWARE" :-)
7933
7934 2004-12-06  Raja R Harinath  <rharinath@novell.com>
7935
7936         Fix crash on cs0657-17.cs.
7937         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7938         Use RootContext.Tree.Types, not 'new RootTypes ()'.
7939         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7940         the case where the NamespaceEntry gets overwritten.
7941
7942 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
7943
7944         Fixed #69195, #56821
7945         * ecore.cs (ResolveBoolean): Tiny refactoring.
7946
7947         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7948         of right expression resolving when left is false constant and
7949         operator is LogicalAnd OR true constant and operator is LogicalOr.
7950
7951         * statement.cs (ResolveUnreachable): Always reports warning.
7952
7953 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
7954
7955         * class.cs: Distinguish between 1721 and 1722 (just a little help
7956         for the programmer).
7957
7958 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
7959
7960         * delegate.cs: Only allow this on new versions of the language. 
7961
7962 2004-12-02  Duncan Mak  <duncan@ximian.com>
7963
7964         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7965         Expression class.
7966         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7967         here as a static method. Take an additional bool out parameter
7968         `must_do_cs1540_check' for signaling to InstanceResolve.
7969         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7970         member field from PropertyExpr class and made it an argument of
7971         the method instead.
7972         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7973         check for MarshalByRefObject, and report CS0122 instead of CS1540.
7974         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7975         and `remove_accessor' as well as InstanceResolve: report CS0122
7976         where applicable.
7977
7978         Fixes #70129.
7979
7980 2004-12-07  Martin Baulig  <martin@ximian.com>
7981
7982         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
7983         and CS0692 where appropriate.
7984
7985 2004-12-06  Martin Baulig  <martin@ximian.com>
7986
7987         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
7988         IsDuplicateImplementation() and improved it.
7989
7990         * expression.cs (Invocation.InferTypeArguments): Added
7991         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
7992         and removed the "ref" modifier from `infered_types'.
7993
7994         * decl.cs (MemberName.ToString): Removed the exception.
7995
7996 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
7997
7998         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7999           comments are allowed.
8000
8001 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8002
8003         * delegate.cs: Add checks for subtypes in paramaters and return values
8004         in VerifyMethod () to add support for Covariance/Contravariance
8005         in delegates.
8006         
8007 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
8008
8009         * report.cs: Remove extra closing parenthesis.
8010
8011         * convert.cs (Error_CannotImplicitConversion): If the name of the
8012         types are the same, provide some extra information.
8013
8014 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
8015
8016         Fix bug #70102
8017         * attribute.cs (Resolve): Improved implementation of params
8018         attribute arguments.
8019
8020         * support.cs (ParameterData): Add HasParams to be faster.
8021
8022 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
8023
8024         all things are for /doc support:
8025
8026         * doc.cs: new file that supports XML documentation generation.
8027         * mcs.exe.sources: added doc.cs.
8028         * driver.cs:
8029           Handle /doc command line option.
8030           Report error 2006 instead of 5 for missing file name for /doc.
8031           Generate XML documentation when required, after type resolution.
8032         * cs-tokenizer.cs:
8033           Added support for picking up documentation (/// and /** ... */),
8034           including a new XmlCommentState enumeration.
8035         * cs-parser.jay:
8036           Added lines to fill Documentation element for field, constant,
8037           property, indexer, method, constructor, destructor, operator, event
8038           and class, struct, interface, delegate, enum.
8039           Added lines to warn incorrect comment.
8040         * rootcontext.cs :
8041           Added Documentation field (passed only when /doc was specified).
8042         * decl.cs:
8043           Added DocComment, DocCommentHeader, GenerateDocComment() and
8044           OnGenerateDocComment() and some supporting private members for
8045           /doc feature to MemberCore.
8046         * class.cs:
8047           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
8048         * delegate.cs:
8049           Added overriden DocCommentHeader.
8050         * enum.cs:
8051           Added overriden DocCommentHeader and GenerateDocComment().
8052
8053 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
8054
8055         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
8056         unwrapping the enumeration values, chain to
8057         DoConstantNumericPromotions again, so we can promote things to the
8058         fundamental types (takes care of enums that are bytes, sbytes).
8059
8060         Fixes bug #62054.
8061
8062 2004-12-01  Raja R Harinath  <rharinath@novell.com>
8063
8064         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
8065         Fix long-standing bug in type-lookup.  Use FindType instead of
8066         LookupType when ec.ResolvingTypeTree.
8067         (Attribute.ResolveType, Attribute.Resolve)
8068         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
8069         Update to changes.
8070         (Attributes.Search): Remove internal version.  Update.
8071         (Attributes.SearchMulti): Update.
8072         (Attributes.GetClsCompliantAttribute): Remove.
8073         (Attributes.GetIndexerNameAttribute): Remove.
8074         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
8075         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
8076         * class.cs (Indexer.Define): Likewise.
8077
8078 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
8079
8080         Fix bug #68790
8081         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
8082         MarshallByReference members access.
8083
8084         * expression.cs: Use CheckMarshallByRefAccess;
8085         Better error CS0197 message.
8086
8087         * report.cs: Print whole related error message.
8088
8089 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8090
8091         * class (GetClassBases): Better error 60 report.
8092         (EventProperty): Disabled warning 67 detection.
8093
8094 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8095
8096         Fix bug #60324
8097         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
8098
8099         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
8100         precise values.
8101
8102 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8103
8104         Fix bug #49488
8105         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
8106
8107         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
8108
8109 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
8110
8111         * attribute.cs (Attribute.Resolve): Refine error reporting and
8112         report a cs0117 if the identifier does not exist, to distinguish
8113         from 0617 which is a miss-use of the actual identifier.
8114
8115         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
8116         between cs0070 and cs0079.
8117
8118         * class.cs (MemberBase.DoDefine): When reporting a wrong
8119         accessibility level, we use MethodCore to compare instead of
8120         Method (this was a regression in some refactoring effort).
8121
8122         So now we correctly report cs0056 again.
8123
8124         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
8125         testing the target_type (which was known to be object_type) and
8126         not the source type (which is anonymous_method).
8127
8128         Fixed reporting of error cs1660.
8129
8130         * expression.cs (UserCast.Source): Expose the underlying cast.
8131
8132         * statement.cs (Switch.SwitchGoverningType): Sort the list of
8133         allowed types to find a match to int32 first (most common).
8134
8135         In addition, it ignores any ImplicitUserConversions that did an
8136         internal implicit conversion (as the switch statement allows only
8137         one integral conversion to exist).
8138
8139         * class.cs (PartialContainer.Create): rename `name' to
8140         `member_name' for clarity.  Then replace the string calls with a
8141         call to MemberName.GetPartialName, as now using
8142         MemberName.ToString is an error (this is due to the side effects
8143         it had, that were fixed in the past).
8144
8145         This will restore the error reporting on a number of partial class
8146         errors that were missusing this (and getting an exception as a
8147         results, which is now just a plain textual warning, because
8148         yyparse debug output would crash otherwise).
8149
8150 2004-11-26  Raja R Harinath  <rharinath@novell.com>
8151
8152         * Makefile (PROGRAM_INSTALL_DIR): Remove.
8153
8154 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
8155
8156         * rootcontext.cs (LookupType): Make sure to cache lookups that
8157         don't give us a negative result. This saves about 5% of corlib
8158         compilation time.
8159
8160 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8161
8162         * report.cs (AbstractMessage.Print): messages are sent to stderr
8163
8164         * class.cs (TypeContainer.GetClassBases): It is an error to have a
8165         non-interface in the list of interfaces (at this point, either
8166         parent was properly set, or a base class is being listed in the
8167         interfaces section).
8168
8169         This flags error 1722, and resolves the crash from bug 69259.
8170
8171 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
8172
8173         * statement.cs (Using.EmitExpressionFinally): make this work right
8174         for valuetypes. Fixes 69926.
8175
8176 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8177
8178         * const.cs (Const.ChangeType): Cope with the "0 literal can be
8179         converted to an enum" here, before we try to change the underlying
8180         type.  This code exists, but it is a different code path than the
8181         one used while encoding constants.
8182
8183         (ImplicitReferenceConversionExists): In addition, resynchronized
8184         the code here, so it matches the same code in
8185         ImplicitReferenceConversionExists for the `from any class-type S
8186         to any interface-type T'.       
8187
8188 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
8189
8190         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
8191
8192 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
8193
8194         * cs-parser.jay: Use verbosity accordingly. 
8195
8196 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8197
8198         * expression.cs (Unary.ResolveOperator): Do not report warning;
8199         AddressOf reads from variable.
8200         
8201         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
8202
8203 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8204
8205         Fix bug #69462
8206
8207         * attribute.cs (Attributable): Removed CheckTargets.
8208         (Attributes.Emit): Explicit attribute targets are tested here.
8209
8210         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
8211         not enabled for interfaces.
8212
8213         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
8214         (GetAssemblyName): Ouch next bug there.
8215
8216 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8217
8218         * expression.cs: Error 275 added.
8219         
8220 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
8221
8222         Fix bug #69177 (Implemented decimal constant support)
8223
8224         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
8225         (BinaryFold): Add DecimalConstant.
8226
8227         * const.cs (Define): Decimal constant 
8228         (is not constant.
8229         (ChangeType): Add decimal type handling.
8230         (LookupConstantValue): Don't set value for decimal type but
8231         emit DecimalConstantAttribute. Needed for constant optimization.
8232
8233         * constant.cs (ToDecimal): New method.
8234         (ConvertToDecimal): New method.
8235         (IntConstant): Implemented ConvertToDecimal.
8236         (DecimalConstant.Emit): Emit optimized version for decimals in
8237         int range.
8238
8239         * expression.cs (ResolveOperator): Changed order of constant
8240         reduction to work correctly with native types which have
8241         overloaded operators.
8242         (ResolveMemberAccess): Extract constant value from attribute
8243         for decimal type.
8244
8245         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8246
8247         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8248         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8249         (ChangeType): Decimal is special.
8250         (TypeToCoreType): Add decimal type.
8251
8252 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8253
8254         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8255         decimal types.
8256
8257 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8258
8259         * class.cs (EventField.ApplyAttributeBuilder): Fix error
8260         test cs1667-5.cs.
8261
8262 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8263
8264         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8265
8266         * pending.cs (PendingImplementation): Grab only interfaces.
8267
8268 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8269
8270         * statement.cs (ForeachHelperMethods): Add location member and
8271         error 202 detection.
8272
8273 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
8274
8275         * expression.cs (DoResolveBase): Fixed wrong warning for out
8276         variables.
8277
8278 2004-12-04  Martin Baulig  <martin@ximian.com>
8279
8280         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
8281         to check whether the conversion is ok.
8282
8283         * typemanager.cs (TypeManager.GetTypeArguments): Just return
8284         `Type.EmptyTypes' if we're not a generic TypeContainer.
8285
8286 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8287
8288         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8289         old bug: when converting from the null literal to a pointer,
8290         return an EmptyCast, not the NullLiteral.
8291
8292         This fixes #69921, the recent null_type changes probably made this
8293         bug more prominent.
8294
8295 2004-12-03  Martin Baulig  <martin@ximian.com>
8296
8297         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8298         method as our child, call AnonymousMethod.Compatible() on it.
8299
8300 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
8301
8302         * class.cs (FieldBase): Use an unused bit field from the field to
8303         encode the `has_offset' property from the FieldMember.  This saves
8304         a couple of Ks on bootstrap compilation.
8305
8306         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8307         method as our child, return the AnonymousMethod resolved
8308         expression.
8309
8310         * expression.cs (New.DoResolve): Allow return values from
8311         NewDelegate to also include AnonymousMethods.
8312
8313         Fixes #70150.
8314
8315 2004-11-29  Raja R Harinath  <rharinath@novell.com>
8316
8317         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
8318         cs1648 report.
8319         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
8320         System.Runtime.InteropServices._Exception, since it's a base
8321         interface of the core type System.Exception in the net_2_0 profile.
8322
8323 2004-11-27  Martin Baulig  <martin@ximian.com>
8324
8325         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
8326
8327 2004-11-26  Raja R Harinath  <rharinath@novell.com>
8328
8329         * Makefile: Convert to use executable.make.
8330         * gmcs.exe.sources: New.
8331
8332 2004-11-25  Martin Baulig  <martin@ximian.com>
8333
8334         * expression.cs (Invocation.InferType): Added support for byref types.
8335
8336 2004-11-25  Martin Baulig  <martin@ximian.com>
8337
8338         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
8339         in TypeManager.TypeToCoreType().
8340
8341 2004-11-25  Martin Baulig  <martin@ximian.com>
8342
8343         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
8344         "Dispose" method from the `current_type'.
8345         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
8346         DoDefineMembers() instead of using the MethodBuilder; this is
8347         required for generic iterators.
8348
8349         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
8350
8351 2004-11-24  Martin Baulig  <martin@ximian.com>
8352
8353         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
8354
8355 2004-11-20  Martin Baulig  <martin@ximian.com>
8356
8357         * expression.cs (Invocation.InferType): Correctly infer generic
8358         instances; see gen-103.cs.
8359         (Invocation.InferTypeArguments): If a generic method doesn't have
8360         any unbound type parameters, we don't need to infer anything.
8361
8362 2004-11-19  Raja R Harinath  <rharinath@novell.com>
8363
8364         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
8365
8366 2004-11-17  Raja R Harinath  <rharinath@novell.com>
8367
8368         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8369         (TypeHandle.GetMemberCache): New.
8370         (TypeHandle.TypeHandle): Update.
8371         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8372         (TypeManager.LookupParentInterfacesCache):
8373         Rename from LookupInterfaceCache.  Optimize slightly.
8374         (TypeManager.MemberLookup_FindMembers): Update.
8375         * decl.cs (MemberCache.MemberCache): Set Container to null in the
8376         multi-type variant.
8377         (AddCacheContents): Rename from AddHashtable.
8378         * class.cs (TypeContainer.parent_container): Remove.
8379         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8380         (TypeContainer.DoDefineMembers): Don't initialize it.
8381         Update to name changes.
8382         
8383 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
8384
8385         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8386         that factors the code to check access modifiers on override.  
8387
8388         (PropertyBase): Use the code here.
8389
8390         Patch from Lluis S'anchez, fixes bug #69361.
8391
8392 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
8393
8394         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8395         routine that is used to report the use of a captured variable
8396         whose address has been taken.
8397
8398         There are two checks: one when variables are being captured and
8399         the other check is when the address of a variable is taken. 
8400         
8401         (because an anonymous methods might be resolved before *or* after
8402         the address has been taken) and 
8403
8404         * expression.cs (Conditional.DoResolve): Remove the special
8405         casing that Martin added to trueExpr and falseExpr being both
8406         NullLiteral.  We get the right behavior now just by introducing
8407         the null_type into the compiler. 
8408
8409         * convert.cs (ExplicitConversion): Change the code to use
8410         null_type instead of testing `expr is NullLiteral'.
8411         (ImplicitConversionStandard): use null_type too.
8412         (ImplicitReferenceConversionExists): use null_type too.
8413         (ImplicitReferenceConversion): use null_type too.
8414
8415         * literal.cs: The type of `NullLiteral' is now null_type instead
8416         of object_type. 
8417         (Resolve): Set the type here.
8418
8419         * typemanager.cs: Introduce null_type.
8420
8421 2004-11-18  Martin Baulig  <martin@ximian.com>
8422
8423         * rootcontext.cs
8424         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
8425
8426 2004-11-18  Martin Baulig  <martin@ximian.com>
8427
8428         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
8429
8430 2004-11-18  Martin Baulig  <martin@ximian.com>
8431
8432         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
8433         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
8434         call ResolveConstructedType() on it to resolve it without checking
8435         constraints.
8436         (Constraints.ResolveTypes): Check them here.
8437         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
8438         but don't check constraints.
8439         (ConstructedType.ResolveAsTypeTerminal): Override this and also
8440         check constraints here.
8441         (ConstructedType.ResolveConstructedType): New public method.  This
8442         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
8443         resolve ourselves without checking constraints.
8444
8445         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
8446
8447 2004-11-18  Martin Baulig  <martin@ximian.com>
8448
8449         * decl.cs
8450         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
8451
8452         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
8453
8454 2004-11-18  Martin Baulig  <martin@ximian.com>
8455
8456         * ecore.cs (TypeExpr.ResolveType): Removed.
8457         (Expression.ResolveAsTypeTerminal): We always return a fully
8458         resolved `TypeExpr', so we can just access its `Type'.
8459
8460         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
8461
8462 2004-11-17  Martin Baulig  <martin@ximian.com>
8463
8464         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
8465         sure we don't return any unresolved TypeExpr's.
8466         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
8467         a `TypeExpr'.
8468         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
8469
8470         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
8471         unresolved `ConstructedType's.
8472
8473 2004-11-17  Martin Baulig  <martin@ximian.com>
8474
8475         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
8476
8477 2004-11-17  Martin Baulig  <martin@ximian.com>
8478
8479         * ecore.cs
8480         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
8481
8482         * decl.cs (DeclSpace.ResolveType): Removed.
8483         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
8484
8485 2004-11-17  Martin Baulig  <martin@ximian.com>
8486
8487         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8488         direction, like FindMembers() does.  Fixes #69546, testcase is in
8489         test-315.cs.    
8490
8491 2004-11-16  Martin Baulig  <martin@ximian.com>
8492
8493         This is based on a patch from Marek Safar, see bug #69082.
8494         Fixes bugs #63705 and #67130.
8495
8496         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8497         method; create a MemberCache for an interface type and cache the
8498         result.
8499
8500         * decl.cs (IMemberContainer.ParentContainer): Removed.
8501         (IMemberContainer.ParentCache): New property.
8502         (MemberCache.SetupCacheForInterface): Removed.
8503         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8504         to create a cache for an interface's "parent".
8505
8506         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8507         interfaces too.
8508
8509 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
8510
8511         * statement.cs: Avoid adding bools to a hashtable.
8512
8513 2004-11-15  Martin Baulig  <martin@ximian.com>
8514
8515         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
8516
8517 2004-11-11  Martin Baulig  <martin@ximian.com>
8518
8519         * typemanager.cs (TypeManager.GetMethodName): New method.
8520
8521         * class.cs (MethodData.Define): Include the generic arity in the
8522         name of an explicit interface; also add it to the method name.
8523
8524         * pending.cs (PendingImplementation.InterfaceMethod): The method
8525         name now includes the generic arity.
8526
8527 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
8528
8529         * expression.cs (Invocation.OverloadResolve): Flag error if we are
8530         calling an unsafe method from a safe location.
8531
8532 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
8533
8534         Fix #69167
8535         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8536
8537 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
8538
8539         * namespace.cs (VerifyUsing): use GetPartialName instead of
8540         ToString. 
8541
8542 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
8543
8544         * statement.cs (Return.Resolve): Fix regression in typo: if
8545         `in_exc', we have to request a NeedReturnLabel, this was a typo
8546         introduced in the anonymous method check-in.  Fixes #69131.
8547
8548         * Indexers were using the ShortName when defining themselves,
8549         causing a regression in the compiler bootstrap when applying the
8550         patch from 2004-11-02 (first part), now they use their full name
8551         and the bug is gone.
8552
8553 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
8554
8555         * driver.cs: Strip the path from the names of embedded resources. Fixes
8556         #68519.
8557
8558 2004-11-04  Raja R Harinath  <rharinath@novell.com>
8559
8560         Fix error message regression: cs0104-2.cs.
8561         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8562         (AliasEntry.Resolve): Update.
8563         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
8564         'silent' flag.
8565         (RootContext.LookupType): Update.
8566
8567 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
8568
8569         * cs-parser.jay: Add support for handling accessor modifiers
8570         * class: Add support port accessor modifiers and error checking,
8571         define PropertyMethod.Define as virtual (not abstract anymore)
8572         * ecore.cs: Add checking for proeprties access with access modifiers
8573         * iterators.cs: Modify Accessor constructor call based in the modified
8574         constructor
8575 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
8576
8577         * expression.cs (StringConcat): Handle being called twice,
8578         as when we have a concat in a field init with more than two
8579         ctors in the class
8580
8581 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
8582
8583         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8584         special case explicit implementations, we should always produce
8585         the .property or .event declaration.
8586         
8587         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8588         since it will not return correct data if people use this
8589         unresolved in the presence of using statements (see test-313).
8590
8591         * class.cs (MethodData.Define): If we are an explicit interface
8592         implementation, set the method name to the full name of the
8593         interface plus the name of the method.  
8594
8595         Notice that using the method.MethodName.GetFullName() does not
8596         work, as it will only contain the name as declared on the source
8597         file (it can be a shorthand in the presence of using statements)
8598         and not the fully qualifed type name, for example:
8599
8600         using System;
8601
8602         class D : ICloneable {
8603                 object ICloneable.Clone ()  {
8604                 }
8605         }
8606
8607         Would produce a method called `ICloneable.Clone' instead of
8608         `System.ICloneable.Clone'.
8609
8610         * namespace.cs (Alias.Resolve): Use GetPartialName.
8611         
8612 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8613
8614         * cs-parser.jay: Add error 1055 report.
8615
8616 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
8617
8618         * assign.cs (Assign.DoResolve): Only do the transform of
8619         assignment into a New if the types are compatible, if not, fall
8620         through and let the implicit code deal with the errors and with
8621         the necessary conversions. 
8622
8623 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8624
8625         * cs-parser.jay: Add error 1031 report.
8626
8627         * cs-tokenizer.cs: Add location for error 1038.
8628
8629 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8630
8631         * cs-parser.jay: Add error 1016 report.
8632
8633 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8634
8635         * cs-parser.jay: Add errors 1575,1611 report.
8636
8637 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8638
8639         * cs-parser.jay: Add error 1001 report.
8640
8641 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8642
8643         Fix #68850
8644         * attribute.cs (GetMarshal): Add method argument for
8645         caller identification.
8646
8647         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8648         agument for GetMarshal and RuntimeMissingSupport.
8649
8650 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8651
8652         * attribute.cs (ExtractSecurityPermissionSet): Removed
8653         TypeManager.code_access_permission_type.
8654
8655         * typemanager.cs: Removed TypeManager.code_access_permission_type.
8656
8657 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
8658
8659         * expression.cs (LocalVariableReference.DoResolveLValue): Check
8660         for obsolete use of a variable here.   Fixes regression on errors
8661         cs0619-25 and cs0619-26.
8662
8663 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
8664
8665         Fix #62358, implemented security attribute encoding.
8666
8667         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8668         Tests permitted SecurityAction for assembly or other types.
8669         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8670         data from SecurityPermissionAttribute to PermisionSet class.
8671
8672         * class.cs (ApplyAttributeBuilder): Added special handling
8673         for System.Security.Permissions.SecurityAttribute based types.
8674
8675         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8676         special handling for System.Security.Permissions.SecurityAttribute
8677         based types.
8678
8679         * enum.cs (ApplyAttributeBuilder): Added special handling
8680         for System.Security.Permissions.SecurityAttribute based types.
8681
8682         * parameter.cs (ApplyAttributeBuilder): Added special handling
8683         for System.Security.Permissions.SecurityAttribute based types.
8684
8685         * rootcontext.cs: Next 2 core types.
8686
8687         * typemanager.cs (TypeManager.security_permission_attr_type):
8688         Built in type for the SecurityPermission Attribute.
8689         (code_access_permission_type): Build in type.
8690
8691 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
8692
8693         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8694         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8695         all of this information into
8696         EmitContext.EmitCapturedVariableInstance.
8697         
8698         * codegen.cs (EmitCapturedVariableInstance): move here the
8699         funcionality of emitting an ldarg.0 in the presence of a
8700         remapping.   This centralizes the instance emit code.
8701
8702         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8703         then emit a load of this: it means that we have reached the
8704         topmost ScopeInfo: the one that contains the pointer to the
8705         instance of the class hosting the anonymous method.
8706
8707         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8708         captures to the topmost CaptureContext.
8709
8710 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
8711
8712         * expression.cs (LocalVariableReference): Move the knowledge about
8713         the iterators into codegen's EmitCapturedVariableInstance.
8714
8715 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
8716
8717         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8718         all code paths return a value from an anonymous method (it is the
8719         same as the 161 error, but for anonymous methods).
8720
8721 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
8722
8723         The introduction of anonymous methods in the compiler changed
8724         various ways of doing things in the compiler.  The most
8725         significant one is the hard split between the resolution phase
8726         and the emission phases of the compiler.
8727
8728         For instance, routines that referenced local variables no
8729         longer can safely create temporary variables during the
8730         resolution phase: they must do so from the emission phase,
8731         since the variable might have been "captured", hence access to
8732         it can not be done with the local-variable operations from the runtime.
8733         
8734         * statement.cs 
8735
8736         (Block.Flags): New flag `IsTopLevel' to indicate that this block
8737         is a toplevel block.
8738
8739         (ToplevelBlock): A new kind of Block, these are the blocks that
8740         are created by the parser for all toplevel method bodies.  These
8741         include methods, accessors and anonymous methods.
8742
8743         These contain some extra information not found in regular blocks:
8744         A pointer to an optional CaptureContext (for tracking captured
8745         local variables and parameters).  A pointer to the parent
8746         ToplevelBlock.
8747         
8748         (Return.Resolve): Catch missmatches when returning a value from an
8749         anonymous method (error 1662).
8750         Invoke NeedReturnLabel from the Resolve phase instead of the emit
8751         phase.
8752
8753         (Break.Resolve): ditto.
8754
8755         (SwitchLabel): instead of defining the labels during the
8756         resolution phase, we now turned the public ILLabel and ILLabelCode
8757         labels into methods called GetILLabelCode() and GetILLabel() that
8758         only define the label during the Emit phase.
8759
8760         (GotoCase): Track the SwitchLabel instead of the computed label
8761         (its contained therein).  Emit the code by using
8762         SwitchLabel.GetILLabelCode ().
8763
8764         (LocalInfo.Flags.Captured): A new flag has been introduce to track
8765         whether the Local has been captured or not.
8766
8767         (LocalInfo.IsCaptured): New property, used to tell whether the
8768         local has been captured.
8769         
8770         * anonymous.cs: Vastly updated to contain the anonymous method
8771         support.
8772
8773         The main classes here are: CaptureContext which tracks any
8774         captured information for a toplevel block and ScopeInfo used to
8775         track the activation frames for various local variables.   
8776
8777         Each toplevel block has an optional capture context associated
8778         with it.  When a method contains an anonymous method both the
8779         toplevel method and the anonymous method will create a capture
8780         context.   When variables or parameters are captured, they are
8781         recorded on the CaptureContext that owns them, for example:
8782
8783         void Demo () {
8784              int a;
8785              MyDelegate d = delegate {
8786                  a = 1;
8787              }
8788         }
8789
8790         Here `a' will be recorded as captured on the toplevel
8791         CapturedContext, the inner captured context will not have anything
8792         (it will only have data if local variables or parameters from it
8793         are captured in a nested anonymous method.
8794
8795         The ScopeInfo is used to track the activation frames for local
8796         variables, for example:
8797
8798         for (int i = 0; i < 10; i++)
8799                 for (int j = 0; j < 10; j++){
8800                    MyDelegate d = delegate {
8801                         call (i, j);
8802                    }
8803                 }
8804
8805         At runtime this captures a single captured variable `i', but it
8806         captures 10 different versions of the variable `j'.  The variable
8807         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8808         recorded on a child.  
8809
8810         The toplevel ScopeInfo will also track information like the `this'
8811         pointer if instance variables were referenced (this is necessary
8812         as the anonymous method lives inside a nested class in the host
8813         type of the method). 
8814
8815         (AnonymousMethod): Expanded to track the Toplevel, implement
8816         `AnonymousMethod.Compatible' to tell whether an anonymous method
8817         can be converted to a target delegate type. 
8818
8819         The routine now also produces the anonymous method content
8820
8821         (AnonymousDelegate): A helper class that derives from
8822         DelegateCreation, this is used to generate the code necessary to
8823         produce the delegate for the anonymous method that was created. 
8824
8825         * assign.cs: API adjustments for new changes in
8826         Convert.ImplicitStandardConversionExists.
8827
8828         * class.cs: Adjustments to cope with the fact that now toplevel
8829         blocks are of type `ToplevelBlock'. 
8830
8831         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8832         insteda of standard blocks.
8833
8834         Flag errors if params arguments are passed to anonymous methods.
8835
8836         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8837         `CurrentAnonymousMethod' which points to the current Anonymous
8838         Method.  The variable points to the AnonymousMethod class that
8839         holds the code being compiled.  It is set in the new EmitContext
8840         created for the anonymous method.
8841
8842         (EmitContext.Phase): Introduce a variable and an enumeration to
8843         assist in enforcing some rules about when and where we are allowed
8844         to invoke certain methods (EmitContext.NeedsReturnLabel is the
8845         only one that enfonces this right now).
8846
8847         (EmitContext.HaveCaptureInfo): new helper method that returns
8848         whether we have a CapturedContext initialized.
8849
8850         (EmitContext.CaptureVariable): New method used to register that a
8851         LocalInfo must be flagged for capturing. 
8852
8853         (EmitContext.CapturedParameter): New method used to register that a
8854         parameters must be flagged for capturing. 
8855         
8856         (EmitContext.CapturedField): New method used to register that a
8857         field must be flagged for capturing. 
8858
8859         (EmitContext.HaveCapturedVariables,
8860         EmitContext.HaveCapturedFields): Return whether there are captured
8861         variables or fields. 
8862
8863         (EmitContext.EmitMethodHostInstance): This is used to emit the
8864         instance for the anonymous method.  The instance might be null
8865         (static methods), this (for anonymous methods that capture nothing
8866         and happen to live side-by-side with the current method body) or a
8867         more complicated expression if the method has a CaptureContext.
8868
8869         (EmitContext.EmitTopBlock): Routine that drives the emission of
8870         code: it will first resolve the top block, then emit any metadata
8871         and then emit the code.  The split is done so that we can extract
8872         any anonymous methods and flag any captured variables/parameters.
8873         
8874         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8875         during this phase, the ILGenerator should not be used as labels
8876         and local variables declared here might not be accessible to any
8877         code that is part of an anonymous method.  
8878
8879         Exceptions to this include the temporary variables that are
8880         created by some statements internally for holding temporary
8881         variables. 
8882         
8883         (EmitContext.EmitMeta): New routine, in charge of emitting all the
8884         metadata for a cb
8885
8886         (EmitContext.TemporaryReturn): This method is typically called
8887         from the Emit phase, and its the only place where we allow the
8888         ReturnLabel to be defined other than the EmitMeta.  The reason is
8889         that otherwise we would have to duplicate a lot of logic in the
8890         Resolve phases of various methods that today is on the Emit
8891         phase. 
8892
8893         (EmitContext.NeedReturnLabel): This no longer creates the label,
8894         as the ILGenerator is not valid during the resolve phase.
8895
8896         (EmitContext.EmitThis): Extended the knowledge in this class to
8897         work in anonymous methods in addition to iterators. 
8898
8899         (EmitContext.EmitCapturedVariableInstance): This emits whatever
8900         code is necessary on the stack to access the instance to a local
8901         variable (the variable will be accessed as a field).
8902
8903         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8904         EmitContext.EmitAddressOfParameter): Routines to support
8905         parameters (not completed at this point). 
8906         
8907         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
8908         will also remove the parameters.
8909
8910         * convert.cs (Convert): Define a `ConstantEC' which points to a
8911         null.  This is just to prefity some code that uses
8912         ImplicitStandardConversion code and do not have an EmitContext
8913         handy.
8914
8915         The idea is to flag explicitly that at that point in time, it is
8916         known that the conversion will not trigger the delegate checking
8917         code in implicit conversions (which requires a valid
8918         EmitContext). 
8919
8920         Everywhere: pass new EmitContext parameter since
8921         ImplicitStandardConversionExists now requires it to check for
8922         anonymous method conversions. 
8923
8924         (Convert.ImplicitStandardConversionExists): If the type of an
8925         expression is the anonymous_method_type, and the type is a
8926         delegate, we invoke the AnonymousMethod.Compatible method to check
8927         whether an implicit conversion is possible. 
8928
8929         (Convert.ImplicitConversionStandard): Only do implicit method
8930         group conversions if the language level is not ISO_1.
8931
8932         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8933         MethodInfo for the Invoke method.  used by Delegate and
8934         AnonymousDelegate.
8935
8936         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8937         method conversions if the target type is a delegate.
8938
8939         Removed extra debugging nops.
8940
8941         (LocalVariableReference): Turn the `local_info' into a public
8942         field. 
8943
8944         Add `prepared' field, the same hack used for FieldExprs to cope
8945         with composed assignments, as Local variables do not necessarily
8946         operate purely on the stack as they used to: they can be captured
8947         fields. 
8948
8949         Add `temp' for a temporary result, like fields.
8950
8951         Refactor DoResolve and DoResolveLValue into DoResolveBase.
8952
8953         It now copes with Local variables that are captured and emits the
8954         proper instance variable to load it from a field in the captured
8955         case. 
8956
8957         (ParameterReference.DoResolveBase): During the resolve phase,
8958         capture parameters if we are in an anonymous method.
8959
8960         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8961         anonymous method, use the EmitContext helper routines to emit the
8962         parameter reference.
8963
8964         * iterators.cs: Set RemapToProxy to true/false during the
8965         EmitDispose class.
8966
8967         * parameters.cs (GetParameterByName): New helper method. 
8968
8969         * typemanager.cs (anonymous_method_type) a new type that
8970         represents an anonyous method.  This is always an internal type,
8971         used as a fencepost to test against the anonymous-methodness of an
8972         expression. 
8973         
8974 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
8975
8976         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8977         561 report.
8978         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8979
8980 2004-11-10  Martin Baulig  <martin@ximian.com>
8981
8982         * expression.cs (Invocation.BetterFunction): If two methods have
8983         equal parameter types, but only one of them is generic, the
8984         non-generic one wins.
8985         (New.DoResolve): Don't set `is_struct' to false if we're a generic
8986         instance; just use `Type.IsValueType' to determine whether
8987         something is a struct or not.
8988         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
8989         so we can be called multiple times.
8990
8991 2004-11-10  Martin Baulig  <martin@ximian.com>
8992
8993         * generic.cs (TypeParameter.DefineConstraints): New public method.
8994         (TypeParameter.CheckAccessLevel): Override this and return true.
8995         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
8996         override ResolveType() anymore.
8997         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
8998
8999 2004-11-10  Martin Baulig  <martin@ximian.com>
9000
9001         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
9002         call DeclSpace.ResolveNestedType() on it.
9003
9004 2004-11-10  Martin Baulig  <martin@ximian.com>
9005
9006         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
9007         non-null, call ParameterModifier() on it.
9008
9009 2004-11-10  Martin Baulig  <martin@ximian.com>
9010
9011         * iterators.cs
9012         (Iterators): Added `current_type' and `this_type' fields.
9013         (Iterators.DefineIterator): Create a new EmitContext and store it
9014         in `ec'; compute `this_type'.
9015
9016 2004-11-10  Martin Baulig  <martin@ximian.com>
9017
9018         * typemanager.cs
9019         (TypeManager.IsPrivateAccessible): New public method.
9020         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
9021
9022 2004-11-10  Martin Baulig  <martin@ximian.com>
9023
9024         * class.cs (TypeContainer.DefineType): Call
9025         TypeBuilder.DefineGenericParameters() before resolving the type
9026         parameters.
9027         (MethodData.parent_method): New protected field.
9028         (MethodData..ctor): Added `MethodInfo parent_method' argument.
9029         (MethodData.Define): Compute `parent_method'.
9030
9031         * decl.cs
9032         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
9033         (MemberCore.GetClsCompliantAttributeValue): Likewise.
9034         (DeclSpace.ec): New protected field; store the EmitContext here.
9035         (DeclSpace.EmitContext): New public property.
9036         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
9037         (DeclSpace.ResolveNestedType): New public method.
9038         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
9039         (DeclSpace.NestedAccessible): Added `Type tb' argument.
9040         (DeclSpace.FamilyAccessible): Likewise.
9041         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
9042         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
9043         EmitContext.
9044
9045         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
9046         field.
9047
9048         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
9049         (Enum.Emit): Don't create a new EmitContext.
9050
9051 2004-10-18  Martin Baulig  <martin@ximian.com>
9052
9053         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
9054         `Type' directly, but call ResolveType() on it.
9055         (Catch.Resolve): Likewise.
9056         (Foreach.Resolve): Likewise.
9057
9058 2004-10-18  Martin Baulig  <martin@ximian.com>
9059
9060         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
9061         `Type' directly, but call ResolveType() on it.
9062         (Probe.DoResolve): Likewise.
9063         (ArrayCreation.LookupType): Likewise.
9064         (TypeOf.DoResolve): Likewise.
9065         (SizeOf.DoResolve): Likewise.
9066
9067 2004-10-18  Raja R Harinath  <rharinath@novell.com>
9068
9069         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
9070         the ResolveType.
9071
9072 2004-10-17  John Luke  <john.luke@gmail.com>
9073
9074         * class.cs (Operator.GetSignatureForError): use CSharpName
9075
9076         * parameter.cs (Parameter.GetSignatureForError): Returns
9077         correct name even if was not defined.
9078
9079 2004-10-13  Raja R Harinath  <rharinath@novell.com>
9080
9081         Fix #65816.
9082         * class.cs (TypeContainer.EmitContext): New property.
9083         (DefineNestedTypes): Create an emitcontext for each part.
9084         (MethodCore.DoDefineParameters): Use container's emitcontext.
9085         Pass type array to InternalParameters.
9086         (MemberBase.DoDefine): Use container's emitcontext.
9087         (FieldMember.Define): Likewise.
9088         (Event.Define): Likewise.
9089         (SetMethod.GetParameterInfo): Change argument to EmitContext.
9090         Pass type array to InternalParameters.
9091         (SetIndexerMethod.GetParameterInfo): Likewise.
9092         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9093         * delegate.cs (Define): Pass emitcontext to
9094         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
9095         array to InternalParameters.
9096         * expression.cs (ParameterReference.DoResolveBase): Pass
9097         emitcontext to GetParameterInfo.
9098         (ComposedCast.DoResolveAsTypeStep): Remove check on
9099         ec.ResolvingTypeTree.
9100         * parameter.cs (Parameter.Resolve): Change argument to
9101         EmitContext.  Use ResolveAsTypeTerminal.
9102         (Parameter.GetSignature): Change argument to EmitContext.
9103         (Parameters.ComputeSignature): Likewise.
9104         (Parameters.ComputeParameterTypes): Likewise.
9105         (Parameters.GetParameterInfo): Likewise.
9106         (Parameters.ComputeAndDefineParameterTypes): Likewise.
9107         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
9108         * support.cs (InternalParameters..ctor): Remove variant that takes
9109         a DeclSpace.
9110         * typemanager.cs (system_intptr_expr): New.
9111         (InitExpressionTypes): Initialize it.
9112
9113 2004-10-12  Chris Toshok  <toshok@ximian.com>
9114
9115         * cs-parser.jay: fix location for try_statement and catch_clause.
9116
9117 2004-10-18  Martin Baulig  <martin@ximian.com>
9118
9119         * class.cs (FieldMember.Define): Don't access the TypeExpr's
9120         `Type' directly, but call ResolveType() on it.
9121         (MemberBase.DoDefine): Likewise.
9122
9123         * expression.cs (New.DoResolve): Don't access the TypeExpr's
9124         `Type' directly, but call ResolveType() on it.
9125         (ComposedCast.DoResolveAsTypeStep): Likewise.
9126
9127         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
9128         `Type' directly, but call ResolveType() on it.
9129
9130 2004-10-17  John Luke  <john.luke@gmail.com>
9131
9132         * class.cs (Operator.GetSignatureForError): use CSharpName
9133
9134         * parameter.cs (Parameter.GetSignatureForError): Returns
9135         correct name even if was not defined.
9136
9137 2004-10-13  Raja R Harinath  <rharinath@novell.com>
9138
9139         Fix #65816.
9140         * class.cs (TypeContainer.EmitContext): New property.
9141         (DefineNestedTypes): Create an emitcontext for each part.
9142         (MethodCore.DoDefineParameters): Use container's emitcontext.
9143         Pass type array to InternalParameters.
9144         (MemberBase.DoDefine): Use container's emitcontext.
9145         (FieldMember.Define): Likewise.
9146         (Event.Define): Likewise.
9147         (SetMethod.GetParameterInfo): Change argument to EmitContext.
9148         Pass type array to InternalParameters.
9149         (SetIndexerMethod.GetParameterInfo): Likewise.
9150         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9151         * delegate.cs (Define): Pass emitcontext to
9152         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
9153         array to InternalParameters.
9154         * expression.cs (ParameterReference.DoResolveBase): Pass
9155         emitcontext to GetParameterInfo.
9156         (ComposedCast.DoResolveAsTypeStep): Remove check on
9157         ec.ResolvingTypeTree.
9158         * parameter.cs (Parameter.Resolve): Change argument to
9159         EmitContext.  Use ResolveAsTypeTerminal.
9160         (Parameter.GetSignature): Change argument to EmitContext.
9161         (Parameters.ComputeSignature): Likewise.
9162         (Parameters.ComputeParameterTypes): Likewise.
9163         (Parameters.GetParameterInfo): Likewise.
9164         (Parameters.ComputeAndDefineParameterTypes): Likewise.
9165         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
9166         * support.cs (InternalParameters..ctor): Remove variant that takes
9167         a DeclSpace.
9168         * typemanager.cs (system_intptr_expr): New.
9169         (InitExpressionTypes): Initialize it.
9170
9171 2004-10-12  Chris Toshok  <toshok@ximian.com>
9172
9173         * cs-parser.jay: fix location for try_statement and catch_clause.
9174
9175 2004-10-07  Raja R Harinath  <rharinath@novell.com>
9176
9177         More DeclSpace.ResolveType avoidance.
9178         * decl.cs (MemberCore.InUnsafe): New property.
9179         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
9180         with newly created EmitContext.
9181         (FieldMember.Define): Likewise.
9182         * delegate.cs (Delegate.Define): Likewise.
9183         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
9184         only if normal name-lookup fails.
9185         (TypeExpr.DoResolve): Enable error-checking.
9186         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
9187         (SizeOf.DoResolve): Likewise.
9188         (ComposedCast.DoResolveAsTypeStep): Likewise.
9189         (StackAlloc.DoResolve): Likewise.
9190         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
9191         (Block.Unsafe): New property.
9192         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
9193         (Unsafe): Set 'unsafe' flag of contained block.
9194         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
9195         (Fixed.Resolve): Likewise.
9196         (Catch.Resolve): Likewise.
9197         (Using.ResolveLocalVariableDecls): Likewise.
9198         (Foreach.Resolve): Likewise.
9199
9200 2004-10-05  John Luke <john.luke@gmail.com>
9201
9202         * cs-parser.jay: add location to error CS0175
9203
9204 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
9205
9206         * ecore.cs (Expression.Constantity): Add support for turning null
9207         into a constant.
9208
9209         * const.cs (Const.Define): Allow constants to be reference types
9210         as long as the value is Null.
9211
9212 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
9213
9214         * namespace.cs (NamespaceEntry.Using): No matter which warning
9215         level is set, check if this namespace name has already been added.
9216
9217 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
9218
9219         * expression.cs: reftype [!=]= null should always use br[true,false].
9220         # 67410
9221
9222 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
9223
9224         Fix #67108
9225         * attribute.cs: Enum conversion moved to 
9226         GetAttributeArgumentExpression to be applied to the all
9227         expressions.
9228
9229 2004-10-01  Raja R Harinath  <rharinath@novell.com>
9230
9231         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
9232         * class.c (TypeContainer.DefineType): Flag error if
9233         base types aren't accessible due to access permissions.
9234         * decl.cs (DeclSpace.ResolveType): Move logic to
9235         Expression.ResolveAsTypeTerminal.
9236         (DeclSpace.ResolveTypeExpr): Thin layer over
9237         Expression.ResolveAsTypeTerminal.
9238         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
9239         Refactor code into NestedAccess.  Use it.
9240         (DeclSpace.NestedAccess): New.
9241         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
9242         argument to silence errors.  Check access permissions.
9243         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
9244         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
9245         (Cast.DoResolve): Likewise.
9246         (New.DoResolve): Likewise.
9247         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
9248         (TypeOf.DoResolve): Likewise.
9249
9250         * expression.cs (Invocation.BetterConversion): Return the Type of
9251         the better conversion.  Implement section 14.4.2.3 more faithfully.
9252         (Invocation.BetterFunction): Make boolean.  Make correspondence to
9253         section 14.4.2.2 explicit.
9254         (Invocation.OverloadResolve): Update.
9255         (Invocation): Remove is_base field.
9256         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
9257         (Invocation.Emit): Likewise.
9258
9259 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
9260
9261         * cs-parser.jay: Reverted 642 warning fix.
9262
9263 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9264
9265         Fix bug #66615
9266         * decl.cs (FindMemberWithSameName): Indexer can have more than
9267         1 argument.
9268
9269 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9270
9271         * expression.cs (LocalVariableReference.DoResolveLValue):
9272         Do not report warning 219 for out values.
9273         (EmptyExpression.Null): New member to avoid extra allocations.
9274
9275 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9276
9277         * cs-parser.jay: Fix wrong warning 642 report.
9278
9279         * cs-tokenizer.cs (CheckNextToken): New helper;
9280         Inspect next character if is same as expected.
9281
9282 2004-09-23  Martin Baulig  <martin@ximian.com>
9283
9284         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9285         (Convert.ImplicitReferenceConversionExists): Likewise.
9286
9287 2004-11-09  Raja R Harinath  <rharinath@novell.com>
9288
9289         * Makefile (DISTFILES): Comment out a few missing files.
9290
9291 2004-10-29  Raja R Harinath  <rharinath@novell.com>
9292
9293         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
9294         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
9295         (gmcs.exe): Invoke bootstrap-libs.
9296         (clean-local): Clean the net_2_0_bootstrap profile too.
9297         (PROGRAM_INSTALL_DIR): New.
9298         (install-local): Use it.
9299
9300 2004-10-13  Martin Baulig  <martin@ximian.com>
9301
9302         * generic.cs (TypeManager.InflatedConstraints): New nested class.
9303         (TypeParameter.DefineType): If we're a method type parameter and
9304         that method is overriding something, "inflate" its constraints.
9305
9306 2004-10-12  Martin Baulig  <martin@ximian.com>
9307
9308         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
9309         and have type arguments, create and resolve a ConstructedType.
9310
9311 2004-10-12  Martin Baulig  <martin@ximian.com>
9312
9313         * decl.cs (MemberCache.FindMemberToOverride): Use
9314         TypeManager.IsEqual() to compare the parameters and Type.Equals()
9315         to compare the invocationType.
9316
9317         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
9318         When comparing two type parameters, only do the signature-only
9319         comparision for method type parameters.
9320
9321 2004-10-11  Martin Baulig  <martin@ximian.com>
9322
9323         * report.cs: Don't make --fatal abort on warnings, we have
9324         -warnaserror for that.
9325
9326 2004-10-11  Martin Baulig  <martin@ximian.com>
9327
9328         * typemanager.cs
9329         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
9330         (TypeManager.IsEqual): Call ourself recursively instead of using
9331         Type.IsEqual(). 
9332
9333 2004-10-11  Martin Baulig  <martin@ximian.com>
9334
9335         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
9336         on our own type parameters, not on the ones we inherit from a containing
9337         class.
9338
9339         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
9340         the comparision.
9341
9342         * generic.cs (TypeParameter.Define): We may only be called once.
9343
9344         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
9345         instead of TypeManager.IsEqual().
9346
9347 2004-09-28  Martin Baulig  <martin@ximian.com>
9348
9349         * generic.cs
9350         (GenericConstraints.EffectiveBaseClass): New public property.
9351         (TypeParameter.GenericConstraints): New public property.
9352         (ConstructedType.CheckConstraints): Improved.
9353
9354         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
9355         (Convert.TypeParameterConversion): New private method; use this in
9356         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
9357         for all conversions related to type parameters.
9358
9359 2004-09-24  Martin Baulig  <martin@ximian.com>
9360
9361         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
9362         type parameter conversions for type parameters which are known to
9363         be reference types.
9364
9365 2004-09-24  Martin Baulig  <martin@ximian.com>
9366
9367         * generic.cs (GenericConstraints): Added `IsReferenceType' and
9368         `IsValueType' properties.
9369
9370         * support.cs (ReflectionConstraints): Use
9371         Type.GetGenericParameterConstraints() instead of the old hack.
9372
9373 2004-09-24  Martin Baulig  <martin@ximian.com>
9374
9375         * generic.cs (GenericConstraints): Moved here and made it an
9376         abstract class.
9377
9378         * support.cs (GenericConstraints): Moved to generic.cs.
9379
9380 2004-09-24  Martin Baulig  <martin@ximian.com>
9381
9382         * support.cs
9383         (ReflectionConstraints): Un-nested this class and made it public.
9384
9385         * typemanager.cs
9386         (TypeManager.GetTypeParameterConstraints): New public method.
9387         (TypeManager.HasConstructorConstraint): Use the attributes.
9388
9389 2004-09-24  Martin Baulig  <martin@ximian.com>
9390
9391         * support.cs (GenericConstraints): Replaced `HasConstructor',
9392         `IsReferenceType' and `IsValueType' with `Attributes'.
9393         (ReflectionParameters.ReflectionConstraints): Removed the Create()
9394         method and made the .ctor public.
9395
9396         * generic.cs (Constraints.Attributes): New public property.
9397         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
9398         `IsReferenceType' -> `HasReferenceTypeConstraint' and
9399         `IsValueType' -> `HasValueTypeConstraint'.
9400
9401 2004-09-23  Martin Baulig  <martin@ximian.com>
9402
9403         * generic.cs (Constraints): Reflect latest runtime changes.
9404
9405 2004-09-23  Martin Baulig  <martin@ximian.com>
9406
9407         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9408         (Convert.ImplicitReferenceConversionExists): Likewise.
9409
9410 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9411
9412         * class.cs (Operator.Define): Add error 448 and 559 report.
9413         
9414 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9415
9416         * class.cs (MemberBase.IsTypePermitted): New protected
9417         method for checking error CS0610.
9418
9419 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9420
9421         * class.cs (TypeContainer.HasExplicitLayout): New property
9422         Returns whether container has StructLayout attribute set Explicit.
9423         (FieldMember): New abstract class for consts and fields.
9424         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
9425         (Field): Reuse FieldMember.
9426
9427         * const.cs (Const): Reuse FieldMember.
9428
9429         * rootcontext.cs: EmitConstants call moved to class.
9430
9431 2004-09-22  Martin Baulig  <martin@ximian.com>
9432
9433         Marek and me just fixed one of our oldest bugs: #28562 :-)
9434
9435         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
9436
9437         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
9438         we're an EnumConstant, just return that.
9439         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
9440         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
9441         to get the value which'll actually be written into the attribute.
9442         However, we have to use GetValue() to access the attribute's value
9443         in the compiler.        
9444
9445 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9446
9447         * constant.cs (Constant.IsNegative): New abstract property
9448         IsNegative.
9449
9450         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
9451         (StackAlloc.DoResolve): Reused IsNegative.
9452
9453 2004-09-22  Martin Baulig  <martin@ximian.com>
9454
9455         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
9456         public method; like LookupTypeContainer, but also works for
9457         generic instances.
9458
9459         * report.cs (Report.SymbolRelatedToPreviousError): Use
9460         TypeManager.LookupGenericTypeContainer().       
9461
9462 2004-09-22  Martin Baulig  <martin@ximian.com>
9463
9464         Thanks to Peter Sestoft for this bug report.
9465
9466         * expression.cs (Conditional): If both the `trueExpr' and the
9467         `falseExpr' is a NullLiteral, return a NullLiteral.
9468
9469 2004-09-22  Martin Baulig  <martin@ximian.com>
9470
9471         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
9472         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
9473         for the "get_Current" call.
9474
9475 2004-09-21  Martin Baulig  <martin@ximian.com>
9476
9477         * convert.cs (Convert.ImplicitReferenceConversion): When
9478         converting to an interface type, first check whether we're
9479         converting from a reference type.
9480
9481 2004-09-14  Martin Baulig  <martin@ximian.com>
9482
9483         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
9484
9485 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
9486
9487         Fixed bug #61902
9488         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
9489         called and is obsolete then this member suppress message
9490         when call is inside next [Obsolete] method or type.
9491
9492         * expression.cs: Use TestObsoleteMethodUsage member.
9493
9494 2004-09-14  Martin Baulig  <martin@ximian.com>
9495
9496         * genericparser.cs: Removed.
9497
9498 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
9499
9500         * class.cs (MethodCore.CheckBase): Fix bug #65757.
9501
9502 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
9503
9504         * attribute.cs (Attribute.Resolve): Add error 653 report.
9505
9506         * class.cs (Class.ApplyAttributeBuilder): Add error 641
9507         report.
9508         (Method.ApplyAttributeBuilder): Add error 685 report.
9509         (Operator.Define): Add error 564 report.
9510
9511         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9512
9513         * expression.cs (Invocation.DoResolve): Add error
9514         245 and 250 report.
9515
9516         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9517         error 674 report.
9518
9519 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9520
9521         * class.cs (ConstructorInitializer.Resolve):
9522         Wrong error number (515->516).
9523
9524 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9525
9526         * class.cs (Indexer.Define): Add error 631 report.
9527
9528 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9529
9530         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9531
9532 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9533
9534         * expression.cs (Probe.DoResolve): Add error CS0241 report.
9535
9536 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
9537
9538         * cs-parser.jay: Added error CS0241 report.
9539
9540 2004-09-10  Raja R Harinath  <rharinath@novell.com>
9541
9542         * cs-parser.jay (fixed_statement): Introduce a scope for the
9543         declaration in the 'fixed' statement.
9544
9545 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9546
9547         * cs-parser.jay: Added CS0230 error report.
9548
9549 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9550
9551         * cs-parser.jay: Added errors CS0231 and CS0257 report.
9552
9553 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9554
9555         * expression.cs (Argument.Resolve): Added error CS0192 and
9556         CS0199 report.
9557
9558 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9559
9560         C# 2.0 #pragma warning feature
9561
9562         * cs-tokenizer.cs (PreProcessPragma): New method; 
9563         Handles #pragma directive.
9564
9565         * report.cs (WarningRegions): New class; Support
9566         class for #pragma warning directive. It tests whether
9567         warning is enabled for a given line.
9568
9569 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
9570
9571         * const.cs: Add more descriptive error report, tahnks to
9572         Sebastien. 
9573
9574 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
9575
9576         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9577
9578 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
9579
9580         * expression.cs: Apply patch from Ben: Remove dead code from
9581         ArrayCreation, and remove the TurnintoConstant call in const.cs,
9582         as that code just threw an exception anwyays.
9583
9584         * const.cs: Remove the call to the turnintoconstant, for details
9585         see bug: #63144
9586         
9587         * literal.cs: The type of the null-literal is the null type;  So
9588         we use a placeholder type (literal.cs:System.Null, defined here)
9589         for it.
9590
9591         * expression.cs (Conditional.DoResolve): Remove some old code that
9592         is no longer needed, conversions have been fixed.
9593
9594         (ArrayCreationExpression.DoResolve): Return false if we fail to
9595         resolve the inner expression.
9596
9597 2004-09-07  Raja R Harinath  <rharinath@novell.com>
9598
9599         Fix test-290.cs.
9600         * cs-parser.jay (delegate_declaration): Record a delegate
9601         declaration as a type declaration.
9602         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9603
9604 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
9605
9606         * parameter.cs: Do not crash if the type can not be resolved. 
9607
9608         * expression.cs: Report errors with unsafe pointers, fixes #64896
9609
9610 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9611
9612         * expression.cs: Pointer arith always needs to do a conv.i
9613         if the operand is a long. fix 65320
9614
9615 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9616
9617         Fixed cs0619-37.cs, cs0619-38.cs
9618
9619         * enum.cs (GetObsoleteAttribute): Removed.
9620
9621         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9622         on Enum member is double staged. The first is tested member
9623         and then enum.
9624
9625 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9626
9627         Fixed #56986, #63631, #65231
9628
9629         * class.cs: (TypeContainer.AddToMemberContainer): New method,
9630         adds member to name container.
9631         (TypeContainer.AddToTypeContainer): New method, adds type to
9632         name container.
9633         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9634         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9635         AddOperator): Simplified by reusing AddToMemberContainer.
9636         (TypeContainer.UserDefinedStaticConstructor): Changed to property
9637         instead of field.
9638         (Method.CheckForDuplications): Fixed implementation to test all
9639         possibilities.
9640         (MemberBase): Detection whether member is explicit interface
9641         implementation is now in constructor.
9642         (MemberBase.UpdateMemberName): Handles IndexerName.
9643         (Accessor): Changed to keep also location information.
9644         (AbstractPropertyEventMethod): Is derived from MemberCore.
9645         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9646         will be emited or not.
9647         (PropertyBase.AreAccessorsDuplicateImplementation):
9648         Tests whether accessors are not in collision with some method.
9649         (Operator): Is derived from MethodCore to simplify common
9650         operations.
9651
9652         * decl.cs (Flags.TestMethodDuplication): Test for duplication
9653         must be performed.
9654         (DeclSpace.AddToContainer): Adds the member to defined_names
9655         table. It tests for duplications and enclosing name conflicts.
9656
9657         * enum.cs (EnumMember): Clean up to reuse the base structures
9658
9659 2004-09-03  Martin Baulig  <martin@ximian.com>
9660
9661         Merged latest changes into gmcs.  Please keep this comment in
9662         here, it makes it easier for me to see what changed in MCS since
9663         the last time I merged.
9664
9665 2004-09-03  Martin Baulig  <martin@ximian.com>
9666
9667         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9668         into TypeContainer, to make partial classes work again.
9669
9670 2004-09-03  Martin Baulig  <martin@ximian.com>
9671
9672         * rootcontext.cs (RootContext.V2): Removed.
9673
9674 2004-03-23  Martin Baulig  <martin@ximian.com>
9675
9676         * expression.cs (Invocation.OverloadResolve): Added `bool
9677         may_fail' argument and use it instead of the Location.IsNull() hack.
9678
9679 2004-09-09  Martin Baulig  <martin@ximian.com>
9680
9681         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
9682
9683 2004-09-09  Martin Baulig  <martin@ximian.com>
9684
9685         * generic.cs (TypeParameter.DefineType): Added support for
9686         explicit interface methods.
9687
9688 2004-09-09  Martin Baulig  <martin@ximian.com>
9689
9690         * README.Changes: New document.  Started to list important changes
9691         between MCS and GMCS here.
9692
9693 2004-09-08  Martin Baulig  <martin@ximian.com>
9694
9695         * class.cs
9696         (TypeContainer.CheckRecursiveDefinition): New protected method.
9697         (TypeContainer.DefineType): Move the CS0146 check into
9698         CheckRecursiveDefinition().     
9699
9700 2004-09-06  Martin Baulig  <martin@ximian.com>
9701
9702         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
9703         types for the constructor constraint.
9704
9705 2004-09-03  Martin Baulig  <martin@ximian.com>
9706
9707         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9708         into TypeContainer, to make partial classes work again.
9709
9710 2004-09-03  Martin Baulig  <martin@ximian.com>
9711
9712         * rootcontext.cs (RootContext.V2): Removed.
9713
9714 2004-03-23  Martin Baulig  <martin@ximian.com>
9715
9716         * expression.cs (Invocation.OverloadResolve): Added `bool
9717         may_fail' argument and use it instead of the Location.IsNull() hack.
9718
9719 2004-09-03  Martin Baulig  <martin@ximian.com>
9720
9721         Merged latest changes into gmcs.  Please keep this comment in
9722         here, it makes it easier for me to see what changed in MCS since
9723         the last time I merged.
9724
9725 2004-09-03  Raja R Harinath  <rharinath@novell.com>
9726
9727         Fix #61128.
9728         * expression.cs (BetterConversion): Don't allow either conversion 
9729         to be null.  Remove redundant implicit conversion test when 'q ==
9730         null' -- when this function is invoked, we already know that the
9731         implicit conversion exists.
9732         (BetterFunction): Assume that 'best' is non-null.  Remove
9733         redundant reimplementation of IsApplicable when 'best' is null.
9734         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9735         number of arguments.
9736         (IsAncestralType): Extract from OverloadResolve.
9737         (OverloadResolve): Make robust to the MethodGroupExpr being
9738         unsorted.  Implement all the logic of Section 14.5.5.1, and
9739         support overloading of methods from multiple applicable types.
9740         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
9741
9742         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9743         (RealError, Warning): Append type of report to related symbol.
9744
9745 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
9746
9747         * enum.cs: Fixed CLS-Compliance checks for enum members.
9748         Error tests cs3008-8.cs, cs3014-8.cs
9749
9750 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9751
9752         Fixed bug #62342, #63102
9753         * class.cs: ImplementIndexer uses member.IsExplicitImpl
9754         like ImplementMethod.
9755
9756 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9757
9758         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9759         Fixed bug #65170.
9760
9761 2004-09-02  Martin Baulig  <martin@ximian.com>
9762
9763         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9764         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9765         on the MethodBase.
9766
9767 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
9768
9769         C# 2.0 Static classes implemented
9770
9771         * class.cs (TypeContainer): instance_constructors,
9772         initialized_fields, initialized_static_fields,
9773         default_constructor, base_inteface_types are protected to be
9774         accessible from StaticClass.
9775         (TypeContainer.DefineDefaultConstructor): New virtual method
9776         for custom default constructor generating
9777         (StaticClass): New class to handle "Static classes" feature.
9778
9779         * cs-parser.jay: Handle static keyword on class like instance
9780         of StaticClass.
9781
9782         * driver.cs: Added "/langversion" command line switch with two
9783         options (iso-1, default).
9784
9785 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
9786
9787         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9788
9789 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
9790
9791         * delegate.cs: Style.
9792
9793 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9794
9795         * delegate.cs: Add seperate instance expr field for miguel.
9796
9797 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9798
9799         * PointerArithmetic (Resolve): make sure we are not doing
9800         pointer arith on void*. Also, make sure we are resolved
9801         by not setting eclass until resolve.
9802
9803         All callers: Make sure that PointerArithmetic gets resolved.
9804
9805 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9806
9807         * ArrayCreation (LookupType): If the type does not resolve 
9808         to an array, give an error.
9809
9810 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
9811
9812         * statement.cs (Try.Resolve): Fixed bug #64222
9813
9814 2004-08-27  Martin Baulig  <martin@ximian.com>
9815
9816         * class.cs
9817         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9818         crash here.     
9819
9820 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9821
9822         * ecore.cs (Constantify): Get underlying type via
9823         System.Enum.GetUnderlyingType to avoid StackOverflow on the
9824         Windows in special cases.
9825
9826 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9827
9828         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9829         for obtaining also private methods.
9830         (GetRemoveMethod): Used GetRemoveMethod (true)
9831         for obtaining also private methods.
9832
9833 2004-09-02  Martin Baulig  <martin@ximian.com>
9834
9835         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9836         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9837         on the MethodBase.
9838
9839 2004-08-27  Martin Baulig  <martin@ximian.com>
9840
9841         * class.cs
9842         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9843         crash here.     
9844
9845 2004-08-25  Martin Baulig  <martin@ximian.com>
9846
9847         * support.cs (ReflectionParameters..ctor): If this is a generic
9848         method, retrieve and store its type parameters.
9849         (InternalParameters..ctor): Added `TypeParameter[]' argument.
9850         (ReflectionParameters.GenericConstraints): The argument specifies
9851         the type parameter, not the method parameter.
9852         (InternalParameters.GenericConstraints): Likewise.
9853
9854         * generic.cs (TypeParameter.DefineType): Correctly handle
9855         constraints wrt. generic methods in interfaces and their
9856         implementations.        
9857
9858 2004-08-24  Martin Baulig  <martin@ximian.com>
9859
9860         * generic.cs (TypeParameter.IsSubclassOf): New public method.
9861         (Constraints.IsSubclassOf): New internal method.
9862
9863         * typemanager.cs (TypeManager.FindMembers): Added special support
9864         for GenericTypeParameterBuilder's.      
9865         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
9866         type parameters.
9867
9868 2004-08-24  Martin Baulig  <martin@ximian.com>
9869
9870         * typemanager.cs
9871         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
9872         this for accessibility checks.
9873         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
9874         IsNestedFamilyAccessible.
9875         (TypeManager.IsSubclassOf): New method, do what the name actually
9876         says.   
9877
9878 2004-08-24  Martin Baulig  <martin@ximian.com>
9879
9880         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
9881         as a SimpleName, include the generic arity.
9882
9883 2004-08-24  Martin Baulig  <martin@ximian.com>
9884
9885         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9886         MethodAttributes.HideBySig for operators.
9887
9888 2004-08-23  Martin Baulig  <martin@ximian.com>
9889
9890         Back to the old error reporting system :-)
9891
9892         * report.cs (Message): Removed.
9893         (Report.MessageData, ErrorData, WarningData): Removed.
9894         (Report.Error, Warning): Back to the old system.
9895
9896 2004-08-23  Martin Baulig  <martin@ximian.com>
9897
9898         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9899
9900         * class.cs (TypeContainer.ParentContainer): New public virtual
9901         method; replaces the explicit interface implementation.
9902         (ClassPart.ParentContainer): Override.
9903
9904 2004-08-23  Martin Baulig  <martin@ximian.com>
9905
9906         * statement.cs (Switch): Added support for constant switches; see
9907         #59428 or test-285.cs.
9908
9909 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9910
9911         Fixed bug #62740.
9912         * statement.cs (GetEnumeratorFilter): Removed useless
9913         logic because C# specs is strict. GetEnumerator must be
9914         public.
9915
9916 2004-08-22  Martin Baulig  <martin@ximian.com>
9917
9918         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9919         a switch and may break, reset the barrier.  Fixes #59867.
9920
9921 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9922
9923         CLS-Compliance speed up (~5% for corlib)
9924
9925         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9926         New method. Tests container for CLS-Compliant names
9927
9928         * class.cs (TypeContainer.VerifyClsName): New method.
9929         Checks whether container name is CLS Compliant.
9930         (Constructor): Implements IMethodData.
9931
9932         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9933         low-case table for CLS Compliance test.
9934         (MemberCache.VerifyClsParameterConflict): New method.
9935         Checks method parameters for CS3006 error.
9936
9937         * enum.cs (EnumMember): Is derived from MemberCore.
9938         (Enum.VerifyClsName): Optimized for better performance.
9939
9940 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9941
9942         * report.cs: Renamed Error_T to Error and changed all
9943         references.
9944
9945 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9946
9947         * class.cs (TypeContainer.IndexerArrayList): New inner class
9948         container for indexers.
9949         (TypeContainer.DefaultIndexerName): New constant for default
9950         indexer name. Replaced all "Item" with this constant.
9951         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9952
9953         * typemanager.cs (TypeManager.default_member_ctor): Cache here
9954         DefaultMemberAttribute constructor.
9955
9956 2004-08-05  Martin Baulig  <martin@ximian.com>
9957
9958         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9959         Fix bug #59429.
9960
9961 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
9962
9963         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9964         multi platforms problem.
9965
9966         * compiler.csproj: Included shared files.
9967
9968 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9969
9970         Fix bug 60333, 55971 in the more general way
9971         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9972         Added arg_type argument for constant conversion.
9973         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9974
9975 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9976
9977         Fix bug #59760
9978         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
9979         OperatorArrayList, MethodCoreArrayList for typecontainer
9980         containers. Changed class member types to these new types.
9981         (MethodArrayList.DefineMembers): Added test for CS0659.
9982
9983 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
9984
9985         * cfold.cs: Synchronize the folding with the code in expression.cs
9986         Binary.DoNumericPromotions for uint operands.
9987
9988         * attribute.cs: Revert patch from Raja, it introduced a regression
9989         while building Blam-1.2.1 (hard to isolate a test case).
9990
9991 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9992
9993         Fix for #55382
9994         * class.cs:
9995         (TypeContainer.Define): Renamed to DefineContainerMembers because of
9996         name collision.
9997         (MethodCore.parent_method): New member. The method we're overriding
9998         if this is an override method.
9999         (MethodCore.CheckBase): Moved from Method class and made common.
10000         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
10001         private.
10002         (MethodCore.CheckForDuplications): New abstract method. For custom
10003         member duplication search in a container
10004         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
10005         method and its return type.
10006         (Event.conflict_symbol): New member. Symbol with same name in the
10007         parent class.
10008
10009         * decl.cs:
10010         (MemberCache.FindMemberWithSameName): New method. The method
10011         is looking for conflict with inherited symbols.
10012
10013 2004-08-04  Martin Baulig  <martin@ximian.com>
10014
10015         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10016
10017         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10018
10019 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10020
10021         * report.cs (Message): New enum for better error, warning reference in
10022         the code.
10023         (MessageData): New inner abstract class. It generally handles printing of
10024         error and warning messages.
10025         Removed unused Error, Warning, Message methods.
10026
10027 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10028
10029         Fix for cs0592-8.cs test
10030         * attribute.cs
10031         (Attributable.ValidAttributeTargets): Made public.
10032         (Attribute.ExplicitTarget): New member for explicit target value.
10033         (Attribute.CheckTargets): Now we translate explicit attribute
10034         target to Target here.
10035
10036 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
10037
10038         * ecore.cs (MethodGroupExpr): new IsBase property.
10039
10040         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
10041
10042         * delegate.cs (DelegateCreation): store a MethodGroupExpr
10043         rather than an instance expr.
10044
10045         (DelegateCreation.Emit): Use the method group rather than
10046         the instance expression. Also, if you have base.Foo as the
10047         method for a delegate, make sure to emit ldftn, not ldftnvirt.
10048
10049         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
10050
10051         (NewDelegate.DoResolve): Only check for the existance of Invoke
10052         if the method is going to be needed. Use MethodGroupExpr.
10053
10054         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
10055
10056         * expression.cs: For pointer arith., make sure to use
10057         the size of the type, not the size of the pointer to
10058         the type.
10059
10060 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10061
10062         Fix for #60722
10063         * class.cs (Class): Added error CS0502 test.
10064
10065 2004-08-03  John Luke  <jluke@cfl.rr.com>
10066             Raja R Harinath  <rharinath@novell.com>
10067
10068         Fix for #60997.
10069         * attribute.cs (Attribute.complained_before): New flag.
10070         (Attribute.ResolveType, Attribute.Resolve),
10071         (Attribute.DefinePInvokeMethod): Set it.
10072         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
10073         
10074 2004-08-03  Martin Baulig  <martin@ximian.com>
10075
10076         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10077         use a user-defined operator; we still need to do numeric
10078         promotions in case one argument is a builtin type and the other
10079         one has an implicit conversion to that type.  Fixes #62322.
10080
10081 2004-08-18  Martin Baulig  <martin@ximian.com>
10082
10083         * class.cs (Method.Define): Use the correct method name when
10084         creating the MethodBuilder for a generic method.
10085
10086 2004-08-17  Martin Baulig  <martin@ximian.com>
10087
10088         * generic.cs (Constraints): Support type parameter constraints.
10089
10090 2004-08-16  Martin Baulig  <martin@ximian.com>
10091
10092         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
10093         (Token.GENERIC_DIMENSION): New token; this is returned if we
10094         encounter an unbound generic type in a typeof() expression.
10095
10096         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
10097         this token is only generated while parsing a typeof() expression.
10098         (typeof_expression): Removed the old unbound_type hack.
10099
10100         * generic.cs (TypeArguments.IsUnbound): New public property.
10101
10102         * decl.cs (MemberName): Added support for unbound types.
10103
10104 2004-08-14  Martin Baulig  <martin@ximian.com>
10105
10106         * typemanager.cs
10107         (TypeManager.IsEqualGenericInstance): New static method.
10108         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
10109         just used to check accessibility, so follow the rules of 26.1.6.        
10110
10111         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
10112         ConstructedType instead of a TypeExpression if we have type arguments.
10113
10114         * cs-parser.jay (typeof_expression): Support unbound generic types.
10115
10116         * ecore.cs (UnboundTypeExpression): New public class.
10117
10118 2004-08-12  Martin Baulig  <martin@ximian.com>
10119
10120         * typemanager.cs (TypeManager.IsNestedChildOf): Use
10121         TypeManager.IsEqual() rather than `=='.
10122
10123         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
10124         generic instances as well.
10125
10126 2004-08-12  Martin Baulig  <martin@ximian.com>
10127
10128         * expression.cs (Invocation.InferType): We can only infer method
10129         type parameters.  Fixes #62647.
10130
10131 2004-08-11  Martin Baulig  <martin@ximian.com>
10132
10133         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
10134         before resolving the base classes.
10135
10136 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10137
10138         * Makefile: install .mdb file too.
10139
10140 2004-08-05  Martin Baulig  <martin@ximian.com>
10141
10142         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
10143         initializer, the current type is just the TypeBuilder, not the
10144         instantiated generic type.
10145         (FieldExpr.IsFieldInitializer): New public property.
10146
10147 2004-08-04  Martin Baulig  <martin@ximian.com>
10148
10149         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10150
10151         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10152
10153 2004-08-03  Martin Baulig  <martin@ximian.com>
10154
10155         * class.cs (MethodData.Define): If we're an explicit
10156         implementation, remove the generic arity from the type name.
10157
10158 2004-08-03  Martin Baulig  <martin@ximian.com>
10159
10160         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10161         use a user-defined operator; we still need to do numeric
10162         promotions in case one argument is a builtin type and the other
10163         one has an implicit conversion to that type.  Fixes #62322.
10164
10165 2004-08-02  Martin Baulig  <martin@ximian.com>
10166
10167         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
10168         `TypeExpr[]' array.
10169         (TypeContainer.GetClassBases): Return the unexpanded list of
10170         interfaces; we expand them later.
10171         (TypeContainer.DefineType): After creating the TypeBuilder, call
10172         TypeManager.ExpandInterfaces() to get an expanded and resolved
10173         list of interfaces.
10174
10175         * ecore.cs (TypeExpr.GetInterfaces): Removed
10176
10177         * generics.cs (Constraints.InterfaceConstraints): Remove.
10178         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
10179         register the interface constraints.
10180
10181         * typemanager.cs
10182         (TypeManager.AddUserType): Removed the `ifaces' argument.
10183         (TypeManager.AddTypeParameter): Likewise.
10184         (TypeManager.AddUserInterface): Removed, was unused.
10185         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
10186         `TypeExpr[]' array for the interfaces.
10187         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
10188         has been defined, returns a list of the resolved interfaces types.
10189         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
10190         (TypeManager.GetExplicitInterfaces): Likewise.  
10191
10192 2004-08-02  Martin Baulig  <martin@ximian.com>
10193
10194         * expression.cs (Invocation.EmitCall): If we're invoking a method
10195         on a type parameter, use the new `Constrained' prefix opcode.
10196
10197 2004-08-02  Martin Baulig  <martin@ximian.com>
10198
10199         * statement.cs (LocalInfo.Flags): Added `IsThis'.
10200         (LocalInfo.IsThis): New public property.
10201         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10202
10203 2004-08-01  Martin Baulig  <martin@ximian.com>
10204
10205         * class.cs (TypeContainer.GetClassBases): Don't set the default
10206         here since we may get called from GetPartialBases().
10207         (TypeContainer.DefineType): If GetClassBases() didn't return a
10208         parent, use the default one.
10209
10210 2004-07-30  Martin Baulig  <martin@ximian.com>
10211
10212         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10213
10214         * class.cs (SourceMethod): New public class, derive from the
10215         symbol writer's ISourceMethod.
10216         (Method): Use the new symbol writer API.
10217
10218         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10219         as argument and use the new symbol writer.
10220
10221         * location.cs
10222         (SourceFile): Implement the symbol writer's ISourceFile.
10223         (Location.SymbolDocument): Removed.
10224         (Location.SourceFile): New public property.
10225
10226         * symbolwriter.cs: Use the new symbol writer API.
10227
10228 2004-07-30  Raja R Harinath  <rharinath@novell.com>
10229
10230         * Makefile (install-local): Remove.  Functionality moved to
10231         executable.make.
10232
10233 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
10234
10235         * Makefile: Install mcs.exe.config file together with mcs.exe.
10236         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10237         correct runtime version.
10238         
10239 2004-07-25  Martin Baulig  <martin@ximian.com>
10240
10241         * class.cs
10242         (TypeContainer.RegisterOrder): Removed, this was unused.
10243         (TypeContainer, interface_order): Removed.
10244         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10245         TypeContainer as argument since we can also be called with a
10246         `PartialContainer' for a partial class/struct/interface.
10247         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10248         of checking whether we're an `Interface' - we could be a
10249         `PartialContainer'.
10250         (PartialContainer.Register): Override; call
10251         AddClass()/AddStruct()/AddInterface() on our parent.
10252
10253         * cs-parser.jay (interface_member_declaration): Add things to the
10254         `current_container', not the `current_class'.
10255
10256         * rootcontext.cs (RegisterOrder): The overloaded version which
10257         takes an `Interface' was unused, removed.
10258
10259         * typemanager.cs (TypeManager.LookupInterface): Return a
10260         `TypeContainer', not an `Interface'.
10261         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10262         contain a `PartialContainer' for an interface, so check it's
10263         `Kind' to figure out what it is.
10264
10265 2004-07-25  Martin Baulig  <martin@ximian.com>
10266
10267         * class.cs (Class.DefaultTypeAttributes): New public constant.
10268         (Struct.DefaultTypeAttributes): Likewise.
10269         (Interface.DefaultTypeAttributes): Likewise.
10270         (PartialContainer.TypeAttr): Override this and add the
10271         DefaultTypeAttributes.
10272
10273 2004-07-25  Martin Baulig  <martin@ximian.com>
10274
10275         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10276         we can just use the `Parent' field instead.
10277
10278 2004-07-25  Martin Baulig  <martin@ximian.com>
10279
10280         * class.cs (TypeContainer.Emit): Renamed to EmitType().
10281
10282 2004-07-25  Martin Baulig  <martin@ximian.com>
10283
10284         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10285         our parts before defining any methods.
10286         (TypeContainer.VerifyImplements): Make this virtual.
10287         (ClassPart.VerifyImplements): Override and call VerifyImplements()
10288         on our PartialContainer.
10289
10290 2004-07-25  Martin Baulig  <martin@ximian.com>
10291
10292         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10293
10294         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10295         argument, we can just use the `Parent' field instead.
10296
10297         * class.cs
10298         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
10299         (MemberBase.DoDefine): Likewise.
10300
10301 2004-07-24  Martin Baulig  <martin@ximian.com>
10302
10303         * decl.cs (MemberCore.Parent): New public field.
10304         (DeclSpace.Parent): Moved to MemberCore.
10305
10306         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10307         (MemberBase.ctor): Added TypeContainer argument, pass it to our
10308         parent's .ctor.
10309         (FieldBase, Field, Operator): Likewise.
10310         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10311         (EventField, Event): Likewise.
10312
10313 2004-07-23  Martin Baulig  <martin@ximian.com>
10314
10315         * class.cs (PartialContainer): New public class.
10316         (ClassPart): New public class.
10317         (TypeContainer): Added support for partial classes.
10318         (TypeContainer.GetClassBases): Splitted some of the functionality
10319         out into GetNormalBases() and GetPartialBases().
10320
10321         * cs-tokenizer.cs (Token.PARTIAL): New token.
10322         (Tokenizer.consume_identifier): Added some hacks to recognize
10323         `partial', but only if it's immediately followed by `class',
10324         `struct' or `interface'.
10325
10326         * cs-parser.jay: Added support for partial clases.
10327
10328 2004-07-23  Martin Baulig  <martin@ximian.com>
10329
10330         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10331         a `DeclSpace' and also made it readonly.
10332         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10333         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10334         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10335
10336         * cs-parser.jay: Pass the `current_class', not the
10337         `current_container' (at the moment, this is still the same thing)
10338         to a new Method, Property, Event, Indexer or Constructor.
10339
10340 2004-07-23  Martin Baulig  <martin@ximian.com>
10341
10342         * cs-parser.jay (CSharpParser): Added a new `current_class' field
10343         and removed the `current_interface' one.
10344         (struct_declaration, class_declaration, interface_declaration):
10345         Set `current_class' to the newly created class/struct/interface;
10346         set their `Bases' and call Register() before parsing their body.
10347
10348 2004-07-23  Martin Baulig  <martin@ximian.com>
10349
10350         * class.cs (Kind): New public enum.
10351         (TypeContainer): Made this class abstract.
10352         (TypeContainer.Kind): New public readonly field.
10353         (TypeContainer.CheckDef): New public method; moved here from
10354         cs-parser.jay.
10355         (TypeContainer.Register): New public abstract method.
10356         (TypeContainer.GetPendingImplementations): New public abstract
10357         method.
10358         (TypeContainer.GetClassBases): Removed the `is_class' and
10359         `is_iface' parameters.
10360         (TypeContainer.DefineNestedTypes): Formerly known as
10361         DoDefineType().
10362         (ClassOrStruct): Made this class abstract.
10363
10364         * tree.cs (RootTypes): New public type. 
10365
10366 2004-07-20  Martin Baulig  <martin@ximian.com>
10367
10368         * tree.cs (Tree.RecordNamespace): Removed.
10369         (Tree.Namespaces): Removed.
10370
10371         * rootcontext.cs (RootContext.IsNamespace): Removed.
10372
10373         * cs-parser.jay (namespace_declaration): Just create a new
10374         NamespaceEntry here.
10375
10376 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
10377
10378         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
10379         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
10380         entry to make sure it runs in the correct runtime version.
10381         
10382 2004-07-18  Martin Baulig  <martin@ximian.com>
10383
10384         * generic.cs (ConstructedType.CheckConstraints): Improved
10385         constraints checking.
10386
10387 2004-07-18  Martin Baulig  <martin@ximian.com>
10388
10389         * expression.cs (Invocation.BetterMethod): Call
10390         TypeManager.TypeToCoreType() on all types and removed my previous
10391         hack; we're already doig the right thing here.
10392
10393 2004-07-17  Martin Baulig  <martin@ximian.com>
10394
10395         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
10396
10397 2004-07-16  Martin Baulig  <martin@ximian.com>
10398
10399         * iterators.cs: Added generics support.
10400
10401 2004-07-16  Martin Baulig  <martin@ximian.com>
10402
10403         * iterators.cs: Rewrote this.  We're now using one single Proxy
10404         class for both the IEnumerable and the IEnumerator interface and
10405         `Iterator' derives from Class so we can use the high-level API.
10406
10407         * class.cs (TypeContainer.AddIterator): New method.
10408         (TypeContainer.DoDefineType): New protected virtual method, which
10409         is called from DefineType().
10410         (TypeContainer.DoDefineMembers): Call DefineType() and
10411         DefineMembers() on all our iterators.
10412         (TypeContainer.Emit): Call Emit() on all our iterators.
10413         (TypeContainer.CloseType): Call CloseType() on all our iterators.
10414
10415         * codegen.cs (EmitContext.CurrentIterator): New public field.
10416
10417 2004-07-15  Martin Baulig  <martin@ximian.com>
10418
10419         * typemanager.cs
10420         (TypeManager.not_supported_exception_type): New type.   
10421
10422 2004-07-14  Martin Baulig  <martin@ximian.com>
10423
10424         * typemanager.cs
10425         (TypeManager.generic_ienumerable_type): New type.
10426         (TypeManager.generic_ienumerator_type): New type.
10427
10428         * rootcontext.cs
10429         (RootContext.interfaces_first_stage): Added
10430         "System.Collections.Generic.IEnumerator`1" and
10431         "System.Collections.Generic.IEnumerable`1".     
10432
10433 2004-07-14  Martin Baulig  <martin@ximian.com>
10434
10435         * iterators.cs: Use real error numbers.
10436
10437 2004-07-14  Martin Baulig  <martin@ximian.com>
10438
10439         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
10440         requires this to be a System.Collection.IEnumerable and not a
10441         class implementing that interface.
10442         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
10443
10444 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
10445
10446         * class.cs: Fixed previous fix, it broke some error tests.
10447
10448 2004-07-12  Martin Baulig  <martin@ximian.com>
10449
10450         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
10451         Fixes #61293.
10452
10453 2004-07-14  Martin Baulig  <martin@ximian.com>
10454
10455         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
10456         an exclamation mark (!) for the generic arity to reflect the
10457         latest spec changes; ie. use "System.Collections.Generic.IList`1".
10458
10459 2004-07-13  Martin Baulig  <martin@ximian.com>
10460
10461         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
10462         specifiers being part of a type argument.
10463
10464 2004-07-13  Martin Baulig  <martin@ximian.com>
10465
10466         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
10467         name for generic types.
10468
10469 2004-07-13  Martin Baulig  <martin@ximian.com>
10470
10471         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
10472         bit to fix #60119.
10473
10474 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
10475
10476         * assign.cs (LocalTemporary): Add new argument: is_address,If
10477         `is_address' is true, then the value that we store is the address
10478         to the real value, and not the value itself.
10479         
10480         * ecore.cs (PropertyExpr): use the new local temporary
10481         stuff to allow us to handle X.Y += z (where X is a struct)
10482
10483 2004-07-08  Martin Baulig  <martin@ximian.com>
10484
10485         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
10486         not always return, just like we're doing in Using.Resolve().
10487
10488 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
10489
10490         * cs-parser.jay (fixed_statement): flag this as Pinned.
10491
10492 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
10493
10494         * typemanager.cs (TypeManager): Removed MakePinned method, this
10495         mechanism is replaced with the .NET 2.x compatible mechanism of
10496         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
10497
10498         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
10499         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
10500         `IsFixed' property which has a different meaning.
10501
10502 2004-07-02  Raja R Harinath  <rharinath@novell.com>
10503
10504         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
10505         visible from inside a nested class, not just the names of the
10506         immediately enclosing class.
10507         Fix for bug #60730.
10508
10509 2004-06-24  Raja R Harinath  <rharinath@novell.com>
10510
10511         * expression.cs (BetterConversion): Remove buggy special-case
10512         handling of "implicit constant expression conversions".  At this
10513         point, we already know that the conversion is possible -- we're
10514         only checking to see which is better.
10515
10516 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10517
10518         * cs-parser.jay: Added error CS0210 test.
10519
10520 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10521
10522         * cs-parser.jay: Added error CS0134 test.
10523
10524 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10525
10526         Fix bug #52507
10527         * cs-parser.jay: Added error CS0145 test.
10528
10529 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10530
10531         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
10532
10533 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
10534         
10535         * expression.cs (StackAlloc.Resolve): The argument may not
10536         be a constant; deal with this case.
10537         
10538 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
10539
10540         * attribute.cs (IndexerName_GetIndexerName): Renamed to
10541         GetIndexerAttributeValue.
10542         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10543
10544         * class.cs (Indexer.Define): Added error tests for CS0415,
10545         CS0609.
10546
10547 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
10548
10549         * attribute.cs (Attribute.Resolve): Keep field code in sync with
10550         property code.
10551
10552 2004-06-23  Martin Baulig  <martin@ximian.com>
10553
10554         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
10555         neither return nor throw, reset the barrier as well.  Fixes #60457.
10556
10557 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
10558
10559         * class.cs : EventAttributes is now set to None by default.
10560           This fixes bug #60459.
10561
10562 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10563
10564         Fix bug #60219
10565         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10566         Don't throw exception but return null (it's sufficient now).
10567
10568 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10569
10570         * typemanager.cs (GetArgumentTypes): Faster implementation.
10571
10572 2004-06-18  Martin Baulig  <martin@ximian.com>
10573
10574         * attribute.cs (Attribute.Resolve): Check whether we're an
10575         EmptyCast which a Constant child.  Fixes #60333.
10576
10577 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
10578
10579         * statement.cs (EmitCollectionForeach): Account for the fact that
10580         not all valuetypes are in areas which we can take the address of.
10581         For these variables, we store to a temporary variable. Also, make
10582         sure that we dont emit a `callvirt' on a valuetype method.
10583
10584 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10585
10586         * expression.cs (StackAlloc.DoReSolve): Added test for
10587         negative parameter (CS0247).
10588
10589 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10590
10591         Fix bug #59792
10592         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
10593
10594 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10595
10596         Fix bug #59781
10597         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10598         ulong.
10599
10600 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10601
10602         Fix bug #58254 & cs1555.cs, cs1556.cs
10603         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10604
10605 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10606
10607         * cs-parser.jay: Added error CS1669 test for indexers.
10608
10609 2004-06-18  Martin Baulig  <martin@ximian.com>
10610
10611         * generics.cs (GenericMethod.ctor): Don't take an Attributes
10612         argument.  Fixes #60441.
10613
10614 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
10615         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
10616         The name needs to have the actual name of the method in order
10617         for other tests (such as the one in OverloadResolve for Invoke
10618         on a delegate) to work. As well, it does not really help
10619         error reporting because the method group had multiple methods.
10620         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
10621         Make profiling work.
10622         
10623 2004-06-13  Martin Baulig  <martin@ximian.com>
10624
10625         * cs-parser.jay: Don't allow generic attributes.
10626
10627 2004-06-13  Martin Baulig  <martin@ximian.com>
10628
10629         * class.cs (MemberBase.DoDefineBase): New protected method.
10630         (MemberBase.DoDefine): Compute the `flags' in the new
10631         DoDefineBase() which must be called first.
10632         (Method.Define): Call DoDefineBase() first so we have the flags
10633         when defining the generic method.
10634
10635         * cs-parser.jay (interface_method_declaration): Support generic methods.
10636
10637 2004-06-13  Martin Baulig  <martin@ximian.com>
10638
10639         * decl.cs (TypeName): Removed.
10640         (MemberName): Removed TypeName and MemberNow; now we just have
10641         MemberName.
10642
10643         * cs-parser.jay: Don't distinguish between type arguments and type
10644         parameters in the grammar and simplified the rules a bit.  The
10645         reduce/reduce conflicts are now gone (except the one we inherited
10646         from mcs).
10647
10648 2004-06-11  Martin Baulig  <martin@ximian.com>
10649
10650         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10651         call this twice: for params and varargs methods.
10652
10653 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10654
10655         * class.cs:
10656         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10657
10658 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10659
10660         * attribute.cs (Attribute.GetValidTargets): Made public.
10661
10662         * class.cs: 
10663         (AbstractPropertyEventMethod): New class for better code sharing.
10664         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10665         CS1667 report.
10666         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10667
10668 2004-06-09  Martin Baulig  <martin@ximian.com>
10669
10670         * cs-parser.jay: Removed a reduce/reduce conflict.
10671
10672 2004-06-03  Martin Baulig  <martin@ximian.com>
10673
10674         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
10675         GetSimpleName() and return a SimpleName.
10676
10677         * ecore.cs (SimpleName.Arguments): New public field.
10678         (SimpleName): Added overloaded ctor which takes an additional
10679         TypeArguments argument.
10680         (SimpleName.SimpleNameResolve): Added support for generic methods.
10681         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
10682         formerly in MemberAccess.DoResolve(), but we also need it in
10683         SimpleNameResolve().
10684
10685         * expression.cs (MemberAccess.DoResolve): Use the new
10686         MethodGroupExpr.ResolveGeneric().       
10687
10688 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10689
10690         * decl.cs: If possible, use lookuptypedirect here. We can only do
10691         this if there is no `.' after the namespace. Avoids using
10692         LookupType, which does lots of slow processing.
10693         (FindNestedType) New method, does what it says :-).
10694         * namespace.cs: use LookupTypeDirect.
10695         * rootcontext.cs: use membercache, if possible.
10696         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10697
10698 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10699
10700         * expression.cs:
10701         According to the spec, 
10702
10703         In a member access of the form E.I, if E is a single identifier,
10704         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10705         field, property, localvariable, or parameter with the same type as
10706         the meaning of E as a type-name (§3.8), then both possible
10707         meanings of E are permitted.
10708
10709         We did not check that E as a simple-name had the same type as E as
10710         a type name.
10711
10712         This trivial check gives us 5-7% on bootstrap time.
10713
10714 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10715
10716         * expression.cs (Invocation.OverloadResolve): Avoid the
10717         use of hashtables and boxing here by allocating on demand.
10718
10719 2004-05-30  Martin Baulig  <martin@ximian.com>
10720
10721         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10722         we're doing a silent lookup.  Don't try to lookup nested types in
10723         TypeManager.object_type (thanks to Ben Maurer).
10724
10725 2004-05-30  Martin Baulig  <martin@ximian.com>
10726
10727         Committing a patch from Ben Maurer.
10728
10729         * rootcontext.cs (RootContext.LookupType): Cache negative results.
10730
10731 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10732
10733         * convert.cs: add a trivial cache for overload operator resolution.
10734
10735 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
10736
10737         * attribute.cs
10738         (AttributeTester.GetObsoleteAttribute): Returns instance of
10739         ObsoleteAttribute when type is obsolete.
10740
10741         * class.cs
10742         (TypeContainer.VerifyObsoleteAttribute): Override.
10743         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10744         (MethodCode.VerifyObsoleteAttribute): Override.
10745         (MemberBase.VerifyObsoleteAttribute): Override.
10746
10747         * decl.cs
10748         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10749         and report proper error.
10750
10751         *delegate.cs
10752         (Delegate.VerifyObsoleteAttribute): Override.
10753
10754         * ecore.cs
10755         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10756         and report proper error.
10757         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10758
10759         * enum.cs
10760         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10761         and enum member.
10762
10763         * expression.cs
10764         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10765         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10766         Added test for ObsoleteAttribute.
10767
10768         * statement.cs
10769         (Catch): Derived from Statement.
10770
10771 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10772
10773         * decl.cs: If possible, use lookuptypedirect here. We can only do
10774         this if there is no `.' after the namespace. Avoids using
10775         LookupType, which does lots of slow processing.
10776         (FindNestedType) New method, does what it says :-).
10777         * namespace.cs: use LookupTypeDirect.
10778         * rootcontext.cs: use membercache, if possible.
10779         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10780
10781 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10782
10783         * expression.cs:
10784         According to the spec, 
10785
10786         In a member access of the form E.I, if E is a single identifier,
10787         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10788         field, property, localvariable, or parameter with the same type as
10789         the meaning of E as a type-name (§3.8), then both possible
10790         meanings of E are permitted.
10791
10792         We did not check that E as a simple-name had the same type as E as
10793         a type name.
10794
10795         This trivial check gives us 5-7% on bootstrap time.
10796
10797 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
10798
10799         Fixed bug #59071 & cs0160.cs
10800         * statement.cs (Try.Resolve): Check here whether order of catch
10801         clauses matches their dependencies.
10802
10803 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
10804
10805         Fixed bug #58624
10806         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
10807         unsafe type.
10808
10809 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10810
10811         * expression.cs (Invocation.OverloadResolve): Avoid the
10812         use of hashtables and boxing here by allocating on demand.
10813
10814 2004-05-30  Martin Baulig  <martin@ximian.com>
10815
10816         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10817         we're doing a silent lookup.  Don't try to lookup nested types in
10818         TypeManager.object_type (thanks to Ben Maurer).
10819
10820 2004-05-30  Martin Baulig  <martin@ximian.com>
10821
10822         Committing a patch from Ben Maurer.
10823
10824         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
10825
10826 2004-05-29  Martin Baulig  <martin@ximian.com>
10827
10828         * class.cs (IMethodData.ShouldIgnore): New method.
10829
10830         * typemanager.cs (TypeManager.MethodFlags): Don't take a
10831         `Location' argument, we don't need it anywhere.  Use
10832         `IMethodData.ShouldIgnore ()' instead of
10833         `MethodData.GetMethodFlags ()'.
10834         (TypeManager.AddMethod): Removed.
10835         (TypeManager.AddMethod2): Renamed to AddMethod.
10836
10837 2004-05-29  Martin Baulig  <martin@ximian.com>
10838
10839         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10840
10841         * convert.cs (Convert.ImplicitReferenceConversion): If we're
10842         converting from a class type S to an interface type and we already
10843         have an object on the stack, don't box it again.  Fixes #52578.
10844
10845 2004-05-29  Martin Baulig  <martin@ximian.com>
10846
10847         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10848         Added support for `params' parameters.  Fixes #59267.
10849
10850 2004-05-29  Martin Baulig  <martin@ximian.com>
10851
10852         * literal.cs (NullPointer): Provide a private .ctor which sets
10853         `type' to TypeManager.object_type.  Fixes #59048.
10854
10855 2004-05-29  Martin Baulig  <martin@ximian.com>
10856
10857         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10858         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
10859
10860         * ecore.cs (EventExpr.instance_expr): Make the field private.
10861
10862 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
10863
10864         Fixed bug #50080 & cs0214-2.cs
10865         * expression.cs (Cast.DoResolve): Check unsafe context here.
10866         
10867         * statement.cs (Resolve.DoResolve): Likewise.
10868
10869 2004-05-26  Martin Baulig  <martin@ximian.com>
10870
10871         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10872
10873         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10874         (RootContext.LookupType): Pass down the `silent' flag.
10875
10876 2004-05-25  Martin Baulig  <martin@ximian.com>
10877
10878         * expression.cs
10879         (MethodGroupExpr.IdenticalTypeName): New public property.
10880         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10881         expression actually refers to a type.
10882
10883 2004-05-25  Martin Baulig  <martin@ximian.com>
10884
10885         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10886         for #56176 and made it actually work.
10887
10888 2004-05-25  Martin Baulig  <martin@ximian.com>
10889
10890         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10891         (FieldExpr, PropertyExpr): Override and implement
10892         CacheTemporaries.  Fixes #52279.
10893
10894 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
10895
10896         * location.cs: In the new compiler listing a file twice is a
10897         warning, not an error.
10898
10899 2004-05-24  Martin Baulig  <martin@ximian.com>
10900
10901         * enum.cs (Enum.DefineType): For the `BaseType' to be a
10902         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
10903
10904 2004-05-24  Martin Baulig  <martin@ximian.com>
10905
10906         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10907         walking the `using' list.  Fixes #53921.
10908
10909 2004-05-24  Martin Baulig  <martin@ximian.com>
10910
10911         * const.cs (Const.LookupConstantValue): Added support for
10912         EmptyCast's; fixes #55251.
10913
10914 2004-05-24  Martin Baulig  <martin@ximian.com>
10915
10916         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10917         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10918         which does the CS0135 check.  The reason is that we first need to
10919         check whether the variable actually exists.
10920
10921 2004-05-24  Martin Baulig  <martin@ximian.com>
10922
10923         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10924         than RootContext.LookupType() to find the explicit interface
10925         type.  Fixes #58584.
10926
10927 2004-05-24  Raja R Harinath  <rharinath@novell.com>
10928
10929         * Makefile: Simplify.  Use executable.make.
10930         * mcs.exe.sources: New file.  List of sources of mcs.exe.
10931
10932 2004-05-24  Anders Carlsson  <andersca@gnome.org>
10933
10934         * decl.cs:
10935         * enum.cs:
10936         Use the invariant culture when doing String.Compare for CLS case
10937         sensitivity.
10938         
10939 2004-05-23  Martin Baulig  <martin@ximian.com>
10940
10941         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10942         don't have any dots.  Fixes #52622, added cs0246-8.cs.
10943
10944         * namespace.cs (NamespaceEntry.Lookup): Likewise.
10945
10946 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10947
10948         * class.cs (MemberBase.Define): Reuse MemberType member for 
10949         resolved type. Other methods can use it too.
10950
10951 2004-05-23  Martin Baulig  <martin@ximian.com>
10952
10953         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10954         the variable also exists in the current block (otherwise, we need
10955         to report a CS0103).  Fixes #58670.
10956
10957 2004-05-23  Martin Baulig  <martin@ximian.com>
10958
10959         * flowanalysis.cs (Reachability.Reachable): Compute this
10960         on-the-fly rather than storing it as a field.
10961
10962 2004-05-23  Martin Baulig  <martin@ximian.com>
10963
10964         * flowanalysis.cs (Reachability.And): Manually compute the
10965         resulting `barrier' from the reachability.      
10966        
10967 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10968
10969         Fix bug #57835
10970         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10971         instance of ObsoleteAttribute when symbol is obsolete.
10972
10973         * class.cs
10974         (IMethodData): Extended interface for ObsoleteAttribute support.
10975
10976 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10977
10978         * attribute.cs: Fix bug #55970
10979
10980 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10981
10982         Fix bug #52705
10983         * attribute.cs
10984         (GetObsoleteAttribute): New method. Creates the instance of
10985         ObsoleteAttribute.
10986         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10987         ObsoleteAttribute when member is obsolete.
10988         (AttributeTester.Report_ObsoleteMessage): Common method for
10989         Obsolete error/warning reporting.
10990
10991         * class.cs
10992         (TypeContainer.base_classs_type): New member for storing parent type.
10993
10994         * decl.cs
10995         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10996         for this MemberCore.
10997
10998 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10999
11000         * attribute.cs, const.cs: Fix bug #58590
11001
11002 2004-05-21  Martin Baulig  <martin@ximian.com>
11003
11004         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
11005         out parameters if the end of the method is unreachable.  Fixes
11006         #58098. 
11007
11008 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11009
11010         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
11011         Hari was right, why extra method.
11012
11013 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11014
11015         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
11016
11017 2004-05-20  Martin Baulig  <martin@ximian.com>
11018
11019         * delegate.cs: Convert this file to Unix mode - like the original
11020         version in mcs is.
11021
11022 2004-05-20  Martin Baulig  <martin@ximian.com>
11023
11024         * attribute.cs: Convert this file to Unix mode - like the original
11025         version in mcs is.
11026
11027 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
11028
11029        Fix bug #58688 (MCS does not report error when the same attribute
11030        is assigned twice)
11031
11032        * attribute.cs (Attribute.Emit): Distinction between null and default.
11033
11034 2004-05-19  Raja R Harinath  <rharinath@novell.com>
11035
11036        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
11037        of a top-level attribute without an attribute target.
11038        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
11039        Make non-static.
11040        (Attribute.Conditional_GetConditionName), 
11041        (Attribute.Obsolete_GetObsoleteMessage): Update.
11042        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
11043        part of ScanForIndexerName.
11044        (Attribute.CanIgnoreInvalidAttribute): New function.
11045        (Attribute.ScanForIndexerName): Move to ...
11046        (Attributes.ScanForIndexerName): ... here.
11047        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
11048        (Attributes.Search): New internal variant that can choose not to
11049        complain if types aren't resolved.  The original signature now
11050        complains.
11051        (Attributes.GetClsCompliantAttribute): Use internal variant, with
11052        complaints suppressed.
11053        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
11054        only if it not useful.
11055        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
11056        top-level for attributes that are shared between the assembly
11057        and a top-level class.
11058        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
11059        * class.cs: Update to reflect changes.
11060        (DefineIndexers): Fuse loops.
11061        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
11062        a couple more variants of attribute names.
11063
11064 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
11065
11066         Fix bug #52585 (Implemented explicit attribute declaration)
11067
11068         * attribute.cs:
11069         (Attributable.ValidAttributeTargets): New abstract method. It gets
11070         list of valid attribute targets for explicit target declaration.
11071         (Attribute.Target): It holds target itself.
11072         (AttributeSection): Removed.
11073         (Attribute.CheckTargets): New method. It checks whether attribute
11074         target is valid for the current element.
11075
11076         * class.cs:
11077         (EventProperty): New class. For events that are declared like
11078         property (with add and remove accessors).
11079         (EventField): New class. For events that are declared like field.
11080         class.cs
11081
11082         * cs-parser.jay: Implemented explicit attribute target declaration.
11083
11084         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
11085         Override ValidAttributeTargets.
11086
11087         * parameter.cs:
11088         (ReturnParameter): Class for applying custom attributes on 
11089         the return type.
11090         (ParameterAtribute): New class. Class for applying custom
11091         attributes on the parameter type.
11092
11093 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
11094
11095         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
11096         definitions. 
11097
11098         (Method): Allow UNSAFE here.
11099
11100         * modifiers.cs: Support unsafe reporting.
11101
11102 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
11103
11104         * decl.cs: Fix bug #58478.
11105
11106 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11107
11108         * statement.cs: When checking for unreachable code on an EmptyStatement,
11109         set the location. Fixes bug #58488.
11110
11111 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
11112
11113         * driver.cs: Add -pkg handling.
11114
11115         From Gonzalo: UseShelLExecute=false
11116
11117 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
11118
11119         * attribute.cs:
11120         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
11121         for attribute.
11122         (Attribute.IsClsCompliaceRequired): Moved to base for better
11123         accesibility.
11124         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
11125         when attribute is AttributeUsageAttribute.
11126         (Attribute.GetValidTargets): Simplified.
11127         (Attribute.GetAttributeUsage): New method returns AttributeUsage
11128         attribute for this type.
11129         (Attribute.ApplyAttributes): Method renamed to Emit and make
11130         non-static.
11131         (GlobalAttributeSection): New class for special handling of global
11132         attributes (assembly, module).
11133         (AttributeSection.Emit): New method.
11134
11135         * class.cs: Implemented Attributable abstract methods.
11136         (MethodCore.LabelParameters): Moved to Parameter class.
11137         (Accessor): Is back simple class.
11138         (PropertyMethod): Implemented Attributable abstract class.
11139         (DelegateMethod): Implemented Attributable abstract class.
11140         (Event): New constructor for disctintion between normal Event
11141         and Event with accessors.
11142
11143         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
11144
11145         * codegen.cs, const.cs, decl.cs, delegate.cs:
11146         (CommonAssemblyModulClass): Implemented Attributable abstract class
11147         and simplified.
11148
11149         * enum.cs: Implement IAttributeSupport interface.
11150         (EnumMember): New class for emum members. Implemented Attributable
11151         abstract class
11152
11153         * parameter.cs:
11154         (ParameterBase): Is abstract.
11155         (ReturnParameter): New class for easier [return:] attribute handling.
11156
11157         * typemanager.cs: Removed builder_to_attr.
11158
11159 2004-05-11  Raja R Harinath  <rharinath@novell.com>
11160
11161         Fix bug #57151.
11162         * attribute.cs (Attribute.GetPositionalValue): New function.
11163         * class.cs (TypeContainer.VerifyMembers): New function.
11164         (TypeContainer.Emit): Use it.
11165         (ClassOrStruct): New base class for Class and Struct.
11166         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
11167         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
11168         class.
11169         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
11170         then each non-static field should have a FieldOffset attribute.
11171         Otherwise, none of the fields should have a FieldOffset attribute.
11172         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
11173         and FieldOffset attributes.
11174         * typemanager.cs (TypeManager.struct_layout_attribute_type)
11175         (TypeManager.field_offset_attribute_type): New core types.
11176         (TypeManager.InitCoreTypes): Initialize them.
11177
11178 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
11179
11180         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11181         Return correct type.
11182         From bug #58270.
11183
11184 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
11185
11186         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11187         be implicitly converted to ulong.
11188         
11189         * expression.cs: The logic for allowing operator &, | and ^ worked
11190         was wrong, it worked before because we did not report an error in
11191         an else branch.  Fixes 57895.
11192
11193         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11194         allow volatile fields to be reference types.
11195
11196 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
11197
11198         * driver.cs: Add support for /debug-
11199
11200 2004-05-07  Raja R Harinath  <rharinath@novell.com>
11201
11202         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
11203         Add a 'complain' parameter to silence errors.
11204         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
11205         silently overlooked type-resolutions.
11206         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11207         to reflect changes.
11208         (Attributes.Search): New function.
11209         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11210         (Attributes.GetAttributeFullName): Remove hack.
11211         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
11212         Update to reflect changes.
11213         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11214         Use Attributes.Search instead of nested loops.
11215
11216 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
11217
11218         * decl.cs:
11219         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11220         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11221         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11222
11223         * report.cs: (Report.Warning): Renamed to Warning_T because of
11224         parameter collision.
11225
11226 2004-05-05  Raja R Harinath  <rharinath@novell.com>
11227
11228         * expression.cs (MemberAccess.ResolveMemberAccess):
11229         Exit with non-zero status after Report.Error.
11230         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
11231         Likewise.
11232         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
11233
11234 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11235
11236         * support.cs: Don't hang when the file is empty.
11237
11238 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11239
11240         * support.cs: In SeekableStreamReader, compute the preamble size of the
11241           underlying stream. Position changes should take into account that initial
11242           count of bytes.
11243
11244 2004-05-03  Todd Berman  <tberman@sevenl.net>
11245
11246         * driver.cs: remove unused GetSysVersion function.
11247
11248 2004-05-03  Todd Berman  <tberman@sevenl.net>
11249
11250         * driver.cs: Remove the hack from saturday, as well as the hack
11251         from jackson (LoadAssemblyFromGac), also adds the CWD to the
11252         link_paths to get that bit proper.
11253
11254 2004-05-01  Todd Berman  <tberman@sevenl.net>
11255
11256         * driver.cs: Try a LoadFrom before a Load, this checks the current
11257         path. This is currently a bug in mono that is be fixed, however, this
11258         provides a workaround for now. This will be removed when the bug
11259         is fixed.
11260
11261 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
11262
11263         * CryptoConvert.cs: Updated to latest version. Fix issue with 
11264         incomplete key pairs (#57941).
11265
11266 2004-05-01  Todd Berman  <tberman@sevenl.net>
11267
11268         * driver.cs: Remove '.' from path_chars, now System.* loads properly
11269         from the GAC
11270
11271 2004-04-30  Jackson Harper  <jackson@ximian.com>
11272
11273         * codegen.cs: Open keys readonly.
11274         
11275 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11276
11277         * typemanager.cs: don't report cyclic struct layout when a struct
11278         contains 2 or more fields of the same type. Failed for Pango.AttrShape
11279         which has 2 Pango.Rectangle fields.
11280
11281 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11282
11283         * expression.cs: Handle IntPtr comparisons with IL code
11284         rather than a method call.
11285
11286 2004-04-29  Martin Baulig  <martin@ximian.com>
11287
11288         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
11289         the list of PropertyInfo's in class hierarchy and find the
11290         accessor.  Fixes #56013.
11291
11292 2004-04-29  Martin Baulig  <martin@ximian.com>
11293
11294         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
11295
11296 2004-04-29  Martin Baulig  <martin@ximian.com>
11297
11298         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11299
11300         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
11301
11302 2004-04-29  Martin Baulig  <martin@ximian.com>
11303
11304         * class.cs (ConstructorInitializer.Resolve): Check whether the
11305         parent .ctor is accessible.  Fixes #52146.
11306
11307 2004-04-29  Martin Baulig  <martin@ximian.com>
11308
11309         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11310
11311         * statement.cs (Using.EmitLocalVariableDecls): Use
11312         TypeManager.idisposable_type, not typeof (IDisposable).
11313         (Foreach.EmitCollectionForeach): Added support for valuetypes.
11314
11315 2004-04-29  Martin Baulig  <martin@ximian.com>
11316
11317         * class.cs (Event.Define): Don't emit the field and don't set
11318         RTSpecialName and SpecialName for events on interfaces.  Fixes
11319         #57703. 
11320
11321 2004-04-29  Raja R Harinath  <rharinath@novell.com>
11322
11323         Refactor Attribute.ApplyAttributes.
11324         * attribute.cs (Attributable): New base class for objects that can
11325         have Attributes applied on them.
11326         (Attribute): Make AttributeUsage fields public.
11327         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
11328         (Attribute.IsInternalCall): New property.
11329         (Attribute.UsageAttr): Convert to a public read-only property.
11330         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
11331         (Attribute.ResolveType, Attribute.Resolve)
11332         (Attribute.ScanForIndexerName): Update to reflect changes.
11333         (Attribute.CheckAttributeTarget): Re-format.
11334         (Attribute.ApplyAttributes): Refactor, to various
11335         Attributable.ApplyAttributeBuilder methods.
11336         * decl.cs (MemberCore): Make Attributable.
11337         * class.cs (Accessor): Make Attributable.
11338         (MethodData.ApplyAttributes): Use proper attribute types, not
11339         attribute names.
11340         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
11341         (TypeContainer.ApplyAttributeBuilder)
11342         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
11343         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
11344         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
11345         (Operator.ApplyAttributeBuilder): New factored-out methods.
11346         * const.cs (Const.ApplyAttributeBuilder): Likewise.
11347         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
11348         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
11349         * parameter.cs (ParameterBase): New Attributable base class
11350         that can also represent Return types.
11351         (Parameter): Update to the changes.
11352
11353 2004-04-29  Jackson Harper  <jackson@ximian.com>
11354
11355         * driver.cs: Prefer the corlib system version when looking for
11356         assemblies in the GAC. This is still a hack, but its a better hack
11357         now.
11358         
11359 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
11360
11361         * decl.cs, enum.cs: Improved error 3005 reporting.
11362   
11363         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
11364         (related_symbols): New private member for list of symbols
11365         related to reported error/warning.
11366         
11367         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
11368
11369 2004-04-29  Martin Baulig  <martin@ximian.com>
11370
11371         * ecore.cs (Expression.Constantify): If we're an enum and
11372         TypeManager.TypeToCoreType() doesn't give us another type, use
11373         t.UnderlyingSystemType.  Fixes #56178.  
11374
11375 2004-04-29  Martin Baulig  <martin@ximian.com>
11376
11377         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
11378         interfaces and for each interface, only add members directly
11379         declared in that interface.  Fixes #53255.
11380
11381 2004-04-28  Martin Baulig  <martin@ximian.com>
11382
11383         * expression.cs (ConditionalLogicalOperator): Use a temporary
11384         variable for `left' to avoid that we evaluate it more than once;
11385         bug #52588.
11386
11387 2004-04-28  Martin Baulig  <martin@ximian.com>
11388
11389         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
11390         `void[]' (CS1547).
11391
11392 2004-04-28  Martin Baulig  <martin@ximian.com>
11393
11394         * statement.cs (LocalInfo.Resolve): Check whether the type is not
11395         void (CS1547).
11396
11397         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
11398         whether the type is not void (CS1547).
11399
11400 2004-04-28  Martin Baulig  <martin@ximian.com>
11401
11402         * expression.cs (Unary.DoResolveLValue): Override this and report
11403         CS0131 for anything but Operator.Indirection.
11404
11405 2004-04-28  Martin Baulig  <martin@ximian.com>
11406
11407         Committing a patch from Ben Maurer; see bug #50820.
11408
11409         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11410         check for classes.
11411
11412         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11413         classes.        
11414
11415 2004-04-28  Martin Baulig  <martin@ximian.com>
11416
11417         Committing a patch from Ben Maurer; see bug #50820.
11418
11419         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11420         check for classes.
11421
11422         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11423         classes.        
11424
11425 2004-04-28  Martin Baulig  <martin@ximian.com>
11426
11427         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
11428         (Block.AddLabel): Call DoLookupLabel() to only search in the
11429         current block.
11430
11431 2004-04-28  Martin Baulig  <martin@ximian.com>
11432
11433         * cfold.cs (ConstantFold.BinaryFold): Added special support for
11434         comparing StringConstants and NullLiterals in Equality and Inequality.
11435
11436 2004-04-28  Jackson Harper  <jackson@ximian.com>
11437
11438         * driver.cs: Attempt to load referenced assemblies from the
11439         GAC. This is the quick and dirty version of this method that
11440         doesnt take into account versions and just takes the first
11441         canidate found. Will be good enough for now as we will not have more
11442         then one version installed into the GAC until I update this method.
11443
11444 2004-04-28  Martin Baulig  <martin@ximian.com>
11445
11446         * typemanager.cs (TypeManager.CheckStructCycles): New public
11447         static method to check for cycles in the struct layout.
11448
11449         * rootcontext.cs (RootContext.PopulateTypes): Call
11450         TypeManager.CheckStructCycles() for each TypeContainer.
11451         [Note: We only need to visit each type once.]
11452
11453 2004-04-28  Martin Baulig  <martin@ximian.com>
11454
11455         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11456
11457         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11458         success and added `out object value'.  Use a `bool resolved' field
11459         to check whether we've already been called rather than
11460         `ConstantValue != null' since this breaks for NullLiterals.
11461
11462 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11463
11464         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11465         setting of this flag, since the 'set' method may be non-public.
11466
11467 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11468
11469         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
11470         check on current_vector.Block.
11471
11472 2004-04-27  Martin Baulig  <martin@ximian.com>
11473
11474         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
11475         a field initializer.  Fixes #56459.
11476
11477 2004-04-27  Martin Baulig  <martin@ximian.com>
11478
11479         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
11480         we're not attempting to use an indexer.  Fixes #52154.
11481
11482 2004-04-27  Martin Baulig  <martin@ximian.com>
11483
11484         * statement.cs (Return): Don't create a return label if we don't
11485         need it; reverts my change from January 20th.  Thanks to Ben
11486         Maurer for this.
11487
11488 2004-04-27  Martin Baulig  <martin@ximian.com>
11489
11490         According to the spec, `goto' can only leave a nested scope, but
11491         never enter it.
11492
11493         * statement.cs (Block.LookupLabel): Only lookup in the current
11494         block, don't recurse into parent or child blocks.
11495         (Block.AddLabel): Check in parent and child blocks, report
11496         CS0140/CS0158 if we find a duplicate.
11497         (Block): Removed this indexer for label lookups.
11498         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
11499         this already does the error reporting for us.
11500
11501         * flowanalysis.cs
11502         (FlowBranching.UsageVector.Block): New public variable; may be null.
11503         (FlowBranching.CreateSibling): Added `Block' argument.
11504         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
11505         label for the target of a `goto' and check whether we're not
11506         leaving a `finally'.
11507
11508 2004-04-27  Martin Baulig  <martin@ximian.com>
11509
11510         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11511         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
11512         just for returns).
11513
11514 2004-04-27  Martin Baulig  <martin@ximian.com>
11515
11516         * statement.cs (Block.AddLabel): Also check for implicit blocks
11517         and added a CS0158 check.
11518
11519 2004-04-27  Martin Baulig  <martin@ximian.com>
11520
11521         * flowanalysis.cs (FlowBranchingLoop): New class.
11522         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11523         UsageVector's instead of an ArrayList.
11524         (FlowBranching.Label): Likewise.
11525         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11526         (FlowBranching.AddBreakVector): New method.
11527
11528 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
11529
11530         * attribute.cs: Small regression fix: only convert the type if we
11531         the type is different, fixes System.Drawing build.
11532
11533 2004-04-27  Martin Baulig  <martin@ximian.com>
11534
11535         * attribute.cs (Attribute.Resolve): If we have a constant value
11536         for a named field or property, implicity convert it to the correct
11537         type.
11538
11539 2004-04-27  Raja R Harinath  <rharinath@novell.com>
11540
11541         * statement.cs (Block.Block): Implicit blocks share
11542         'child_variable_names' fields with parent blocks.
11543         (Block.AddChildVariableNames): Remove.
11544         (Block.AddVariable): Mark variable as "used by a child block" in
11545         every surrounding block.
11546         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11547         been used in a child block, complain about violation of "Invariant
11548         meaning in blocks" rule.
11549         * cs-parser.jay (declare_local_variables): Don't use
11550         AddChildVariableNames.
11551         (foreach_statement): Don't create an implicit block: 'foreach'
11552         introduces a scope.
11553
11554 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
11555
11556         * convert.cs (ImplicitNumericConversion): 0 is also positive when
11557         converting from 0L to ulong.  Fixes 57522.
11558
11559 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11560
11561         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11562         derived class hides via 'new' keyword field from base class (test-242.cs).
11563         TODO: Handle this in the more general way.
11564         
11565         * class.cs (CheckBase): Ditto.
11566
11567 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11568
11569         * decl.cs (caching_flags): New member for storing cached values
11570         as bit flags.
11571         (MemberCore.Flags): New enum where bit flags for caching_flags
11572         are defined.
11573         (MemberCore.cls_compliance): Moved to caching_flags.
11574         (DeclSpace.Created): Moved to caching_flags.
11575
11576         * class.cs: Use caching_flags instead of DeclSpace.Created
11577         
11578 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
11579
11580         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11581         if we are only a derived class, not a nested class.
11582
11583         * typemanager.cs: Same as above, but do this at the MemberLookup
11584         level (used by field and methods, properties are handled in
11585         PropertyExpr).   Allow for the qualified access if we are a nested
11586         method. 
11587
11588 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
11589
11590         * class.cs: Refactoring.
11591         (IMethodData): New inteface; Holds links to parent members
11592         to avoid member duplication (reduced memory allocation).
11593         (Method): Implemented IMethodData interface.
11594         (PropertyBase): New inner classes for get/set methods.
11595         (PropertyBase.PropertyMethod): Implemented IMethodData interface
11596         (Event): New inner classes for add/remove methods.
11597         (Event.DelegateMethod): Implemented IMethodData interface.
11598
11599         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11600         EmitContext (related to class.cs refactoring).
11601
11602 2004-04-21  Raja R Harinath  <rharinath@novell.com>
11603
11604         * delegate.cs (Delegate.VerifyApplicability): If the number of
11605         arguments are the same as the number of parameters, first try to
11606         verify applicability ignoring  any 'params' modifier on the last
11607         parameter.
11608         Fixes #56442.
11609
11610 2004-04-08  Martin Baulig  <martin@ximian.com>
11611
11612         Merged latest changes into gmcs.  Please keep this comment in
11613         here, it makes it easier for me to see what changed in MCS since
11614         the last time I merged.
11615
11616 2004-04-16  Raja R Harinath  <rharinath@novell.com>
11617
11618         * class.cs (TypeContainer.AddIndexer): Use
11619         'ExplicitInterfaceName' to determine if interface name was
11620         explicitly specified.  'InterfaceType' is not initialized at this time.
11621         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
11622         Indexers array is already in the required order.  Initialize
11623         'IndexerName' only if there are normal indexers.
11624         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11625         (TypeContainer.Emit): Emit DefaultMember attribute only if
11626         IndexerName is initialized.
11627         Fixes #56300.
11628
11629 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
11630
11631         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11632         Fixes #57007
11633
11634 2004-04-15  Raja R Harinath  <rharinath@novell.com>
11635
11636         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11637         attributes.
11638         Fix for #56456.
11639
11640         * attribute.cs (Attribute.Resolve): Check for duplicate named
11641         attributes.
11642         Fix for #56463.
11643
11644 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
11645
11646         * iterators.cs (MarkYield): track whether we are in an exception,
11647         and generate code accordingly.  Use a temporary value to store the
11648         result for our state.
11649
11650         I had ignored a bit the interaction of try/catch with iterators
11651         since their behavior was not entirely obvious, but now it is
11652         possible to verify that our behavior is the same as MS .NET 2.0
11653
11654         Fixes 54814
11655
11656 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
11657
11658         * iterators.cs: Avoid creating temporaries if there is no work to
11659         do. 
11660
11661         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11662         Enumerations, use TypeManager.EnumToUnderlying and call
11663         recursively. 
11664
11665         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11666         bug #57013
11667
11668         (This.Emit): Use EmitContext.EmitThis to emit our
11669         instance variable.
11670
11671         (This.EmitAssign): Ditto.
11672
11673         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11674         codepaths, we will move all the functionality into
11675         Mono.CSharp.This 
11676
11677         (FieldExpr.EmitAssign): Ditto.
11678
11679         This fixes several hidden bugs that I uncovered while doing a code
11680         review of this today.
11681
11682         * codegen.cs (EmitThis): reworked so the semantics are more clear
11683         and also support value types "this" instances.
11684
11685         * iterators.cs: Changed so that for iterators in value types, we
11686         do not pass the value type as a parameter.  
11687
11688         Initialization of the enumerator helpers is now done in the caller
11689         instead of passing the parameters to the constructors and having
11690         the constructor set the fields.
11691
11692         The fields have now `assembly' visibility instead of private.
11693
11694 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
11695
11696         * expression.cs (Argument.Resolve): Check if fields passed as ref
11697         or out are contained in a MarshalByRefObject.
11698
11699         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11700         another compiler type.
11701
11702 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
11703
11704         * class.cs (Indexer.Define): use the new name checking method.
11705         Also, return false on an error.
11706         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11707         (is_identifier_[start/part]_character): make static.
11708
11709 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
11710
11711         * expression.cs (Binary.ResolveOperator): Do no append strings
11712         twice: since we can be invoked more than once (array evaluation)
11713         on the same concatenation, take care of this here.  Based on a fix
11714         from Ben (bug #56454)
11715
11716 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11717
11718         * codegen.cs: Fix another case where CS1548 must be reported (when 
11719         delay-sign isn't specified and no private is available #56564). Fix
11720         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11721         error when MCS is used on the MS runtime and we need to delay-sign 
11722         (which seems unsupported by AssemblyBuilder - see #56621).
11723
11724 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
11725
11726         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11727         (TypeManager.ComputeNamespaces): Faster implementation for
11728         Microsoft runtime.
11729
11730         * compiler.csproj: Updated AssemblyName to mcs.
11731
11732 2004-05-11  Jackson Harper  <jackson@ximian.com>
11733
11734         * Makefile: Preserve MONO_PATH
11735         
11736 2004-05-11  Jackson Harper  <jackson@ximian.com>
11737
11738         * Makefile: Use mono and mcs to build gmcs
11739         
11740 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
11741
11742         * codegen.cs: Add patch from Robert Shade
11743         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
11744         sync with mcs.
11745
11746 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
11747
11748         * CryptoConvert.cs: Updated to latest version. Fix issue with 
11749         incomplete key pairs (#57941).
11750
11751 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11752
11753         * codegen.cs: Fix another case where CS1548 must be reported (when 
11754         delay-sign isn't specified and no private is available #56564). Fix
11755         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11756         error when MCS is used on the MS runtime and we need to delay-sign 
11757         (which seems unsupported by AssemblyBuilder - see #56621).
11758
11759 2004-04-29  Jackson Harper  <jackson@ximian.com>
11760
11761         * Makefile: Set MONO_PATH to use the bootstrap corlib
11762         * driver.cs: Check the GAC for referenced assemblies.
11763                 
11764 2004-04-29  Martin Baulig  <martin@ximian.com>
11765
11766         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
11767
11768 2004-04-07  Martin Baulig  <martin@ximian.com>
11769
11770         * expression.cs (Binary.ResolveOperator): Added special case for
11771         Equality/Inequality between a type parameter and a null literal.
11772
11773 2004-04-07  Martin Baulig  <martin@ximian.com>
11774
11775         * convert.cs: Check null literal -> type parameter conversions.
11776
11777 2004-04-07  Martin Baulig  <martin@ximian.com>
11778
11779         * generic.cs (ConstructedType.CheckConstraints): Enforce the
11780         `class' and `struct' constraints.
11781
11782 2004-04-07  Martin Baulig  <martin@ximian.com>
11783
11784         * generic.cs (SpecialConstraint): New public enum.
11785         (Constraints.Resolve): Added support for the `class' and `struct'
11786         constraints.
11787
11788         * cs-parser.jay (type_parameter_constraint): Added support for the
11789         `class' and `struct' constraints.
11790
11791 2004-04-07  Martin Baulig  <martin@ximian.com>
11792
11793         * support.cs (GenericConstraints): Replaced `Types' by
11794         `ClassConstraint' and `InterfaceConstraints'; added
11795         `HasClassConstraint'.   
11796
11797 2004-04-07  Martin Baulig  <martin@ximian.com>
11798
11799         * generic.cs
11800         (Constraints.InterfaceConstraints): New public property.
11801         (Constraints.Types): Make this property public
11802         (TypeParameter): Implement IMemberContainer.
11803         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
11804         instead of a TypeBuilder/MethodBuilder; pass the interface
11805         constraints to TypeManager.AddTypeParameter().
11806         (TypeParameter.DefineType): Just take an EmitContext and no
11807         TypeBuilder/MethodBuilder.  Use the new public API.
11808
11809         * typemanager.cs (TypeManager.AddTypeParameter): Added
11810         `TypeExpr[]' argument; add the interfaces to the
11811         `builder_to_ifaces' hash.
11812         (TypeManager.LookupMemberContainer): For
11813         GenericTypeParameterBuilders, get the TypeParameter from the
11814         `builder_to_type_param'.
11815         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
11816         the TypeParameter and call FindMembers on it.
11817
11818 2004-04-07  Martin Baulig  <martin@ximian.com>
11819
11820         * class.cs
11821         (MethodCore.GenericMethod): Moved this field here from Method.
11822         (MethodCore.IsDuplicateImplementation): Take the number of type
11823         parameters into account if we're a generic method.
11824
11825         * expression.cs (Invocation.InferTypeArguments): Don't return true
11826         if `arguments' is null; we still need to check whether we actually
11827         don't need to infer anything in this case.
11828         (MemberAccess): Merged the functionality from GenericMemberAccess
11829         into this class.
11830
11831         * generic.cs (GenericMemberAccess): Removed.
11832
11833 2004-04-05  Martin Baulig  <martin@ximian.com>
11834
11835         * decl.cs (MemberCore): For generic classes, interfaces and
11836         structs, `Name' now includes the number of type parameters
11837         ("Stack!1.Node!1").
11838         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
11839         encode the number of type arguments in the type name.
11840
11841         * expression.cs (Expression.MemberLookup): Removed the
11842         `num_type_args' argument; we now encode the number of type
11843         arguments in the type name.
11844
11845         * ecore.cs (SimpleName): Encode the number of type arguments in
11846         the type name itself.
11847
11848         * generic.cs (ConstructedType): Likewise.
11849
11850         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
11851         `MemberName'; we now include the number of type parameters in the
11852         type name.
11853
11854         * typemanager.cs (TypeManager.CheckGeneric): Removed.
11855         (TypeManager.MemberLookup): Removed the
11856         `num_type_args' argument; we now encode the number of type
11857         arguments in the type name.     
11858
11859 2004-04-03  Martin Baulig  <martin@ximian.com>
11860
11861         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
11862         (MemberCore.MemberName): Moved here from MemberBase.
11863         (DeclSpace.SetParameterInfo): Just take the constraints as an
11864         ArrayList; we already have the type parameters in our
11865         `MemberName'; also do the CS0080 reporting here.
11866
11867         * cs-parser.jay (struct_declaration): Use `member_name' instead of
11868         `IDENTIFIER opt_type_parameter_list'; when constructing our
11869         `MemberName', it'll already include our type parameters.
11870         (class_declaration, interface_declaration): Likewise.
11871         (delegate_declaration): Likewise.
11872         (MakeName): Take a MemberName and return a MemberName.
11873         The following two changes are required to avoid shift/reduce conflicts:
11874         (member_name): Don't include a TypeName anymore; ie. this is now
11875         just 'IDENTIFIER opt_type_parameter_list'.
11876         (property_declaration, event_declaration): Use a
11877         `namespace_or_type_name' instead of a `member_name'.            
11878
11879 2004-04-03  Martin Baulig  <martin@ximian.com>
11880
11881         * decl.cs (MemberName): Renamed to `TypeName' and created a new
11882         `MemberName' class.
11883         (TypeName): Formerly known as MemberName.
11884
11885         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
11886         instead of a `MemberName'.
11887
11888         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
11889         (member_name): New rule; create a MemberName.
11890
11891 2004-04-02  Martin Baulig  <martin@ximian.com>
11892
11893         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
11894         (CS0305 and CS0308).
11895
11896 2004-04-02  Martin Baulig  <martin@ximian.com>
11897
11898         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
11899         support for nested types.
11900
11901 2004-04-02  Martin Baulig  <martin@ximian.com>
11902
11903         * ecore.cs (IAlias): New public interface.
11904         (TypeExpr, TypeExpression): Implement IAlias.
11905         (TypeAliasExpression): New public class.
11906
11907         * namespace.cs (Namespace): Implement IAlias.
11908         (Namespace.Lookup): Return an IAlias instead on an object.
11909         (Namespace.DefineName): Take an IAlias instead of an object.
11910         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
11911         an object.
11912         (NamespaceEntry.UsingAlias): Take a Membername instead of an
11913         Expression.
11914         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
11915         object.
11916         (NamespaceEntry.Lookup): Likewise.
11917
11918         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
11919         instead of a Type.      
11920
11921         * decl.cs (DeclSpace): Implement IAlias.
11922         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
11923
11924         * generic.cs (ConstructedType): Improved error checking.
11925
11926 2004-04-02  Martin Baulig  <martin@ximian.com>
11927
11928         * convert.cs: Added type parameter conversions.
11929
11930         * ecore.cs
11931         (UnboxCast.Emit): Emit an `unbox.any' for type params.
11932         (ClassCast.Emit): If the source type is a type parameter, box it.
11933         If the target type is a type parameter, emit an `unbox.any'
11934         instead of a `classcast'.1      
11935
11936 2004-04-01  Martin Baulig  <martin@ximian.com>
11937
11938         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
11939
11940 2004-04-01  Martin Baulig  <martin@ximian.com>
11941
11942         * generic.cs (ConstructedType.CheckConstraints): Use
11943         Convert.ImplicitStandardConversionExists(); user-defined implicit
11944         conversions are not allowed according to the spec.
11945
11946 2004-03-30  Martin Baulig  <martin@ximian.com>
11947
11948         * expression.cs (New): Added support for type parameters.
11949
11950         * typemanager.cs
11951         (TypeManager.activator_type): New public static field.
11952         (TypeManager.activator_create_instance): Likewise.
11953
11954 2004-03-30  Martin Baulig  <martin@ximian.com>
11955
11956         * typemanager.cs (TypeManager.HasConstructorConstraint): New
11957         public method.
11958
11959 2004-03-30  Martin Baulig  <martin@ximian.com>
11960
11961         * generic.cs (ConstructedType.CheckConstraints): Actually follow
11962         the spec here: the argument type must be convertible to the
11963         constraints.
11964
11965 2004-03-30  Martin Baulig  <martin@ximian.com>
11966
11967         * generic.cs
11968         (TypeParameter.Define, TypeParameter.DefineMethod): Call
11969         TypeManager.AddTypeParameter().
11970         (ConstructedType.CheckConstraints): Re-enable this and actually
11971         check whether we have a constructor constraint.
11972
11973         * typemanager.cs
11974         (TypeManager.builder_to_type_param): New static field.
11975         (TypeManager.AddTypeParameter): New static method.
11976         (TypeManager.LookupTypeParameter): New public method.
11977
11978 2004-03-30  Martin Baulig  <martin@ximian.com>
11979
11980         * generic.cs (TypeParameter.DefineType): Return a boolean and use
11981         the new API to actually define the constructor constraint.
11982
11983         * typemanager.cs
11984         (TypeManager.new_constraint_attr_type): New static field.
11985         (TypeManager.InitCoreTypes): Initialize it.
11986
11987 2004-03-30  Martin Baulig  <martin@ximian.com>
11988
11989         * generic.cs (Constraints): Completed error checking, use correct
11990         error numbers.
11991
11992 2004-03-29  Martin Baulig  <martin@ximian.com>
11993
11994         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
11995
11996         * expression.cs (Invocation.InferTypeArguments): Added overloaded
11997         public version which takes a `ParameterData pd' instead of an
11998         `ArrayList args'.
11999
12000 2004-03-29  Martin Baulig  <martin@ximian.com>
12001
12002         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
12003         not a MethodInfo.       
12004
12005 2004-03-29  Martin Baulig  <martin@ximian.com>
12006
12007         * expression.cs (Argument.ResolveMethodGroup): If we're a
12008         ConstructedType, call GetMemberAccess() on it.  
12009
12010 2004-03-29  Martin Baulig  <martin@ximian.com>
12011
12012         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
12013         (MethodCore.CheckGenericOverride): When overriding a generic
12014         method, check whether the constraints match.
12015
12016         * support.cs (GenericConstraints): New public interface.
12017         (ParameterData.GenericConstraints): New public method.
12018
12019         * parameter.cs (Parameter.Resolve): Check whether we're a generic
12020         method parameter and compute our constraints if appropriate.
12021         (Parameter.GenericConstraints): New public property.
12022
12023         * generic.cs (Constraints): Implement GenericConstraints.
12024
12025 2004-03-29  Martin Baulig  <martin@ximian.com>
12026
12027         * decl.cs (MemberCache.FindMemberToOverride): Use
12028         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
12029
12030 2004-03-29  Martin Baulig  <martin@ximian.com>
12031
12032         * generic.cs (GenericMethod.Define): Resolve our type parameters.
12033
12034 2004-03-29  Martin Baulig  <martin@ximian.com>
12035
12036         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
12037         not allowed on non-generic declarations").
12038
12039 2004-03-29  Martin Baulig  <martin@ximian.com>
12040
12041         * expression.cs (Invocation.InferTypeArguments): Added overloaded
12042         public version of this method.
12043
12044         * class.cs (MethodCore.IsDuplicateImplementation): Use
12045         Invocation.InferTypeArguments() to check this.
12046
12047 2004-03-29  Martin Baulig  <martin@ximian.com>
12048
12049         * convert.cs: Use TypeManager.IsDelegateType() instead of
12050         comparing types correctly.
12051
12052 2004-03-29  Martin Baulig  <martin@ximian.com>
12053
12054         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
12055         types directly to make it work for generic instances.
12056
12057         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
12058
12059 2004-03-29  Martin Baulig  <martin@ximian.com>
12060
12061         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
12062         support for arrays.     
12063
12064 2004-03-24  Martin Baulig  <martin@ximian.com>
12065
12066         * decl.cs (DeclSpace.FindType): Also use
12067         TypeManager.CheckGeneric() for types from the using clauses.
12068
12069 2004-03-23  Martin Baulig  <martin@ximian.com>
12070
12071         * expression.cs (Invocation.OverloadResolve): Added `bool
12072         may_fail' argument and use it instead of the Location.IsNull() hack.
12073
12074 2004-03-23  Martin Baulig  <martin@ximian.com>
12075
12076         * expression.cs (Invocation.InferType): Use correct type inference
12077         rules here.     
12078
12079 2004-03-23  Martin Baulig  <martin@ximian.com>
12080
12081         * ecore.cs (MethodGroupExpr.Name): Use
12082         TypeManager.CSharpSignature() instead of just the name.
12083
12084         * expression.cs (Invocation.OverloadResolve): Provide better error
12085         reporting.
12086         (Invocation.DoResolve): OverloadResolve() never returns null
12087         without reporting an error, so removed the error -6 reporting here.
12088
12089 2004-03-23  Martin Baulig  <martin@ximian.com>
12090
12091         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
12092         generic methods.
12093
12094         * cs-parser.jay (delegate_declaration): Support generic delegates.
12095
12096         * delegate.cs: Support generic delegates.
12097
12098 2004-03-22  Martin Baulig  <martin@ximian.com>
12099
12100         * expression.cs (Invocation.InferParamsTypeArguments): New static
12101         method; does type inference for params arguments.
12102
12103 2004-03-21  Martin Baulig  <martin@ximian.com>
12104
12105         * typemanager.cs (TypeManager.IsGenericMethod): New public static
12106         method; checks whether a method is a generic method.    
12107
12108         * expression.cs (Invocation.InferTypeArguments): New static method;
12109         infer type arguments for generic method invocation.
12110
12111         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
12112         property; we set this to true if we're resolving a generic method
12113         invocation and the user specified type arguments, ie. we're not
12114         doing type inference.
12115
12116 2004-03-20  Martin Baulig  <martin@ximian.com>
12117
12118         * class.cs (MethodData.DeclaringType): New public property.
12119         (MethodData.Define): Set DeclaringType here.
12120         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
12121         instead of OperatorMethodBuilder.DeclaringType.
12122
12123 2004-03-20  Martin Baulig  <martin@ximian.com>
12124
12125         * cs-tokenizer.cs (xtoken): Return a special
12126         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
12127
12128         * cs-parser.jay (default_value_expression): Switch to the new
12129         syntax (14.5.13).
12130
12131 2004-03-19  Martin Baulig  <martin@ximian.com>
12132
12133         * decl.cs (MemberName): New class.  We use this to "construct"
12134         namespace_or_type_name's.
12135
12136         * generics.cs (TypeArguments.GetDeclarations): New public method;
12137         returns the type arguments as a string[] and reports a CS0081 if
12138         one of them is not an identifier.
12139
12140         * class.cs (MemberBase): The .ctor now takes the name as a
12141         MemberName instead of a string.
12142         (MemberBase.ExplicitInterfaceName): Changed type from string to
12143         Expression.
12144         (MemberBase.DoDefine): If we're an explicit implementation, the
12145         InterfaceType may be a generic instance.
12146
12147         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
12148         (namespace_name): Call MemberName.GetName () to transform the
12149         MemberName into a string and ensure we don't have any type
12150         arguments.
12151         (type_name): Call MemberName.GetTypeExpression() to transfrom the
12152         MemberName into an expression.
12153         (method_header): Use namespace_or_type_name instead of member_name.     
12154
12155 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
12156
12157         * rootcontext.cs: Add new types to the boot resolution.
12158
12159         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
12160         MulticastDelegate is not allowed.
12161
12162         * typemanager.cs: Add new types to lookup: System.TypedReference
12163         and ArgIterator.
12164
12165         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
12166         check for TypedReference or ArgIterator, they are not allowed. 
12167
12168         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
12169         makes us properly catch 1510 in some conditions (see bug 56016 for
12170         details). 
12171
12172 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
12173
12174         * CryptoConvert.cs: update from corlib version
12175         with endian fixes.
12176
12177 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
12178
12179         * class.cs (Indexer.Define): Check indexername declaration
12180
12181 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
12182
12183         * attribute.cs (IsClsCompliant): Fixed problem with handling
12184         all three states (compliant, not-compliant, undetected).
12185
12186 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
12187
12188         * attribute.cs (Attribute): Location is now public.
12189         (Resolve): Store resolved arguments (pos_values) in attribute class.
12190         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
12191         (GetClsCompliantAttributeValue): New method that gets
12192         CLSCompliantAttribute value.
12193         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
12194         if exists else null.
12195         (AttributeTester): New class for CLS-Compliant verification routines.
12196
12197         * class.cs (Emit): Add CLS-Compliant verification.
12198         (Method.GetSignatureForError): Implemented.
12199         (Constructor.GetSignatureForError): Implemented
12200         (Constructor.HasCompliantArgs): Returns if constructor has
12201         CLS-Compliant arguments.
12202         (Constructor.Emit): Override.
12203         (Construcor.IsIdentifierClsCompliant): New method; For constructors
12204         is needed to test only parameters.
12205         (FieldBase.GetSignatureForError): Implemented.
12206         (TypeContainer): New member for storing base interfaces.
12207         (TypeContainer.FindMembers): Search in base interfaces too.
12208
12209         * codegen.cs (GetClsComplianceAttribute): New method that gets
12210         assembly or module CLSCompliantAttribute value.
12211         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
12212         for assembly.
12213         (ModuleClass.Emit): Add error 3012 test.
12214
12215         * const.cs (Emit): Override and call base for CLS-Compliant tests.
12216
12217         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
12218         state for all decl types.
12219         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
12220         if CLS-Compliant tests are required.
12221         (IsClsCompliaceRequired): New method. Analyze whether code
12222         must be CLS-Compliant.
12223         (IsExposedFromAssembly): New method. Returns true when MemberCore
12224         is exposed from assembly.
12225         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
12226         value or gets cached value.
12227         (HasClsCompliantAttribute): New method. Returns true if MemberCore
12228         is explicitly marked with CLSCompliantAttribute.
12229         (IsIdentifierClsCompliant): New abstract method. This method is
12230         used to testing error 3005.
12231         (IsIdentifierAndParamClsCompliant): New method. Common helper method
12232         for identifier and parameters CLS-Compliant testing.
12233         (VerifyClsCompliance): New method. The main virtual method for
12234         CLS-Compliant verifications.
12235         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
12236         null. I don't know why is null (too many public members !).
12237         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
12238         and get value of first CLSCompliantAttribute that found.
12239
12240         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
12241         (VerifyClsCompliance): Override and add extra tests.
12242
12243         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
12244         clscheck- disable CLS-Compliant verification event if assembly is has
12245         CLSCompliantAttribute(true).
12246
12247         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
12248         ApllyAttribute is now called in emit section as in the other cases.
12249         Possible future Emit integration.
12250         (IsIdentifierClsCompliant): New override.
12251         (VerifyClsCompliance): New override.
12252         (GetEnumeratorName): Returns full enum name.
12253
12254         * parameter.cs (GetSignatureForError): Implemented.
12255
12256         * report.cs (WarningData): New struct for Warning message information.
12257         (LocationOfPreviousError): New method.
12258         (Warning): New method. Reports warning based on the warning table.
12259         (Error_T): New method. Reports error based on the error table.
12260
12261         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
12262         verifications are done here.
12263
12264         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
12265
12266         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
12267         CLSCompliantAttribute.
12268         (all_imported_types): New member holds all imported types from other
12269         assemblies.
12270         (LoadAllImportedTypes): New method fills static table with exported types
12271         from all referenced assemblies.
12272         (Modules): New property returns all assembly modules.
12273
12274 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
12275
12276         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
12277         throwing a parser error.
12278
12279         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
12280         which removes the hardcoded get_/set_ prefixes for properties, as
12281         IL allows for the properties to be named something else.  
12282
12283         Bug #56013
12284
12285         * expression.cs: Do not override operand before we know if it is
12286         non-null.  Fix 56207
12287
12288 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12289
12290         * typemanager.cs: support for pinned variables.
12291
12292 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12293
12294         * decl.cs, typemanager.cs: Avoid using an arraylist
12295         as a buffer if there is only one result set.
12296
12297 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12298
12299         * expression.cs: Make sure you cant call a static method
12300         with an instance expression, bug #56174.
12301
12302 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
12303
12304         * class.cs (IsDuplicateImplementation): Improve error reporting to
12305         flag 663 (method only differs in parameter modifier).
12306
12307         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12308         in preprocessor directives.
12309
12310         * location.cs (LookupFile): Allow for the empty path.
12311
12312         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
12313         better approach for some of that patch, but its failing with the
12314         CharSet enumeration.  For now try/catch will do.
12315
12316         * typemanager.cs: Do not crash if a struct does not have fields.
12317         Fixes 56150.
12318
12319 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12320
12321         * expression.cs: cs0213, cant fix a fixed expression.
12322         fixes 50231.
12323
12324 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12325
12326         * cs-parser.jay: detect invalid embeded statements gracefully.
12327         bug #51113.
12328
12329 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12330
12331         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12332         As a regex:
12333         s/
12334         the invocation type may not be a subclass of the tye of the item/
12335         The type of the item must be a subclass of the invocation item.
12336         /g
12337
12338         Fixes bug #50820.
12339
12340 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
12341
12342         * attribute.cs: Added methods to get a string and a bool from an
12343         attribute. Required to information from AssemblyKeyFileAttribute,
12344         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12345         * codegen.cs: Modified AssemblyName creation to include support for
12346         strongnames. Catch additional exceptions to report them as CS1548.
12347         * compiler.csproj: Updated include CryptoConvert.cs.
12348         * compiler.csproj.user: Removed file - user specific configuration.
12349         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
12350         Mono.Security assembly. The original class is maintained and tested in
12351         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12352         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12353         like CSC 8.0 (C# v2) supports.
12354         * Makefile: Added CryptoConvert.cs to mcs sources.
12355         * rootcontext.cs: Added new options for strongnames.
12356
12357 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
12358
12359         * driver.cs: For --expect-error, report error code `2'
12360         if the program compiled with no errors, error code `1' if
12361         it compiled with an error other than the one expected.
12362
12363 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
12364
12365         * compiler.csproj: Updated for Visual Studio .NET 2003.
12366         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12367         * compiler.sln: Updated for Visual Studio .NET 2003.
12368
12369 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
12370
12371         * expression.cs: Fix bug #47234. We basically need to apply the
12372         rule that we prefer the conversion of null to a reference type
12373         when faced with a conversion to 'object' (csc behaviour).
12374
12375 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12376
12377         * statement.cs: Shorter form for foreach, eliminates
12378         a local variable. r=Martin.
12379
12380 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12381
12382         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12383         checks if we can use brtrue/brfalse to test for 0.
12384         * expression.cs: use the above in the test for using brtrue/brfalse.
12385         cleanup code a bit.
12386
12387 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12388
12389         * expression.cs: Rewrite string concat stuff. Benefits:
12390
12391         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12392         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12393         rather than a concat chain.
12394
12395         * typemanager.cs: Add lookups for more concat overloads.
12396
12397 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12398
12399         * expression.cs: Emit shorter il code for array init.
12400
12401         newarr
12402         dup
12403         // set 1
12404
12405         // set 2
12406
12407         newarr
12408         stloc.x
12409
12410         ldloc.x
12411         // set 1
12412
12413         ldloc.x
12414         // set 2
12415
12416 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
12417
12418         * statement.cs: Before, two switch blocks would be merged if the
12419         total size of the blocks (end_item - begin_item + 1) was less than
12420         two times the combined sizes of the blocks.
12421
12422         Now, it will only merge if after the merge at least half of the
12423         slots are filled.
12424
12425         fixes 55885.
12426
12427 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
12428
12429         * class.cs : csc build fix for GetMethods(). See bug #52503.
12430
12431 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
12432
12433         * expression.cs: Make sure fp comparisons work with NaN.
12434         This fixes bug #54303. Mig approved this patch a long
12435         time ago, but we were not able to test b/c the runtime
12436         had a related bug.
12437
12438 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
12439
12440         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
12441
12442 2004-03-19  Martin Baulig  <martin@ximian.com>
12443
12444         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
12445         two overloads may unify for some type parameter substitutions and
12446         report a CS0408 if appropriate.
12447
12448 2004-03-19  Martin Baulig  <martin@ximian.com>
12449
12450         * class.cs (MemberCore.IsDuplicateImplementation): Report the
12451         error here and not in our caller.
12452
12453 2004-03-19  Martin Baulig  <martin@ximian.com>
12454
12455         * interface.cs: Completely killed this file.
12456         (Interface): We're now a TypeContainer and live in class.cs.
12457
12458         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12459         argument; we're now also called for interfaces.
12460         (TypeContainer.DefineMembers): Allow this method being called
12461         multiple times.
12462         (TypeContainer.GetMethods): New public method; formerly known as
12463         Interface.GetMethod().  This is used by PendingImplementation.
12464         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12465         it's now private and non-static.
12466         (Interface): Moved this here; it's now implemented similar to
12467         Class and Struct.
12468         (Method, Property, Event, Indexer): Added `bool is_interface'
12469         argument to their .ctor's.
12470         (MemberBase.IsInterface): New public field.
12471
12472         * cs-parser.jay: Create normal Method, Property, Event, Indexer
12473         instances instead of InterfaceMethod, InterfaceProperty, etc.
12474         (opt_interface_base): Removed; we now use `opt_class_base' instead.
12475         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12476
12477 2004-03-19  Martin Baulig  <martin@ximian.com>
12478
12479         * class.cs (MethodCore.IsDuplicateImplementation): New private
12480         method which does the CS0111 checking.
12481         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12482         Use IsDuplicateImplementation().
12483
12484 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
12485
12486         * decl.cs (FindMemberToOverride): New method to find the correct
12487         method or property to override in the base class.
12488         * class.cs
12489             - Make Method/Property use the above method to find the
12490               version in the base class.
12491             - Remove the InheritableMemberSignatureCompare as it is now
12492               dead code.
12493
12494         This patch makes large code bases much faster to compile, as it is
12495         O(n) rather than O(n^2) to do this validation.
12496
12497         Also, it fixes bug 52458 which is that nested classes are not
12498         taken into account when finding the base class member.
12499
12500         Reviewed/Approved by Martin.
12501
12502 2004-03-17  Martin Baulig  <martin@ximian.com>
12503
12504         * expression.cs (MemberAccess.DoResolve): Take the parent's number
12505         of type arguments into account; use the `real_num_type_args'
12506         approach like in DoResolveAsTypeStep().
12507
12508         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
12509         nested types.
12510
12511 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
12512
12513         * interface.cs: In all interface classes removed redundant
12514         member initialization.
12515
12516 2004-03-16  Martin Baulig  <martin@ximian.com>
12517
12518         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12519
12520 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12521
12522         * decl.cs (DefineTypeAndParents): New helper method to define a
12523         type's containers before the type itself is defined;  This is a
12524         bug exposed by the recent changes to Windows.Forms when an
12525         implemented interface was defined inside a class that had not been
12526         built yet.   
12527
12528         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12529
12530         (Check): Loop correctly to report errors modifiers
12531         (UNSAFE was not in the loop, since it was the same as TOP).
12532
12533         * interface.cs: Every interface member now takes a ModFlags,
12534         instead of a "is_new" bool, which we set on the base MemberCore. 
12535
12536         Every place where we called "UnsafeOk" in the interface, now we
12537         call the proper member (InterfaceMethod.UnsafeOK) instead to get
12538         the unsafe settings from the member declaration instead of the
12539         container interface. 
12540
12541         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
12542
12543         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12544         `set_indexer_name' to the pending bits (one per type).
12545
12546         We fixed a bug today that was picking the wrong method to
12547         override, since for properties the existing InterfaceMethod code
12548         basically ignored the method name.  Now we make sure that the
12549         method name is one of the valid indexer names.
12550
12551 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
12552  
12553         * support.cs (SeekableStreamReader): Keep track of stream byte
12554         positions and don't mix them with character offsets to the buffer.
12555
12556         Patch from Gustavo Giráldez
12557
12558 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
12559
12560         * interface.cs (InterfaceSetGetBase): Removed double member
12561         initialization, base class does it as well.
12562
12563 2004-03-13  Martin Baulig  <martin@ximian.com>
12564
12565         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12566         when compiling corlib.
12567
12568 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
12569
12570         * convert.cs (ExplicitConversion): We were reporting an error on
12571         certain conversions (object_type source to a value type, when the
12572         expression was `null') before we had a chance to pass it through
12573         the user defined conversions.
12574
12575         * driver.cs: Replace / and \ in resource specifications to dots.
12576         Fixes 50752
12577
12578         * class.cs: Add check for duplicate operators.  Fixes 52477
12579
12580 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
12581
12582         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12583         that are in the middle of the statements, not only at the end.
12584         Fixes #54987
12585
12586         * class.cs (TypeContainer.AddField): No longer set the
12587         `HaveStaticConstructor' flag, now we call it
12588         `UserDefineStaticConstructor' to diferentiate the slightly
12589         semantic difference.
12590
12591         The situation is that we were not adding BeforeFieldInit (from
12592         Modifiers.TypeAttr) to classes that could have it.
12593         BeforeFieldInit should be set to classes that have no static
12594         constructor. 
12595
12596         See:
12597
12598         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12599
12600         And most importantly Zoltan's comment:
12601
12602         http://bugzilla.ximian.com/show_bug.cgi?id=44229
12603
12604         "I think beforefieldinit means 'it's ok to initialize the type sometime 
12605          before its static fields are used', i.e. initialization does not need
12606          to be triggered by the first access to the type. Setting this flag
12607          helps the JIT to compile better code, since it can run the static
12608          constructor at JIT time, and does not need to generate code to call it
12609          (possibly lots of times) at runtime. Unfortunately, mcs does not set
12610          this flag for lots of classes like String. 
12611          
12612          csc sets this flag if the type does not have an explicit static 
12613          constructor. The reasoning seems to be that if there are only static
12614          initalizers for a type, and no static constructor, then the programmer
12615          does not care when this initialization happens, so beforefieldinit
12616          can be used.
12617          
12618          This bug prevents the AOT compiler from being usable, since it 
12619          generates so many calls to mono_runtime_class_init that the AOT code
12620          is much slower than the JITted code. The JITted code is faster, 
12621          because it does not generate these calls if the vtable is type is
12622          already initialized, which is true in the majority of cases. But the
12623          AOT compiler can't do this."
12624
12625 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
12626
12627         * class.cs (MethodData.Emit): Refactor the code so symbolic
12628         information is generated for destructors;  For some reasons we
12629         were taking a code path that did not generate symbolic information
12630         before. 
12631
12632 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12633
12634         * class.cs: Create a Constructor.CheckBase method that
12635         takes care of all validation type code. The method
12636         contains some code that was moved from Define.
12637
12638         It also includes new code that checks for duplicate ctors.
12639         This fixes bug #55148.
12640
12641 2004-03-09  Joshua Tauberer <tauberer@for.net>
12642
12643         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12644         a { ... }-style array creation invokes EmitStaticInitializers
12645         which is not good for reference-type arrays.  String, decimal
12646         and now null constants (NullCast) are not counted toward
12647         static initializers.
12648
12649 2004-03-05  Martin Baulig  <martin@ximian.com>
12650
12651         * location.cs (SourceFile.HasLineDirective): New public field;
12652         specifies whether the file contains or is referenced by a "#line"
12653         directive.
12654         (Location.DefineSymbolDocuments): Ignore source files which
12655         either contain or are referenced by a "#line" directive.        
12656
12657 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
12658
12659         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12660         direct access to our parent, so check the method inline there.
12661
12662 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12663
12664         * expression.cs (Invocation.EmitCall): Miguel's last commit
12665         caused a regression. If you had:
12666
12667             T t = null;
12668             t.Foo ();
12669
12670         In Foo the implict this would be null.
12671
12672 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
12673
12674         * expression.cs (Invocation.EmitCall): If the method is not
12675         virtual, do not emit a CallVirt to it, use Call.
12676
12677         * typemanager.cs (GetFullNameSignature): Improve the method to
12678         cope with ".ctor" and replace it with the type name.
12679
12680         * class.cs (ConstructorInitializer.Resolve): Now the method takes
12681         as an argument the ConstructorBuilder where it is being defined,
12682         to catch the recursive constructor invocations.
12683
12684 2004-03-16  Martin Baulig  <martin@ximian.com>
12685
12686         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
12687         ConstructedType, call ResolveType() on it to get the type rather
12688         than just using `expr.Type'.
12689
12690 2004-03-16  Martin Baulig  <martin@ximian.com>
12691
12692         * generics.cs (ConstructedType.GetMemberAccess): Take the
12693         EmitContext instead on the TypeExpr and use
12694         ec.TypeContainer.CurrentType/ec.ContainerType.
12695
12696 2004-03-16  Martin Baulig  <martin@ximian.com>
12697
12698         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
12699         parameters before aliases.
12700
12701 2004-03-16  Martin Baulig  <martin@ximian.com>
12702
12703         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
12704         New oublic function; checks whether two generic instances may become
12705         equal under some instantiations (26.3.1).
12706
12707         * class.cs (TypeContainer.Define): Call
12708         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
12709         error.
12710
12711 2004-03-16  Martin Baulig  <martin@ximian.com>
12712
12713         * class.cs (TypeContainer.GetClassBases): Moved
12714         Error_TypeParameterAsBase() here and also check whether the base
12715         class is not an attribute.
12716
12717 2004-03-16  Martin Baulig  <martin@ximian.com>
12718
12719         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12720
12721 2004-03-16  Martin Baulig  <martin@ximian.com>
12722
12723         * class.cs (Error_TypeParameterAsBase): Use correct error number
12724         here (CS0689).  
12725
12726 2004-03-16  Martin Baulig  <martin@ximian.com>
12727
12728         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
12729         for generics.
12730
12731         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
12732         error reporting.
12733
12734 2004-03-15  Martin Baulig  <martin@ximian.com>
12735
12736         * typemanager.cs (TypeManager.GetFullName): New public method.
12737         (TypeManager.MemberLookup): Added `int_num_type_arguments'
12738         argument; only return members with the correct number of type
12739         arguments.
12740         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
12741         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
12742         whether the number of type arguments matches.
12743
12744         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
12745         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
12746
12747         * expression.cs (MemberAccess): Added public `NumTypeArguments'
12748         field; it's set by the protected .ctor when we're actually a
12749         GenericMemberAccess.
12750         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
12751         arguments and pass it to MemberLookupFinal ().
12752
12753         * ecore.cs (Expression.MemberLookup): Added `int
12754         num_type_arguments' argument; only return members with the correct
12755         number of type arguments.
12756         (Expression.MemberLookupFailed): Check whether the MemberLookup
12757         failed because we did not have the correct number of type
12758         arguments; report CS0305 in this case.
12759
12760         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
12761         `e.ResolveAsTypeTerminal()' already did so.
12762
12763 2004-03-15  Martin Baulig  <martin@ximian.com>
12764
12765         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
12766         we're a ConstructedType; in this case, the caller must report an
12767         error (for instance CS0131).
12768
12769         * generic.cs (TypeArguments): Added Location argument to the .ctor.
12770         (TypeArguments.Resolve): Actually report errors here.
12771
12772 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12773
12774         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12775         `set_indexer_name' to the pending bits (one per type).
12776
12777         We fixed a bug today that was picking the wrong method to
12778         override, since for properties the existing InterfaceMethod code
12779         basically ignored the method name.  Now we make sure that the
12780         method name is one of the valid indexer names.
12781
12782 2004-03-15  Martin Baulig  <martin@ximian.com>
12783
12784         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
12785         for generic instances.
12786
12787 2004-03-13  Martin Baulig  <martin@ximian.com>
12788
12789         * class.cs (TypeContainer.DefineType): Call
12790         TypeManager.AddUserType() immediately after creating the
12791         TypeBuilder; pass all type parameters when creating the
12792         CurrentType.
12793
12794         * decl.cs (DeclSpace.FindNestedType): New public method.
12795         (DeclSpace.FindType): Added `int num_type_args' argument; only
12796         return types with the correct number of type parameters.
12797         (DeclSpace.CountTypeParams): New public property.
12798
12799         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
12800         the number of type parameters; defaults to zero.
12801
12802         * generic.cs (TypeArguments.Count): New public property.
12803         (ConstructedType.DoResolveAsTypeStep): First call
12804         ds.FindNestedType() to find out whether we're nested in the
12805         current generic type; in this case, we inherit all type parameters
12806         from the current class.
12807
12808         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
12809         num_type_args' argument.
12810         (RootContext.LookupType): Added overloaded version which takes the
12811         number of type arguments; only return types with the correct
12812         number of type arguments.
12813
12814         * typemanager.cs (TypeManager.CheckGeneric): New public function;
12815         checks whether `Type t' has `int num_type_args'.
12816
12817 2004-03-13  Martin Baulig  <martin@ximian.com>
12818
12819         * generic.cs (GenericMethod.DefineType): New method; calls
12820         DefineType() on all the type parameters.
12821
12822         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
12823         (MethodData.Define): If we're a generic method, call
12824         GenericMethod.DefineType() to define the type parameters.       
12825
12826 2004-03-10  Martin Baulig  <martin@ximian.com>
12827
12828         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
12829         instead of IsAssignableFrom.    
12830
12831 2004-03-10  Martin Baulig  <martin@ximian.com>
12832
12833         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
12834
12835         * support.cs (ParameterData.HasArrayParameter): New property.
12836         (ReflectionParameters.ctor): Take a MethodBase instead of a
12837         ParameterInfo[].  If we have any type parameters, get the generic
12838         method definition and ask it whether we have variable arguments.
12839
12840 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
12841
12842         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12843         routines to check if a type is an enumerable/enumerator allow
12844         classes that implement the IEnumerable or IEnumerator interfaces.
12845
12846         * class.cs (Property, Operator): Implement IIteratorContainer, and
12847         implement SetYields.
12848
12849         (Property.Define): Do the block swapping for get_methods in the
12850         context of iterators.   We need to check if Properties also
12851         include indexers or not.
12852
12853         (Operator): Assign the Block before invoking the
12854         OperatorMethod.Define, so we can trigger the Iterator code
12855         replacement. 
12856
12857         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
12858         Property and Operator classes are not created when we parse the
12859         declarator but until we have the block completed, so we use a
12860         singleton SimpleIteratorContainer.Simple to flag whether the
12861         SetYields has been invoked.
12862
12863         We propagate this setting then to the Property or the Operator to
12864         allow the `yield' to function.
12865
12866 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
12867
12868         * codegen.cs: Implemented attribute support for modules.
12869         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12870         Assembly/Module functionality.
12871
12872         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12873         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12874         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12875
12876 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
12877
12878         * interface.cs (FindMembers): The operation is performed on all base
12879         interfaces and not only on the first. It is required for future CLS Compliance patch.
12880
12881 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12882
12883         * statement.cs, codegen.cs:
12884         This patch deals with patterns such as:
12885
12886         public class List : IEnumerable {
12887
12888                 public MyEnumerator GetEnumerator () {
12889                         return new MyEnumerator(this);
12890                 }
12891
12892                 IEnumerator IEnumerable.GetEnumerator () {
12893                         ...
12894                 }
12895                 
12896                 public struct MyEnumerator : IEnumerator {
12897                         ...
12898                 }
12899         }
12900
12901         Before, there were a few things we did wrong:
12902         1) we would emit callvirt on a struct, which is illegal
12903         2) we emited ldarg when we needed to emit ldarga
12904         3) we would mistakenly call the interface methods on an enumerator
12905         type that derived from IEnumerator and was in another assembly. For example:
12906
12907         public class MyEnumerator : IEnumerator
12908
12909         Would have the interface methods called, even if there were public impls of the
12910         method. In a struct, this lead to invalid IL code.
12911
12912 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
12913
12914         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12915           renamed to Emit.
12916
12917         * delegate.cs (Define): Fixed crash when delegate type is undefined.
12918
12919 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
12920
12921         * cs-parser.jay: Fix small regression: we were not testing V2
12922         compiler features correctly.
12923
12924         * interface.cs: If the emit context is null, then create one
12925
12926 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
12927
12928         * decl.cs (GetSignatureForError): New virtual method to get full name
12929           for error messages.
12930
12931         * attribute.cs (IAttributeSupport): New interface for attribute setting.
12932           Now it is possible to rewrite ApplyAttributes method to be less if/else.
12933
12934         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12935           Duplicated members and code in these classes has been removed.
12936           Better encapsulation in these classes.
12937
12938 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
12939
12940         * assign.cs (Assign.DoResolve): When dealing with compound
12941         assignments, there is a new rule in ECMA C# 2.4 (might have been
12942         there before, but it is documented here) that states that in:
12943
12944         a op= b;
12945
12946         If b is of type int, and the `op' is a shift-operator, then the
12947         above is evaluated as:
12948
12949         a = (int) a op b 
12950
12951         * expression.cs (Binary.ResolveOperator): Instead of testing for
12952         int/uint/long/ulong, try to implicitly convert to any of those
12953         types and use that in pointer arithmetic.
12954
12955         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12956         method to print information for from the type, not from the
12957         null-method we were given.
12958
12959 2004-02-01  Duncan Mak  <duncan@ximian.com>
12960
12961         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12962         parsing for cmd, fixes bug #53694.
12963
12964 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
12965
12966         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12967         in the member name duplication tests. Property and operator name duplication
12968         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12969
12970 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
12971
12972         * interface.cs (PopulateMethod): Fixed crash when interface method
12973         returns not existing type (error test cs0246-3.cs).
12974
12975 2004-02-02  Ravi Pratap M <ravi@ximian.com>
12976
12977         * cs-parser.jay (interface_accessors): Re-write actions to also
12978         store attributes attached to get and set methods. Fix spelling
12979         while at it.
12980
12981         (inteface_property_declaration): Modify accordingly.
12982
12983         (InterfaceAccessorInfo): New helper class to store information to pass
12984         around between rules that use interface_accessors.
12985
12986         * interface.cs (Emit): Apply attributes on the get and set
12987         accessors of properties and indexers too.
12988
12989         * attribute.cs (ApplyAttributes): Modify accordingly to use the
12990         right MethodBuilder when applying attributes to the get and set accessors.
12991
12992 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
12993
12994         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12995
12996 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
12997
12998         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12999
13000 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
13001
13002         * cs-parser.jay: Remove YIELD token, instead use the new grammar
13003         changes that treat `yield' specially when present before `break'
13004         or `return' tokens.
13005
13006         * cs-tokenizer.cs: yield is no longer a keyword.
13007
13008 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
13009
13010         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
13011         setting for default constructors.
13012         For default constructors are almost every time set wrong Modifier. The
13013         generated IL code has been alright. But inside mcs this values was
13014         wrong and this was reason why several of my CLS Compliance tests
13015         failed.
13016
13017 2004-02-27  Martin Baulig  <martin@ximian.com>
13018
13019         * generics.cs (ConstructedType.ResolveType): Make the nested type
13020         stuff actually work.
13021
13022 2004-02-25  Martin Baulig  <martin@ximian.com>
13023
13024         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
13025         property; returns the type parameters just from the current type,
13026         ie. with the ones from outer classes.
13027         (DeclSpace.LookupGeneric): First search in the current class, then
13028         in outer classes.
13029         (DeclSpace.initialize_type_params): When hiding a type parameter
13030         from an outer class, put it into the `type_param_list' anyways.
13031
13032         * expression.cs (MemberAccess.expr): Made this field protected.
13033
13034         * class.cs (TypeContainer.Define): The `CurrentType' just contains
13035         the type parameters from the current class.
13036
13037         * generic.cs (ConstructedType.ResolveType): Support nested generic
13038         types by taking the type parameters which we inherit from outer
13039         classes into account.
13040         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
13041         support for nested generic types.
13042
13043 2004-02-23  Martin Baulig  <martin@ximian.com>
13044
13045         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
13046         field and check whether we're nested inside a generic type.
13047         (DeclSpace.ResolveType): If we're resolving to a generic type
13048         definition, create a ConstructedType and return its resolved type.
13049         (DeclSpace.initialize_type_params): New private method;
13050         initializes the `type_param_list' field from the type parameters
13051         from this and all enclosing classes.
13052         (DeclSpace.TypeParameters): Call initialize_type_params() unless
13053         we're already initialized.
13054
13055 2004-02-23  Martin Baulig  <martin@ximian.com>
13056
13057         * class.cs (Method.Define): Create the generic method before
13058         calling DoDefine().
13059         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
13060         the TypeContainer one); we use this for generic methods.
13061
13062         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
13063         parent's TypeBuilder.
13064
13065 2004-02-18  Martin Baulig  <martin@ximian.com>
13066
13067         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
13068         to check for equality.
13069
13070 2004-02-05  Martin Baulig  <martin@ximian.com>
13071
13072         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
13073         `ec.TypeContainer.CurrentType', use it instead of
13074         `ec.ContainerType' to check whether we're in the type's ctor.
13075
13076 2004-01-29  Martin Baulig  <martin@ximian.com>
13077
13078         * expression.cs (Invocation.DoResolve): If we're a
13079         `ConstructedType', then we're actually a generic method, so
13080         rewrite the expr as a GenericMemberAccess.
13081
13082         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
13083         here; manually parse it into a string.
13084
13085 2004-01-28  Martin Baulig  <martin@ximian.com>
13086
13087         * typemanager.cs (TypeManager.IsEqual): New static method.
13088         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
13089         check for equality instead of using `=='.
13090
13091 2004-01-26  Martin Baulig  <martin@ximian.com>
13092
13093         * decl.cs (DeclSpace.CurrentType): New public field.
13094
13095         * expression.cs (This.ResolveBase): If we have an
13096         `ec.TypeContainer.CurrentType', use it instead of
13097         `ec.ContainerType'.
13098
13099         * class.cs (TypeContainer.DefineType): If we're a generic type,
13100         create the `CurrentType' (unresolved).
13101         (TypeContainer.GenericType): New private field.
13102         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
13103         it and store it in `GenericType' before creating the MemberCache.
13104         (TypeContainer.GetMembers): If we have a `GenericType', call
13105         TypeManager.FindMembers() on it.
13106
13107         * interface.cs (Interface.GenericType): New private field.
13108         (Interface.DefineType): If we're a generic type, create the
13109         `CurrentType' (unresolved).
13110         (Interface.DefineMembers): If we have a `CurrentType', resolve it
13111         and store it in `GenericType' before creating the MemberCache.
13112         (Interface.GetMembers): If we have a `GenericType', call
13113         TypeManager.FindMembers() on it.
13114
13115 2004-01-22  Martin Baulig  <martin@ximian.com>
13116
13117         * cs-parser.jay (namespace_or_type_name): Return an Expression,
13118         not a QualifiedIdentifier.  This is what `type_name_expression'
13119         was previously doing.
13120         (type_name_expression): Removed; the code is now in
13121         `namespace_or_type_name'.
13122         (qualified_identifier): Removed, use `namespace_or_type_name'
13123         instead.
13124         (QualifiedIdentifier): Removed this class.      
13125
13126 2004-01-22  Martin Baulig  <martin@ximian.com>
13127
13128         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
13129         not a string as alias name.
13130
13131 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
13132
13133         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
13134         #52730 bug, and instead compute correctly the need to use a
13135         temporary variable when requesting an address based on the
13136         static/instace modified of the field and the constructor.
13137  
13138 2004-01-21  Martin Baulig  <martin@ximian.com>
13139
13140         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
13141         class and namespace before looking up aliases.  Fixes #52517.
13142
13143 2004-01-21  Martin Baulig  <martin@ximian.com>
13144
13145         * flowanalysis.cs (UsageVector.Merge): Allow variables being
13146         assinged in a 'try'; fixes exception4.cs.
13147
13148 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13149         * class.cs : Implemented parameter-less constructor for TypeContainer
13150
13151         * decl.cs: Attributes are now stored here. New property OptAttributes
13152
13153         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
13154
13155         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
13156
13157 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13158
13159         * typemanager.cs (CSharpSignature): Now reports also inner class name.
13160           (CSharpSignature): New method for indexer and property signature.
13161
13162 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13163
13164         * pending.cs (IsVirtualFilter): Faster implementation.
13165
13166 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13167
13168         * typemanager.cs: Avoid inclusion of same assembly more than once.
13169
13170 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13171
13172         * cs-parser.jay: Fixed problem where the last assembly attribute
13173           has been applied also to following declaration (class, struct, etc.)
13174           
13175 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13176
13177         * class.cs: Added error CS0538, CS0539 reporting.
13178         Fixed crash on Microsoft runtime when field type is void.
13179
13180         * cs-parser.jay: Added error CS0537 reporting.
13181
13182         * pending.cs: Added error CS0535 reporting.
13183         Improved error report for errors CS0536, CS0534.
13184
13185 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
13186
13187         Merge a few bits from the Anonymous Method MCS tree.
13188
13189         * statement.cs (ToplevelBlock): New class for toplevel methods,
13190         will hold anonymous methods, lifted variables.
13191
13192         * cs-parser.jay: Create toplevel blocks for delegates and for
13193         regular blocks of code. 
13194
13195 2004-01-20  Martin Baulig  <martin@ximian.com>
13196
13197         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
13198         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
13199         and `NeedExplicitReturn'; added `IsLastStatement'.
13200         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
13201         have a `ReturnLabel' or we're not unreachable.
13202
13203         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
13204         child's reachability; don't just override ours with it.  Fixes
13205         #58058 (lluis's example).
13206         (FlowBranching): Added public InTryOrCatch(), InCatch(),
13207         InFinally(), InLoop(), InSwitch() and
13208         BreakCrossesTryCatchBoundary() methods.
13209
13210         * statement.cs (Return): Do all error checking in Resolve().
13211         Unless we are the last statement in a top-level block, always
13212         create a return label and jump to it.
13213         (Break, Continue): Do all error checking in Resolve(); also make
13214         sure we aren't leaving a `finally'.
13215         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
13216         statement in a top-level block.
13217         (Block.Flags): Added `IsDestructor'.
13218         (Block.IsDestructor): New public property.
13219
13220 2004-01-20  Martin Baulig  <martin@ximian.com>
13221
13222         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
13223
13224 2004-01-20  Martin Baulig  <martin@ximian.com>
13225
13226         * statement.cs (Statement.ResolveUnreachable): New public method.
13227         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
13228         (Block.Resolve): Resolve unreachable statements.
13229
13230 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13231
13232         * expression.cs: We need to fix the case where we do
13233         not have a temp variable here.
13234
13235         * assign.cs: Only expression compound assignments need
13236         temporary variables.
13237
13238 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13239
13240         * flowanalysis.cs: Reduce memory allocation in a few ways:
13241           - A block with no variables should not allocate a bit
13242             vector for itself.
13243           - A method with no out parameters does not need any tracking
13244             for assignment of the parameters, so we need not allocate
13245             any data for it.
13246           - The arrays:
13247                 public readonly Type[] VariableTypes;
13248                 public readonly string[] VariableNames;
13249             Are redundant. The data is already stored in the variable
13250             map, so we need not allocate another array for it.
13251           - We need to add alot of checks for if (params | locals) == null
13252             due to the first two changes.
13253
13254 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
13255
13256         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
13257         implement IMemoryLocation, we store a copy on a local variable and
13258         take the address of it.  Patch from Benjamin Jemlich
13259
13260         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
13261         to use a special "type_name_expression" rule which reduces the
13262         number of "QualifiedIdentifier" classes created, and instead
13263         directly creates MemberAccess expressions.
13264
13265 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
13266
13267         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
13268         that fixes #52853.  Null literal assignment to ValueType
13269
13270         * class.cs (MethodData.Emit): Instead of checking the name of the
13271         method to determine if its a destructor, create a new derived
13272         class from Method called Destructor, and test for that.  
13273
13274         * cs-parser.jay: Create a Destructor object instead of a Method.  
13275
13276         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
13277
13278         Fixes: 52933
13279
13280 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
13281
13282         * expression.cs (Binary.ResolveOperator): Perform an implicit
13283         conversion from MethodGroups to their delegate types on the
13284         Addition operation.
13285
13286         * delegate.cs: Introduce a new class DelegateCreation that is the
13287         base class for `NewDelegate' and `ImplicitDelegateCreation',
13288         factor some code in here.
13289
13290         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
13291         conversion from MethodGroups to compatible delegate types. 
13292
13293         * ecore.cs (Expression.Resolve): Do not flag error 654
13294         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
13295         we allow conversions from MethodGroups to delegate types now.
13296
13297         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
13298         assignments in v2 either.
13299
13300 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
13301
13302         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
13303         static read-only fields in ctors.
13304
13305         Applied patch from Benjamin Jemlich 
13306
13307         * expression.cs (UnaryMutator): Avoid leaking local variables. 
13308
13309 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
13310
13311         * cs-tokenizer.cs (IsCastToken): Allow the various native types
13312         here to return true, as they can be used like this:
13313
13314                 (XXX) int.MEMBER ()
13315
13316         Fixed 49836 and all the other dups
13317
13318 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
13319
13320         * driver.cs: Implement /win32res and /win32icon.
13321
13322 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
13323
13324         * cs-parser.jay: Add a rule to improve error handling for the
13325         common mistake of placing modifiers after the type.
13326
13327 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
13328
13329         * cs-parser.jay (interface_event_declaration): Catch
13330         initialization of events on interfaces, and report cs0068
13331
13332         * cs-parser.jay (interface_event_declaration): Catch
13333         initialization of events. 
13334
13335         * ecore.cs: Better report missing constructors.
13336
13337         * expression.cs (Binary.ResolveOperator): My previous bug fix had
13338         the error reporting done in the wrong place.  Fix.
13339
13340         * expression.cs (Binary.ResolveOperator): Catch the 
13341         operator + (E x, E y) error earlier, and later allow for implicit
13342         conversions in operator +/- (E e, U x) from U to the underlying
13343         type of E.
13344
13345         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
13346         52596, if the container class is abstract, the default constructor
13347         is protected otherwise its public (before, we were always public).
13348
13349         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
13350         fixed statement.
13351
13352         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
13353         Jemlich that fixes bug #52597, MCS was generating invalid code for
13354         idisposable structs.   Thanks to Ben for following up with this
13355         bug as well.
13356
13357 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
13358
13359         * driver.cs: Allow assemblies without code to be generated, fixes
13360         52230.
13361
13362 2004-01-07  Nick Drochak <ndrochak@gol.com>
13363
13364         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
13365
13366 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
13367
13368         * cs-parser.jay: Add rules to improve error reporting if fields or
13369         methods are declared at the namespace level (error 116)
13370
13371         * Add rules to catch event add/remove
13372
13373 2004-01-04  David Sheldon <dave-mono@earth.li>
13374
13375   * expression.cs: Added matching ")" to error message for 
13376   CS0077
13377
13378 2004-01-03 Todd Berman <tberman@gentoo.org>
13379
13380         * ecore.cs, attribute.cs:
13381         Applying fix from #52429.
13382
13383 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13384
13385         * ecore.cs, expression.cs, statement.cs:
13386         Total rewrite of how we handle branching. We
13387         now handle complex boolean expressions with fewer
13388         jumps. As well if (x == 0) no longer emits a ceq.
13389
13390         if (x is Foo) is much faster now, because we generate
13391         better code.
13392
13393         Overall, we get a pretty big improvement on our benchmark
13394         tests. The code we generate is smaller and more readable.
13395
13396         I did a full two-stage bootstrap. The patch was reviewed
13397         by Martin and Miguel.
13398
13399 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13400
13401         * cs-parser.jay: Make primary_expression not take a QI.
13402         we dont need this because the member_access rule covers
13403         us here. So we replace the rule with just IDENTIFIER.
13404
13405         This has two good effects. First, we remove a s/r conflict.
13406         Second, we allocate many fewer QualifiedIdentifier objects.
13407
13408 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13409
13410         * attribute.cs: Handle MarshalAs attributes as pseudo, and
13411         set the correct information via SRE. This prevents
13412         hanging on the MS runtime. Fixes #29374.
13413
13414 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13415
13416         * convert.cs: correctly handle conversions to value types
13417         from Enum and ValueType as unboxing conversions.
13418
13419         Fixes bug #52569. Patch by Benjamin Jemlich.
13420
13421 2004-01-02  Ravi Pratap  <ravi@ximian.com>
13422
13423         * expression.cs (BetterConversion): Prefer int -> uint
13424         over int -> ulong (csc's behaviour). This fixed bug #52046.
13425
13426 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13427
13428         * decl.cs (MemberCache.FindMembers): now returns a
13429         MemberInfo [].
13430
13431         * typemanager.cs: In general, go with with ^^.
13432         (CopyNewMethods): take an IList.
13433         (RealMemberLookup): Only allocate an arraylist
13434         if we copy from two sets of methods.
13435
13436         This change basically does two things:
13437         1) Fewer array lists allocated due to CopyNewMethods.
13438         2) the explicit cast in MemberList costed ALOT.
13439
13440 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
13441
13442         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
13443         a hashtable to avoid needless string allocations when an identifier is
13444         used more than once (the common case).
13445
13446 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13447
13448         * pending.cs: MS's TypeBuilder.GetInterfaces ()
13449         is broken, it will not return anything. So, we
13450         have to use the information we have in mcs to
13451         do the task.
13452
13453         * typemanager.cs: Add a cache for GetInterfaces,
13454         since this will now be used more often (due to ^^)
13455
13456         (GetExplicitInterfaces) New method that gets the
13457         declared, not effective, interfaces on a type
13458         builder (eg, if you have interface IFoo, interface
13459         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
13460         { IBar }.
13461
13462         This patch makes MCS able to bootstrap itself on
13463         Windows again.
13464
13465 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13466
13467         * expression.cs: Remove the Nop's that Miguel put
13468         in by mistake.
13469
13470 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13471
13472         * report.cs, codegen.cs: Give the real stack trace to
13473         the error when an exception is thrown.
13474
13475 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13476
13477         * decl.cs: only allocate hashtables for ifaces if 
13478         it is an iface!
13479
13480 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13481
13482         * expression.cs: fix the error from cs0121-2.cs
13483         (a parent interface has two child interfaces that
13484         have a function with the same name and 0 params
13485         and the function is called through the parent).
13486
13487 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13488
13489         * class.cs, rootcontext.cs, typmanager.cs: do not
13490         leak pointers.
13491
13492 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
13493
13494         * codegen.cs: remove stack for the ec flow branching.
13495         It is already a linked list, so no need.
13496
13497 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
13498
13499         * Makefile: Allow custom profiler here.
13500
13501 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13502
13503         * typemanager.cs (LookupType):
13504           - Use a static char [], because split takes
13505             a param array for args, so it was allocating
13506             every time.
13507           - Do not store true in a hashtable, it boxes.
13508
13509 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13510
13511         * flowanalysis.cs: bytify common enums.
13512
13513 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13514
13515         * modifiers.cs: Add a new set of flags for the
13516         flags allowed on explicit interface impls.
13517         * cs-parser.jay: catch the use of modifiers in
13518         interfaces correctly.
13519         * class.cs: catch private void IFoo.Blah ().
13520
13521         All related to bug #50572.
13522
13523 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13524
13525         * decl.cs: Rewrite the consistant accessability checking.
13526         Accessability is not linear, it must be implemented in
13527         a tableish way. Fixes #49704.
13528
13529 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13530
13531         * expression.cs: Handle negation in a checked context.
13532         We must use subtraction from zero. Fixes #38674.
13533
13534 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13535
13536         * class.cs: Ignore static void main in DLLs.
13537         * rootcontext.cs: Handle the target type here,
13538         since we are have to access it from class.cs
13539         * driver.cs: account for the above.
13540
13541 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13542
13543         * report.cs: Give line numbers and files if available.
13544
13545 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
13546
13547         * driver.cs: Implement /addmodule.
13548
13549         * typemanager.cs:  Change 'modules' field so it now contains Modules not
13550         ModuleBuilders.
13551
13552 2003-12-20  Martin Baulig  <martin@ximian.com>
13553
13554         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13555         (FieldBase.IsAssigned): Removed this field.
13556         (FieldBase.SetAssigned): New public method.
13557         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13558
13559 2003-12-20  Martin Baulig  <martin@ximian.com>
13560
13561         * expression.cs (LocalVariableReference.DoResolve): Don't set
13562         `vi.Used' if we're called from DoResolveLValue().
13563
13564         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13565         returns the usage vector it just merged into the current one -
13566         pass this one to UsageWarning().
13567         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13568         of the `EmitContext', don't call this recursively on our children.
13569
13570 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
13571
13572         * driver.cs: Implement /target:module.
13573
13574 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
13575
13576         * support.cs (CharArrayHashtable): New helper class.
13577
13578         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
13579         char arrays, not strings, so we can avoid creating a string in
13580         consume_identifier if the identifier is a keyword.
13581
13582 2003-12-16  Martin Baulig  <martin@ximian.com>
13583
13584         * statement.cs (LocalInfo.Assigned): Removed this property.
13585         (LocalInfo.Flags): Removed `Assigned'.
13586         (LocalInfo.IsAssigned): New public method; takes the EmitContext
13587         and uses flow analysis.
13588         (Block.UsageWarning): Made this method private.
13589         (Block.Resolve): Call UsageWarning() if appropriate.
13590
13591         * expression.cs (LocalVariableReference.DoResolve): Always set
13592         LocalInfo.Used here.
13593
13594 2003-12-13  Martin Baulig  <martin@ximian.com>
13595
13596         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13597         any value here; we're now using flow analysis to figure out
13598         whether a statement/block returns a value.
13599
13600 2003-12-13  Martin Baulig  <martin@ximian.com>
13601
13602         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13603         working again.
13604         (FlowBranching.MergeFinally): Don't call
13605         `branching.CheckOutParameters()' here, this is called in
13606         MergeTopBlock().
13607         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13608         when adding the `finally' vector.       
13609
13610 2003-12-13  Martin Baulig  <martin@ximian.com>
13611
13612         * flowanalysis.cs
13613         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13614         actually work and also fix #48962.
13615
13616 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
13617
13618         * decl.cs: Do not check System.Object for nested types,
13619         since we know it does not have any. Big bang for buck:
13620
13621         BEFORE:
13622            Run 1:   8.35 seconds
13623            Run 2:   8.32 seconds
13624            corlib:  17.99 seconds
13625         AFTER:
13626            Run 1:   8.17 seconds
13627            Run 2:   8.17 seconds
13628            corlib:  17.39 seconds
13629
13630 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
13631
13632         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13633         time we are returning 0 members, so we save alot here.
13634
13635 2003-12-11  Martin Baulig  <martin@ximian.com>
13636
13637         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13638         `MergeChild()', also just take the `FlowBranching' as argument;
13639         call Merge() on it and return the result.
13640         (FlowBranching.Merge): We don't need to do anything if we just
13641         have one sibling.
13642
13643 2003-12-11  Martin Baulig  <martin@ximian.com>
13644
13645         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13646         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
13647         Maurer for this idea.
13648
13649 2003-12-11  Martin Baulig  <martin@ximian.com>
13650
13651         * flowanalysis.cs (MergeResult): This class is now gone; we now
13652         use the `UsageVector' for this.  The reason for this is that if a
13653         branching just has one sibling, we don't need to "merge" them at
13654         all - that's the next step to do.
13655         (FlowBranching.Merge): We now return a `UsageVector' instead of a
13656         `MergeResult'.
13657
13658 2003-12-11  Martin Baulig  <martin@ximian.com>
13659
13660         Reworked flow analyis and made it more precise and bug-free.  The
13661         most important change is that we're now using a special `Reachability'
13662         class instead of having "magic" meanings of `FlowReturns'.  I'll
13663         do some more cleanups and optimizations and also add some more
13664         documentation this week.
13665
13666         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13667         largely reworked this class.
13668         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13669         the new `Reachability' class instead of having "magic" values here.
13670         (FlowBranching): We're now using an instance of `Reachability'
13671         instead of having separate `Returns', `Breaks' etc. fields.
13672
13673         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13674         based on flow analysis; ignore the return value of block.Emit ().
13675
13676 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
13677
13678         * driver.cs typemanager.cs: Find the mono extensions to corlib even
13679         if they are private.
13680
13681 2003-12-09  Martin Baulig  <martin@ximian.com>
13682
13683         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13684         call them directly on the UsageVector.
13685
13686 2003-12-09  Martin Baulig  <martin@ximian.com>
13687
13688         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13689         Changed return type from `FlowReturns' to `Reachability'.
13690
13691 2003-12-09  Martin Baulig  <martin@ximian.com>
13692
13693         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13694         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13695         `Reachable' fields with a single `Reachability' one.
13696
13697 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13698
13699         * class.cs (FindMembers): Remove foreach's.
13700
13701         Bootstrap times:
13702
13703         BEFORE
13704                 Run 1:   8.74 seconds
13705                 Run 2:   8.71 seconds
13706
13707         AFTER
13708                 Run 1:   8.64 seconds
13709                 Run 2:   8.58 seconds
13710
13711
13712 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13713
13714         * cs-parser.jay:
13715         * gen-treedump.cs:
13716         * statement.cs:
13717         This patch does a few things:
13718                 1. EmptyStatement is now a singleton, so it is never reallocated.
13719                 2. All blah is EmptyStatement constructs have been changed to
13720                    blah == EmptyStatement.Value, which is much faster and valid
13721                    now that EmptyStatement is a singleton.
13722                 3. When resolving a block, rather than allocating a new array for
13723                    the non-empty statements, empty statements are replaced with
13724                    EmptyStatement.Value
13725                 4. Some recursive functions have been made non-recursive.
13726         Mainly the performance impact is from (3), however (1) and (2) are needed for
13727         this to work. (4) does not make a big difference in normal situations, however
13728         it makes the profile look saner.
13729
13730         Bootstrap times:
13731
13732         BEFORE
13733         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13734         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13735         Total memory allocated: 56397 KB
13736
13737         AFTER
13738         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13739         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13740         Total memory allocated: 55666 KB
13741
13742 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13743
13744         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13745         than the hashtable in a hashtable version
13746
13747         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13748         we always end up concating a string. This results in a huge perf
13749         loss, because many strings have to be tracked by the GC. In this
13750         patch, we first use a hashtable that works with two keys, so that
13751         the strings do not need to be concat'ed.
13752
13753         Bootstrap times:
13754         BEFORE
13755                 Run 1:   8.74 seconds
13756                 Run 2:   8.71 seconds
13757
13758         AFTER
13759                 Run 1:   8.65 seconds
13760                 Run 2:   8.56 seconds
13761
13762 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13763
13764         * Makefile: Add a new target `do-time' that does a quick and simple
13765         profile, leaving easy to parse output.
13766
13767 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
13768
13769         * codegen.cs (Init): Create the dynamic assembly with 
13770         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13771
13772 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13773
13774         * support.cs: Make the PtrHashtable use only one
13775         instance of its comparer.
13776
13777 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
13778
13779         * typemanager.cs: Fix lookup of GetNamespaces.
13780
13781 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
13782
13783         * expression.cs: Removed redundant line.
13784
13785         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13786         ArrayLists, use for loops with bounds.  
13787
13788         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13789         arraylist.
13790
13791         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13792         arraylists, use for loop with bounds.
13793
13794         The above three changes give us a 0.071 second performance
13795         improvement out of 3.294 seconds down to 3.223.  On my machine
13796         the above changes reduced the memory usage by 1,387 KB during
13797         compiler bootstrap.
13798
13799         * cs-parser.jay (QualifiedIdentifier): New class used to represent
13800         QualifiedIdentifiers.  Before we created a new string through
13801         concatenation, and mostly later on, the result would be
13802         manipulated by DecomposeQI through string manipulation.
13803
13804         This reduced the compiler memory usage for bootstrapping from
13805         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13806         compile times in 0.05 seconds.
13807
13808 2003-11-28  Dick Porter  <dick@ximian.com>
13809
13810         * support.cs: Do string compares with the Invariant culture.
13811
13812         * rootcontext.cs: 
13813         * gen-treedump.cs: 
13814         * expression.cs: 
13815         * driver.cs: 
13816         * decl.cs: 
13817         * codegen.cs: 
13818         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13819         the comparison is done with the Invariant culture.
13820
13821 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
13822
13823         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13824         GetEnumerator method.
13825
13826         (ProbeCollectionType): Iterate starting at the most specific type
13827         upwards looking for a GetEnumerator
13828
13829         * expression.cs: Shift count can be up to 31 for int/uint and 63
13830         for long/ulong.
13831
13832 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
13833
13834         * statement.cs (Block.LookupLabel): Also look for the label on the
13835         children blocks.  Use a hash table to keep track of visited
13836         nodes. 
13837
13838         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13839         we actually did transform the other operand, otherwise fall back
13840         to the common codepath that casts to long.
13841
13842         * cs-tokenizer.cs: Use the same code pattern as the int case.
13843         Maybe I should do the parsing myself, and avoid depending on the
13844         Parse routines to get this done.
13845
13846 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
13847
13848         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13849         which fixes bug 51347.  This time test it.
13850
13851         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13852         attributes for example can not tell the difference between these.
13853         The difference was only a syntax feature of the language. 
13854
13855         * attribute.cs: Apply attributes to delegates.
13856
13857         * delegate.cs: Call the apply attributes method.
13858
13859 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
13860
13861         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13862         comparing 0 vs Byte.MinValue, not the value
13863
13864         (ImplicitConversionRequired): When reporting a conversion error,
13865         use error 31 to print out the constant error instead of the
13866         simpler 29.
13867
13868         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13869         which fixes bug 51347.
13870
13871 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
13872
13873         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
13874         which fixes the -warnaserror command line option.
13875
13876 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
13877
13878         * cfold.cs (DoNumericPromotions): During constant folding of
13879         additions on UIntConstant, special case intconstants with
13880         IntConstants like we do on the expression binary operator. 
13881
13882 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
13883
13884         * convert.cs (ImplicitReferenceConversion): We were missing a case
13885         (System.Enum are not value types or class types, so we need to
13886         classify them separatedly).
13887
13888         * driver.cs: We do not support error 2007.
13889
13890 2003-11-12 Jackson Harper <jackson@ximian.com>
13891
13892         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13893         system directory. Also use the full file name so users can
13894         libraries names mscorlib-o-tron.dll in a non system dir.
13895         
13896 2004-01-04  David Sheldon <dave-mono@earth.li>
13897
13898         * expression.cs: Added matching ")" to error message for CS0077.
13899
13900 2003-12-19  Martin Baulig  <martin@ximian.com>
13901
13902         * typemanager.cs (TypeManager.IsEqualGenericType): New public
13903         static method; see documentation in the method.
13904         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
13905
13906         * convert.cs (Convert.ImplicitReferenceConversion,
13907         Convert.ImplicitReferenceConversionExists): Add support for
13908         generic type declarations; see gen-36.cs.
13909
13910 2003-12-19  Martin Baulig  <martin@ximian.com>
13911
13912         * pending.cs (Pending.InterfaceMethod): Use
13913         `Type.IsAssignableFrom()' instead of `=='.
13914
13915 2003-12-18  Martin Baulig  <martin@ximian.com>
13916
13917         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
13918         byref types first.
13919
13920         * convert.cs (Convert.ImplicitStandardConversionExists): Use
13921         `expr_type.Equals (target_type)' instead of `=='.
13922
13923 2003-12-08  Martin Baulig  <martin@ximian.com>
13924
13925         * generics.cs (Constraints.Types): Removed.
13926         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
13927         to Type's.
13928         (Constraints.ResolveTypes): New public method; resolves the
13929         TypeExpr's to Type's.
13930         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
13931         longer takes the constraints.
13932         (TypeParameter.DefineMethod): Likewise.
13933         (TypeParameter.DefineType): New public method.  Calls
13934         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
13935         the constraints.
13936
13937 2003-12-08  Martin Baulig  <martin@ximian.com>
13938
13939         * convert.cs (Convert.ImplicitConversionStandard): Use
13940         `expr_type.Equals (target_type)' instead of `=='.
13941
13942 2003-12-08  Martin Baulig  <martin@ximian.com>
13943
13944         * typemanager.cs (TypeManager.GetReferenceType): Call
13945         `Type.MakeByRefType ()'.
13946
13947 2003-12-08  Martin Baulig  <martin@ximian.com>
13948
13949         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
13950         just has some special meaning in some situations.  For instance,
13951         it is allowed to use `where' as the name of a variable etc.
13952
13953 2003-12-04  Martin Baulig  <martin@ximian.com>
13954
13955         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13956         `Type.MakeArrayType()' for array types.
13957
13958 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
13959
13960         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
13961         debugging message.
13962
13963         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
13964         corlib to compile.
13965
13966 2003-11-16  Martin Baulig  <martin@ximian.com>
13967
13968         * codegen.cs (EmitContext.IsGeneric): Removed.
13969
13970         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
13971         ResolveGeneric() on the DeclSpace.
13972
13973 2003-11-16  Martin Baulig  <martin@ximian.com>
13974
13975         * generic.cs (TypeArguments.Resolve):
13976         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
13977         `ResolveType()' on it to get the Type.
13978
13979 2003-11-15  Martin Baulig  <martin@ximian.com>
13980
13981         * generic.cs (ConstructedType.GetInterfaces): Override this.
13982
13983 2003-11-14  Martin Baulig  <martin@ximian.com>
13984
13985         * interface.cs (Interface.DefineType): Define all type parameters
13986         before adding the interfaces we inherit.
13987
13988 2003-11-11  Martin Baulig  <martin@ximian.com>
13989
13990         * generic.cs (ConstructedType.ResolveType): Always call
13991         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
13992
13993 2003-11-10  Martin Baulig  <martin@ximian.com>
13994
13995         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13996         (TypeManager.InitCoreTypes): Initialize them here, but instead of
13997         calling `ResolveType()' on them, directly assign their `Type'.
13998
13999 2003-11-08  Martin Baulig  <martin@ximian.com>
14000
14001         * generic.cs (ConstructedType): Override `IsClass' etc.
14002
14003 2003-11-08  Martin Baulig  <martin@ximian.com>
14004
14005         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
14006         return value and the `out parent' parameter.
14007         (TypeContainer.DefineType): Moved the CS0644 check into
14008         GetClassBases().  Don't pass the interface types to the
14009         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
14010         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
14011
14012         * ecore.cs (TypeExpr.IsAttribute): New property.
14013         (TypeExpr.GetInterfaces): New method.
14014
14015         * interface.cs (Interface.GetInterfaceTypeByName): Return a
14016         TypeExpr instead of a Type.
14017         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
14018         (Interface.DefineType): Don't pass the interface types to the
14019         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
14020         them later and then call `TypeBulider.AddInterfaceImplementation()'.
14021
14022         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
14023         instead of a `Type[]'.
14024         (TypeManager.RegisterBuilder): Likewise.
14025         (TypeManager.AddUserInterface): Likewise.
14026         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
14027         `Type[]' and also return a `TypeExpr[]'.
14028         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
14029
14030 2003-11-08  Martin Baulig  <martin@ximian.com>
14031
14032         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
14033         Expression.     
14034
14035 2003-11-08  Martin Baulig  <martin@ximian.com>
14036
14037         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
14038         TypeManager.ResolveExpressionTypes().
14039
14040         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
14041         instead of an Expression.
14042         (TypeExpr): This is now an abstract base class for `TypeExpression'.
14043         (TypeExpression): New public class; formerly known as `TypeExpr'.
14044
14045         * expression.cs (ComposedCast): Derive from TypeExpr.
14046
14047         * typemanager.cs (TypeManager.system_*_expr): These are now
14048         TypExpr's instead of Expression's.
14049         (TypeManager.ResolveExpressionTypes): New public static function;
14050         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
14051         of them.        
14052
14053 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
14054
14055         * expression.cs (New.DoResolve): Do not dereference value that
14056         might be a null return.
14057
14058         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
14059         sure that the constant value has the right type.  Fixes an
14060         unreported bug, similar to 50425.
14061
14062         * const.cs (Const.LookupConstantValue): Call
14063         ImplicitStandardConversionExists before doing a conversion to
14064         avoid havng the TypeManager.ChangeType do conversions.
14065
14066         Reduced the number of casts used
14067
14068         (Const.ChangeType): New routine to enable reuse of the constant
14069         type changing code from statement.
14070
14071         * typemanager.cs (ChangeType): Move common initialization to
14072         static global variables.
14073
14074         Fixes #50425.
14075
14076         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
14077         every value type to go through, even if it was void.  Fix that. 
14078
14079         * cs-tokenizer.cs: Use is_identifier_start_character on the start
14080         character of the define, and the is_identifier_part_character for
14081         the rest of the string.
14082
14083 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
14084
14085         * expression.cs (UnaryMutator.EmitCode): When I updated
14086         LocalVariableReference.DoResolve, I overdid it, and dropped an
14087         optimization done on local variable references.
14088
14089 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
14090
14091         * ecore.cs: Convert the return from Ldlen into an int.
14092
14093 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
14094
14095         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
14096         the accessibility, this is a special case for toplevel non-public
14097         classes (internal for instance).
14098
14099 2003-10-20  Nick Drochak <ndrochak@gol.com>
14100
14101         * ecore.cs: Fix typo and build.  Needed another right paren.
14102
14103 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
14104
14105         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
14106         `internal' case regular and protected, but not allowing protected
14107         to be evaluated later.  Bug 49840
14108
14109 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
14110
14111         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
14112         to kb.Nlast, and not the kb.nFirst to isolate the switch
14113         statement.
14114
14115         Extract the underlying type, so enumerations of long/ulong are
14116         treated like long/ulong.
14117
14118 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
14119
14120         * expression.cs (New): Overload the meaning of RequestedType to
14121         track the possible creation of the NewDelegate type, since
14122         DoResolve is invoked more than once for new constructors on field
14123         initialization.
14124
14125         See bugs: #48800 and #37014
14126
14127         * cs-parser.jay (declare_local_constants): Take an arraylist
14128         instead of a single constant.
14129
14130         (local_constant_declaration): It should take a
14131         constant_declarators, not a constant_declarator.  Fixes 49487
14132
14133         * convert.cs: Fix error report.
14134
14135 2003-10-13 Jackson Harper <jackson@ximian.com>
14136
14137         * typemanager.cs (TypeToCoreType): Add float and double this fixes
14138         bug #49611
14139         
14140 2003-11-03  Martin Baulig  <martin@ximian.com>
14141
14142         * expression.cs (ArrayAccess.GetStoreOpcode): Added
14143         `out bool has_type_arg'; if set, we need to pass the type to
14144         ig.Emit().
14145         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
14146         Stelem_Any/Ldelem_Any for generic parameters.   
14147
14148 2003-11-02  Martin Baulig  <martin@ximian.com>
14149
14150         * expression.cs (Invocation.EmitCall): Use
14151         `TypeManager.IsValueType()' to check whether it's a value type.
14152         Don't set `struct_call' when calling a method on a type parameter.
14153
14154 2003-11-02  Martin Baulig  <martin@ximian.com>
14155
14156         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
14157         and removed the TypeBuilder argument.
14158
14159         * typemanager.cs (TypeManager.IsValueType): Return
14160         `t.IsGenericParameter || t.IsValueType'.
14161
14162 2003-10-25  Martin Baulig  <martin@ximian.com>
14163
14164         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
14165         call ConstructedType.Resolve() on it.
14166
14167         * generic.cs (ConstructedType.Resolve): Set `type' on success.
14168
14169 2003-10-25  Martin Baulig  <martin@ximian.com>
14170
14171         * class.cs (TypeContainer.GetClassBases): Changed
14172         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
14173         CS8214 reporting here.
14174         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
14175         instead of a `Type' for our parent.  In case of a recursive
14176         declaration (see tests/gen-23.cs for an example), our parent is a
14177         ConstructedType and it doesn't have its type set.  So, first
14178         create our own TypeBuilder, then call constructed.Resolve() to get
14179         the parent's type and finally TypeBuilder.SetParent() it.
14180
14181         * ecore.cs (TypeExpr.Name): New public virtual property.
14182
14183         * generic.cs
14184         (ConstructedType): We're now a TypeExpr and not just an Expression.
14185         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
14186         arguments here; this is done later.
14187         (ConstructedType.Resolve): New public method to resolve the type
14188         arguments and bind them.
14189
14190 2003-10-21  Martin Baulig  <martin@ximian.com>
14191
14192         * convert.cs: Use `TypeManager.IsValueType' instead of
14193         'type.IsValueType' everywhere.
14194
14195         * typemanager.cs (TypeManager.IsValueType): Return true for type
14196         parameters.  The reason for this is that we need to box a type
14197         parameter when converting it to a reference type.
14198
14199         * cs-parser.jay: Added support for default value expressions.
14200
14201         * generics.cs (DefaultValueExpression): New public class.       
14202
14203 2003-10-17  Martin Baulig  <martin@ximian.com>
14204
14205         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
14206         TypeContainer so we can also use this for Interfaces.
14207         (TypeParameter.Resolve): Likewise.
14208
14209         * interface.cs (Interface.DefineType): Added support for generic
14210         interfaces.
14211
14212         * cs-parser.jay: Added support for generic structs and interfaces.
14213
14214 2003-10-17  Martin Baulig  <martin@ximian.com>
14215
14216         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
14217         call generic methods :-)
14218
14219 2003-10-16  Martin Baulig  <martin@ximian.com>
14220
14221         * cs-parser.jay (namespace_or_type_name): Only create a
14222         GenericMemberAccess if we actually have type arguments.
14223
14224 2003-10-13  Martin Baulig  <martin@ximian.com>
14225
14226         * class.cs (Method.Define): If we're a generic method, call
14227         TypeBuilder.DefineGenericMethod () before resolving
14228         the parameters.
14229         (MethodData): Added .ctor which takes an additional MethodBuilder
14230         argument; this is used for generic methods.
14231         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
14232         we already have a MethodBuilder.
14233
14234 2003-10-10  Martin Baulig  <martin@ximian.com>
14235
14236         * class.cs (Method): Added .ctor which takes a `GenericMethod'
14237         instead of a `DeclSpace'.  This is used for generic methods.
14238
14239         * cs-parser.jay (method_header): Added support for generic
14240         methods; create a `GenericMethod' instance and pass it to the
14241         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
14242         parameters and locals.
14243
14244         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
14245         since we already have the location.  Check whether we're a generic
14246         type declaration or a generic method and create the correct type
14247         parameter.
14248
14249         * generic.cs (TypeParameter.DefineMethod): New public method.
14250         (GenericMethod): New public class; derives from DeclSpace and is
14251         used for generic methods.       
14252
14253 2003-10-09  Martin Baulig  <martin@ximian.com>
14254
14255         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
14256         to the .ctor.
14257         (MethodCore.DoDefineParameters): Removed the TypeContainer
14258         argument; use the DeclSpace which was passed to the .ctor instead.
14259         (MethodCore.CheckParameter): Take a DeclSpace instead of a
14260         TypeContainer; we only need a DeclSpace here.
14261
14262 2003-10-09  Martin Baulig  <martin@ximian.com>
14263
14264         * class.cs (MethodData): Added additional `DeclSpace ds' argument
14265         to the .ctor.
14266         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
14267         EmitContext's .ctor.    
14268
14269 2003-10-09  Martin Baulig  <martin@ximian.com>
14270
14271         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
14272         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
14273         AsAccessible(), moved them as well.
14274
14275         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
14276
14277 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
14278
14279         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
14280         generation for >=, as spotted by Paolo, bug 48679.  
14281         Patch from David Waite.
14282
14283         * cs-tokenizer.cs: Add handling for #pragma.
14284
14285         * cs-parser.jay: Allow for both yield and yield return in the
14286         syntax.  The anti-cobolization of C# fight will go on!
14287
14288         * class.cs (TypeBuilder.DefineType): Catch error condition here
14289         (Parent.DefineType erroring out and returning null).
14290
14291         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14292         coping with enumerations variables, we were mistakenly processing
14293         them as a regular value type instead of built-in types.  Fixes the
14294         bug #48063
14295
14296         * typemanager.cs (IsBuiltinOrEnum): New method.
14297
14298 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
14299
14300         * cs-parser.jay: Upgrade: yield now needs the return clause.
14301
14302 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
14303
14304         * cs-parser.jay : Renamed yyName to yyNames related to jay.
14305
14306 2003-09-29  Martin Baulig  <martin@ximian.com>
14307
14308         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
14309         inflated generic methods.
14310
14311         * generics.cs (ConstructedType): Distinguish between open and
14312         closed constructed types; correctly resolve the arguments.
14313
14314 2003-09-22  Martin Baulig  <martin@ximian.com>
14315
14316         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
14317         all type arguments meet their constraints.
14318
14319 2003-09-19  Martin Baulig  <martin@ximian.com>
14320
14321         * decl.cs (MemberCache.SetupCacheForInterface): Take a
14322         `MemberCache parent' argument.  Normally, an interface doesn't
14323         have a parent type except System.Object, but we use this in gmcs
14324         for generic type parameters.
14325
14326 2003-09-18  Martin Baulig  <martin@ximian.com>
14327
14328         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
14329         on `type.IsInterface'; don't check whether the type has a parent
14330         to determine whether it's an interface.
14331
14332 2003-09-17  Martin Baulig  <martin@ximian.com>
14333
14334         * generic.cs (ConstructedType.ToString): Always use `name' as the
14335         type name.
14336
14337 2003-09-15  Martin Baulig  <martin@ximian.com>
14338
14339         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
14340
14341         * generic.cs (Constraints.Resolve): New public method; this is
14342         called to resolve the constraint types and to check whether all
14343         the constraints are correct.
14344         (Constraints.Types): New public property.
14345         (TypeParameter.Resolve): New public method; resolves all the
14346         type's constraints.
14347
14348         * class.cs (TypeContainer.DefineType): Call
14349         TypeParameter.Resolve() before actually defining the type.
14350
14351 2003-09-15  Martin Baulig  <martin@ximian.com>
14352
14353         * class.cs (TypeContainer.DefineType): Added an error flag to
14354         avoid reporting duplicate CS0146's ("class definition is
14355         circular.").
14356
14357         * driver.cs (Driver.MainDriver): Abort if
14358         RootContext.ResolveTree() reported any errors.
14359
14360 2003-09-07  Martin Baulig  <martin@ximian.com>
14361
14362         * report.cs (Error, Warning): Added overloaded versions which take
14363         a `params object[] args' and call String.Format().
14364
14365 2003-09-07  Martin Baulig  <martin@ximian.com>
14366
14367         * decl.cs (DeclSpace..ctor): Don't call
14368         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
14369         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
14370         (DeclSpace.RecordDecl): New method.
14371
14372         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
14373
14374 2003-09-02  Ravi Pratap  <ravi@ximian.com>
14375
14376         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
14377         value attributes to be applied to ParameterBuilders.
14378
14379         * class.cs (MethodCore.LabelParameters): Make static and more
14380         generic so that it can be used from other places - like interface
14381         methods, for instance.
14382
14383         * interface.cs (Interface.Emit): Call LabelParameters before
14384         emitting attributes on the InterfaceMethod.
14385
14386 2003-09-07  Martin Baulig  <martin@ximian.com>
14387
14388         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
14389         if the number of type parameters doesn't match.
14390
14391 2003-09-04  Martin Baulig  <martin@ximian.com>
14392
14393         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
14394         for arrays of generic type params (ie. `!0[]').
14395
14396 2003-09-04  Martin Baulig  <martin@ximian.com>
14397
14398         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
14399         for the moment.
14400
14401 2003-09-04  Martin Baulig  <martin@ximian.com>
14402
14403         * decl.cs (DeclSpace.LookupGeneric): New method.
14404         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
14405         moment.
14406
14407         * generic.cs (TypeParameterExpr): Take a TypeParameter as
14408         argument, not just a string.
14409         (TypeParameter.Define): New public method; this is called to
14410         actually define the generic parameter; after this, you can use the
14411         new `Type' property to get the type.
14412
14413 2003-09-04  Martin Baulig  <martin@ximian.com>
14414
14415         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
14416         is now an ArrayList; initialize the result of the `TypeParameters'
14417         property here.
14418         (DeclSpace.GetGenericData): Removed.
14419         (DeclSpace.LookupGeneric): Temporarily removed; we need to
14420         implement this in a different way.
14421         (DeclSpace.GetTypeParameters): Removed; there's now a
14422         `TypeParameters' property.
14423         (DeclSpace.TypeParameters): New public property.
14424
14425         * generic.cs (Constraints): Make this class public.
14426         (TypeParameter): New public class.
14427
14428 2003-09-04  Martin Baulig  <martin@ximian.com>
14429
14430         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
14431         generic parameters.
14432
14433         * class.cs (TypeContainer.DefineType): Call
14434         TypeBuilder.DefineGenericParameter () on all generic parameters if
14435         this is a generic type.
14436
14437 2003-08-28  Martin Baulig  <martin@ximian.com>
14438
14439         * sample-stack.il: Compile this with ilasm: "ilasm /dll
14440         sample-stack.il".
14441
14442         * sample-hello.cs: Compile this with gmcs: "gmcs
14443         /r:sample-stack.dll sample-hello.cs".
14444
14445 2003-08-28  Martin Baulig  <martin@ximian.com>
14446
14447         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
14448         the parameters to the generic type.
14449
14450 2003-08-28  Martin Baulig  <martin@ximian.com>
14451
14452         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
14453
14454 2003-08-28  Martin Baulig  <martin@ximian.com>
14455
14456         * cs-parser.jay (opt_type_argument_list): Use
14457         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
14458         (primary_expression): Replace `qualified_identifier' with `type_name'.
14459         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
14460
14461         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
14462         parser to check whether it is syntactically a type parameter list;
14463         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
14464         this case.
14465
14466 2003-08-26  Martin Baulig  <martin@ximian.com>
14467
14468         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
14469         resolving aliases; fixes #47927.
14470
14471 2003-08-26  Martin Baulig  <martin@ximian.com>
14472
14473         * statement.cs (Using.DoResolve): This is internally emitting a
14474         try/finally clause, so we need to set ec.NeedExplicitReturn if we
14475         do not always return.  Fixes #47681.
14476
14477 2003-08-26  Martin Baulig  <martin@ximian.com>
14478
14479         * decl.cs (MemberCore): Moved WarningNotHiding(),
14480         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
14481         into MemberBase.
14482         (AdditionResult): Make this nested in DeclSpace.
14483         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
14484         argument; call NamespaceEntry.Define() unless we're nested in a
14485         class or struct.
14486
14487         * namespace.cs (Namespace.DefineName): New public function.  This
14488         is called from DeclSpace's .ctor to add 
14489         (Namespace.Lookup): Include DeclSpaces in the lookup.
14490
14491         * class.cs (Operator): Derive from MemberBase, not MemberCore.
14492
14493         * const.cs (Const): Derive from MemberBase, not MemberCore.     
14494
14495 2003-08-25  Martin Baulig  <martin@ximian.com>
14496
14497         * convert.cs (Convert.ExplicitReferenceConversion): When
14498         converting from an interface type to a class, unbox if the target
14499         type is a struct type.  Fixes #47822.
14500
14501 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14502
14503         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
14504         #47854.
14505
14506 2003-08-22  Martin Baulig  <martin@ximian.com>
14507
14508         * class.cs (TypeManager.DefineType): When defining a nested type,
14509         call DefineType() on our parent; fixes #47801.
14510
14511 2003-08-22  Martin Baulig  <martin@ximian.com>
14512
14513         * class.cs (MethodData.Define): While checking if a method is an
14514         interface implementation, improve the test a bit more to fix #47654.
14515
14516 2003-08-22  Martin Baulig  <martin@ximian.com>
14517
14518         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
14519         correctly; fixes #47722.
14520
14521 2003-08-22  Martin Baulig  <martin@ximian.com>
14522
14523         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
14524         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
14525
14526         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
14527
14528 2003-08-22  Martin Baulig  <martin@ximian.com>
14529
14530         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
14531         can only be assigned in static constructors.  Fixes #47161.
14532
14533 2003-08-22  Martin Baulig  <martin@ximian.com>
14534
14535         Rewrote and improved the flow analysis code.
14536
14537         * flowbranching.cs (FlowBranching): Make this class abstract.
14538         (FlowBranching.CreateBranching): New static function to create a
14539         new flow branching.
14540         (FlowBranchingBlock, FlowBranchingException): New classes.
14541         (FlowBranching.UsageVector.Type): New public readonly field.
14542         (FlowBranching.UsageVector.Breaks): Removed the setter.
14543         (FlowBranching.UsageVector.Returns): Removed the setter.
14544         (FlowBranching.UsageVector): Added Break(), Return(),
14545         NeverReachable() and Throw() methods to modify the reachability.
14546         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
14547         done by FlowBranching.Merge().
14548         (FlowBranching.UsageVector.MergeChild): New method; merges the
14549         merge result into the current vector.
14550         (FlowBranching.Merge): New abstract method to merge a branching.
14551
14552 2003-08-12  Martin Baulig  <martin@ximian.com>
14553
14554         * expression.cs (Indirection.CacheTemporaries): Create the
14555         LocalTemporary with the pointer type, not its element type.
14556
14557 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
14558
14559         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
14560         token was a keyword or not.
14561
14562         Add `error' options where an IDENTIFIER was expected;  Provide
14563         CheckToken and CheckIdentifierToken convenience error reporting
14564         functions. 
14565
14566         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
14567
14568         * decl.cs: Rename `NamespaceEntry Namespace' public field into
14569         NameSpaceEntry NameSpaceEntry.
14570
14571         (LookupInterfaceOrClass): Avoid creating a full qualified name
14572         from namespace and name: avoid doing lookups when we know the
14573         namespace is non-existant.   Use new Tree.LookupByNamespace which
14574         looks up DeclSpaces based on their namespace, name pair.
14575
14576         * driver.cs: Provide a new `parser verbose' to display the
14577         exception thrown during parsing.  This is turned off by default
14578         now, so the output of a failure from mcs is more graceful.
14579
14580         * namespace.cs: Track all the namespaces defined in a hashtable
14581         for quick lookup.
14582
14583         (IsNamespace): New method
14584
14585 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
14586
14587         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
14588         we know that we need to concatenate (full typename can never be
14589         null). 
14590
14591         * class.cs: ditto.
14592
14593         * statement.cs: Use a bitfield;  Do not initialize to null things
14594         which are done by the constructor by default.
14595
14596         * cs-parser.jay: bug fix, parameter was 4, not 3.
14597
14598         * expression.cs: Just use the property;
14599
14600         * statement.cs: No need for GetVariableInfo method.
14601
14602 2003-08-08  Martin Baulig  <martin@ximian.com>
14603
14604         * flowanalysis.cs (FlowReturns): This is now nested in the
14605         `FlowBranching' class.
14606         (MyBitVector): Moved this here from statement.cs.
14607         (FlowBranching.SiblingType): New enum type.
14608         (FlowBranching.CreateSibling): Added `SiblingType' argument.
14609
14610 2003-08-07  Martin Baulig  <martin@ximian.com>
14611
14612         * flowanalysis.cs (FlowBranchingType): This is now nested in the
14613         `FlowBranching' class and called `BranchingType'.
14614
14615 2003-08-07  Martin Baulig  <martin@ximian.com>
14616
14617         * flowanalysis.cs: Moved all the control flow analysis code into
14618         its own file.
14619
14620 2003-08-07  Martin Baulig  <martin@ximian.com>
14621
14622         * assign.cs (Assign.DoResolve): `target' must either be an
14623         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
14624         #37319.
14625
14626 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
14627
14628         * expression.cs (BinaryMethod): This kind of expression is created by the
14629         Binary class if it determines that the operator has to be handled
14630         by a method.
14631
14632         (BinaryDelegate): This kind of expression is created if we are
14633         dealing with a + or - operator on delegates.
14634
14635         (Binary): remove method, argumetns, and DelegateOperator: when
14636         dealing with methods, 
14637
14638         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14639
14640         * statement.cs (Block): use bitfields for the three extra booleans
14641         we had in use.   Remove unused topblock parameter.
14642
14643         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14644
14645         * assign.cs: Drop extra unneeded tests.
14646
14647 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
14648
14649         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14650
14651         * statement.cs (Foreach): Use VariableStorage instead of
14652         LocalBuilders.   
14653
14654         * codegen.cs (VariableStorage): New class used by clients that
14655         require a variable stored: locals or fields for variables that
14656         need to live across yield.
14657
14658         Maybe provide a convenience api for EmitThis+EmitLoad?
14659
14660         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14661         these bad boys.
14662
14663 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
14664
14665         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14666         RemapParameterLValue): New methods that are used to turn a
14667         precomputed FieldInfo into an expression like this:
14668
14669                 instance.FieldInfo
14670
14671         The idea is to use this instead of making LocalVariableReference
14672         have more than one meaning.
14673
14674         * cs-parser.jay: Add error production to BASE.
14675
14676         * ecore.cs: Deal with TypeManager.GetField returning null, which
14677         is now a valid return value.
14678
14679         (FieldExprNoAddress): New expression for Fields whose address can
14680         not be taken.
14681
14682         * expression.cs (LocalVariableReference): During the resolve
14683         phases, create new expressions if we are in a remapping context.
14684         Remove code that dealt with remapping here.
14685
14686         (ParameterReference): same.
14687
14688         (ProxyInstance): New expression, like the `This' expression, but
14689         it is born fully resolved.  We know what we are doing, so remove
14690         the errors that are targeted to user-provided uses of `this'.
14691
14692         * statement.cs (Foreach): our variable is now stored as an
14693         Expression;  During resolution, follow the protocol, dont just
14694         assume it will return this.
14695
14696 2003-08-06  Martin Baulig  <martin@ximian.com>
14697
14698         * support.cs (SeekableStreamReader.cs): New public class.
14699
14700         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14701         SeekableStreamReader instead of the normal StreamReader.
14702
14703 2003-08-04  Martin Baulig  <martin@ximian.com>
14704
14705         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14706         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14707         deambiguate casts and delegate invocations.
14708         (parenthesized_expression): Use the new tokens to ensure this is
14709         not a cast of method invocation.
14710
14711         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14712         when reading a `)' and Deambiguate_CloseParens () was previously
14713         called.
14714
14715         * expression.cs (ParenthesizedExpression): New class.  This is
14716         just used for the CS0075 test.
14717         (Binary.DoResolve): Check for CS0075.   
14718
14719 2003-07-29  Ravi Pratap  <ravi@ximian.com>
14720
14721         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14722         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14723         reference comparison.
14724
14725         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14726         examine the ReturnType for equality - this is necessary in the
14727         cases of implicit and explicit operators whose signature also
14728         includes the return type.
14729
14730 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
14731
14732         * namespace.cs: Cache the result of the namespace computation,
14733         instead of computing it every time.
14734
14735 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14736
14737         * decl.cs: Use a global arraylist that we reuse over invocations
14738         to avoid excesive memory consumption.  Reduces memory usage on an
14739         mcs compile by one meg (45 average).
14740
14741         * typemanager.cs (LookupTypeReflection): In .NET pointers are
14742         private, work around that.
14743
14744 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
14745
14746         * literal.cs (IntLiteral): Define Zero and One static literals. 
14747
14748         * cs-parser.jay (integer_literal): use static literals to reduce
14749         memory usage for the most used literals (0, 1 and -1).  211kb
14750         reduced in memory usage.
14751
14752         Replace all calls to `new ArrayList' with `new
14753         ArrayList(4)' which is a good average number for most allocations,
14754         and also requires only 16 bytes of memory for its buffer by
14755         default. 
14756
14757         This reduced MCS memory usage in seven megabytes for the RSS after
14758         bootstrapping.
14759
14760 2003-07-28  Ravi Pratap  <ravi@ximian.com>
14761
14762         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14763         handle params methods the correct way by forming only one
14764         applicable set with params and normal methods in them. Earlier we
14765         were looking at params methods only if we found no normal methods
14766         which was not the correct thing to do.
14767
14768         (Invocation.BetterFunction): Take separate arguments indicating
14769         when candidate and the best method are params methods in their
14770         expanded form.
14771
14772         This fixes bugs #43367 and #46199.
14773
14774         * attribute.cs: Documentation updates.
14775
14776         (CheckAttribute): Rename to CheckAttributeTarget.
14777         (GetValidPlaces): Rename to GetValidTargets.
14778
14779         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14780         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14781
14782         Fixes bug #44468.
14783
14784 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
14785
14786         * codegen.cs: Compute IsGeneric correctly.
14787
14788         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
14789         resolution. 
14790
14791         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
14792         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
14793         regressions, and I was chasing more bugs than I required.
14794
14795         * interface.cs: Use expressions for base type names (like classes
14796         and structs have been doing for a while now), and resolve that.
14797         This patch should probably go into head as well.
14798
14799         This makes it one less user of FindType.
14800
14801 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14802
14803         This compiler can not self host currently.  Need to fix that.
14804         
14805         * Makefile: compile to `gmcs.exe'
14806
14807         * driver.cs: Turn on v2 by default on gmcs.
14808
14809         * generic.cs (ConstructedType): Does no longer take a container
14810         type argument;  That will be taken care of later.
14811
14812         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
14813         Use SimpleName to resolve for now, so we can continue the work on
14814         the parser, until we get Type.GetType that understands generics.
14815
14816         (ConstructedType.ToString): Implement
14817
14818         (TypeArguments.Resolve): Resolve the child expressions as types. 
14819         
14820         * cs-parser.jay: Rename interface_constraints to
14821         type_parameter_constraints
14822
14823         (namespace_or_type_name): Only use constructed types for the basic
14824         construction, we will deal with identifier<...> later.
14825
14826         (type/type_name): No longer call DecomposeQI, as
14827         namespace_or_type_name is always decoded now.
14828         
14829 2003-07-22  Ravi Pratap  <ravi@ximian.com>
14830
14831         * expression.cs (Invocation.OverloadResolve): Follow the spec more
14832         closely: we eliminate methods in base types when we have an
14833         applicable method in a top-level type.
14834
14835         Please see section 14.5.5.1 for an exact description of what goes
14836         on. 
14837
14838         This fixes bug #45127 and a host of other related to corlib compilation.
14839
14840         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14841         array is the method corresponding to the top-level type (this is
14842         because of the changes made to icall.c) so we change this
14843         accordingly.
14844
14845         (MethodGroupExpr.Name): This too.
14846
14847         * typemanager.cs (GetElementType): New method which does the right
14848         thing when compiling corlib. 
14849
14850         * everywhere: Make use of the above in the relevant places.
14851
14852 2003-07-22  Martin Baulig  <martin@ximian.com>
14853
14854         * cs-parser.jay (invocation_expression): Moved
14855         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14856         `cast_expression', but create a InvocationOrCast which later
14857         resolves to either an Invocation or a Cast.
14858
14859         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14860         method; call this before EmitStatement() to make sure that this
14861         expression can be used as a statement.
14862
14863         * expression.cs (InvocationOrCast): New class; resolves to either
14864         an Invocation or a Cast.
14865
14866         * statement.cs (StatementExpression): Call ResolveStatement() on
14867         the ExpressionStatement before emitting it.
14868
14869 2003-07-21  Martin Baulig  <martin@ximian.com>
14870
14871         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14872         `ref' and `out' attributes match; fixes #46220.
14873         (MemberAccess.ResolveMemberAccess): You can't reference a type
14874         through an expression; fixes #33180.
14875         (Indexers.GetIndexersForType): Don't return the indexers from
14876         interfaces the class implements; fixes #46502.
14877
14878 2003-07-21  Martin Baulig  <martin@ximian.com>
14879
14880         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14881         CS0661 checks; fixes bug #30442.
14882
14883 2003-07-21  Martin Baulig  <martin@ximian.com>
14884
14885         * decl.cs (AdditionResult): Added `Error'.
14886
14887         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14888
14889         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
14890         cs0031.cs actually work.
14891
14892  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14893  
14894         * cs-parser.jay (namespace_name): do not use
14895         namespace_or_type_name, use qualified_identifier, because
14896         namespace_or_type_name will soon return a composed expression
14897         instead of a string.
14898  
14899         (namespace_or_type_name): Instead of returning a string, now this
14900         production returns an expression.
14901  
14902         * codegen.cs (EmitContext): Setup IsGeneric property based on
14903         whether our DeclSpace is generic, our the method is generic.
14904  
14905         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
14906         the method is generic.
14907  
14908         * cs-parser.jay (type_arguments, opt_type_argument_list,
14909         type_parameters, type_parameter_list, opt_type_parameter_list,
14910         type_parameter,, opt_type_parameter_constraints_clauses,
14911         type_parameter_constraints_clauses,
14912         type_parameter_constraint_clause, type_parameter_constraint,
14913         interface_constraints): Add new production
14914  
14915         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
14916         DeclSpace is generic or not.
14917  
14918         (DeclSpace.SetParameterInfo): New routine, used to set the
14919         parameter info for a type.
14920  
14921         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
14922         returns a GenericTypeExpr
14923  
14924         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
14925         generic, lookup the generic argument.
14926  
14927         * attribute.cs: Do not allow TypeParameterExpressions in
14928         Attributes.
14929  
14930         * class.cs: Do not allow the Main method to be defined in a
14931         Generic container.
14932  
14933         * expression.cs (SizeOf): Do not allow generic types to be used as
14934         arguments to sizeof.
14935  
14936         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
14937         it: whether a type is generic or not.  Only works for types we are
14938         currently building for now.
14939         
14940 2003-07-20  Martin Baulig  <martin@ximian.com>
14941
14942         * namespace.cs: Fixed that bug which caused a crash when compiling
14943         the debugger's GUI.
14944
14945 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14946
14947         * typemanager.cs (LookupTypeReflection): Never expose types which
14948         are NotPublic, NestedPrivate, NestedAssembly, or
14949         NestedFamANDAssem.  We used to return these, and later do a check
14950         that would report a meaningful error, but the problem is that we
14951         would not get the real match, if there was a name override.
14952
14953 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
14954
14955         * namespace.cs (Namespace, Name): Do not compute the namespace
14956         name dynamically, compute it in the constructor.  This reduced
14957         memory usage by 1697 KB.
14958
14959         * driver.cs: Use --pause to pause at the end.
14960
14961 2003-07-17  Peter Williams  <peter@newton.cx>
14962
14963         * Makefile: Change the name of the test target so that it doesn't
14964         conflict with the recursive test target.
14965
14966 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
14967
14968         * expression.cs (LocalVariableReference.Emit, EmitAssign,
14969         AddressOf): Do not use EmitThis, that was wrong, use the actual
14970         this pointer.
14971
14972 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
14973
14974         * class.cs (MethodData.Define): While checking if a method is an
14975         interface implementation, improve the test: If we are not public
14976         (use new test here: use the computed MethodAttributes directly,
14977         instead of the parsed modifier flags) check if the `implementing'
14978         method comes from an interface or not.
14979
14980         * pending.cs (VerifyPendingMethods): Slightly better error
14981         message.
14982
14983         * makefile: add test target that does the mcs bootstrap.
14984
14985 2003-07-16  Ravi Pratap  <ravi@ximian.com>
14986
14987         * interface.cs (Define): Do nothing here since there are no
14988         members to populate etc. Move the attribute emission out of here
14989         since this was just totally the wrong place to put it. Attribute
14990         application happens during the 'Emit' phase, not in the 'Define'
14991         phase.
14992
14993         (Emit): Add this method and move the attribute emission here
14994
14995         * rootcontext.cs (EmitCode): Call the Emit method on interface
14996         types too.
14997
14998 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14999
15000         * expression.cs (OverloadResolve): Report error only if Location
15001         is not 'Null' which means that there was a probe going on.
15002
15003 2003-07-14  Martin Baulig  <martin@ximian.com>
15004
15005         * expression.cs (ConditionalLogicalOperator): New public class to
15006         implement user defined conditional logical operators.
15007         This is section 14.11.2 in the spec and bug #40505.
15008
15009 2003-07-14  Martin Baulig  <martin@ximian.com>
15010
15011         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
15012
15013 2003-07-14  Martin Baulig  <martin@ximian.com>
15014
15015         * codegen.cs (EmitContext.InFixedInitializer): New public field.
15016
15017         * ecore.cs (IVariable.VerifyFixed): New interface method.
15018
15019         * expression.cs (Unary.ResolveOperator): When resolving the `&'
15020         operator, check whether the variable is actually fixed.  Fixes bug
15021         #36055.  Set a variable definitely assigned when taking its
15022         address as required by the spec.
15023
15024         * statement.cs (LocalInfo.IsFixed): New field.
15025         (LocalInfo.MakePinned): Set `IsFixed' to true.
15026
15027 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
15028
15029         * attribute.cs (Attribute.Resolve): While doing a Member lookup
15030         for .ctors, ensure that we only ask for members declared in the
15031         attribute type (BindingFlags.DeclaredOnly).
15032
15033         Fixes bug #43632.
15034
15035         * expression.cs (Error_WrongNumArguments): Report error 1501
15036         correctly the way CSC does.
15037
15038 2003-07-13  Martin Baulig  <martin@ximian.com>
15039
15040         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
15041         lookup on the fully qualified name, to make things like "X.X" work
15042         where "X.X" is a fully qualified type name, but we also have a
15043         namespace "X" in the using list.  Fixes #41975.
15044
15045 2003-07-13  Martin Baulig  <martin@ximian.com>
15046
15047         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
15048         function. If we're a CompoundAssign, we need to create an embedded
15049         CompoundAssign, not an embedded Assign.
15050         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
15051         Fixes #45854.
15052
15053 2003-07-13  Martin Baulig  <martin@ximian.com>
15054
15055         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
15056         work to fix bug #46088.
15057
15058 2003-07-13  Ravi Pratap <ravi@ximian.com>
15059
15060         * class.cs (Operator.Emit): Do not emit attributes here - it is
15061         taken care of by the Method class that we delegate too. This takes
15062         care of bug #45876.
15063
15064 2003-07-10  Martin Baulig  <martin@ximian.com>
15065
15066         * expression.cs (TypeOfVoid): New class.
15067         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
15068
15069 2003-07-10  Martin Baulig  <martin@ximian.com>
15070
15071         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
15072         bug #35957.
15073
15074 2003-07-10  Martin Baulig  <martin@ximian.com>
15075
15076         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
15077         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
15078
15079         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
15080
15081         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
15082
15083 2003-07-10  Martin Baulig  <martin@ximian.com>
15084
15085         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
15086         of decimal.  Fixes #42850.
15087
15088         NOTE: I also fixed the created byte blob, but this doesn't work on
15089         the MS runtime and csc never produces any byte blobs for decimal
15090         arrays.
15091
15092 2003-07-10  Martin Baulig  <martin@ximian.com>
15093
15094         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
15095         structs; fixes #32068.
15096         (Block.AddChildVariableNames): Fixed #44302.
15097
15098 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15099
15100         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
15101
15102 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
15103
15104         * attribute.cs: And this test is onger needed.
15105
15106 2003-07-08  Martin Baulig  <martin@ximian.com>
15107
15108         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
15109         inaccessible types.  Fixes #36313.
15110
15111         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
15112
15113         * namespace.cs (NamespaceEntry): Create implicit entries for all
15114         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
15115         implicit entries for N1.N2 and N1.
15116
15117 2003-07-08  Martin Baulig  <martin@ximian.com>
15118
15119         Rewrote the handling of namespaces to fix a lot of the issues
15120         wrt. `using' aliases etc.
15121
15122         * namespace.cs (Namespace): Splitted this class into a
15123         per-assembly `Namespace' and a per-file `NamespaceEntry'.
15124
15125         * typemanager.cs (TypeManager.IsNamespace): Removed.
15126         (TypeManager.ComputeNamespaces): Only compute namespaces from
15127         loaded assemblies here, not the namespaces from the assembly we're
15128         currently compiling.
15129
15130 2003-07-08  Martin Baulig  <martin@ximian.com>
15131
15132         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
15133
15134 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
15135
15136         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
15137         already fixed it.  
15138
15139         I thought about the memory savings here, but LookupTypeReflection
15140         is used under already very constrained scenarios.  Compiling
15141         corlib or mcs only exposes one hit, so it would not really reduce
15142         any memory consumption.
15143
15144 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15145
15146         * typemanager.cs: fixes bug #45889 by only adding public types from
15147         other assemblies to the list of known types.
15148
15149 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
15150
15151         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
15152         on the type we resolved.
15153
15154 2003-07-05  Martin Baulig  <martin@ximian.com>
15155
15156         * pending.cs (PendingImplementation.ParentImplements): Don't
15157         create the proxy if the parent is abstract.
15158
15159         * class.cs (TypeContainer.DefineIndexers): Process explicit
15160         interface implementations first.  Fixes #37714.
15161
15162 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
15163
15164         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
15165         defined recursively;  but since we modify the input parameters
15166         (left is set to `this' temporarily), we reset this value if the
15167         left_is_explicit is false, which gives the original semantics to
15168         the code.  
15169
15170         * literal.cs (NullPointer): new class used to represent a null
15171         literal in a pointer context.
15172
15173         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
15174         type is a pointer, use a NullPointer object instead of a
15175         NullLiteral.   Closes 43687
15176
15177         (ExplicitConversion): Convert pointer values using
15178         the conv opcode to the proper type.
15179
15180         * ecore.cs (New): change ValueTypeVariable property into a method,
15181         that returns whether the valuetype is suitable for being used.
15182
15183         * expression.cs (Binary.DoNumericPromotions): Only return if we
15184         the int constant was a valid uint, and we can return both left and
15185         right as uints.  If not, we continue processing, to trigger the
15186         type conversion.  This fixes 39018.
15187
15188         * statement.cs (Block.EmitMeta): During constant resolution, set
15189         the CurrentBlock property on the emitcontext, so that we resolve
15190         constants propertly.
15191
15192 2003-07-02  Martin Baulig  <martin@ximian.com>
15193
15194         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
15195         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
15196
15197         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
15198         than emitting it here.
15199
15200         * statement.cs: Fixed some more flow analysis bugs.
15201
15202 2003-07-02  Martin Baulig  <martin@ximian.com>
15203
15204         * class.cs (MethodData.Define): When implementing interface
15205         methods, set Final unless we're Virtual.
15206
15207         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
15208         check work for interface methods.
15209
15210 2003-07-01  Martin Baulig  <martin@ximian.com>
15211
15212         * ecore.cs (EmitContext.This): Replaced this property with a
15213         GetThis() method which takes a Location argument.  This ensures
15214         that we get the correct error location for a CS0188.
15215
15216 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
15217
15218         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
15219         ImplicitStandardConversion.
15220
15221         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
15222
15223 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
15224
15225         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
15226         optimization.
15227
15228 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
15229
15230         * class.cs (Constructor.Define): Turn off initlocals for unsafe
15231         constructors.
15232
15233         (MethodData.Define): Turn off initlocals for unsafe methods.
15234
15235 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
15236
15237         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
15238         complete;  Fixes #37521.
15239
15240         * delegate.cs: Use Modifiers.TypeAttr to compute the
15241         TypeAttributes, instead of rolling our own.  This makes the flags
15242         correct for the delegates.
15243
15244 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
15245
15246         * class.cs (Constructor.Define): Set the private flag for static
15247         constructors as well.
15248
15249         * cs-parser.jay (statement_expression): Set the return value to
15250         null, to avoid a crash when we catch an error.
15251
15252 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
15253
15254         * cs-parser.jay: Applied patch from Jackson that adds support for
15255         extern and unsafe modifiers to destructor declarations.
15256
15257         * expression.cs: Report error 21 if the user is trying to index a
15258         System.Array.
15259
15260         * driver.cs: Add an error message, suggested by the bug report.
15261
15262         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
15263         if we do not have a ": this ()" constructor initializer.  Fixes 45149
15264
15265 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
15266
15267         * namespace.cs: Add some information to reduce FAQs.
15268
15269 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
15270
15271         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
15272         underlying enumeration types.  Fixes #43915.
15273
15274         * expression.cs: Treat ushort/short as legal values to be used in
15275         bitwise operations.
15276
15277 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
15278
15279         * delegate.cs: transfer custom attributes for paramenters from
15280         the delegate declaration to Invoke and BeginInvoke.
15281
15282 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
15283
15284         * attribute.cs: handle custom marshalers and emit marshal info
15285         for fields, too.
15286
15287 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
15288
15289         * makefile.gnu: Added anonymous.cs to the compiler sources.
15290
15291 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
15292
15293         * iterators.cs: Change the name of the proxy class to include two
15294         underscores.
15295
15296         * cs-parser.jay: Update grammar to include anonymous methods.
15297
15298         * anonymous.cs: new file.
15299
15300 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
15301
15302         * class.cs (Field.Define): Add missing test for pointers and
15303         safety. 
15304
15305 2003-05-27  Ravi Pratap  <ravi@ximian.com>
15306
15307         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
15308         we use the stobj opcode.
15309
15310         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
15311         since it wasn't the correct fix. 
15312
15313         It still is puzzling that we are required to use stobj for IntPtr
15314         which seems to be a ValueType.
15315
15316 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
15317
15318         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
15319         during regular simple name resolution.   Now, the trick is that
15320         instead of returning for processing the simplename, we do a
15321         TypeManager.LookupType (ie, a rooted lookup as opposed to a
15322         contextual lookup type).   If a match is found, return that, if
15323         not, return for further composition.
15324
15325         This fixes long-standing 30485.
15326
15327         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15328         using the address to initialize an object, do an Stobj instead of
15329         using the regular Stelem.
15330
15331         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
15332         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
15333         Because if we are a BaseIndexerAccess that value will be true.
15334         Fixes 43643.
15335
15336         * statement.cs (GotoCase.Resolve): Return after reporting an
15337         error, do not attempt to continue. 
15338
15339         * expression.cs (PointerArithmetic.Emit): If our operand is a
15340         long, convert our constants to match the operand before
15341         multiplying.  Convert to I type before adding.   Fixes 43670.
15342
15343 2003-05-14  Ravi Pratap  <ravi@ximian.com>
15344
15345         * enum.cs (ImplicitConversionExists) : Rename to
15346         ImplicitEnumConversionExists to remove ambiguity. 
15347
15348         * ecore.cs (NullCast): New type of cast expression class which
15349         basically is very similar to EmptyCast with the difference being
15350         it still is a constant since it is used only to cast a null to
15351         something else
15352         (eg. (string) null)
15353
15354         * convert.cs (ImplicitReferenceConversion): When casting a null
15355         literal, we return a NullCast.
15356
15357         * literal.cs (NullLiteralTyped): Remove - I don't see why this
15358         should be around anymore.
15359
15360         The renaming (reported was slightly wrong). Corrections:
15361
15362         ConvertImplicitStandard -> ImplicitConversionStandard
15363         ConvertExplicitStandard -> ExplicitConversionStandard
15364
15365         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
15366         before passing them in !
15367
15368         * convert.cs (ImplicitConversionStandard): When comparing for
15369         equal expr and target types, ensure that expr is not a
15370         NullLiteral.
15371
15372         In general, we must not be checking (expr_type ==
15373         target_type) in the top level conversion methods
15374         (ImplicitConversion, ExplicitConversion etc). This checking is
15375         done in the methods that they delegate to.
15376
15377 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
15378
15379         * convert.cs: Move Error_CannotConvertType,
15380         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
15381         ImplicitNumericConversion, ImplicitConversionExists,
15382         ImplicitUserConversionExists, StandardConversionExists,
15383         FindMostEncompassedType, FindMostSpecificSource,
15384         FindMostSpecificTarget, ImplicitUserConversion,
15385         ExplicitUserConversion, GetConversionOperators,
15386         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
15387         TryImplicitIntConversion, Error_CannotConvertImplicit,
15388         ConvertImplicitRequired, ConvertNumericExplicit,
15389         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
15390         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
15391         its own file.
15392
15393         Perform the following renames:
15394
15395         StandardConversionExists -> ImplicitStandardConversionExists
15396         ConvertImplicit -> ImplicitConversion
15397         ConvertImplicitStandard -> ImplicitStandardConversion
15398         TryImplicitIntConversion -> ImplicitIntConversion
15399         ConvertImplicitRequired -> ImplicitConversionRequired
15400         ConvertNumericExplicit -> ExplicitNumericConversion
15401         ConvertReferenceExplicit -> ExplicitReferenceConversion
15402         ConvertExplicit -> ExplicitConversion
15403         ConvertExplicitStandard -> ExplicitStandardConversion
15404
15405 2003-05-19  Martin Baulig  <martin@ximian.com>
15406
15407         * statement.cs (TypeInfo.StructInfo): Made this type protected.
15408         (TypeInfo): Added support for structs having structs as fields.
15409
15410         * ecore.cs (FieldExpr): Implement IVariable.
15411         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
15412         VariableInfo for the field.
15413
15414 2003-05-18  Martin Baulig  <martin@ximian.com>
15415
15416         * expression.cs (This.DoResolve): Report a CS0027 if we're
15417         emitting a field initializer.
15418
15419 2003-05-18  Martin Baulig  <martin@ximian.com>
15420
15421         * expression.cs (This.ResolveBase): New public function.
15422         (This.DoResolve): Check for CS0188.
15423
15424         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
15425         This.Resolve().
15426
15427         * ecore.cs (MethodGroupExpr.DoResolve): Set the
15428         `instance_expression' to null if we don't have any non-static
15429         methods.
15430
15431 2003-05-18  Martin Baulig  <martin@ximian.com>
15432
15433         Reworked the way how local variables and parameters are handled by
15434         the flow analysis code.
15435
15436         * statement.cs (TypeInfo, VariableMap): New public classes.
15437         (VariableInfo): New public class.  This is now responsible for
15438         checking whether a variable has been assigned.  It is used for
15439         parameters and local variables.
15440         (Block.EmitMeta): Take the InternalParameters as argument; compute
15441         the layout of the flow vectors here.
15442         (Block.LocalMap, Block.ParameterMap): New public properties.
15443         (FlowBranching): The .ctor doesn't get the InternalParameters
15444         anymore since Block.EmitMeta() now computes the layout of the flow
15445         vector.
15446         (MyStructInfo): This class is now known as `StructInfo' and nested
15447         in `TypeInfo'; we don't access this directly anymore.
15448
15449         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
15450         property and removed IsAssigned(), IsFieldAssigned(),
15451         SetAssigned() and SetFieldAssigned(); we now call them on the
15452         VariableInfo so we don't need to duplicate this code everywhere.
15453
15454         * expression.cs (ParameterReference): Added `Block block' argument
15455         to the .ctor.
15456         (LocalVariableReference, ParameterReference, This): The new
15457         VariableInfo class is now responsible for all the definite
15458         assignment stuff.
15459
15460         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
15461         IsParameterAssigned, SetParameterAssigned): Removed.
15462
15463 2003-05-18  Martin Baulig  <martin@ximian.com>
15464
15465         * typemanager.cs (InitCoreTypes): Try calling
15466         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
15467         the 3-args-version.  Corlib now also needs our `void_type'.
15468         (GetMethod): Added overloaded version which takes an optional
15469         `bool report_errors' to allow lookups of optional methods.
15470
15471 2003-05-12  Martin Baulig  <martin@ximian.com>
15472
15473         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
15474         only used for locals and not for parameters.
15475
15476 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
15477
15478         * support.cs (InternalParameters.ParameterType): Return the
15479         ExternalType of the parameter.
15480
15481         * parameter.cs (Parameter.ExternalType): drop the two arguments,
15482         they were unused.
15483
15484 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
15485
15486         * class.cs (MethodData.Define): Do not set the `newslot' on
15487         interface members, if they are also flagged as "override".
15488
15489         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
15490         better code for ++i and i++.  This only works for static fields
15491         and local variables.
15492
15493         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
15494         want to pull the DeclSpace out of the builder_to_declspace instead
15495         of the TypeBuilder (like in TypeContainer.FindMembers).
15496
15497         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
15498         instead of LookupTypeContainer.  Fixes the crash on .NET for
15499         looking up interface members.
15500
15501         * const.cs: Create our own emit context during the Definition
15502         stage, so that constants are evaluated in the proper context, when
15503         a recursive definition happens.
15504
15505 2003-05-11  Martin Baulig  <martin@ximian.com>
15506
15507         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
15508         new block for a switch section.
15509         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
15510         the adding/lookup in the switch block.  Fixes #39828.
15511
15512 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
15513
15514         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
15515         functionality: I needed to convert the data after I had performed
15516         the add/sub operation into the operands type size.
15517
15518         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
15519         pass the type for the box operation, otherwise the resulting
15520         object would have been of type object.
15521
15522         (BoxedCast): Add constructor to specify the type to box as.
15523
15524 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
15525
15526         * iterators.cs: I was reusing the `count' variable inadvertently,
15527         take steps to not allow this to happen.
15528
15529 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
15530
15531         * attribute.cs (Attribute.Resolve): Params attributes are encoded
15532         by creating an array at the point where the params starts and
15533         putting all those arguments there, then adjusting the size of the
15534         array.
15535
15536 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
15537
15538         * expression.cs (New.AddressOf): Implement interface
15539         IMemoryLocation.  This is used when the `new' operator is used in
15540         the context of an invocation to a method on a value type.
15541
15542         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
15543         example. 
15544
15545         * namespace.cs: Also check the using aliases here.
15546
15547         * driver.cs: Move the test for using validity after the types have
15548         been entered, so we do a single pass that also includes the using
15549         aliases. 
15550
15551         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
15552         in the regular case.   CreateSiblingForFinally is doing extra
15553         error checking.
15554
15555         * attribute.cs (GetAttributeArgumentExpression): Store the result
15556         on an out value, and use the return value to indicate failure
15557         instead of using null (which is a valid return for Constant.GetValue).
15558
15559         * statement.cs: Perform the analysis flow for the increment
15560         portion after the statement, because this will be the real flow of
15561         execution.  Fixes #42385
15562
15563         * codegen.cs (EmitContext.EmitArgument,
15564         EmitContext.EmitStoreArgument): New helper functions when the
15565         RemapToProxy flag is set.
15566
15567         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
15568         function.
15569
15570         Add support for remapping parameters. 
15571
15572         * iterators.cs: Propagate parameter values;  Store parameter
15573         values in the proxy classes.
15574
15575 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
15576
15577         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
15578         need a proxy reference;  I do not know what I was thinking
15579
15580         * cs-parser.jay (constructor_initializer): catch another error,
15581         and display nice message.
15582
15583         (field_declaration): catch void field declaration
15584         to flag a better error. 
15585
15586         * class.cs (MemberBase.CheckBase): Report an error instead of a
15587         warning if a new protected member is declared in a struct. 
15588         (Field.Define): catch the error of readonly/volatile.
15589
15590         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
15591
15592         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
15593         volatile variable is taken
15594
15595 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
15596
15597         * statement.cs (Fixed.Resolve): Report an error if we are not in
15598         an unsafe context.
15599
15600 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
15601
15602         * typemanager.cs: reuse the code that handles type clashes for
15603         delegates and enumerations.
15604
15605         * class.cs (Report28): Always report.
15606
15607         * expression.cs (EncodeAsAttribute): Allow nulls here.
15608
15609 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
15610
15611         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
15612         the functionality for testing whether an expression is valid for
15613         an attribute here.  Also handle the case of arrays of elements
15614         being stored. 
15615
15616         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
15617         encoding a linear array into an array of objects that are suitable
15618         to be passed to an CustomAttributeBuilder.
15619
15620         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15621
15622         * ecore.cs: (FieldExpr): Handle field remapping here.
15623
15624         * iteratators.cs: Pass the instance variable (if the method is an
15625         instance method) to the constructors, so we can access the field
15626         variables on the class.
15627
15628         TODO: Test this with structs.  I think the THIS variable on
15629         structs might have to be a pointer, and not a refenrece
15630
15631 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
15632
15633         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15634         local variables to fields in a proxy class.
15635
15636         * iterators.cs (PopulateProxy): Rename our internal fields to
15637         <XXX>.  
15638         Create a <THIS> field if we are an instance method, so we can
15639         reference our parent container variables.
15640         (MapVariable): Called back from the EmitContext code to enter a
15641         new variable to field mapping into the proxy class (we just create
15642         a FieldBuilder).
15643
15644         * expression.cs
15645         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15646         for using the remapped locals to fields.
15647
15648         I placed the code here, because that gives the same semantics to
15649         local variables, and only changes the Emit code.
15650
15651         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15652         statements inside iterators.
15653         (VariableInfo): Add a FieldBuilder for the cases when we are
15654         remapping local variables to fields in a proxy class
15655
15656         * ecore.cs (SimpleNameResolve): Avoid testing two times for
15657         current_block != null.
15658
15659         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15660         not cope with strings, as it has been moved to the
15661         TableSwitchEmit.  Fixed bug in switch generation.
15662
15663         * expression.cs (New.DoResolve): Provide more context for the user
15664         when reporting an error.
15665
15666         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15667         pointers. 
15668
15669         * expression.cs (MemberAccess.DoResolve): When we get a type back,
15670         check the permissions for it.  Note than in a type-resolution
15671         context the check was already present in DeclSpace.ResolveType,
15672         but was missing from the MemberAccess.
15673
15674         (ArrayCreation.CheckIndices): warn if the user has
15675         more nested levels of expressions, but there are no more
15676         dimensions specified.  Avoids crash on bug 41906.
15677
15678 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
15679
15680         * statement.cs (Block): replace Implicit bool, for a generic
15681         flags.   
15682         New flag: `Unchecked'.  This is used during the EmitMeta phase
15683         (which is out-of-line with the regular Resolve/Emit process for a
15684         statement, as this is done ahead of time, but still gets a chance
15685         to call constant resolve).
15686
15687         (Block.Flags): new enum for adding a new flag.
15688
15689         (Block.EmitMeta): track the state of unchecked.
15690
15691         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15692         to enable constant resolution to work there as well.
15693
15694 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
15695
15696         * typemanager.cs (ienumerable_type): Also look up
15697         System.Collections.IEnumerable. 
15698
15699 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
15700
15701         TODO: Test more than one conditional per method.
15702
15703         * class.cs (Indexer.Define): Report the location where the user is
15704         referencing the unsupported feature.
15705
15706         (MethodData): Overload the use of `conditionals' to
15707         minimize the creation of needless ArrayLists.   This saves roughly
15708         212kb on my machine.
15709
15710         (Method): Implement the new IIteratorContainer interface.
15711         (Method.SetYields): Implement the method by setting the ModFlags
15712         to contain METHOD_YIELDS.
15713
15714         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15715         which just got set to null.
15716
15717         * iterators.cs: New file.
15718
15719         (Yield, YieldBreak): New statements.
15720
15721         * statement.cs (Return.Resolve): Flag an error if we are used in
15722         an iterator method.
15723
15724         * codegen.cs (InIterator): New flag set if the code is being
15725         compiled in an iterator method.
15726
15727         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
15728         internal modifier, and we just use it to avoid adding extra
15729         fields, as this is seldom used.  
15730
15731         * cs-parser.jay: Add yield_statement (yield and yield break).
15732
15733         * driver.cs: New flag -v2 to turn on version 2 features. 
15734
15735         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15736         hashtable when v2 is enabled.
15737
15738 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
15739
15740         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15741         there is already a namespace defined with this name.
15742
15743         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15744         people upgraded their corlibs.
15745
15746         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15747         always use fully qualified types, no need to use the compiler
15748         front end.
15749
15750         (TypeManager.IsNamespace): Use binarysearch.
15751
15752         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15753         AddDelegate): I did not quite use the new IsValid API properly: I
15754         have to pass the short-name and the fullname.  I was passing only
15755         the basename instead of the fullname sometimes. 
15756
15757         (TypeContainer.DefineType): call NamespaceClash.
15758
15759         * interface.cs (Interface.DefineType): use NamespaceClash before
15760         defining the type.
15761
15762         * delegate.cs (Delegate.DefineType): use NamespaceClash before
15763         defining the type.
15764
15765         * enum.cs: (Enum.DefineType): use NamespaceClash before
15766         defining the type.
15767
15768         * typemanager.cs (: 3-line patch that gives us some tasty 11%
15769         speed increase.  First, use the negative_hits cache when we get a
15770         negative.  Second, add the type with its full original name
15771         instead of the new . and + encoded name (reflection uses + to
15772         separate type from a nested type).  Use LookupTypeReflection
15773         directly which bypasses the type->name hashtable (that we already
15774         know does not contain the type.
15775
15776         * decl.cs (DeclSpace.ResolveTypeExpr): track the
15777         location/container type. 
15778
15779         * driver.cs: When passing utf8, use directly the UTF8Encoding.
15780
15781 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
15782
15783         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15784
15785         * delegate.cs (NewDelegate.Resolve): Test whether an instance
15786         method is being referenced in the method group from a static
15787         context, and report error 120 if so.
15788
15789         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15790         Error118. 
15791
15792         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15793         is created, we create the A namespace).
15794
15795         * cs-parser.jay: A namespace also introduces a DeclarationFound.
15796         Fixes #41591
15797
15798 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
15799
15800         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15801         invocation to ModuleBuilder.GetType with the same values will
15802         return a new type instance, so we need to cache its return
15803         values. 
15804
15805         * expression.cs (Binary.ResolveOperator): Only allow the compare
15806         operators on enums if they are of the same type.
15807
15808         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15809         types of ValueType on their own case.  Before we were giving them
15810         the same treatment as objects.
15811
15812         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15813         fullname.  Short name is used to compare against container name.
15814         Fullname is used to check against defined namespace names.
15815
15816         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15817         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15818
15819         (Method.CheckBase): Call parent.
15820         (MemberBase.CheckBase): Check for protected members on sealed
15821         classes.
15822         (PropertyBase.CheckBase): Call parent.
15823         (Field.Define): Call parent.
15824
15825         * report.cs: Negative error codes are now mapped to 8000 - code,
15826         so that the display is render more nicely.
15827
15828         * typemanager.cs: Do not use try/catch, instead report a regular
15829         error. 
15830
15831         (GetPointerType, GetReferenceType): These methods provide
15832         mechanisms to obtain the T* and T& from a T.  We had the code
15833         previously scattered around the code base, and it also used
15834         TypeManager.LookupType that would go through plenty of caches.
15835         This one goes directly to the type source.
15836
15837         In some places we did the Type.GetType followed by
15838         ModuleBuilder.GetType, but not in others, so this unifies the
15839         processing as well.
15840
15841         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15842         statements now that we have namespace information.
15843
15844         * typemanager.cs (IsNamespace): New method, returns whether the
15845         string presented is a namespace or not.
15846
15847         (ComputeNamespaces): New public entry point, computes the list of
15848         available namespaces, using the GetNamespaces API call in Mono, or
15849         the slower version in MS.NET.   
15850
15851         Now before we start the semantic analysis phase, we have a
15852         complete list of namespaces including everything that the user has
15853         provided.
15854
15855         Deleted old code to cache namespaces in .nsc files.
15856
15857 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
15858
15859         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15860         class/struct location definition Location for the implicit
15861         constructor location.
15862
15863         (Operator.Define): Use the location of the operator for the
15864         implicit Method definition.
15865
15866         (Constructor.Emit): use the constructor location for the implicit
15867         base initializer constructor.
15868
15869         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
15870         and the Expression class now contains two new methods:
15871
15872         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
15873         isolate type lookup from the rest of the resolution process.
15874
15875         Since we use Expressions to hold type definitions due to the way
15876         we parse the input we have historically overloaded Resolve to
15877         perform the Type lookups if a special flag is passed.  Now this is
15878         eliminated and two methods take their place. 
15879
15880         The differences in the two methods between xStep and xTerminal is
15881         that xStep is involved in our current lookup system that uses
15882         SimpleNames to compose a name, while xTerminal is used just to
15883         catch the case where the simplename lookup failed.
15884
15885 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
15886
15887         * expression.cs (ResolveMemberAccess): Remove redundant code.
15888         TypeExpr expressions are always born fully resolved.
15889
15890         * interface.cs (PopulateMethod): Do not lookup the types twice.
15891         We were doing it once during SemanticAnalysis and once during
15892         PopulateMethod.
15893
15894         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15895         in local variable type definitions, were being returned as a
15896         SimpleName (we decomposed everything into a string), that is
15897         because primary_expression was being used instead of a type in the
15898         grammar (reduce/reduce conflicts).
15899
15900         The part that was wrong is that we converted the expression into a
15901         string (an oversimplification in one hand, compounded with primary
15902         expressions doing string concatenation).
15903
15904         So things like:
15905
15906         A.B.C [] x;
15907
15908         Would return "A.B.C[]" as a SimpleName.  This stopped things like
15909         using clauses from working on this particular context.  And a type
15910         was being matched directly against "A.B.C[]".
15911
15912         We now use the correct approach, and allow for ComposedCast to be
15913         part of the unary expression.  So the "A.B.C []" become a composed
15914         cast of "A.B.C" (as a nested group of MemberAccess with a
15915         SimpleName at the end) plus the rank composition "[]". 
15916
15917         Also fixes 35567
15918
15919 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
15920
15921         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15922         for the access level checking.
15923
15924         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
15925         `TypeContainer container', because I kept getting confused when I
15926         was debugging this code.
15927
15928         * expression.cs (Indexers): Instead of tracking getters/setters,
15929         we now track them in parallel.  We create one arraylist less, but
15930         most importantly it is possible now for the LValue code to find a
15931         matching get for a set.
15932
15933         (IndexerAccess.DoResolveLValue): Update the code.
15934         GetIndexersForType has been modified already to extract all the
15935         indexers from a type.  The code assumed it did not.
15936
15937         Also make the code set the correct return type for the indexer.
15938         This was fixed a long time ago for properties, but was missing for
15939         indexers.  It used to be void_type.
15940
15941         (Binary.Emit): Test first for doubles instead of
15942         floats, as they are more common.
15943
15944         (Binary.EmitBranchable): Use the .un version of the branch opcodes
15945         when dealing with floats and the <=, >= operators.  This fixes bug
15946         #39314 
15947
15948         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15949         to load the array value by emitting a load on the foreach variable
15950         type.  This was incorrect.  
15951
15952         We now emit the code to load an element using the the array
15953         variable type, and then we emit the conversion operator.
15954
15955         Fixed #40176
15956
15957 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
15958
15959         * attribute.cs: Avoid allocation of ArrayLists in the common case.
15960
15961 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
15962
15963         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15964         test for protection before we test for signatures. 
15965
15966         (MethodSignature.ToString): implement.
15967
15968         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15969         to the case where we reduced into a LongConstant.
15970
15971         * decl.cs (CheckAccessLevel): If the type is an array, we can not
15972         depend on whether the information is acurrate, because the
15973         Microsoft runtime will always claim that the array type is public,
15974         regardless of the real state.
15975
15976         If the type is a pointer, another problem happens: the type is
15977         reported as non-public in Microsoft.  
15978
15979         In both cases we have to call CheckAccessLevel recursively with
15980         the underlying type as the argument to be tested.
15981
15982 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
15983
15984         * assign.cs (Assign.Emit): If we are dealing with a compound
15985         assignment expression, we should use the code path that stores the
15986         intermediate result in a temporary value.  This fixes #40903.
15987
15988         *expression.cs (Indirection.ToString): Provide ToString method for
15989         debugging. 
15990
15991 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
15992
15993         * class.cs: Null out fields holding references to Block objects so
15994         they can be garbage collected.
15995
15996         * expression.cs (OverloadResolve): Remove unused local.
15997
15998 2003-04-07  Martin Baulig  <martin@ximian.com>
15999
16000         * codegen.cs (EmitContext.CurrentFile): New public field.
16001         (EmitContext.Mark): Use the CurrentFile to check whether the
16002         location is in the correct file.
16003         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
16004
16005 2003-04-07  Martin Baulig  <martin@ximian.com>
16006
16007         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
16008
16009         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
16010         location.  [FIXME: The location argument which gets passed to this
16011         method is sometimes wrong!]
16012
16013 2003-04-07  Nick Drochak <ndrochak@gol.com>
16014
16015         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
16016
16017 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
16018
16019         * expression.cs (Indirection.EmitAssign): We were using the
16020         temporary, but returning immediately instead of continuing the
16021         EmitAssing flow.
16022
16023 2003-04-06  Martin Baulig  <martin@ximian.com>
16024
16025         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
16026         if it's a nested child, but also deriving from the outer class.
16027         See test 190.cs.
16028
16029         * typemanager.cs (IsNestedChildOf): Make this work if it's a
16030         nested child, but also deriving from the outer class.  See
16031         test-190.cs.
16032         (FilterWithClosure): We may access private members of the outer
16033         class if we're a nested child and deriving from the outer class.
16034         (RealMemberLookup): Only set `closure_private_ok' if the
16035         `original_bf' contained BindingFlags.NonPublic.
16036
16037 2003-04-05  Martin Baulig  <martin@ximian.com>
16038
16039         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
16040         probe if its a type parameter, and if so, flag an error.
16041
16042         * decl.cs: Move here the SetParameterInfo code from class.cs.
16043         Handle IsGeneric here.
16044
16045         Handle a variety of errors in the parameter info definition.
16046
16047         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
16048         type parameters here.
16049
16050         * cs-parser.jay (class_declaration): report errors for parameters
16051         here as well.
16052
16053 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
16054
16055         * generic.cs: New file, contains support code for generics.
16056
16057         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
16058         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
16059
16060         Update parser for the above removals.
16061
16062         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
16063         now taken care of in the parser.
16064
16065 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
16066
16067         * class.cs (Event.Define): Do not allow abstract events to have
16068         initializers. 
16069
16070 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
16071
16072         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
16073         block in event declarations.
16074
16075         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
16076         value type, get its address.
16077
16078         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
16079         leaving a class on the stack instead of a boolean value (int
16080         0/1).  Change the code so we compare against null, and then the
16081         result against zero.
16082
16083         * class.cs (TypeContainer.GetClassBases): We were checking for the
16084         parent class being sealed too late.
16085
16086         * expression.cs (Binary.Emit): For <= and >= when dealing with
16087         floating point values, use cgt.un and clt.un instead of cgt and
16088         clt alone.
16089
16090 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
16091
16092         * statement.cs: Apply the same optimization as MS: skip the 
16093         GetEnumerator returning an IEnumerator, and use the one returning a 
16094         CharEnumerator instead. This allows us to avoid the try-finally block 
16095         and the boxing.
16096
16097 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
16098
16099         * cs-parser.jay: Attributes cannot be applied to
16100                          namespaces. Fixes #40473
16101
16102 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16103
16104         * class.cs:
16105         (Add*): check if the name is valid using the full name for constants,
16106         fields, properties and events.
16107
16108 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
16109
16110         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
16111         char constants to be part of the enumeration.
16112
16113         * expression.cs (Conditional.DoResolve): Add support for operator
16114         true. Implements the missing functionality from 14.12
16115
16116         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
16117         operator true/false as required by the spec.
16118
16119         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
16120         implicit conversion to boolean.
16121
16122         * statement.cs (Statement.ResolveBoolean): A boolean expression is
16123         also one where the type implements `operator true'. 
16124
16125         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
16126         get an expression that will invoke operator true based on an
16127         expression.  
16128
16129         (GetConversionOperators): Removed the hack that called op_True
16130         here.  
16131
16132         (Expression.ResolveBoolean): Move this from Statement.
16133
16134 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
16135
16136         * ecore.cs (FieldExpr): do not allow initialization of initonly
16137         fields on derived classes
16138
16139 2003-03-13  Martin Baulig  <martin@ximian.com>
16140
16141         * statement.cs (Block.Emit): Call ig.BeginScope() and
16142         ig.EndScope() when compiling with debugging info; call
16143         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
16144
16145 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
16146
16147         * expression.cs (Indexers): Do not construct immediately, allow
16148         for new members to be appended as we go.  Fixes 38143
16149
16150 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16151
16152         * expression.cs: save/restore context when resolving an unchecked
16153         expression.
16154
16155 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
16156
16157         * cfold.cs: Catch division by zero in modulus operator during
16158         constant folding.
16159
16160 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
16161
16162         * interface.cs (Interface.DefineMembers): Avoid defining members
16163         twice. 
16164
16165 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
16166
16167         * driver.cs: handle the +/- options for -noconfig
16168
16169         * statement.cs (Unckeched.Resolve): Also track the state of
16170         unchecked in the Resolve phase.
16171
16172 2003-02-27  Martin Baulig  <martin@ximian.com>
16173
16174         * ecore.cs (Expression.MemberLookup): Don't create a
16175         MethodGroupExpr for something which is not a method.  Fixes #38291.
16176
16177 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
16178
16179         * class.cs (MemberBase.CheckParameters): Also check that the type
16180         is unmanaged if it is a pointer.
16181
16182         * expression.cs (SizeOf.Resolve): Add location information.
16183
16184         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
16185         a managed type is declared.
16186
16187         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
16188         parameter modifiers as well.  Fixes bug 38606
16189
16190         * class.cs: Very sad.  Am backing out the speed up changes
16191         introduced by the ArrayList -> Array in the TypeContainer, as they
16192         were not actually that much faster, and introduced a bug (no error
16193         reports on duplicated methods).
16194
16195         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
16196         source first, this will guarantee that we have a valid expression
16197         before calling in lower levels functions that will require a
16198         resolved object.  Then use this original_source in the
16199         target.ResolveLValue instead of the original source that was
16200         passed to us.
16201
16202         Another change.  Use target.Resolve instead of LValueResolve.
16203         Although we are resolving for LValues, we will let the Assign code
16204         take care of that (it will be called again from Resolve).  This
16205         basically allows code like this:
16206
16207         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
16208         class Y { void A (X x) { x [0] += o; }
16209
16210         The problem was that the indexer was trying to resolve for
16211         set_Item (idx, object o) and never finding one.  The real set_Item
16212         was set_Item (idx, X).  By delaying the process we get the right
16213         semantics. 
16214
16215         Fixes bug 36505
16216
16217 2003-02-23  Martin Baulig  <martin@ximian.com>
16218
16219         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
16220         while calling DoEmit ().
16221
16222         * codegen.cs (EmitContext.Mark): Don't mark locations in other
16223         source files; if you use the #line directive inside a method, the
16224         compiler stops emitting line numbers for the debugger until it
16225         reaches the end of the method or another #line directive which
16226         restores the original file.
16227
16228 2003-02-23  Martin Baulig  <martin@ximian.com>
16229
16230         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
16231
16232 2003-02-23  Martin Baulig  <martin@ximian.com>
16233
16234         * statement.cs (Block.AddChildVariableNames): We need to call this
16235         recursively, not just for our immediate children.
16236
16237 2003-02-23  Martin Baulig  <martin@ximian.com>
16238
16239         * class.cs (Event.Define): Always make the field private, like csc does.
16240
16241         * typemanager.cs (TypeManager.RealMemberLookup): Make events
16242         actually work, fixes bug #37521.
16243
16244 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
16245
16246         * delegate.cs: When creating the various temporary "Parameters"
16247         classes, make sure that we call the ComputeAndDefineParameterTypes
16248         on those new parameters (just like we do with the formal ones), to
16249         allow them to be resolved in the context of the DeclSpace.
16250
16251         This fixes the bug that Dick observed in Bugzilla #38530.
16252
16253 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
16254
16255         * expression.cs (ResolveMemberAccess): When resolving a constant,
16256         do not attempt to pull a constant if the value was not able to
16257         generate a valid constant.
16258
16259         * const.cs (LookupConstantValue): Do not report more errors than required.
16260
16261 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16262
16263         * expression.cs: fixes bug #38328.
16264
16265 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
16266
16267         * class.cs: Changed all the various members that can be part of a
16268         class from being an ArrayList to be an Array of the right type.
16269         During the DefineType type_list, interface_list, delegate_list and
16270         enum_list are turned into types, interfaces, delegates and enums
16271         arrays.  
16272
16273         And during the member population, indexer_list, event_list,
16274         constant_list, field_list, instance_constructor_list, method_list,
16275         operator_list and property_list are turned into their real arrays.
16276
16277         Although we could probably perform this operation earlier, for
16278         good error reporting we need to keep the lists and remove the
16279         lists for longer than required.
16280
16281         This optimization was triggered by Paolo profiling the compiler
16282         speed on the output of `gen-sample-program.pl' perl script. 
16283
16284         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
16285         not crash in methods like MemberLookupFailed that use this field.  
16286
16287         This problem arises when the compiler fails to resolve a type
16288         during interface type definition for example.
16289
16290 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
16291
16292         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
16293         inherit from System.Object, so we have to stop at null, not only
16294         when reaching System.Object.
16295
16296 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
16297
16298         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
16299         DeclaredOnly because the parent indexer might have had a different
16300         name, but did not loop until the top of the hierarchy was reached.
16301
16302         The problem this one fixes is 35492: when a class implemented an
16303         indexer from an interface, we were getting the interface method
16304         (which was abstract) and we were flagging an error (can not invoke
16305         abstract method).
16306
16307         This also keeps bug 33089 functioning, and test-148 functioning.
16308
16309         * typemanager.cs (IsSpecialMethod): The correct way of figuring
16310         out if a method is special is to see if it is declared in a
16311         property or event, or whether it is one of the predefined operator
16312         names.   This should fix correctly #36804.
16313
16314 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
16315
16316         The goal here is to remove the dependency on EmptyCast.Peel ().
16317         Killing it completely.
16318
16319         The problem is that currently in a number of places where
16320         constants are expected, we have to "probe" for an EmptyCast, and
16321         Peel, which is not the correct thing to do, as this will be
16322         repetitive and will likely lead to errors. 
16323
16324         The idea is to remove any EmptyCasts that are used in casts that
16325         can be reduced to constants, so we only have to cope with
16326         constants. 
16327
16328         This bug hunt was triggered by Bug 37363 and the desire to remove
16329         the duplicate pattern where we were "peeling" emptycasts to check
16330         whether they were constants.  Now constants will always be
16331         constants.
16332
16333         * ecore.cs: Use an enumconstant here instead of wrapping with
16334         EmptyCast.  
16335
16336         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
16337         throwing me off.  By handling this we can get rid of a few hacks.
16338
16339         * statement.cs (Switch): Removed Peel() code.
16340
16341 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
16342
16343         * class.cs: Location information for error 508
16344
16345         * expression.cs (New.DoResolve): Add a guard against double
16346         resolution of an expression.  
16347
16348         The New DoResolve might be called twice when initializing field
16349         expressions (see EmitFieldInitializers, the call to
16350         GetInitializerExpression will perform a resolve on the expression,
16351         and later the assign will trigger another resolution
16352
16353         This leads to bugs (#37014)
16354
16355         * delegate.cs: The signature for EndInvoke should contain any ref
16356         or out parameters as well.  We were not doing this in the past. 
16357
16358         * class.cs (Field.Define): Do not overwrite the type definition
16359         inside the `volatile' group.  Turns out that volatile enumerations
16360         were changing the type here to perform a validity test, which
16361         broke conversions. 
16362
16363 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
16364
16365         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
16366         and structs, we do not want to load the instance variable
16367
16368         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
16369         enum_type has to be handled like an object reference (implicit
16370         conversions exists from this to object), but the regular IsClass
16371         and IsValueType tests will never return true for this one.
16372
16373         Also we use TypeManager.IsValueType instead of type.IsValueType,
16374         just for consistency with the rest of the code (this is only
16375         needed if we ever use the construct exposed by test-180.cs inside
16376         corlib, which we dont today).
16377
16378 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
16379
16380         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
16381         just InternalCall.
16382
16383 2003-02-09  Martin Baulig  <martin@ximian.com>
16384
16385         * namespace.cs (Namespace..ctor): Added SourceFile argument.
16386         (Namespace.DefineNamespaces): New static public method; this is
16387         called when we're compiling with debugging to add all namespaces
16388         to the symbol file.
16389
16390         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
16391         pass it to the Namespace's .ctor.
16392
16393         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
16394         and MethodBase arguments; pass the namespace ID to the symwriter;
16395         pass the MethodBase instead of the token to the symwriter.
16396         (SymbolWriter.DefineNamespace): New method to add a namespace to
16397         the symbol file.
16398
16399 2003-02-09  Martin Baulig  <martin@ximian.com>
16400
16401         * symbolwriter.cs: New file.  This is a wrapper around
16402         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
16403         methods here in near future.
16404
16405 2003-02-09  Martin Baulig  <martin@ximian.com>
16406
16407         * codegen.cs (EmitContext.Mark): Just pass the arguments to
16408         ILGenerator.MarkSequencePoint() which are actually used by the
16409         symbol writer.
16410
16411 2003-02-09  Martin Baulig  <martin@ximian.com>
16412
16413         * location.cs (SourceFile): New public sealed class.  This
16414         contains the name and an index which is used in the location's token.
16415         (Location): Reserve an appropriate number of bits in the token for
16416         the source file instead of walking over that list, this gives us a
16417         really huge performance improvement when compiling with debugging.
16418
16419         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
16420         `SourceFile' argument instead of a string.
16421         (Driver.ProcessFile): Add all the files via Location.AddFile(),
16422         but don't parse/tokenize here, we need to generate the list of all
16423         source files before we do that.
16424         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
16425         the files.
16426
16427         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
16428         instead of a string.
16429
16430         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
16431         of a string.
16432
16433 2003-02-09  Martin Baulig  <martin@ximian.com>
16434
16435         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
16436         filename on `#line default'.
16437
16438 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
16439
16440         * statement.cs: don't clear the pinned var when the fixed statement
16441         returns from the method (fixes bug#37752).
16442
16443 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
16444
16445         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
16446         to IsValueType.
16447
16448 2003-02-07  Martin Baulig  <martin@ximian.com>
16449
16450         * driver.cs: Removed the `--debug-args' command line argument.
16451
16452         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
16453         automatically by the AsssemblyBuilder.
16454         (CodeGen.InitializeSymbolWriter): We don't need to call any
16455         initialization function on the symbol writer anymore.  This method
16456         doesn't take any arguments.
16457
16458 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
16459
16460         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
16461         from referenced assemblies as well.
16462
16463 2003-02-02  Martin Baulig  <martin@ximian.com>
16464
16465         * class.cs (MethodData.Emit): Generate debugging info for external methods.
16466
16467 2003-02-02  Martin Baulig  <martin@ximian.com>
16468
16469         * class.cs (Constructor.Emit): Open the symbol writer before
16470         emitting the constructor initializer.
16471         (ConstructorInitializer.Emit): Call ec.Mark() to allow
16472         single-stepping through constructor initializers.
16473
16474 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
16475
16476         * class.cs: Handle error 549: do not allow virtual methods in
16477         sealed classes. 
16478
16479 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
16480
16481         * decl.cs: Check access levels when resolving types
16482
16483 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
16484
16485         * statement.cs: Add parameters and locals set in catch blocks that might 
16486         return to set vector
16487
16488 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
16489
16490         * class.cs (Operator): Set the SpecialName flags for operators.
16491
16492         * expression.cs (Invocation.DoResolve): Only block calls to
16493         accessors and operators on SpecialName methods.
16494
16495         (Cast.TryReduce): Handle conversions from char constants.
16496
16497
16498 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
16499
16500         * statement.cs: small memory and time optimization in FlowBranching.
16501
16502 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
16503
16504         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
16505         problem that the last fix but in the other sid (Set).
16506
16507         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
16508         access when there is no indexer in the hierarchy.
16509
16510 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
16511
16512         * class.cs: Combine some if statements.
16513
16514 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16515
16516         * driver.cs: fixed bug #37187.
16517
16518 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
16519
16520         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
16521         any indexer, it's needed to build a list with all the indexers in the
16522         hierarchy (AllGetters), else we have problems. Fixes #35653.
16523
16524 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
16525
16526         * class.cs (MethodData.Define): It is wrong for an interface
16527         implementation to be static in both cases: explicit and implicit.
16528         We were only handling this in one case.
16529
16530         Improve the if situation there to not have negations.
16531
16532         * class.cs (Field.Define): Turns out that we do not need to check
16533         the unsafe bit on field definition, only on usage.  Remove the test.
16534
16535 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16536
16537         * driver.cs: use assembly.Location instead of Codebase (the latest
16538         patch made mcs fail when using MS assemblies).
16539
16540 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
16541
16542         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
16543         get the path to *corlib.dll.
16544
16545 2003-01-21  Nick Drochak <ndrochak@gol.com>
16546
16547         * cs-tokenizer.cs:
16548         * pending.cs:
16549         * typemanager.cs: Remove compiler warnings
16550
16551 2003-01-20  Duncan Mak  <duncan@ximian.com>
16552
16553         * AssemblyInfo.cs: Bump the version number to 0.19.
16554
16555 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16556
16557         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
16558
16559 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
16560
16561         * class.cs (Constructor::Emit): Emit debugging info for constructors.
16562
16563 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
16564
16565         * cs-parser.jay: Small fix: we were not comparing the constructor
16566         name correctly.   Thanks to Zoltan for the initial pointer.
16567
16568 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
16569
16570         * cs-tokenizer.cs: Set file name when specified with #line
16571
16572 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
16573
16574         * cs-parser.jay: Only perform the constructor checks here if we
16575         are named like the class;  This will help provider a better
16576         error.  The constructor path is taken when a type definition is
16577         not found, but most likely the user forgot to add the type, so
16578         report that rather than the constructor error.
16579
16580 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
16581
16582         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
16583         allocations.
16584
16585 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16586
16587         * cs-parser.jay: Add cleanup call.
16588
16589 2003-01-13  Duncan Mak  <duncan@ximian.com>
16590
16591         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
16592         consistent with other methods.
16593
16594 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16595
16596         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
16597
16598 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
16599
16600         * attribute.cs: only set GuidAttr to true when we have a
16601         GuidAttribute.
16602
16603 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16604
16605         * ecore.cs:
16606         * expression.cs:
16607         * typemanager.cs: fixes to allow mcs compile corlib with the new
16608         Type.IsSubclassOf fix.
16609
16610 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
16611
16612         * expression.cs (LocalVariableReference.DoResolve): Classify a
16613         constant as a value, not as a variable.   Also, set the type for
16614         the variable.
16615
16616         * cs-parser.jay (fixed_statement): take a type instead of a
16617         pointer_type, so we can produce a better error message later.
16618
16619         * statement.cs (Fixed.Resolve): Flag types that are not pointers
16620         as an error.  
16621
16622         (For.DoEmit): Make inifinite loops have a
16623         non-conditional branch back.
16624
16625         (Fixed.DoEmit): First populate the pinned variables, then emit the
16626         statement, then clear the variables.  Before I was emitting the
16627         code once for each fixed piece.
16628
16629
16630 2003-01-08  Martin Baulig  <martin@ximian.com>
16631
16632         * statement.cs (FlowBranching.MergeChild): A break in a
16633         SWITCH_SECTION does not leave a loop.  Fixes #36155.
16634
16635 2003-01-08  Martin Baulig  <martin@ximian.com>
16636
16637         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16638         lives in the same number space than `param_map'.  Fixes #36154.
16639
16640 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
16641
16642         * cs-parser.jay (constructor_declaration): Set the
16643         Constructor.ModFlags before probing for it.  This makes the
16644         compiler report 514, 515 and 132 (the code was there, but got
16645         broken). 
16646
16647         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16648         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16649         (GotoCase.Resolve): Set `Returns' to ALWAYS.
16650
16651 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16652
16653         * enum.cs: create the enum static fields using the enum type.
16654
16655 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16656
16657         * class.cs: don't try to create the ParamBuilder for the return
16658         type if it's not needed (and handle it breaking for the ms runtime
16659         anyway).
16660
16661 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16662
16663         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16664
16665 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
16666
16667         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16668         the command.   This showed up while compiling the JANET source
16669         code, which used \r as its only newline separator.
16670
16671 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
16672
16673         * class.cs (Method.Define): If we are an operator (because it
16674         reuses our code), then set the SpecialName and HideBySig.  #36128
16675
16676 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
16677
16678         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16679         exception, report error 120 `object reference required'.
16680
16681         * driver.cs: Add --pause option, used during to measure the size
16682         of the process as it goes with --timestamp.
16683
16684         * expression.cs (Invocation.DoResolve): Do not allow methods with
16685         SpecialName to be invoked.
16686
16687 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
16688
16689         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16690         number before adding it.
16691
16692 2002-12-21  Ravi Pratap  <ravi@ximian.com>
16693
16694         * ecore.cs (StandardImplicitConversion): When in an unsafe
16695         context, we allow conversion between void * to any other pointer
16696         type. This fixes bug #35973.
16697
16698 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16699
16700         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16701         is not thrown when extensionless outputs are used 
16702
16703 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16704
16705         * rootcontext.cs: fixed compilation of corlib.
16706
16707 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
16708
16709         * attribute.cs (Attributes.Contains): Add new method.
16710
16711         * class.cs (MethodCore.LabelParameters): if the parameter is an
16712         `out' parameter, check that no attribute `[In]' has been passed.
16713
16714         * enum.cs: Handle the `value__' name in an enumeration.
16715
16716 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
16717
16718         * decl.cs: Added special case to allow overrides on "protected
16719         internal" methods
16720
16721 2002-12-18  Ravi Pratap  <ravi@ximian.com>
16722
16723         * attribute.cs (Attributes.AddAttributeSection): Rename to this
16724         since it makes much more sense.
16725
16726         (Attributes.ctor): Don't require a Location parameter.
16727
16728         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16729
16730         * attribute.cs (ApplyAttributes): Remove extra Location parameters
16731         since we already have that information per attribute.
16732
16733         * everywhere : make appropriate changes.
16734
16735         * class.cs (LabelParameters): Write the code which actually
16736         applies attributes to the return type. We can't do this on the MS
16737         .NET runtime so we flag a warning in the case an exception is
16738         thrown.
16739
16740 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
16741
16742         * const.cs: Handle implicit null conversions here too.
16743
16744 2002-12-17  Ravi Pratap  <ravi@ximian.com>
16745
16746         * class.cs (MethodCore.LabelParameters): Remove the extra
16747         Type [] parameter since it is completely unnecessary. Instead
16748         pass in the method's attributes so that we can extract
16749         the "return" attribute.
16750
16751 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
16752
16753         * cs-parser.jay (parse): Use Report.Error to flag errors instead
16754         of ignoring it and letting the compile continue.
16755
16756         * typemanager.cs (ChangeType): use an extra argument to return an
16757         error condition instead of throwing an exception.
16758
16759 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
16760
16761         * expression.cs (Unary.TryReduce): mimic the code for the regular
16762         code path.  Perform an implicit cast in the cases where we can
16763         implicitly convert to one of the integral types, and then reduce
16764         based on that constant.   This fixes bug #35483.
16765
16766 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16767
16768         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16769
16770 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16771
16772         * namespace.cs: fixed bug #35489.
16773
16774 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
16775
16776         * class.cs: Remove some dead code.
16777
16778         * cs-parser.jay: Estimate the number of methods needed
16779         (RootContext.MethodCount);
16780
16781         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16782         numbers instead of StringBuilders.
16783
16784         * support.cs (PtrHashtable): Add constructor with initial size;
16785         We can now reduce reallocations of the method table.
16786
16787 2002-12-10  Ravi Pratap  <ravi@ximian.com>
16788
16789         * attribute.cs (ApplyAttributes): Keep track of the emitted
16790         attributes on a per-target basis. This fixes bug #35413.
16791
16792 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
16793
16794         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16795         default to the Windows 1252 encoding.
16796
16797         (UnixParseOption): Support version, thanks to Alp for the missing
16798         pointer. 
16799
16800         * AssemblyInfo.cs: Add nice assembly information.
16801
16802         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16803         (bug 35169).
16804
16805         * cs-parser.jay: Allow a trailing comma before the close bracked
16806         in the attribute_section production.
16807
16808         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16809         address of the instance was being taken, I will take this out,
16810         because we take the address of the object immediately here.
16811
16812 2002-12-09  Ravi Pratap  <ravi@ximian.com>
16813
16814         * typemanager.cs (AreMultipleAllowed): Take care of the most
16815         obvious case where attribute type is not in the current assembly -
16816         stupid me ;-)
16817
16818 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
16819
16820         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16821         definitions, instead of doing that afterwards.  
16822
16823         Also we use a nice little hack, depending on the constructor, we
16824         know if we are a "composed" name or a simple name.  Hence, we
16825         avoid the IndexOf test, and we avoid 
16826
16827         * codegen.cs: Add code to assist in a bug reporter to track down
16828         the source of a compiler crash. 
16829
16830 2002-12-07  Ravi Pratap  <ravi@ximian.com>
16831
16832         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16833         types have been emitted for a given element and flag an error
16834         if something which does not have AllowMultiple set is used more
16835         than once.
16836
16837         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16838         attribute types and their corresponding AllowMultiple properties
16839
16840         (AreMultipleAllowed): Check the property for a given type.
16841
16842         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16843         property in the case we have a TypeContainer.
16844
16845         (Attributes.AddAttribute): Detect duplicates and just skip on
16846         adding them. This trivial fix catches a pretty gross error in our
16847         attribute emission - global attributes were being emitted twice!
16848
16849         Bugzilla bug #33187 is now fixed.
16850
16851 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
16852
16853         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16854         instead of pp_and).
16855
16856         * expression.cs (Binary.ResolveOperator): I can only use the
16857         Concat (string, string, string) and Concat (string, string,
16858         string, string) if the child is actually a concatenation of
16859         strings. 
16860
16861 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
16862
16863         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16864         context where we need a 2-character lookahead.
16865
16866         * pending.cs (PendingImplementation): Rework so we can keep track
16867         of interface types all the time, and flag those which were
16868         implemented by parents as optional.
16869
16870 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
16871
16872         * expression.cs (Binary.ResolveOperator): Use
16873         String.Concat(string,string,string) or
16874         String.Concat(string,string,string,string) when possible. 
16875
16876         * typemanager: More helper methods.
16877
16878
16879 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16880
16881         * pending.cs: remove the bogus return from GetMissingInterfaces()
16882         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16883
16884 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16885
16886         * namespace.cs: avoid duplicated 'using xxx' being added to
16887         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16888         when we get more than one 'using' statement for the same namespace.
16889         Report a CS0105 warning for it.
16890
16891 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
16892
16893         * cs-tokenizer.cs (consume_identifier): use read directly, instead
16894         of calling getChar/putback, uses internal knowledge of it.    
16895
16896         (xtoken): Reorder tokenizer so most common patterns are checked
16897         first.  This reduces the compilation time in another 5% (from 8.11s
16898         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16899
16900         The parsing time is 22% of the compilation in mcs, and from that
16901         64% is spent on the tokenization process.  
16902
16903         I tried using a binary search for keywords, but this is slower
16904         than the hashtable.  Another option would be to do a couple of
16905         things:
16906
16907                 * Not use a StringBuilder, instead use an array of chars,
16908                   with a set value.  Notice that this way we could catch
16909                   the 645 error without having to do it *afterwards*.
16910
16911                 * We could write a hand-parser to avoid the hashtable
16912                   compares altogether.
16913
16914         The identifier consumption process takes 37% of the tokenization
16915         time.  Another 15% is spent on is_number.  56% of the time spent
16916         on is_number is spent on Int64.Parse:
16917
16918                 * We could probably choose based on the string length to
16919                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
16920                   computations. 
16921
16922         Another 3% is spend on wrapping `xtoken' in the `token' function.
16923
16924         Handle 0xa0 as whitespace (#34752)
16925
16926 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
16927
16928         * typemanager.cs (IsCLRType): New routine to tell whether a type
16929         is one of the builtin types.  
16930
16931         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
16932         typecode in more places instead of doing pointer comparissions.
16933         We could leverage some knowledge about the way the typecodes are
16934         laid out.
16935
16936         New code to cache namespaces in assemblies, it is currently not
16937         invoked, to be used soon.
16938
16939         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16940
16941         * expression.cs (Binary.ResolveOperator): specially handle
16942         strings, and do not perform user-defined operator overloading for
16943         built-in types.
16944
16945 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
16946
16947         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16948         internalcall as it is a pretty simple operation;  Avoid whenever
16949         possible to call Char.IsLetter.
16950
16951         (consume_identifier): Cut by half the number of
16952         hashtable calls by merging the is_keyword and GetKeyword behavior.
16953
16954         Do not short-circuit, because if we do, we
16955         report errors (ie, #if false && true would produce an invalid
16956         directive error);
16957
16958
16959 2002-11-24  Martin Baulig  <martin@ximian.com>
16960
16961         * expression.cs (Cast.TryReduce): If we're in checked syntax,
16962         check constant ranges and report a CS0221.  Fixes #33186.
16963
16964 2002-11-24  Martin Baulig  <martin@ximian.com>
16965
16966         * cs-parser.jay: Make this work for uninitialized variable
16967         declarations in the `for' initializer.  Fixes #32416.
16968
16969 2002-11-24  Martin Baulig  <martin@ximian.com>
16970
16971         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16972         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
16973
16974 2002-11-24  Martin Baulig  <martin@ximian.com>
16975
16976         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16977         argument; if true, we also check for user-defined conversions.
16978         This is only needed if both arguments are of a user-defined type.
16979         Fixes #30443, added test-175.cs.
16980         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16981
16982         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16983
16984 2002-11-24  Martin Baulig  <martin@ximian.com>
16985
16986         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16987         function to get the store opcode.
16988         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16989         only emit the Ldelema if the store opcode is Stobj.  You must run
16990         both test-34 and test-167 to test this.  Fixes #34529.
16991
16992 2002-11-23  Martin Baulig  <martin@ximian.com>
16993
16994         * ecore.cs (Expression.MemberLookup): Added additional
16995         `qualifier_type' argument which is used when we're being called
16996         from MemberAccess.DoResolve() and null if we're called from a
16997         SimpleName lookup.
16998         (Expression.MemberLookupFailed): New method to report errors; this
16999         does the CS1540 check and reports the correct error message.
17000
17001         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
17002         argument for the CS1540 check and redone the way how we're dealing
17003         with private members.  See the comment in the source code for details.
17004         (FilterWithClosure): Reverted this back to revision 1.197; renamed
17005         `closure_start_type' to `closure_qualifier_type' and check whether
17006         it's not null.  It was not this filter being broken, it was just
17007         being called with the wrong arguments.
17008
17009         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
17010         and pass it the correct `qualifier_type'; this also does the error
17011         handling for us.
17012
17013 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
17014
17015         * expression.cs (Invocation.EmitParams): If the we are dealing
17016         with a non-built-in value type, load its address as well.
17017
17018         (ArrayCreation): Use a a pretty constant instead
17019         of the hardcoded value 2.   Use 6 instead of 2 for the number of
17020         static initializers.  
17021
17022         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
17023         because they are not really value types, just glorified integers. 
17024
17025         * driver.cs: Do not append .exe, the CSC compiler does not do it.
17026
17027         * ecore.cs: Remove redundant code for enumerations, make them use
17028         the same code path as everything else, fixes the casting issue
17029         with enumerations in Windows.Forms.
17030
17031         * attribute.cs: Do only cast to string if it is a string, the
17032         validation happens later.
17033
17034         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
17035         people upgrade their corlibs.
17036
17037         * ecore.cs: Oops, enumerations were not following the entire code path
17038
17039 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
17040
17041         * typemanager.cs (FilterWithClosure): Commented out the test for
17042         1540 in typemanager.cs, as it has problems when accessing
17043         protected methods from a parent class (see test-174.cs). 
17044
17045         * attribute.cs (Attribute.ValidateGuid): new method.
17046         (Attribute.Resolve): Use above.
17047
17048 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
17049
17050         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
17051
17052         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
17053         handling for enumerations, as we only needed the TypeContainer
17054         functionality to begin with (this is required for the fix below to
17055         work for enums that reference constants in a container class for
17056         example). 
17057
17058         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
17059
17060         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
17061         a valid TypeBuilder to perform lookups on.o
17062
17063         * class.cs (InheritableMemberSignatureCompare): Use true in the
17064         call to GetGetMethod and GetSetMethod, because we are comparing
17065         the signature, and we need to get the methods *even* if they are
17066         private. 
17067
17068         (PropertyBase.CheckBase): ditto.
17069
17070         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
17071         GotoCase.Resolve): Use Peel on EmpytCasts.
17072
17073         * ecore.cs (EmptyCast): drop child, add Peel method.
17074
17075 2002-11-17  Martin Baulig  <martin@ximian.com>
17076
17077         * ecore.cs (EmptyCast.Child): New public property.
17078
17079         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
17080         label resolved to an EmptyCast.  Fixes #34162.
17081         (GotoCase.Resolve): Likewise.
17082         (Block.EmitMeta): Likewise.
17083
17084 2002-11-17  Martin Baulig  <martin@ximian.com>
17085
17086         * expression.cs (Invocation.BetterConversion): Prefer int over
17087         uint; short over ushort; long over ulong for integer literals.
17088         Use ImplicitConversionExists instead of StandardConversionExists
17089         since we also need to check for user-defined implicit conversions.
17090         Fixes #34165.  Added test-173.cs.
17091
17092 2002-11-16  Martin Baulig  <martin@ximian.com>
17093
17094         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
17095         with the `true' and `false' literals.  Fixes #33151.
17096
17097 2002-11-16  Martin Baulig  <martin@ximian.com>
17098
17099         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
17100         October 22nd; don't do the cs1540 check for static members.
17101
17102         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
17103         now using our own filter here and doing the cs1540 check again.
17104
17105 2002-11-16  Martin Baulig  <martin@ximian.com>
17106
17107         * support.cs (InternalParameters): Don't crash if we don't have
17108         any fixed parameters.  Fixes #33532.
17109
17110 2002-11-16  Martin Baulig  <martin@ximian.com>
17111
17112         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
17113         when looking up static methods to make this work on Windows.
17114         Fixes #33773.
17115
17116 2002-11-16  Martin Baulig  <martin@ximian.com>
17117
17118         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
17119         a setter rather than using PropertyInfo.CanWrite.
17120
17121 2002-11-15  Nick Drochak  <ndrochak@gol.com>
17122
17123         * class.cs: Allow acces to block member by subclasses. Fixes build
17124         breaker.
17125
17126 2002-11-14  Martin Baulig  <martin@ximian.com>
17127
17128         * class.cs (Constructor.Emit): Added the extern/block check.
17129         Fixes bug #33678.
17130
17131 2002-11-14  Martin Baulig  <martin@ximian.com>
17132
17133         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
17134         iteration while looking for indexers, this is needed because the
17135         indexer may have a different name in our base classes.  Fixed the
17136         error reporting (no indexers at all, not get accessor, no
17137         overloaded match).  Fixes bug #33089.
17138         (IndexerAccess.DoResolveLValue): Likewise.
17139
17140 2002-11-14  Martin Baulig  <martin@ximian.com>
17141
17142         * class.cs (PropertyBase.CheckBase): Make this work for multiple
17143         indexers.  Fixes the first part of bug #33089.
17144         (MethodSignature.InheritableMemberSignatureCompare): Added support
17145         for properties.
17146
17147 2002-11-13  Ravi Pratap  <ravi@ximian.com>
17148
17149         * attribute.cs (Attribute.Resolve): Catch the
17150         NullReferenceException and report it since it isn't supposed to
17151         happen. 
17152
17153 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
17154
17155         * expression.cs (Binary.EmitBranchable): Also handle the cases for
17156         LogicalOr and LogicalAnd that can benefit from recursively
17157         handling EmitBranchable.  The code now should be nice for Paolo.
17158
17159 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
17160
17161         * typemanager.cs (LookupType): Added a negative-hit hashtable for
17162         the Type lookups, as we perform quite a number of lookups on
17163         non-Types.  This can be removed once we can deterministically tell
17164         whether we have a type or a namespace in advance.
17165
17166         But this might require special hacks from our corlib.
17167
17168         * TODO: updated.
17169
17170         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
17171         and double which avoids a conversion from an integer to a double.
17172
17173         * expression.cs: tiny optimization, avoid calling IsConstant,
17174         because it effectively performs the lookup twice.
17175
17176 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
17177
17178         But a bogus return here to keep the semantics of the old code
17179         until the Mono runtime is fixed.
17180
17181         * pending.cs (GetMissingInterfaces): New method used to remove all
17182         the interfaces that are already implemented by our parent
17183         classes from the list of pending methods. 
17184
17185         * interface.cs: Add checks for calls after ResolveTypeExpr.
17186
17187 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
17188
17189         * class.cs (Class.Emit): Report warning 67: event not used if the
17190         warning level is beyond 3.
17191
17192         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
17193         being a NullLiteral.
17194
17195         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
17196         specifiers. 
17197
17198         * class.cs (TypeContainer.GetClassBases): Cover a missing code
17199         path that might fail if a type can not be resolved.
17200
17201         * expression.cs (Binary.Emit): Emit unsigned versions of the
17202         operators. 
17203
17204         * driver.cs: use error 5.
17205
17206 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
17207
17208         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
17209
17210 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
17211
17212         * cs-parser.jay (switch_section): A beautiful patch from Martin
17213         Baulig that fixed 33094.
17214
17215 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
17216
17217         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
17218         Check whether the base is abstract and report an error if so.
17219
17220         * expression.cs (IndexerAccess.DoResolveLValue,
17221         IndexerAccess.DoResolve): ditto. 
17222
17223         (Invocation.DoResolve): ditto.
17224
17225         (Invocation.FullMethodDesc): Improve the report string.
17226
17227         * statement.cs (Block): Eliminate IsVariableDefined as it is
17228         basically just a wrapper for GetVariableInfo.
17229
17230         * ecore.cs (SimpleName): Use new 
17231
17232         * support.cs (ReflectionParamter.ParameterType): We unwrap the
17233         type, as we return the actual parameter ref/unref state on a
17234         different call.
17235
17236 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
17237
17238         * support.cs: Return proper flags REF/OUT fixing the previous
17239         commit.  
17240
17241         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
17242         not used to mean `ref' but `ref or out' in ParameterReference
17243
17244         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
17245         full type signature instead of calling TypeManger.CSharpName
17246         ourselves. 
17247
17248         * support.cs (InternalParameters.ParameterDesc): Do not compare
17249         directly to the modflags, because REF/OUT will actually be bitsets
17250         if set. 
17251
17252         * delegate.cs (VerifyMethod): Check also the modifiers.
17253
17254         * cs-tokenizer.cs: Fix bug where floating point values with an
17255         exponent where a sign was missing was ignored.
17256
17257         * driver.cs: Allow multiple assemblies to be specified in a single
17258         /r: argument
17259
17260 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
17261
17262         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
17263         because identifiers after a parenthesis would end up in this kind
17264         of production, and we needed to desamiguate it for having casts
17265         like:
17266
17267                 (UserDefinedType *) xxx
17268
17269 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
17270
17271         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
17272         we should set on the Bindingflags.NonPublic, but not turn on
17273         private_ok.  private_ok controls whether a Private member is
17274         returned (this is chekced on the filter routine), while the
17275         BindingFlags.NonPublic just controls whether private/protected
17276         will be allowed.   This fixes the problem part of the problem of
17277         private properties being allowed to be used in derived classes.
17278
17279         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
17280         so we can call the children DoResolveLValue method (this will
17281         properly signal errors on lvalue assignments to base properties)
17282
17283         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
17284         getter are null, and we have a property info, we know that this
17285         happened because the lookup failed, so we report an error 122 for
17286         protection level violation.
17287
17288         We also silently return if setter and getter are null in the
17289         resolve functions, this condition only happens if we have flagged
17290         the error before.  This is the other half of the problem. 
17291
17292         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
17293         not have accessibility information, that is why we were returning
17294         true in the filter function in typemanager.cs.
17295
17296         To properly report 122 (property is inaccessible because of its
17297         protection level) correctly, we report this error in ResolveAccess
17298         by failing if both the setter and the getter are lacking (ie, the
17299         lookup failed). 
17300
17301         DoResolve and DoLResolve have been modified to check for both
17302         setter/getter being null and returning silently, the reason being
17303         that I did not want to put the knowledge about this error in upper
17304         layers, like:
17305
17306         int old = Report.Errors;
17307         x = new PropertyExpr (...);
17308         if (old != Report.Errors)
17309                 return null;
17310         else
17311                 return x;
17312
17313         So the property expr is returned, but it is invalid, so the error
17314         will be flagged during the resolve process. 
17315
17316         * class.cs: Remove InheritablePropertySignatureCompare from the
17317         class, as we no longer depend on the property signature to compute
17318         whether it is possible to implement a method or not.
17319
17320         The reason is that calling PropertyInfo.GetGetMethod will return
17321         null (in .NET, in Mono it works, and we should change this), in
17322         cases where the Get Method does not exist in that particular
17323         class.
17324
17325         So this code:
17326
17327         class X { public virtual int A { get { return 1; } } }
17328         class Y : X { }
17329         class Z : Y { public override int A { get { return 2; } } }
17330
17331         Would fail in Z because the parent (Y) would not have the property
17332         defined.  So we avoid this completely now (because the alternative
17333         fix was ugly and slow), and we now depend exclusively on the
17334         method names.
17335
17336         (PropertyBase.CheckBase): Use a method-base mechanism to find our
17337         reference method, instead of using the property.
17338
17339         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
17340         routines are gone now.
17341
17342         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
17343         names, they were incorrectly named.
17344
17345         * cs-tokenizer.cs: Return are more gentle token on failure. 
17346
17347         * pending.cs (PendingImplementation.InterfaceMethod): This routine
17348         had an out-of-sync index variable, which caused it to remove from
17349         the list of pending methods the wrong method sometimes.
17350
17351 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
17352
17353         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
17354         CanWrite, because those refer to this particular instance of the
17355         property, and do not take into account the fact that we can
17356         override single members of a property.
17357
17358         Constructor requires an EmitContext.  The resolution process does
17359         not happen here, but we need to compute the accessors before,
17360         because the resolution does not always happen for properties.
17361
17362         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
17363         subclass, before we did not update this flag, but we did update
17364         bindingflags. 
17365
17366         (GetAccessors): Drop this routine, as it did not work in the
17367         presence of partially overwritten set/get methods. 
17368
17369         Notice that this broke the cs1540 detection, but that will require
17370         more thinking. 
17371
17372 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17373
17374         * class.cs:
17375         * codegen.cs:
17376         * driver.cs: issue a warning instead of an error if we don't support
17377         debugging for the platform. Also ignore a couple of errors that may
17378         arise when trying to write the symbols. Undo my previous patch.
17379
17380 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17381
17382         * driver.cs: ignore /debug switch except for Unix platforms.
17383
17384 2002-10-23  Nick Drochak  <ndrochak@gol.com>
17385
17386         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
17387
17388 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
17389
17390         * driver.cs: Do not make mcs-debug conditional, so we do not break
17391         builds that use it.
17392
17393         * statement.cs (UsageVector.MergeChildren): I would like Martin to
17394         review this patch.  But basically after all the children variables
17395         have been merged, the value of "Breaks" was not being set to
17396         new_breaks for Switch blocks.  I think that it should be set after
17397         it has executed.  Currently I set this to the value of new_breaks,
17398         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
17399         conservative, but I do not understand this code very well.
17400
17401         I did not break anything in the build, so that is good ;-)
17402
17403         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
17404
17405 2002-10-20  Mark Crichton  <crichton@gimp.org>
17406
17407         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
17408
17409 2002-10-20  Nick Drochak  <ndrochak@gol.com>
17410
17411         * cfold.cs: Fixed compile blocker.
17412
17413 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
17414
17415         * driver.cs: I was chekcing the key, not the file.
17416
17417 2002-10-19  Ravi Pratap  <ravi@ximian.com>
17418
17419         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
17420         message that we were generating - we just need to silently return
17421         a null.
17422
17423 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
17424
17425         * class.cs (Event.Define): Change my previous commit, as this
17426         breaks the debugger.  This is a temporary hack, as it seems like
17427         the compiler is generating events incorrectly to begin with.
17428
17429         * expression.cs (Binary.ResolveOperator): Added support for 
17430         "U operator - (E x, E y)"
17431
17432         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
17433         y)".
17434
17435         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
17436         init-only variables, but this path did not take into account that
17437         there might be also instance readonly variables.  Correct this
17438         problem. 
17439
17440         This fixes bug 32253
17441
17442         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
17443         delegates as well.
17444
17445         * driver.cs: Change the extension for modules to `netmodule'
17446
17447         * cs-parser.jay: Improved slightly the location tracking for
17448         the debugger symbols.
17449
17450         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
17451         modifiers that were specified instead of the hardcoded value
17452         (FamAndAssem).  This was basically ignoring the static modifier,
17453         and others.  Fixes 32429.
17454
17455         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
17456         fixed a bug in the process (32476)
17457
17458         * expression.cs (ArrayAccess.EmitAssign): Patch from
17459         hwang_rob@yahoo.ca that fixes bug 31834.3
17460
17461 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
17462
17463         * driver.cs: Make the module extension .netmodule.
17464
17465 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
17466
17467         * driver.cs: Report an error if the resource file is not found
17468         instead of crashing.
17469
17470         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
17471         false, like Emit does.
17472
17473 2002-10-16  Nick Drochak  <ndrochak@gol.com>
17474
17475         * typemanager.cs: Remove unused private member.  Also reported mcs
17476         bug to report this as a warning like csc.
17477
17478 2002-10-15  Martin Baulig  <martin@gnome.org>
17479
17480         * statement.cs (Statement.Emit): Made this a virtual method; emits
17481         the line number info and calls DoEmit().
17482         (Statement.DoEmit): New protected abstract method, formerly knows
17483         as Statement.Emit().
17484
17485         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
17486
17487 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
17488
17489         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
17490         have fixed a remaining problem: not every AddXXXX was adding a
17491         fully qualified name.  
17492
17493         Now everyone registers a fully qualified name in the DeclSpace as
17494         being defined instead of the partial name.  
17495
17496         Downsides: we are slower than we need to be due to the excess
17497         copies and the names being registered this way.  
17498
17499         The reason for this is that we currently depend (on the corlib
17500         bootstrap for instance) that types are fully qualified, because
17501         we dump all the types in the namespace, and we should really have
17502         types inserted into the proper namespace, so we can only store the
17503         basenames in the defined_names array.
17504
17505 2002-10-10  Martin Baulig  <martin@gnome.org>
17506
17507         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
17508         from bug #31834, see the bug report for a testcase which is
17509         miscompiled.
17510
17511 2002-10-10  Martin Baulig  <martin@gnome.org>
17512
17513         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
17514         flow analysis code for this.
17515
17516         * statement.cs (Do, While, For): Tell the flow analysis code about
17517         infinite loops.
17518         (FlowBranching.UsageVector): Added support for infinite loops.
17519         (Block.Resolve): Moved the dead code elimination here and use flow
17520         analysis to do it.
17521
17522 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
17523
17524         * class.cs (Field.Define): Catch cycles on struct type
17525         definitions. 
17526
17527         * typemanager.cs (IsUnmanagedtype): Do not recursively check
17528         fields if the fields are static.  We only need to check instance
17529         fields. 
17530
17531         * expression.cs (As.DoResolve): Test for reference type.
17532
17533         * statement.cs (Using.ResolveExpression): Use
17534         ConvertImplicitRequired, not ConvertImplicit which reports an
17535         error on failture
17536         (Using.ResolveLocalVariableDecls): ditto.
17537
17538         * expression.cs (Binary.ResolveOperator): Report errors in a few
17539         places where we had to.
17540
17541         * typemanager.cs (IsUnmanagedtype): Finish implementation.
17542
17543 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
17544
17545         * expression.cs: Use StoreFromPtr instead of extracting the type
17546         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
17547
17548         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
17549         an enumeration value to a System.Enum, but System.Enum is not a
17550         value type, but an class type, so we need to box.
17551
17552         (Expression.ConvertExplicit): One codepath could return
17553         errors but not flag them.  Fix this.  Fixes #31853
17554
17555         * parameter.cs (Resolve): Do not allow void as a parameter type.
17556
17557 2002-10-06  Martin Baulig  <martin@gnome.org>
17558
17559         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
17560         if it's a class type and not a struct.  Fixes #31815.
17561
17562 2002-10-06  Martin Baulig  <martin@gnome.org>
17563
17564         * statement.cs: Reworked the flow analysis code a bit to make it
17565         usable for dead code elimination.
17566
17567 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17568
17569         * cs-parser.jay: allow empty source files. Fixes bug #31781.
17570
17571 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17572
17573         * expression.cs (ComposedCast.DoResolveType): A quick workaround
17574         to fix the test 165, will investigate deeper.
17575
17576 2002-10-04  Martin Baulig  <martin@gnome.org>
17577
17578         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
17579         finally blocks actually work.
17580         (Try.Resolve): We don't need to create a sibling for `finally' if
17581         there is no finally block.
17582
17583 2002-10-04  Martin Baulig  <martin@gnome.org>
17584
17585         * class.cs (Constructor.Define): The default accessibility for a
17586         non-default constructor is private, not public.
17587
17588 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17589
17590         * class.cs (Constructor): Make AllowedModifiers public, add
17591         EXTERN.
17592
17593         * cs-parser.jay: Perform the modifiers test here, as the
17594         constructor for the Constructor class usually receives a zero
17595         because of the way we create it (first we create, later we
17596         customize, and we were never checking the modifiers).
17597
17598         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
17599         is a version of LookupTypeReflection that includes the type-name
17600         cache.  This can be used as a fast path for functions that know
17601         the fully qualified name and are only calling into *.GetType() to
17602         obtain a composed type.
17603
17604         This is also used by TypeManager.LookupType during its type
17605         composition.
17606
17607         (LookupType): We now also track the real type name, as sometimes
17608         we can get a quey for the real type name from things like
17609         ComposedCast.  This fixes bug 31422.
17610
17611         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
17612         complete type fullname, it does not have to go through the type
17613         resolution system to obtain the composed version of the type (for
17614         obtaining arrays or pointers).
17615
17616         (Conditional.Emit): Use the EmitBoolExpression to
17617         generate nicer code, as requested by Paolo.
17618
17619         (ArrayCreation.CheckIndices): Use the patch from
17620         hwang_rob@yahoo.ca to validate the array initializers. 
17621
17622 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
17623
17624         * class.cs (ConstructorInitializer.Emit): simplify code by using
17625         Invocation.EmitCall, and at the same time, fix the bugs in calling
17626         parent constructors that took variable arguments. 
17627
17628         * ecore.cs (Expression.ConvertNumericExplicit,
17629         Expression.ImplicitNumericConversion): Remove the code that
17630         manually wrapped decimal (InternalTypeConstructor call is now gone
17631         as well).
17632
17633         * expression.cs (Cast.TryReduce): Also handle decimal types when
17634         trying to perform a constant fold on the type.
17635
17636         * typemanager.cs (IsUnmanagedtype): Partially implemented.
17637
17638         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17639         that only turned off an error report, and did nothing else. 
17640
17641 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
17642
17643         * driver.cs: Handle and ignore /fullpaths
17644
17645 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
17646
17647         * expression.cs (Binary.ResolveOperator): Catch the case where
17648         DoNumericPromotions returns true, 
17649
17650         (Binary.DoNumericPromotions): Simplify the code, and the tests.
17651
17652 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
17653
17654         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17655         report error 70.
17656
17657 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
17658
17659         * ecore.cs (ConvertNumericExplicit): It is not enough that the
17660         conversion exists, but it is also required that the conversion be
17661         performed.  This manifested in "(Type64Enum) 2".  
17662
17663         * class.cs (TypeManager.AddMethod): The fix is not to change
17664         AddEnum, because that one was using a fully qualified name (every
17665         DeclSpace derivative does), but to change the AddMethod routine
17666         that was using an un-namespaced name.  This now correctly reports
17667         the duplicated name.
17668
17669         Revert patch until I can properly fix it.  The issue
17670         is that we have a shared Type space across all namespaces
17671         currently, which is wrong.
17672
17673         Options include making the Namespace a DeclSpace, and merge
17674         current_namespace/current_container in the parser.
17675
17676 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
17677
17678         * cs-parser.jay: Improve error reporting when we get a different
17679         kind of expression in local_variable_type and
17680         local_variable_pointer_type. 
17681
17682         Propagate this to avoid missleading errors being reported.
17683
17684         * ecore.cs (ImplicitReferenceConversion): treat
17685         TypeManager.value_type as a target just like object_type.   As
17686         code like this:
17687
17688         ValueType v = 1;
17689
17690         Is valid, and needs to result in the int 1 being boxed before it
17691         is assigned to the value type v.
17692
17693         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17694         to validate the enumeration name.
17695
17696         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17697         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
17698         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17699
17700         * ecore.cs (TryImplicitIntConversion): When doing an
17701         implicit-enumeration-conversion, check if the type is 64-bits and
17702         perform a conversion before passing to EnumConstant.
17703
17704 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
17705
17706         * decl.cs (Error_AmbiguousTypeReference); New routine used to
17707         report ambiguous type references.  Unlike the MS version, we
17708         report what the ambiguity is.   Innovation at work ;-)
17709
17710         (DeclSpace.FindType): Require a location argument to
17711         display when we display an ambiguous error.
17712
17713         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17714
17715         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17716
17717         * expression.cs (EmitDynamicInitializers): Apply patch from
17718         hwang_rob@yahoo.ca that fixes the order in which we emit our
17719         initializers. 
17720
17721 2002-09-21  Martin Baulig  <martin@gnome.org>
17722
17723         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17724         delegate takes no arguments.
17725
17726 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
17727
17728         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17729         from integers.
17730
17731         * expression.cs: Extract the underlying type.
17732
17733         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17734
17735         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17736
17737 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
17738
17739         * class.cs (TypeContainer.DefineType): We can not use the nice
17740         PackingSize with the size set to 1 DefineType method, because it
17741         will not allow us to define the interfaces that the struct
17742         implements.
17743
17744         This completes the fixing of bug 27287
17745
17746         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17747         means also structs.  This fixes part of the problem. 
17748         (Expresion.ImplicitReferenceConversionExists): ditto.
17749
17750         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17751         error if there were no errors reported during the type lookup
17752         process, to avoid duplicates or redundant errors.  Without this
17753         you would get an ambiguous errors plus a type not found.  We have
17754         beaten the user enough with the first error.  
17755
17756         (DeclSparce.FindType): Emit a warning if we have an ambiguous
17757         reference. 
17758
17759         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17760         during the resolution process, stop the lookup, this avoids
17761         repeated error reports (same error twice).
17762
17763         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17764
17765         * typemanager.cs (LookupType): Redo the type lookup code to match
17766         the needs of System.Reflection.  
17767
17768         The issue is that System.Reflection requires references to nested
17769         types to begin with a "+" sign instead of a dot.  So toplevel
17770         types look like: "NameSpace.TopLevelClass", and nested ones look
17771         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17772         levels. 
17773
17774 2002-09-19  Martin Baulig  <martin@gnome.org>
17775
17776         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17777         says that a method always returns or always throws an exception,
17778         don't report the CS0161.
17779
17780         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17781         set `Returns = new_returns'.
17782
17783 2002-09-19  Martin Baulig  <martin@gnome.org>
17784
17785         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17786         to an enum constant, check for a CS0176.
17787
17788 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
17789
17790         * class.cs (TypeContainer.CheckPairedOperators): Now we check
17791         for operators that must be in pairs and report errors.
17792
17793         * ecore.cs (SimpleName.DoResolveType): During the initial type
17794         resolution process, when we define types recursively, we must
17795         check first for types in our current scope before we perform
17796         lookups in the enclosing scopes.
17797
17798         * expression.cs (MakeByteBlob): Handle Decimal blobs.
17799
17800         (Invocation.VerifyArgumentsCompat): Call
17801         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17802         I thought we were supposed to always call this, but there are a
17803         few places in the code where we dont do it.
17804
17805 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
17806
17807         * driver.cs: Add support in -linkres and -resource to specify the
17808         name of the identifier.
17809
17810 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17811
17812         * ecore.cs (StandardConversionExists): Sync with the conversion
17813         code: allow anything-* to void* conversions.
17814
17815         (FindMostSpecificSource): Use an Expression argument
17816         instead of a Type, because we might be handed over a Literal which
17817         gets a few more implicit conversions that plain types do not.  So
17818         this information was being lost.
17819
17820         Also, we drop the temporary type-holder expression when not
17821         required.
17822
17823 2002-09-17  Martin Baulig  <martin@gnome.org>
17824
17825         * class.cs (PropertyBase.CheckBase): Don't check the base class if
17826         this is an explicit interface implementation.
17827
17828 2002-09-17  Martin Baulig  <martin@gnome.org>
17829
17830         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17831         different `IndexerName' attributes.
17832
17833         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17834         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17835         virtual CommonResolve().
17836
17837 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17838
17839         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17840         and convert that to the UnderlyingType.
17841
17842         * statement.cs (Foreach.Resolve): Indexers are just like variables
17843         or PropertyAccesses.
17844
17845         * cs-tokenizer.cs (consume_string): Track line numbers and columns
17846         inside quoted strings, we were not doing this before.
17847
17848 2002-09-16  Martin Baulig  <martin@gnome.org>
17849
17850         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17851         resolve it.  This is needed for the definite assignment check of the
17852         instance expression, fixes bug #29846.
17853         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17854
17855 2002-09-16  Nick Drochak  <ndrochak@gol.com>
17856
17857         * parameter.cs: Fix compile error.  Cannot reference static member
17858         from an instance object.  Is this an mcs bug?
17859
17860 2002-09-14  Martin Baulig  <martin@gnome.org>
17861
17862         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17863         multiple times.  Fixes bug #30295, added test-166.cs.
17864
17865 2002-09-14  Martin Baulig  <martin@gnome.org>
17866
17867         * statement.cs (Block.Emit): Don't emit unreachable code.
17868         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17869         `break' statements.
17870         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17871
17872 2002-09-14  Martin Baulig  <martin@gnome.org>
17873
17874         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17875         is set.
17876
17877 2002-09-14  Martin Baulig  <martin@gnome.org>
17878
17879         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17880         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17881         be false on the ms runtime.
17882
17883 2002-09-13  Martin Baulig  <martin@gnome.org>
17884
17885         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17886         the CS0038 error message.
17887
17888 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
17889
17890         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17891         constant inside, return it.
17892
17893 2002-09-12  Martin Baulig  <martin@gnome.org>
17894
17895         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17896         implicit conversion can be done between enum types.
17897
17898         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17899         check whether an implicit conversion to the current enum's UnderlyingType
17900         exists and report an error if not.
17901
17902         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17903         without debugging support.
17904
17905         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17906         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
17907
17908 2002-09-12  Martin Baulig  <martin@gnome.org>
17909
17910         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17911
17912         * ecore.cs (IMemberExpr.DeclaringType): New property.
17913         (SimpleName.SimpleNameResolve): Check whether we're accessing a
17914         nonstatic member of an outer type (CS0038).
17915
17916 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
17917
17918         * driver.cs: Activate the using-error detector at warning level
17919         4 (at least for MS-compatible APIs).
17920
17921         * namespace.cs (VerifyUsing): Small buglett fix.
17922
17923         * pending.cs (PendingImplementation): pass the container pointer. 
17924
17925         * interface.cs (GetMethods): Allow for recursive definition.  Long
17926         term, I would like to move every type to support recursive
17927         definitions, not the current ordering mechanism that we have right
17928         now.
17929
17930         The situation is this: Attributes are handled before interfaces,
17931         so we can apply attributes to interfaces.  But some attributes
17932         implement interfaces, we will now handle the simple cases
17933         (recursive definitions will just get an error).  
17934
17935         * parameter.cs: Only invalidate types at the end if we fail to
17936         lookup all types.  
17937
17938 2002-09-09  Martin Baulig  <martin@gnome.org>
17939
17940         * ecore.cs (PropertyExpr.Emit): Also check for
17941         TypeManager.system_int_array_get_length so this'll also work when
17942         compiling corlib.  Fixes #30003.
17943
17944 2002-09-09  Martin Baulig  <martin@gnome.org>
17945
17946         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17947         and throw an exception if we can't get the type's size.  Fixed #30040,
17948         added test-165.cs.
17949
17950 2002-09-09  Martin Baulig  <martin@gnome.org>
17951
17952         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17953
17954         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17955         context.  Fixes bug #30027.
17956
17957         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17958         virtual functions.  Fixes bug #30043, added test-164.cs.
17959
17960 2002-09-08  Ravi Pratap  <ravi@ximian.com>
17961
17962         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17963
17964 2002-09-08  Nick Drochak  <ndrochak@gol.com>
17965
17966         * driver.cs: Use an object to get the windows codepage since it's not a
17967         static property.
17968
17969 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
17970
17971         * statement.cs (For.Emit): for infinite loops (test == null)
17972         return whether there is a break inside, not always "true".
17973
17974         * namespace.cs (UsingEntry): New struct to hold the name of the
17975         using definition, the location where it is defined, and whether it
17976         has been used in a successful type lookup.
17977
17978         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17979         strings.
17980
17981         * decl.cs: ditto.
17982
17983 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17984
17985         * attribute.cs : Fix incorrect code which relied on catching
17986         a NullReferenceException to detect a null being passed in
17987         where an object was expected.
17988
17989 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
17990
17991         * statement.cs (Try): flag the catch variable as assigned
17992
17993         * expression.cs (Cast): Simplified by using ResolveType instead of
17994         manually resolving.
17995
17996         * statement.cs (Catch): Fix bug by using ResolveType.
17997
17998 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17999
18000         * expression.cs (BetterConversion): Special case for when we have
18001         a NullLiteral as the argument and we have to choose between string
18002         and object types - we choose string the way csc does.
18003
18004         * attribute.cs (Attribute.Resolve): Catch the
18005         NullReferenceException and report error #182 since the Mono
18006         runtime no more has the bug and having this exception raised means
18007         we tried to select a constructor which takes an object and is
18008         passed a null.
18009
18010 2002-09-05  Ravi Pratap  <ravi@ximian.com>
18011
18012         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
18013         message (1502, 1503) when we can't locate a method after overload
18014         resolution. This is much more informative and closes the bug
18015         Miguel reported.
18016
18017         * interface.cs (PopulateMethod): Return if there are no argument
18018         types. Fixes a NullReferenceException bug.
18019
18020         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
18021         expressions too. Previously we were checking only in one place for
18022         positional arguments leaving out named arguments.
18023
18024         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
18025         type to the enum type is not allowed. Remove code corresponding to
18026         that.
18027
18028         (ConvertNumericExplicit): Allow explicit conversions from
18029         the underlying type to enum type. This precisely follows the spec
18030         and closes a bug filed by Gonzalo.
18031
18032 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18033
18034         * compiler.csproj:
18035         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
18036
18037 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
18038
18039         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
18040         it was important that we stored the right value after the
18041         reduction in `converted'.
18042
18043 2002-09-04  Martin Baulig  <martin@gnome.org>
18044
18045         * location.cs (Location.SymbolDocument): Use full pathnames for the
18046         source files.
18047
18048 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
18049
18050         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
18051         of the expression resolve mechanism, because that will catch the
18052         SimpleName error failures.
18053
18054         (Conditional): If we can not resolve the
18055         expression, return, do not crash.
18056
18057 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18058
18059         * cs-tokenizer.cs:
18060         (location): display token name instead of its number.
18061
18062 2002-08-28  Martin Baulig  <martin@gnome.org>
18063
18064         * expression.cs (Binary.ResolveOperator): Don't silently return
18065         but return an error if an operator cannot be applied between two
18066         enum types.
18067
18068 2002-08-28  Martin Baulig  <martin@gnome.org>
18069
18070         * class.cs (Constructor.Define): Set the permission attributes
18071         correctly instead of making all constructors public.
18072
18073 2002-08-28  Martin Baulig  <martin@gnome.org>
18074
18075         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
18076         for private members before reporting a CS0103; if we find anything,
18077         it's a CS0122.
18078
18079 2002-08-28  Martin Baulig  <martin@gnome.org>
18080
18081         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
18082         to check whether `closure_start_type == closure_invocation_type',
18083         we also need to check whether `m.DeclaringType == closure_invocation_type'
18084         before bypassing the permission checks.  We might be accessing
18085         protected/private members from the base class.
18086         (TypeManager.RealMemberLookup): Only set private_ok if private
18087         members were requested via BindingFlags.NonPublic.
18088
18089         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
18090
18091         * expression.cs (MemberAccess.ResolveMemberAccess): Set
18092         MethodGroupExpr.IsExplicitImpl if appropriate.
18093         (Invocation.DoResolve): Don't report the CS0120 for explicit
18094         interface implementations.
18095
18096 2002-08-27  Martin Baulig  <martin@gnome.org>
18097
18098         * expression.cs (Invocation.DoResolve): If this is a static
18099         method and we don't have an InstanceExpression, we must report
18100         a CS0120.
18101
18102 2002-08-25  Martin Baulig  <martin@gnome.org>
18103
18104         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
18105         `==' between a valuetype and an object.
18106
18107 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
18108
18109         * ecore.cs (TypeExpr): Provide a ToString method.
18110
18111 2002-08-24  Martin Baulig  <martin@gnome.org>
18112
18113         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
18114         now called proggie.dbg and it's a binary file.
18115
18116 2002-08-23  Martin Baulig  <martin@gnome.org>
18117
18118         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
18119
18120 2002-08-23  Martin Baulig  <martin@gnome.org>
18121
18122         * struct.cs (MyStructInfo.ctor): Make this work with empty
18123         structs; it's not allowed to use foreach() on null.
18124
18125 2002-08-23  Martin Baulig  <martin@gnome.org>
18126
18127         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
18128         writer the full pathname of the generated assembly.
18129
18130 2002-08-23  Martin Baulig  <martin@gnome.org>
18131
18132         * statements.cs (FlowBranching.UsageVector.MergeChildren):
18133         A `finally' block never returns or breaks; improved handling of
18134         unreachable code.
18135
18136 2002-08-23  Martin Baulig  <martin@gnome.org>
18137
18138         * statement.cs (Throw.Resolve): Allow `throw null'.
18139
18140 2002-08-23  Martin Baulig  <martin@gnome.org>
18141
18142         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
18143         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
18144         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
18145         MemberLookup would return a wrong event if this is an explicit
18146         interface implementation and the class has an event with the same
18147         name.
18148
18149 2002-08-23  Martin Baulig  <martin@gnome.org>
18150
18151         * statement.cs (Block.AddChildVariableNames): New public method.
18152         (Block.AddChildVariableName): Likewise.
18153         (Block.IsVariableNameUsedInChildBlock): Likewise.
18154         (Block.AddVariable): Check whether a variable name has already
18155         been used in a child block.
18156
18157         * cs-parser.jay (declare_local_variables): Mark all variable names
18158         from the current block as being used in a child block in the
18159         implicit block.
18160
18161 2002-08-23  Martin Baulig  <martin@gnome.org>
18162
18163         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
18164         find the symbol writer.
18165
18166         * driver.cs: csc also allows the arguments to /define being
18167         separated by commas, not only by semicolons.
18168
18169 2002-08-23  Martin Baulig  <martin@gnome.org>
18170
18171         * interface.cs (Interface.GetMembers): Added static check for events.
18172
18173 2002-08-15  Martin Baulig  <martin@gnome.org>
18174
18175         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
18176         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
18177
18178         * ecore.cs (Expression.MemberLookup): Added documentation and explained
18179         why the MethodData.EmitDestructor() change was necessary.
18180
18181 2002-08-20  Martin Baulig  <martin@gnome.org>
18182
18183         * class.cs (TypeContainer.FindMembers): Added static check for events.
18184
18185         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
18186
18187         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
18188         use Type.GetEvents(), not Type.FindMembers().
18189
18190 2002-08-20  Martin Baulig  <martin@gnome.org>
18191
18192         * decl.cs (MemberCache): Added a special method cache which will
18193         be used for method-only searched.  This ensures that a method
18194         search will return a MethodInfo with the correct ReflectedType for
18195         inherited methods.      
18196
18197 2002-08-20  Martin Baulig  <martin@gnome.org>
18198
18199         * decl.cs (DeclSpace.FindMembers): Made this public.
18200
18201 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18202
18203         * delegate.cs: fixed build on windows.
18204         [FIXME:  Filed as bug #29150: MCS must report these errors.]
18205
18206 2002-08-19  Ravi Pratap  <ravi@ximian.com>
18207
18208         * ecore.cs (StandardConversionExists): Return a false
18209         if we are trying to convert the void type to anything else
18210         since that is not allowed.
18211
18212         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
18213         we flag error 70 in the event an event is trying to be accessed
18214         directly from outside the declaring type.
18215
18216 2002-08-20  Martin Baulig  <martin@gnome.org>
18217
18218         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
18219         MemberCache from typemanager.cs to decl.cs.
18220
18221 2002-08-19  Martin Baulig  <martin@gnome.org>
18222
18223         * class.cs (TypeContainer): Implement IMemberContainer.
18224         (TypeContainer.DefineMembers): Create the MemberCache.
18225         (TypeContainer.FindMembers): Do better BindingFlags checking; only
18226         return public members if BindingFlags.Public was given, check
18227         whether members are static.
18228
18229 2002-08-16  Martin Baulig  <martin@gnome.org>
18230
18231         * decl.cs (DeclSpace.Define): Splitted this in Define and
18232         DefineMembers.  DefineMembers is called first and initializes the
18233         MemberCache.
18234
18235         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
18236         DefineMembers() on all our DeclSpaces.
18237
18238         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
18239         but call DefineMembers() on all nested interfaces.  We call their
18240         Define() in our new Define() function.
18241
18242         * interface.cs (Interface): Implement IMemberContainer.
18243         (Interface.Define): Moved all code except the attribute stuf to
18244         DefineMembers().
18245         (Interface.DefineMembers): Initialize the member cache.
18246
18247         * typemanager.cs (IMemberFinder): Removed this interface, we don't
18248         need this anymore since we can use MemberCache.FindMembers directly.
18249
18250 2002-08-19  Martin Baulig  <martin@gnome.org>
18251
18252         * typemanager.cs (MemberCache): When creating the cache for an
18253         interface type, add all inherited members.
18254         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
18255         to `out bool used_cache' and documented it.
18256         (TypeManager.MemberLookup): If we already used the cache in the first
18257         iteration, we don't need to do the interfaces check.
18258
18259 2002-08-19  Martin Baulig  <martin@gnome.org>
18260
18261         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
18262         here from IMemberFinder and don't implement this interface anymore.
18263         (DeclSpace.MemberCache): Moved here from IMemberFinder.
18264
18265         * typemanager.cs (IMemberFinder): This interface is now only used by
18266         classes which actually support the member cache.
18267         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
18268         since we only put DeclSpaces into this Hashtable.
18269         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
18270         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
18271
18272 2002-08-16  Martin Baulig  <martin@gnome.org>
18273
18274         * typemanager.cs (ICachingMemberFinder): Removed.
18275         (IMemberFinder.MemberCache): New property.
18276         (TypeManager.FindMembers): Merged this with RealFindMembers().
18277         This function will never be called from TypeManager.MemberLookup()
18278         so we can't use the cache here, just the IMemberFinder.
18279         (TypeManager.MemberLookup_FindMembers): Check whether the
18280         IMemberFinder has a MemberCache and call the cache's FindMembers
18281         function.
18282         (MemberCache): Rewrote larger parts of this yet another time and
18283         cleaned it up a bit.
18284
18285 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
18286
18287         * driver.cs (LoadArgs): Support quoting.
18288
18289         (Usage): Show the CSC-like command line arguments.
18290
18291         Improved a few error messages.
18292
18293 2002-08-15  Martin Baulig  <martin@gnome.org>
18294
18295         * typemanager.cs (IMemberContainer.Type): New property.
18296         (IMemberContainer.IsInterface): New property.
18297
18298         The following changes are conditional to BROKEN_RUNTIME, which is
18299         defined at the top of the file.
18300
18301         * typemanager.cs (MemberCache.MemberCache): Don't add the base
18302         class'es members, but add all members from TypeHandle.ObjectType
18303         if we're an interface.
18304         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
18305         is the current type.
18306         (MemberCache.CacheEntry.Container): Removed this field.
18307         (TypeHandle.GetMembers): Include inherited members.
18308
18309 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18310
18311         * typemanager.cs: fixed compilation and added a comment on a field that
18312         is never used.
18313
18314 2002-08-15  Martin Baulig  <martin@gnome.org>
18315
18316         * class.cs (ConstructorInitializer.Resolve): In the
18317         Expression.MemberLookup call, use the queried_type as
18318         invocation_type.
18319
18320         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
18321         declared' attribute, it's always true.
18322         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
18323         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
18324         temporary wrapper for FindMembers which tells MemberLookup whether
18325         members from the base classes are included in the return value.
18326         This will go away soon.
18327         (TypeManager.MemberLookup): Use this temporary hack here; once the
18328         new MemberCache is completed, we don't need to do the DeclaredOnly
18329         looping here anymore since the MemberCache will take care of this.
18330         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
18331         (MemberCache): When creating the MemberCache for a class, get
18332         members from the current class and all its base classes.
18333         (MemberCache.CacheEntry.Container): New field.  This is a
18334         temporary hack until the Mono runtime is fixed to distinguish
18335         between ReflectedType and DeclaringType.  It allows us to use MCS
18336         with both the MS runtime and the unfixed Mono runtime without
18337         problems and without accecting performance.
18338         (MemberCache.SearchMembers): The DeclaredOnly looping from
18339         TypeManager.MemberLookup is now done here.      
18340
18341 2002-08-14  Martin Baulig  <martin@gnome.org>
18342
18343         * statement.cs (MyStructInfo.MyStructInfo): Don't call
18344         Type.GetFields on dynamic types but get the fields from the
18345         corresponding TypeContainer.
18346         (MyStructInfo.GetStructInfo): Added check for enum types.
18347
18348         * typemanager.cs (MemberList.IsSynchronized): Implemented.
18349         (MemberList.SyncRoot): Implemented.
18350         (TypeManager.FilterWithClosure): No need to check permissions if
18351         closure_start_type == closure_invocation_type, don't crash if
18352         closure_invocation_type is null.
18353
18354 2002-08-13  Martin Baulig  <martin@gnome.org>
18355
18356         Rewrote TypeContainer.FindMembers to use a member cache.  This
18357         gives us a speed increase of about 35% for the self-hosting MCS
18358         build and of about 15-20% for the class libs (both on GNU/Linux).
18359
18360         * report.cs (Timer): New class to get enhanced profiling.  This
18361         whole class is "TIMER" conditional since it remarkably slows down
18362         compilation speed.
18363
18364         * class.cs (MemberList): New class.  This is an IList wrapper
18365         which we're now using instead of passing MemberInfo[]'s around to
18366         avoid copying this array unnecessarily.
18367         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
18368         (ICachingMemberFinder, IMemberContainer): New interface.
18369         (TypeManager.FilterWithClosure): If `criteria' is null, the name
18370         has already been checked, otherwise use it for the name comparision.
18371         (TypeManager.FindMembers): Renamed to RealMemberFinder and
18372         provided wrapper which tries to use ICachingMemberFinder.FindMembers
18373         if possible.  Returns a MemberList, not a MemberInfo [].
18374         (TypeHandle): New class, implements IMemberContainer.  We create
18375         one instance of this class per type, it contains a MemberCache
18376         which is used to do the member lookups.
18377         (MemberCache): New class.  Each instance of this class contains
18378         all members of a type and a name-based hash table.
18379         (MemberCache.FindMembers): This is our new member lookup
18380         function.  First, it looks up all members of the requested name in
18381         the hash table.  Then, it walks this list and sorts out all
18382         applicable members and returns them.
18383
18384 2002-08-13  Martin Baulig  <martin@gnome.org>
18385
18386         In addition to a nice code cleanup, this gives us a performance
18387         increase of about 1.4% on GNU/Linux - not much, but it's already
18388         half a second for the self-hosting MCS compilation.
18389
18390         * typemanager.cs (IMemberFinder): New interface.  It is used by
18391         TypeManager.FindMembers to call FindMembers on a TypeContainer,
18392         Enum, Delegate or Interface.
18393         (TypeManager.finder_to_member_finder): New PtrHashtable.
18394         (TypeManager.finder_to_container): Removed.
18395         (TypeManager.finder_to_delegate): Removed.
18396         (TypeManager.finder_to_interface): Removed.
18397         (TypeManager.finder_to_enum): Removed.
18398
18399         * interface.cs (Interface): Implement IMemberFinder.
18400
18401         * delegate.cs (Delegate): Implement IMemberFinder.
18402
18403         * enum.cs (Enum): Implement IMemberFinder.
18404
18405         * class.cs (TypeContainer): Implement IMemberFinder.
18406
18407 2002-08-12  Martin Baulig  <martin@gnome.org>
18408
18409         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
18410
18411 2002-08-12  Martin Baulig  <martin@gnome.org>
18412
18413         * ecore.cs (ITypeExpression): New interface for expressions which
18414         resolve to a type.
18415         (TypeExpression): Renamed to TypeLookupExpression.
18416         (Expression.DoResolve): If we're doing a types-only lookup, the
18417         expression must implement the ITypeExpression interface and we
18418         call DoResolveType() on it.
18419         (SimpleName): Implement the new ITypeExpression interface.
18420         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
18421         hack, the situation that we're only looking up types can't happen
18422         anymore when this method is called.  Moved the type lookup code to
18423         DoResolveType() and call it.
18424         (SimpleName.DoResolveType): This ITypeExpression interface method
18425         is now doing the types-only lookup.
18426         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
18427         (ResolveFlags): Added MaskExprClass.
18428
18429         * expression.cs (MemberAccess): Implement the ITypeExpression
18430         interface.
18431         (MemberAccess.DoResolve): Added support for a types-only lookup
18432         when we're called via ITypeExpression.DoResolveType().
18433         (ComposedCast): Implement the ITypeExpression interface.
18434
18435         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
18436         Expression.Resolve() with ResolveFlags.Type instead.
18437
18438 2002-08-12  Martin Baulig  <martin@gnome.org>
18439
18440         * interface.cs (Interface.Define): Apply attributes.
18441
18442         * attribute.cs (Attribute.ApplyAttributes): Added support for
18443         interface attributes.
18444
18445 2002-08-11  Martin Baulig  <martin@gnome.org>
18446
18447         * statement.cs (Block.Emit): Only check the "this" variable if we
18448         do not always throw an exception.
18449
18450         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
18451         whether the property has a set accessor.
18452
18453 2002-08-11  Martin Baulig  <martin@gnome.org>
18454
18455         Added control flow analysis support for structs.
18456
18457         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
18458         with control flow analysis turned off.
18459         (IVariable): New interface.
18460         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
18461         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
18462         (FieldExpr.DoResolve): Resolve the instance expression with flow
18463         analysis turned off and do the definite assignment check after the
18464         resolving when we know what the expression will resolve to.
18465
18466         * expression.cs (LocalVariableReference, ParameterReference):
18467         Implement the new IVariable interface, only call the flow analysis
18468         code if ec.DoFlowAnalysis is true.
18469         (This): Added constructor which takes a Block argument.  Implement
18470         the new IVariable interface.
18471         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
18472         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
18473         This does the definite assignment checks for struct members.
18474
18475         * class.cs (Constructor.Emit): If this is a non-static `struct'
18476         constructor which doesn't have any initializer, call
18477         Block.AddThisVariable() to tell the flow analysis code that all
18478         struct elements must be initialized before control returns from
18479         the constructor.
18480
18481         * statement.cs (MyStructInfo): New public class.
18482         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
18483         argument to this indexer.  If non-zero, check an individual struct
18484         member, not the whole struct.
18485         (FlowBranching.CheckOutParameters): Check struct members.
18486         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
18487         overloaded versions of these methods which take an additional
18488         `int field_idx' argument to check struct members.
18489         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
18490         overloaded versions of these methods which take an additional
18491         `string field_name' argument to check struct member.s
18492         (VariableInfo): Implement the IVariable interface.
18493         (VariableInfo.StructInfo): New public property.  Returns the
18494         MyStructInfo instance of the variable if it's a struct or null.
18495         (Block.AddThisVariable): New public method.  This is called from
18496         Constructor.Emit() for non-static `struct' constructor which do
18497         not have any initializer.  It creates a special variable for the
18498         "this" instance variable which will be checked by the flow
18499         analysis code to ensure that all of the struct's fields are
18500         initialized before control returns from the constructor.
18501         (UsageVector): Added support for struct members.  If a
18502         variable/parameter is a struct with N members, we reserve a slot
18503         in the usage vector for each member.  A struct is considered fully
18504         initialized if either the struct itself (slot 0) or all its
18505         members are initialized.
18506
18507 2002-08-08  Martin Baulig  <martin@gnome.org>
18508
18509         * driver.cs (Driver.MainDriver): Only report an error CS5001
18510         if there were no compilation errors.
18511
18512         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
18513         `UnsafeContext' property to determine whether the parent is in
18514         unsafe context rather than checking the parent's ModFlags:
18515         classes nested in an unsafe class are unsafe as well.
18516
18517 2002-08-08  Martin Baulig  <martin@gnome.org>
18518
18519         * statement.cs (UsageVector.MergeChildren): Distinguish between
18520         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
18521         we return.  Added test17() and test18() to test-154.cs.
18522
18523 2002-08-08  Martin Baulig  <martin@gnome.org>
18524
18525         * typemanager.cs (TypeManager.FilterWithClosure): If we have
18526         Family access, make sure the invoking type isn't a subclass of the
18527         queried type (that'd be a CS1540).
18528
18529         * ecore.cs (Expression.MemberLookup): Added overloaded version of
18530         this method which takes an additional `Type invocation_type'.
18531
18532         * expression.cs (BaseAccess.DoResolve): Use the base type as
18533         invocation and query type.
18534         (MemberAccess.DoResolve): If the lookup failed and we're about to
18535         report a CS0122, try a lookup with the ec.ContainerType - if this
18536         succeeds, we must report a CS1540.
18537
18538 2002-08-08  Martin Baulig  <martin@gnome.org>
18539
18540         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
18541         (MethodGroupExpr): Implement the IMemberExpr interface.
18542
18543         * expression (MemberAccess.ResolveMemberAccess): No need to have
18544         any special code for MethodGroupExprs anymore, they're now
18545         IMemberExprs.   
18546
18547 2002-08-08  Martin Baulig  <martin@gnome.org>
18548
18549         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
18550         Family, FamANDAssem and FamORAssem permissions.
18551         (TypeManager.IsSubclassOrNestedChildOf): New public method.
18552
18553 2002-08-08  Martin Baulig  <martin@gnome.org>
18554
18555         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
18556         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
18557         or loop block.
18558
18559 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
18560
18561         * driver.cs: implemented /resource option to embed managed resources.
18562
18563 2002-08-07  Martin Baulig  <martin@gnome.org>
18564
18565         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
18566         (FieldBase.HasFieldInitializer): New public property.
18567         (FieldBase.GetInitializerExpression): New public method.  Resolves and
18568         returns the field initializer and makes sure it is only resolved once.
18569         (TypeContainer.EmitFieldInitializers): Call
18570         FieldBase.GetInitializerExpression to get the initializer, this ensures
18571         that it isn't resolved multiple times.
18572
18573         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
18574         the resolving process (SimpleName/MemberLookup) that we're currently
18575         emitting a field initializer (which must not access any instance members,
18576         this is an error CS0236).
18577
18578         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
18579         argument, if the `IsFieldInitializer' flag is set, we must report and
18580         error CS0236 and not an error CS0120.   
18581
18582 2002-08-07  Martin Baulig  <martin@gnome.org>
18583
18584         * ecore.cs (IMemberExpr): New public interface.
18585         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
18586         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
18587         if the expression is an IMemberExpr.
18588
18589         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
18590         to be null, implicitly default to `this' if we're non-static in
18591         this case.  Simplified the code a lot by using the new IMemberExpr
18592         interface.  Also fixed bug #28176 here.
18593
18594 2002-08-06  Martin Baulig  <martin@gnome.org>
18595
18596         * cs-parser.jay (SimpleLookup): Removed.  We need to create
18597         ParameterReferences during semantic analysis so that we can do a
18598         type-only search when resolving Cast, TypeOf and SizeOf.
18599         (block): Pass the `current_local_parameters' to the Block's
18600         constructor.
18601
18602         * class.cs (ConstructorInitializer): Added `Parameters parameters'
18603         argument to the constructor.
18604         (ConstructorInitializer.Resolve): Create a temporary implicit
18605         block with the parameters.
18606
18607         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
18608         references here if we aren't doing a type-only search.
18609
18610         * statement.cs (Block): Added constructor which takes a
18611         `Parameters parameters' argument.
18612         (Block.Parameters): New public property.
18613
18614         * support.cs (InternalParameters.Parameters): Renamed `parameters'
18615         to `Parameters' and made it public readonly.
18616
18617 2002-08-06  Martin Baulig  <martin@gnome.org>
18618
18619         * ecore.cs (Expression.Warning): Made this public as well.
18620
18621         * report.cs (Report.Debug): Print the contents of collections.
18622
18623 2002-08-06  Martin Baulig  <martin@gnome.org>
18624
18625         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
18626         used to tell Resolve() which kinds of expressions it may return.
18627         (Expression.Resolve): Added overloaded version of this method which
18628         takes a `ResolveFlags flags' argument.  This can be used to tell
18629         Resolve() which kinds of expressions it may return.  Reports a
18630         CS0118 on error.
18631         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18632         ResolveFlags.SimpleName.
18633         (Expression.Error118): Added overloaded version of this method which
18634         takes a `ResolveFlags flags' argument.  It uses the flags to determine
18635         which kinds of expressions are allowed.
18636
18637         * expression.cs (Argument.ResolveMethodGroup): New public method.
18638         Resolves an argument, but allows a MethodGroup to be returned.
18639         This is used when invoking a delegate.
18640
18641         * TODO: Updated a bit.
18642
18643 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18644
18645         Fixed compilation with csc.
18646
18647         * ecore.cs: Expression.Error made public. Is this correct? Should
18648         Warning be made public too?
18649
18650         * expression.cs: use ea.Location instead of ea.loc.
18651         [FIXME:  Filed as bug #28607: MCS must report these errors.]
18652
18653 2002-08-06  Martin Baulig  <martin@gnome.org>
18654
18655         * ecore.cs (Expression.loc): Moved the location here instead of
18656         duplicating it in all derived classes.
18657         (Expression.Location): New public property.
18658         (Expression.Error, Expression.Warning): Made them non-static and
18659         removed the location argument.
18660         (Expression.Warning): Added overloaded version which takes an
18661         `int level' argument.
18662         (Expression.Error118): Make this non-static and removed the
18663         expression and location arguments.
18664         (TypeExpr): Added location argument to the constructor.
18665
18666         * expression.cs (StaticCallExpr): Added location argument to
18667         the constructor.
18668         (Indirection, PointerArithmetic): Likewise.
18669         (CheckedExpr, UnCheckedExpr): Likewise.
18670         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18671         (StringPtr): Likewise.
18672
18673
18674 2002-08-05  Martin Baulig  <martin@gnome.org>
18675
18676         * expression.cs (BaseAccess.DoResolve): Actually report errors.
18677
18678         * assign.cs (Assign.DoResolve): Check whether the source
18679         expression is a value or variable.
18680
18681         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18682         while resolving the corresponding blocks.
18683
18684         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18685         an error, don't silently return null.
18686
18687         * statement.cs (Block.AddVariable): Do the error reporting here
18688         and distinguish between CS0128 and CS0136.
18689         (Block.DoResolve): Report all unused labels (warning CS0164).
18690         (LabeledStatement): Pass the location to the constructor.
18691         (LabeledStatement.HasBeenReferenced): New property.
18692         (LabeledStatement.Resolve): Set it to true here.
18693
18694         * statement.cs (Return.Emit): Return success even after reporting
18695         a type mismatch error (CS0126 or CS0127), this is what csc does and
18696         it avoids confusing the users with any consecutive errors.
18697
18698 2002-08-05  Martin Baulig  <martin@gnome.org>
18699
18700         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18701
18702         * const.cs (Const.LookupConstantValue): Catch circular definitions.
18703
18704         * expression.cs (MemberAccess.DoResolve): Silently return if an
18705         error has already been reported.
18706
18707         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18708         error has already been reported.
18709
18710 2002-08-05  Martin Baulig  <martin@gnome.org>
18711
18712         * statement.cs (UsageVector): Only initialize the `parameters'
18713         vector if we actually have any "out" parameters.
18714
18715 2002-08-05  Martin Baulig  <martin@gnome.org>
18716
18717         * expression.cs (Binary.ResolveOperator): When combining delegates,
18718         they must have the same type.
18719
18720 2002-08-05  Martin Baulig  <martin@gnome.org>
18721
18722         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18723         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18724         work with the ms runtime and we also don't need it: if we're a
18725         PropertyBuilder and not in the `indexer_arguments' hash, then we
18726         are a property and not an indexer.
18727
18728         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18729         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18730         since the latter one doesn't work with the ms runtime.
18731
18732 2002-08-03  Martin Baulig  <martin@gnome.org>
18733
18734         Fixed bugs #27998 and #22735.
18735
18736         * class.cs (Method.IsOperator): New public field.
18737         (Method.CheckBase): Report CS0111 if there's already a method
18738         with the same parameters in the current class.  Report CS0508 when
18739         attempting to change the return type of an inherited method.
18740         (MethodData.Emit): Report CS0179 if a method doesn't have a body
18741         and it's not marked abstract or extern.
18742         (PropertyBase): New abstract base class for Property and Indexer.
18743         (PropertyBase.CheckBase): Moved here from Property and made it work
18744         for indexers.
18745         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18746         the same so we can reuse it there.
18747         (Property, Indexer): Derive from PropertyBase.
18748         (MethodSignature.inheritable_property_signature_filter): New delegate
18749         to find properties and indexers.
18750
18751         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18752         argument and improved error reporting.
18753
18754         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18755         EmptyReadOnlyParameters and made it a property.
18756
18757         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18758         version of this method which takes a `PropertyInfo indexer'.
18759         (TypeManager.RegisterIndexer): New method.
18760
18761         * class.cs: Added myself as author of this file :-)
18762
18763 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18764
18765         * class.cs: fixed compilation on windoze.
18766
18767 2002-08-03  Martin Baulig  <martin@gnome.org>
18768
18769         * interface.cs (Interface.GetInterfaceBases): Check whether all
18770         base interfaces are at least as accessible than the current one.
18771
18772         * class.cs (TypeContainer.GetClassBases): Check whether base types
18773         are at least as accessible than the current type.
18774         (TypeContainer.AsAccessible): Implemented and made non-static.
18775         (MemberBase.CheckParameters): Report errors if the accessibility
18776         checks fail.
18777
18778         * delegate.cs (Delegate.Delegate): The default visibility is
18779         internal for top-level types and private for nested types.
18780         (Delegate.Define): Report errors if the accessibility checks fail.
18781
18782         * enum.cs (Enum.Enum): The default visibility is internal for
18783         top-level types and private for nested types.
18784         (Enum.DefineType): Compute the correct visibility.
18785
18786         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18787         function which takes a `bool is_toplevel' instead of a TypeContainer.
18788
18789         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18790         builtin type.
18791
18792 2002-08-02  Martin Baulig  <martin@gnome.org>
18793
18794         * expression.cs (LocalVariableReferenc): Added constructor which
18795         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18796         (LocalVariableReference.IsReadOnly): New property.
18797         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18798         variable is readonly, use our own readonly flag to do this; you can
18799         use the new constructor to get a writable reference to a read-only
18800         variable.
18801
18802         * cs-parser.jay (foreach_statement, using_statement): Get a writable
18803         reference to the local variable.
18804
18805 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
18806
18807         * rootcontext.cs (ResolveCore): Also include System.Exception
18808
18809         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18810         we reach an EmptyStatement.
18811
18812         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18813         is also fine.
18814
18815         * expression.cs (Binary.ResolveOperator): Check error result in
18816         two places.
18817
18818         use brtrue/brfalse directly and avoid compares to null.
18819
18820 2002-08-02  Martin Baulig  <martin@gnome.org>
18821
18822         * class.cs (TypeContainer.Define): Define all nested interfaces here.
18823         Fixes bug #28407, added test-155.cs.
18824
18825 2002-08-01  Martin Baulig  <martin@gnome.org>
18826
18827         * class.cs (Event.EmitDefaultMethod): Make this work with static
18828         events.  Fixes #28311, added verify-3.cs.
18829
18830 2002-08-01  Martin Baulig  <martin@gnome.org>
18831
18832         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18833         `is_disposable' fields.
18834         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18835         `hm.is_disposable' if we're using the collection pattern.
18836         (Foreach.EmitCollectionForeach): Use the correct type for the
18837         enumerator's local variable, only emit the try/finally block if
18838         necessary (fixes #27713).
18839
18840 2002-08-01  Martin Baulig  <martin@gnome.org>
18841
18842         * ecore.cs (Expression.report118): Renamed to Error118 and made
18843         it public static.
18844
18845         * statement.cs (Throw.Resolve): Check whether the expression is of
18846         the correct type (CS0118) and whether the type derives from
18847         System.Exception (CS0155).
18848         (Catch.Resolve): New method.  Do the type lookup here and check
18849         whether it derives from System.Exception (CS0155).
18850         (Catch.CatchType, Catch.IsGeneral): New public properties.
18851
18852         * typemanager.cs (TypeManager.exception_type): Added.
18853
18854 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
18855
18856         * driver.cs: Updated About function.
18857
18858 2002-07-31  Martin Baulig  <martin@gnome.org>
18859
18860         Implemented Control Flow Analysis.
18861
18862         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18863         (EmitContext.CurrentBranching): Added.
18864         (EmitContext.StartFlowBranching): Added.
18865         (EmitContext.EndFlowBranching): Added.
18866         (EmitContext.KillFlowBranching): Added.
18867         (EmitContext.IsVariableAssigned): Added.
18868         (EmitContext.SetVariableAssigned): Added.
18869         (EmitContext.IsParameterAssigned): Added.
18870         (EmitContext.SetParameterAssigned): Added.
18871         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18872         Added control flow analysis stuff here.
18873
18874         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18875         resolve the expression as lvalue.
18876         (LocalVariableReference.DoResolve): Check whether the variable has
18877         already been assigned.
18878         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18879         the parameter as assigned here.
18880         (ParameterReference.DoResolve): Check whether the parameter has already
18881         been assigned.
18882         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18883         expression as lvalue.
18884
18885         * statement.cs (FlowBranching): New class for the flow analysis code.
18886         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18887         (LabeledStatement.IsDefined): New public property.
18888         (LabeledStatement.AddUsageVector): New public method to tell flow
18889         analyis that the label may be reached via a forward jump.
18890         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18891         flow analysis.
18892         (VariableInfo.Number): New public field.  This is used by flow analysis
18893         to number all locals of a block.
18894         (Block.CountVariables): New public property.  This is the number of
18895         local variables in this block (including the locals from all parent
18896         blocks).
18897         (Block.EmitMeta): Number all the variables.
18898
18899         * statement.cs: Added flow analysis support to all classes.
18900
18901 2002-07-31  Martin Baulig  <martin@gnome.org>
18902
18903         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18904         To get debugging messages, compile mcs with /define:MCS_DEBUG and
18905         then use this argument.
18906
18907         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18908
18909         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18910         use this to specify /define options.
18911
18912 2002-07-29  Martin Baulig  <martin@gnome.org>
18913
18914         * statement.cs (Fixed): Moved all code that does variable lookups
18915         and resolvings from Emit to Resolve.
18916
18917         * statement.cs (For): Moved all code that does variable lookups
18918         and resolvings from Emit to Resolve.
18919
18920         * statement.cs (Using): Moved all code that does variable lookups
18921         and resolvings from Emit to Resolve.
18922
18923 2002-07-29  Martin Baulig  <martin@gnome.org>
18924
18925         * attribute.cs (Attribute.Resolve): Explicitly catch a
18926         System.NullReferenceException when creating the
18927         CustromAttributeBuilder and report a different warning message.
18928
18929 2002-07-29  Martin Baulig  <martin@gnome.org>
18930
18931         * support.cs (ParameterData.ParameterName): Added method to
18932         get the name of a parameter.
18933
18934         * typemanager.cs (TypeManager.IsValueType): New public method.
18935
18936 2002-07-29  Martin Baulig  <martin@gnome.org>
18937
18938         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
18939         is a flag which specifies that it's either ref or out.
18940         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18941         the out parameter to `out Parameter.Modifier mod', also set the
18942         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18943
18944         * support.cs (InternalParameters.ParameterModifier): Distinguish
18945         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18946         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18947
18948         * expression.cs (Argument.GetParameterModifier): Distinguish
18949         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18950         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18951
18952 2002-07-29  Martin Baulig  <martin@gnome.org>
18953
18954         * expression.cs (ParameterReference.ParameterReference): Added
18955         `Location loc' argument to the constructor.
18956
18957         * cs-parser.jay: Pass location to ParameterReference.
18958
18959 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
18960
18961         * statement.cs (Try): Initialize the location.
18962
18963         * cs-parser.jay: pass location to Try.
18964
18965         * expression.cs (Unary.Reduce): Change the prototype to return
18966         whether a constant fold could be performed or not.  The result is
18967         returned in an out parameters.  In the case of Indirection and
18968         AddressOf, we want to perform the full tests.
18969
18970 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
18971
18972         * statement.cs (Statement.Emit): Flag dead code.
18973
18974 2002-07-27  Andrew Birkett  <andy@nobugs.org>
18975
18976         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18977
18978 2002-07-27  Martin Baulig  <martin@gnome.org>
18979
18980         * class.cs (MethodData.Define): Put back call to
18981         TypeManager.AddMethod(), accidentally commented this out.
18982
18983         * report.cs (Debug): New public method to print debugging information,
18984         this is `[Conditional ("DEBUG")]'.
18985
18986 2002-07-26  Martin Baulig  <martin@gnome.org>
18987
18988         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18989         (switch_statement): Push the current_block to the switch_stack and
18990         pop it again when we're done with the switch.
18991         (switch_section): The new block is a child of the current_block.
18992         Fixes bug #24007, added test-152.cs.
18993
18994 2002-07-27  Martin Baulig  <martin@gnome.org>
18995
18996         * expression.cs (Invocation.EmitArguments): When calling a varargs
18997         function with only its fixed arguments, we need to pass an empty
18998         array.
18999
19000 2002-07-27  Martin Baulig  <martin@gnome.org>
19001
19002         Mono 0.13 has been released.
19003
19004 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
19005
19006         * driver.cs: Rename --resource to --linkres, because that is what
19007         we do currently, we dont support --resource yet.
19008
19009         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
19010
19011 2002-07-25  Martin Baulig  <martin@gnome.org>
19012
19013         * class.cs (MethodData): New public class.  This is a `method builder'
19014         class for a method or one accessor of a Property/Indexer/Event.
19015         (MethodData.GetMethodFlags): Moved here from MemberBase.
19016         (MethodData.ApplyAttributes): Likewise.
19017         (MethodData.ApplyObsoleteAttribute): Likewise.
19018         (MethodData.ApplyConditionalAttribute): Likewise.
19019         (MethodData.ApplyDllImportAttribute): Likewise.
19020         (MethodData.CheckAbstractAndExternal): Likewise.
19021         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
19022         (MethodData.Emit): Formerly known as Method.Emit().
19023         (MemberBase): Moved everything which was specific to a single
19024         accessor/method to MethodData.
19025         (Method): Create a new MethodData and call Define() and Emit() on it.
19026         (Property, Indexer, Event): Create a new MethodData objects for each
19027         accessor and call Define() and Emit() on them.
19028
19029 2002-07-25  Martin Baulig  <martin@gnome.org>
19030
19031         Made MethodCore derive from MemberBase to reuse the code from there.
19032         MemberBase now also checks for attributes.
19033
19034         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
19035         (MemberBase.GetMethodFlags): Moved here from class Method and marked
19036         as virtual.
19037         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
19038         `CallingConventions cc' and `Attributes opt_attrs' arguments.
19039         (MemberBase.ApplyAttributes): New virtual method; applies the
19040         attributes to a method or accessor.
19041         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
19042         (MemberBase.ApplyConditionalAttribute): Likewise.
19043         (MemberBase.ApplyDllImportAttribute): Likewise.
19044         (MemberBase.CheckAbstractAndExternal): Likewise.
19045         (MethodCore.ParameterTypes): This is now a property instead of a
19046         method, it's initialized from DoDefineParameters().
19047         (MethodCore.ParameterInfo): Removed the set accessor.
19048         (MethodCore.DoDefineParameters): New protected virtual method to
19049         initialize ParameterTypes and ParameterInfo.
19050         (Method.GetReturnType): We can now simply return the MemberType.
19051         (Method.GetMethodFlags): Override the MemberBase version and add
19052         the conditional flags.
19053         (Method.CheckBase): Moved some code from Define() here, call
19054         DoDefineParameters() here.
19055         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
19056         here to avoid some larger code duplication.
19057         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
19058         ensure that abstract and external accessors don't declare a body.
19059
19060         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
19061         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
19062         lookup in the attribute's parent classes, so we need to abort as soon
19063         as we found the first match.
19064         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
19065         the attribute has no arguments.
19066
19067         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
19068         of a Method.
19069
19070 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19071
19072         * cs-parser.jay: reverted previous patch.
19073
19074 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19075
19076         * cs-parser.jay: fixed bug #22119.
19077
19078 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19079
19080         * attribute.cs: fixed compilation. The error was:
19081         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
19082         be assigned to before control leaves the current method."
19083         [FIXME:  Filed as bug #28186: MCS must report this error.]
19084
19085 2002-07-25  Martin Baulig  <martin@gnome.org>
19086
19087         * attribute.cs (Attribute.Conditional_GetConditionName): New static
19088         method to pull the condition name ouf of a Conditional attribute.
19089         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
19090         the obsolete message and error flag out of an Obsolete attribute.
19091
19092         * class.cs (Method.GetMethodFlags): New public method to get the
19093         TypeManager.MethodFlags for this method.
19094         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
19095         private methods.
19096         (Method.Define): Get and apply the Obsolete and Conditional attributes;
19097         if we're overriding a virtual function, set the new private variable
19098         `parent_method'; call the new TypeManager.AddMethod().
19099
19100         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
19101         the MethodBuilder and the Method in a PtrHashtable.
19102         (TypeManager.builder_to_method): Added for this purpose.
19103         (TypeManager.MethodFlags): Added IsObsoleteError.
19104         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
19105         Obsolete and Conditional arguments in MethodBuilders.  If we discover
19106         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
19107         the message from the attribute.
19108
19109 2002-07-24  Martin Baulig  <martin@gnome.org>
19110
19111         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
19112         preprocessor directives, ensure that the argument to #define/#undef is
19113         exactly one identifier and that it's actually an identifier.
19114
19115         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
19116         did not work ....
19117
19118 2002-07-24  Martin Baulig  <martin@gnome.org>
19119
19120         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
19121         initialize it to TypeManager.object_type in the constructor.
19122         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
19123         of the `hm.get_current' method if we're using the collection pattern.
19124         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
19125         for the explicit conversion to make it work when we're using the collection
19126         pattern and the `Current' property has a different return type than `object'.
19127         Fixes #27713.
19128
19129 2002-07-24  Martin Baulig  <martin@gnome.org>
19130
19131         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
19132         does not match, but don't report any errors.  This method is called in
19133         order for all methods in a MethodGroupExpr until a matching method is
19134         found, so we don't want to bail out if the first method doesn't match.
19135         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
19136         matches, report the 123.  Fixes #28070.
19137
19138 2002-07-24  Martin Baulig  <martin@gnome.org>
19139
19140         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
19141         TypeManager.TypeToCoreType() to the top of the method so the
19142         following equality checks will work.  Fixes #28107.
19143
19144 2002-07-24  Martin Baulig  <martin@gnome.org>
19145
19146         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
19147         operand is of type uint, and the other operand is of type sbyte,
19148         short or int, the operands are converted to type long." -
19149         Actually do what this comment already told us.  Fixes bug #28106,
19150         added test-150.cs.
19151
19152 2002-07-24  Martin Baulig  <martin@gnome.org>
19153
19154         * class.cs (MethodBase): New abstract class.  This is now a base
19155         class for Property, Indexer and Event to avoid some code duplication
19156         in their Define() and DefineMethods() methods.
19157         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
19158         generic methods for Define() and DefineMethods().
19159         (FieldBase): Derive from MemberBase, not MemberCore.
19160         (Property): Derive from MemberBase, not MemberCore.
19161         (Property.DefineMethod): Moved all the code from this method to the
19162         new MethodBase.DefineAccessor(), just call it with appropriate
19163         argumetnts.
19164         (Property.Define): Call the new Property.DoDefine(), this does some
19165         sanity checks and we don't need to duplicate the code everywhere.
19166         (Event): Derive from MemberBase, not MemberCore.
19167         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
19168         accessors, this will also make them work with interface events.
19169         (Indexer): Derive from MemberBase, not MemberCore.
19170         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
19171         (Indexer.Define): Use the new MethodBase functions.
19172
19173         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
19174         argument to the constructor.
19175         (Interface.FindMembers): Added support for interface events.
19176         (Interface.PopluateEvent): Implemented.
19177
19178         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
19179
19180 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
19181
19182         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
19183         but this is required to check for a method name being the same as
19184         the containing class.  
19185
19186         Handle this now.
19187
19188 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19189
19190         * interface.cs: initialize variable.
19191
19192 2002-07-23  Martin Baulig  <martin@gnome.org>
19193
19194         Implemented the IndexerName attribute in interfaces.
19195
19196         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
19197         name if this is an explicit interface implementation.
19198         (Indexer.InterfaceIndexerName): New public variable.  If we're
19199         implementing an interface indexer, this is the IndexerName in that
19200         interface.  Otherwise, it's the IndexerName.
19201         (Indexer.DefineMethod): If we're implementing interface indexer,
19202         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
19203         and Pending.ImplementIndexer methods.
19204         (Indexer.Define): Also define the PropertyBuilder if we're
19205         implementing an interface indexer and this is neither an explicit
19206         interface implementation nor do the IndexerName match the one in
19207         the interface.
19208
19209         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
19210         If a method is defined here, then we always need to create a proxy
19211         for it.  This is used when implementing interface indexers.
19212         (Pending.IsInterfaceIndexer): New public method.
19213         (Pending.ImplementIndexer): New public method.
19214         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
19215         This is used when implementing interface indexers to define a proxy
19216         if necessary.
19217         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
19218         define a proxy if necessary.
19219
19220         * interface.cs (Interface.IndexerName): New public variable.
19221         (Interface.PopulateIndexer): Set the IndexerName.
19222         (Interface.DefineIndexers): New private method.  Populate all the
19223         indexers and make sure their IndexerNames match.
19224
19225         * typemanager.cs (IndexerPropertyName): Added support for interface
19226         indexers.
19227
19228 2002-07-22  Martin Baulig  <martin@gnome.org>
19229
19230         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
19231         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
19232         ret if HasReturnLabel.
19233         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
19234         variables.
19235
19236         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
19237         and set the ec.LoopBeginTryCatchLevel.
19238         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
19239         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
19240         the current ec.TryCatchLevel, the branch goes out of an exception
19241         block.  In this case, we need to use Leave and not Br.
19242
19243 2002-07-22  Martin Baulig  <martin@gnome.org>
19244
19245         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
19246         block unless the block does not always return or it is contained in
19247         another try { ... } catch { ... } block.  Fixes bug #26506.
19248         Added verify-1.cs to the test suite.
19249
19250 2002-07-22  Martin Baulig  <martin@gnome.org>
19251
19252         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
19253         then we do not always return.  Fixes bug #24985.
19254
19255 2002-07-22  Martin Baulig  <martin@gnome.org>
19256
19257         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
19258         lookup on a per-class level; ie. walk up the class hierarchy until we
19259         found at least one applicable method, then choose the best among them.
19260         Fixes bug #24463 and test-29.cs.
19261
19262 2002-07-22  Martin Baulig  <martin@gnome.org>
19263
19264         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
19265         return types of the methods.  The return type is not part of the
19266         signature and we must not check it to make the `new' modifier work.
19267         Fixes bug #27999, also added test-147.cs.
19268         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
19269
19270         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
19271         on the method's return type.
19272
19273 2002-07-21  Martin Baulig  <martin@gnome.org>
19274
19275         * assign.cs: Make this work if the rightmost source is a constant and
19276         we need to do an implicit type conversion.  Also adding a few more tests
19277         to test-38.cs which should have caught this.
19278
19279         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
19280         target in the makefile for this.  The makefile.gnu is primarily intended
19281         for end-users who don't want to debug the compiler.
19282
19283 2002-07-21  Martin Baulig  <martin@gnome.org>
19284
19285         * assign.cs: Improved the Assign class so it can now handle embedded
19286         assignments (X = Y = Z = something).  As a side-effect this'll now also
19287         consume less local variables.  test-38.cs now passes with MCS, added
19288         a few new test cases to that test.
19289
19290 2002-07-20  Martin Baulig  <martin@gnome.org>
19291
19292         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
19293         instructions.  Fixes bug #27977, also added test-146.cs.
19294
19295 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19296
19297         * cs-tokenizer.cs: fixed getHex ().
19298
19299 2002-07-19  Martin Baulig  <martin@gnome.org>
19300
19301         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
19302         not Type.GetType() to lookup the array type.  This is needed when
19303         we're constructing an array of a user-defined type.
19304         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
19305         single-dimensional arrays, but also for single-dimensial arrays of
19306         type decimal.
19307
19308 2002-07-19  Martin Baulig  <martin@gnome.org>
19309
19310         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
19311         this function is called, it's not allowed to share LocalBuilders
19312         among ILGenerators.
19313
19314 2002-07-19  Martin Baulig  <martin@gnome.org>
19315
19316         * expression.cs (Argument.Resolve): Report an error 118 when trying
19317         to pass a type as argument.
19318
19319 2002-07-18  Martin Baulig  <martin@gnome.org>
19320
19321         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
19322         Conv_R_Un for the signed `long' type.
19323
19324 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
19325
19326         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
19327         `expr' for the temporary result, as that will fail if we do
19328         multiple resolves on the same expression.
19329
19330 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
19331
19332         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
19333         ec.TypeContainer for looking up aliases. 
19334
19335         * class.cs (TypeContainer): Remove LookupAlias from here.
19336
19337         * decl.cs (DeclSpace); Move here.
19338
19339 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
19340
19341         * class.cs (FindMembers): Only call filter if the constructor
19342         bulider is not null.
19343
19344         Also handle delegates in `NestedTypes' now.  Now we will perform
19345         type lookups using the standard resolution process.  This also
19346         fixes a bug.
19347
19348         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
19349         This uses Expressions (the limited kind that can be parsed by the
19350         tree) instead of strings.
19351
19352         * expression.cs (ComposedCast.ToString): Implement, used to flag
19353         errors since now we have to render expressions.
19354
19355         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
19356         FormArrayType. 
19357
19358         * ecore.cs (SimpleName.ToString): ditto.
19359
19360         * cs-parser.jay: Instead of using strings to assemble types, use
19361         Expressions to assemble the type (using SimpleName, ComposedCast,
19362         MemberAccess).  This should fix the type lookups in declarations,
19363         because we were using a different code path for this.
19364
19365         * statement.cs (Block.Resolve): Continue processing statements
19366         even when there is an error.
19367
19368 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
19369
19370         * class.cs (Event.Define): Also remove the `remove' method from
19371         the list of pending items.
19372
19373         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
19374         generate more compact code. 
19375
19376 2002-07-17  Martin Baulig  <martin@gnome.org>
19377
19378         * const.cs (Const.LookupConstantValue): Add support for constant
19379         `unchecked' and `checked' expressions.
19380         Also adding test case test-140.cs for this.
19381
19382 2002-07-17  Martin Baulig  <martin@gnome.org>
19383
19384         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
19385         check whether mi.ReturnType implements the IEnumerator interface; the
19386         `==' and the IsAssignableFrom() will fail in this situation.
19387
19388 2002-07-16  Ravi Pratap  <ravi@ximian.com>
19389
19390         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
19391         here too.
19392
19393 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19394
19395         * expression.cs: fixed bug #27811.
19396
19397 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
19398
19399         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
19400         Molaro: when we are a ref, the value already contains a pointer
19401         value, do not take the address of it.
19402
19403 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19404         * removed mb-parser.jay and mb-tokenizer.cs
19405
19406 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19407
19408         * expression.cs: check against the building corlib void type.
19409
19410 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
19411
19412         * ecore.cs: fix for valuetype static readonly fields: when 
19413         initializing them, we need their address, not the address of a copy.
19414
19415 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
19416
19417         * typemanager.cs: register also enum_type in corlib.
19418
19419 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19420
19421         * class.cs: allow calling this (but not base) initializers in structs.
19422
19423 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
19424
19425         * ecore.cs: make sure we compare against the building base types
19426         in GetTypeSize ().
19427
19428 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
19429
19430         * typemanager.cs: fix TypeToCoreType() to handle void and object
19431         (corlib gets no more typerefs after this change).
19432
19433 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
19434
19435         * expression.cs (ArrayCreation.EmitArrayArguments): use
19436         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
19437
19438         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
19439         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
19440         array indexes, the runtime actually forbids them.
19441
19442         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
19443         for array arguments here.
19444
19445         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
19446         instead of the default for ValueTypes.
19447
19448         (New.DoEmit): Use IsValueType instead of
19449         IsSubclassOf (value_type)
19450         (New.DoResolve): ditto.
19451         (Invocation.EmitCall): ditto.
19452
19453         * assign.cs (Assign): ditto.
19454
19455         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
19456         Statements *are* currently doing part of their resolution during
19457         Emit.  
19458
19459         Expressions do always resolve during resolve, but statements are
19460         only required to propagate resolution to their children.
19461
19462 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
19463
19464         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
19465
19466         (LoadAssembly): Do not add the dll if it is already specified
19467
19468         (MainDriver): Add the System directory to the link path at the end,
19469         after all the other -L arguments. 
19470
19471         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
19472         wrong opcode for loading bytes and bools (ldelem.i1 instead of
19473         ldelem.u1) and using the opposite for sbytes.
19474
19475         This fixes Digger, and we can finally run it.
19476
19477         * driver.cs (UnixParseOption): Move the option parsing here.  
19478         (CSCParseOption): Implement CSC-like parsing of options.
19479
19480         We now support both modes of operation, the old Unix way, and the
19481         new CSC-like way.  This should help those who wanted to make cross
19482         platform makefiles.
19483
19484         The only thing broken is that /r:, /reference: and /lib: are not
19485         implemented, because I want to make those have the same semantics
19486         as the CSC compiler has, and kill once and for all the confussion
19487         around this.   Will be doing this tomorrow.
19488
19489         * statement.cs (Unsafe.Resolve): The state is checked during
19490         resolve, not emit, so we have to set the flags for IsUnsfe here.
19491
19492 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
19493
19494         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
19495         not catch the Error_ObjectRefRequired in SimpleName (as it is
19496         possible to have a class/instance variable name that later gets
19497         deambiguated), we have to check this here.      
19498
19499 2002-07-10  Ravi Pratap  <ravi@ximian.com>
19500
19501         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
19502         make static and put into Expression.
19503
19504         (Event.Define): Register the private field of the event with the 
19505         TypeManager so that GetFieldFromEvent can get at it.
19506
19507         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
19508         keep track of the private field associated with an event which
19509         has no accessors.
19510
19511         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
19512         private field.
19513
19514         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
19515
19516 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
19517
19518         * expression.cs (Binary.EmitBranchable): this routine emits the
19519         Binary expression in a branchable context.  This basically means:
19520         we need to branch somewhere, not just get the value on the stack.
19521
19522         This works together with Statement.EmitBoolExpression.
19523
19524         * statement.cs (Statement.EmitBoolExpression): Use
19525         EmitBranchable. 
19526
19527 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
19528
19529         * statement.cs (For): Reduce the number of jumps in loops.
19530
19531         (For): Implement loop inversion for the For statement.
19532
19533         (Break): We can be breaking out of a Try/Catch controlled section
19534         (foreach might have an implicit try/catch clause), so we need to
19535         use Leave instead of Br.
19536
19537         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
19538         now).  If the instace expression supports IMemoryLocation, we use
19539         the AddressOf method from the IMemoryLocation to extract the
19540         address instead of emitting the instance.
19541
19542         This showed up with `This', as we were emitting the instance
19543         always (Emit) instead of the Address of This.  Particularly
19544         interesting when This is a value type, as we dont want the Emit
19545         effect (which was to load the object).
19546
19547 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
19548
19549         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
19550
19551         * statement.cs (Checked): Set the CheckedState during the resolve
19552         process too, as the ConvCast operations track the checked state on
19553         the resolve process, and not emit.
19554
19555         * cs-parser.jay (namespace_member_declaration): Flag that we have
19556         found a declaration when we do.  This is used to flag error 1529
19557
19558         * driver.cs: Report ok when we display the help only.
19559
19560 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
19561
19562         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
19563
19564 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
19565
19566         * cs-tokenizer.cs (define): We also have to track locally the
19567         defines.  AllDefines is just used for the Conditional Attribute,
19568         but we also need the local defines for the current source code. 
19569
19570 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
19571
19572         * statement.cs (While, For, Do): These loops can exit through a
19573         Break statement, use this information to tell whether the
19574         statement is the last piece of code.
19575
19576         (Break): Flag that we break.
19577
19578         * codegen.cs (EmitContexts): New `Breaks' state variable.
19579
19580 2002-07-03  Martin Baulig  <martin@gnome.org>
19581
19582         * class.cs (TypeContainer.MethodModifiersValid): Allow override
19583         modifiers in method declarations in structs.  Otherwise, you won't
19584         be able to override things like Object.Equals().
19585
19586 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19587
19588         * class.cs (Method, Property, Indexer): Do not allow the public
19589         modifier to be used in explicit interface implementations.
19590
19591         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
19592         override modifiers in method declarations in structs
19593
19594 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
19595
19596         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
19597         integer or real overflow, report an error
19598
19599 2002-07-02  Martin Baulig  <martin@gnome.org>
19600
19601         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
19602         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
19603         to tell the runtime about our newly created System.Object and
19604         System.ValueType types.
19605
19606 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19607
19608         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
19609         struct instead of Ldarg/Starg.
19610
19611 2002-07-02  Martin Baulig  <martin@gnome.org>
19612
19613         * expression.cs (Indirection.Indirection): Call
19614         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
19615
19616 2002-07-02  Martin Baulig  <martin@gnome.org>
19617
19618         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
19619         ValueType, call TypeManager.TypeToCoreType() on it.
19620         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19621         the OpCodes.Newarr argument.
19622
19623 2002-07-02  Martin Baulig  <martin@gnome.org>
19624
19625         * expression.cs (Invocation.EmitCall): When compiling corlib,
19626         replace all calls to the system's System.Array type to calls to
19627         the newly created one.
19628
19629         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19630         System.Array methods.
19631         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19632         from the system's System.Array type which must be replaced.
19633
19634 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19635
19636         * typemanager.cs: load unverifiable_code_ctor so we can build
19637         corlib using the correct type. Avoid using GetTypeCode() with
19638         TypeBuilders.
19639         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19640         TypeManager.object_type to allow building corlib.
19641
19642 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19643
19644         * ecore.cs: handle System.Enum separately in LoadFromPtr().
19645
19646 2002-07-01  Martin Baulig  <martin@gnome.org>
19647
19648         * class.cs: Make the last change actually work, we need to check
19649         whether `ifaces != null' to avoid a crash.
19650
19651 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19652
19653         * class.cs: when we build structs without fields that implement
19654         interfaces, we need to add the interfaces separately, since there is
19655         no API to both set the size and add the interfaces at type creation
19656         time.
19657
19658 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19659
19660         * expression.cs: the dimension arguments to the array constructors
19661         need to be converted if they are a long.
19662
19663 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19664
19665         * class.cs: don't emit ldarg.0 if there is no parent constructor
19666         (fixes showstopper for corlib).
19667
19668 2002-06-29  Martin Baulig  <martin@gnome.org>
19669
19670         MCS now compiles corlib on GNU/Linux :-)
19671
19672         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19673         ie. check for MethodImplOptions.InternalCall.
19674
19675         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19676         and TypeManager.attribute_type are null, so we must explicitly check
19677         whether parent is not null to find out whether it's an attribute type.
19678         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19679         and SetBuilder, not only if the property is neither abstract nor external.
19680         This is necessary to set the MethodImplOptions on the accessor methods.
19681         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19682         SetBuilder, see Property.Emit().
19683
19684         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19685         populate "System.Object", "System.ValueType" and "System.Attribute" since
19686         they've already been populated from BootCorlib_PopulateCoreTypes().
19687
19688 2002-06-29  Martin Baulig  <martin@gnome.org>
19689
19690         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19691         is the NullLiteral, we also need to make sure that target_type is not
19692         an enum type.   
19693
19694 2002-06-29  Martin Baulig  <martin@gnome.org>
19695
19696         * rootcontext.cs (RootContext.ResolveCore): We must initialize
19697         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19698         before calling BootstrapCorlib_ResolveDelegate ().
19699
19700 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19701
19702         * statement.cs: fixed build-breaker. All tests passed ok.
19703
19704 2002-06-27  Martin Baulig  <martin@gnome.org>
19705
19706         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19707         for System.Decimal when compiling corlib.
19708
19709 2002-06-27  Martin Baulig  <martin@gnome.org>
19710
19711         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19712         switch blocks which contain nothing but a default clause.
19713
19714 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
19715
19716        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19717
19718 2002-06-27  Martin Baulig  <martin@gnome.org>
19719
19720         * ecore.cs (PropertyExpr.PropertyExpr): Call
19721         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19722
19723         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19724         is already a TypeBuilder.
19725
19726 2002-06-27  Martin Baulig  <martin@gnome.org>
19727
19728         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19729         `target_type == TypeManager.array_type', not IsAssignableFrom() in
19730         the "from an array-type to System.Array" case.  This makes it work
19731         when compiling corlib.
19732
19733 2002-06-27  Martin Baulig  <martin@gnome.org>
19734
19735         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19736         non-static PropertyExpr, set its InstanceExpression.  This makes
19737         the `ICollection.Count' property work in System/Array.cs.
19738
19739 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
19740
19741         * driver.cs: Made error handling more consistent.  Errors now
19742         tracked by Report class, so many methods which used to return int
19743         now return void.  Main() now prints success/failure and 
19744         errors/warnings message.
19745
19746         Renamed '--probe' compiler argument to '--expect-error'.  Removed
19747         the magic number return values (123 and 124).  Now, if the
19748         expected error occurs, the compiler exits with success (exit value
19749         0).  If the compilation completes without seeing that particular
19750         error, the compiler exits with failure (exit value 1).  The
19751         makefile in mcs/errors has been changed to handle the new behaviour.
19752
19753         * report.cs: Made 'expected error' number a property and renamed
19754         it from 'Probe' to 'ExpectedError'.
19755
19756         * genericparser.cs: Removed error handling support, since it is
19757         now all done by Report class.
19758
19759         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19760         class, so parse() no longer returns an int.
19761
19762         * namespace.cs: Use Report.Error instead of GenericParser.error
19763
19764 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
19765
19766         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19767         TypeContainer.AddOperator): At the front of the list put the
19768         explicit implementations, so they get resolved/defined first. 
19769
19770 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
19771
19772         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19773         interface type is implemented by this TypeContainer.  Used during
19774         explicit interface implementation.
19775
19776         (Property.Define, Indexer.Define, Method.Define): Validate that
19777         the given interface in the explicit implementation is one of the
19778         base classes for the containing type.
19779
19780         Also if we are explicitly implementing an interface, but there is
19781         no match in the pending implementation table, report an error.
19782
19783         (Property.Define): Only define the property if we are
19784         not explicitly implementing a property from an interface.  Use the
19785         correct name also for those properties (the same CSC uses,
19786         although that is really not needed).
19787
19788         (Property.Emit): Do not emit attributes for explicitly implemented
19789         properties, as there is no TypeBuilder.
19790
19791         (Indexer.Emit): ditto.
19792
19793         Hiding then means that we do not really *implement* a pending
19794         implementation, which makes code fail.
19795
19796 2002-06-22  Martin Baulig  <martin@gnome.org>
19797
19798         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19799         the return value of Object.GetType().  [FIXME: we need to do this whenever
19800         we get a type back from the reflection library].
19801
19802 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19803
19804         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19805
19806 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
19807
19808         * attribute.cs: Return null if we can not look up the type.
19809
19810         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19811         the interface types found.
19812
19813         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19814         interface types found.
19815
19816         * typemanager.cs (GetInterfaces): Make this routine returns alll
19817         the interfaces and work around the lame differences between
19818         System.Type and System.Reflection.Emit.TypeBuilder in the results
19819         result for GetInterfaces.
19820
19821         (ExpandInterfaces): Given an array of interface types, expand and
19822         eliminate repeated ocurrences of an interface.  This expands in
19823         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19824         be IA, IB, IC.
19825
19826 2002-06-21  Martin Baulig  <martin@gnome.org>
19827
19828         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19829         on System.Enum.
19830
19831 2002-06-21  Martin Baulig  <martin@gnome.org>
19832
19833         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
19834         and called with one of the core types, return the corresponding typebuilder for
19835         that type.
19836
19837         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19838         element type.
19839
19840 2002-06-21  Martin Baulig  <martin@gnome.org>
19841
19842         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19843         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19844         (Expression.ConvertReferenceExplicit): Likewise.
19845
19846         * expression.cs (ElementAccess.DoResolve): Likewise.
19847         (ElementAccess.DoResolveLValue): Likewise.
19848
19849 2002-06-10  Martin Baulig  <martin@gnome.org>
19850
19851         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19852         add the "value" parameter to the parameter list.
19853
19854         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19855         to our caller.
19856
19857 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
19858
19859         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19860         the argument to an int, uint, long or ulong, per the spec.  Also
19861         catch negative constants in array creation.
19862
19863 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19864
19865         * class.cs: do not allow the same interface to appear twice in
19866         the definition list.
19867
19868 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19869
19870         * ecore.cs: don't use ldlen with System.Array.
19871
19872 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19873
19874         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19875
19876 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19877
19878         * modifiers.cs: produce correct field attributes for protected
19879         internal. Easy fix so miguel can work on ther harder stuff:-)
19880
19881 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
19882
19883         * pending.cs: New file.  Move the code from class.cs here.
19884         Support clearning the pending flag for all methods (when not doing
19885         explicit interface implementation).
19886
19887 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19888
19889         * rootcontext.cs: added a couple more types needed to bootstrap.
19890
19891 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
19892
19893         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19894         constructor in the type, instead of any constructor in the type
19895         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
19896         a bug in the Mono runtime when applying the params attribute). 
19897
19898 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
19899         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19900
19901 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
19902
19903         * expression.cs (Unary.ResolveOperator): Use TypeManager
19904         to resolve the type.
19905
19906 2002-06-13  Ravi Pratap  <ravi@ximian.com>
19907
19908         * cs-parser.jay (enum_member_declaration): Pass in the attributes
19909         attached.
19910
19911         * enum.cs (AddEnumMember): Add support to store the attributes associated 
19912         with each member too.
19913
19914         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19915         field builders too - this takes care of the enum member case.
19916
19917 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
19918
19919         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19920         address-of operator on both value types and pointers.
19921
19922 2002-06-10  Martin Baulig  <martin@gnome.org>
19923
19924         * interface.cs (Interface.PopulateIndexer): Add the indexer's
19925         PropertyBuilder to the `property_builders' list.
19926
19927         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19928         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19929         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
19930         find any indexers which are inherited from an interface.
19931
19932 2002-06-09  Martin Baulig  <martin@gnome.org>
19933
19934         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19935         the same type as the constant if necessary.  There's also a test-130.cs
19936         for this.
19937
19938         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19939
19940         * typemanager.cs (TypeManager.ChangeType): Previously known as
19941         Enum.ChangeEnumType().
19942
19943 2002-06-09  Martin Baulig  <martin@gnome.org>
19944
19945         * expression.cs (Cast.TryReduce): Added support for consts.
19946
19947 2002-06-08  Ravi Pratap  <ravi@ximian.com>
19948
19949         * class.cs (Accessor): Hold attributes information so we can pass
19950         it along.
19951
19952         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19953         Modify to pass in attributes attached to the methods.
19954
19955         (add_accessor_declaration, remove_accessor_declaration): Ditto.
19956
19957         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19958         to handle the Accessor kind :-)
19959
19960         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19961
19962 2002-06-08  Martin Baulig  <martin@gnome.org>
19963
19964         * expression.cs (Unary.TryReduceNegative): Added support for
19965         ULongConstants.
19966
19967 2002-06-08  Martin Baulig  <martin@gnome.org>
19968
19969         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19970         name can't be found in the `defined_names' - the caller will do a
19971         MemberLookup in this case and thus find methods in System.Enum
19972         such as Enum.IsDefined().
19973
19974 2002-06-08  Martin Baulig  <martin@gnome.org>
19975
19976         * enum.cs (Enum.ChangeEnumType): This is a custom version of
19977         Convert.ChangeType() which works with TypeBuilder created types.
19978         (Enum.LookupEnumValue, Enum.Define): Use it here.
19979
19980         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19981         `TypeBuilder.BaseType != null' check.
19982         (TypeContainer.FindMembers): Only lookup parent members if we
19983         actually have a parent.
19984         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19985         (ConstructorInitializer.Resolve): Likewise.
19986
19987         * interface.cs (Interface.FindMembers): Added
19988         `TypeBuilder.BaseType != null' check.
19989
19990         * rootcontext.cs (RootContext.ResolveCore): Added
19991         "System.Runtime.CompilerServices.IndexerNameAttribute" to
19992         classes_second_stage.
19993
19994         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19995         debug_type and trace_type when compiling with --nostdlib.       
19996
19997 2002-06-07  Martin Baulig  <martin@gnome.org>
19998
19999         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
20000         (AddField): Set it to true when adding a non-static field.
20001         (DefineType): Use `have_nonstatic_fields' to find out whether we
20002         have non-static fields, not `Fields != null'.
20003
20004 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
20005
20006         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
20007         dereferencing a null on the static-field code path)
20008
20009 2002-05-30  Martin Baulig  <martin@gnome.org>
20010
20011         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
20012         to take command line arguments.  Use reflection to call the new
20013         custom `Initialize' function on the symbol writer and pass it the
20014         command line arguments.
20015
20016         * driver.cs (--debug-args): New command line argument to pass command
20017         line arguments to the symbol writer.
20018
20019 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
20020
20021         * assign.cs (DoResolve): Forgot to do the implicit conversion to
20022         the target type for indexers and properties.  Thanks to Joe for
20023         catching this.
20024
20025 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
20026
20027         * typemanager.cs (MethodFlags): returns the method flags
20028         (Obsolete/ShouldIgnore) that control warning emission and whether
20029         the invocation should be made, or ignored. 
20030
20031         * expression.cs (Invocation.Emit): Remove previous hack, we should
20032         not do this on matching a base type, we should do this based on an attribute
20033
20034         Only emit calls to System.Diagnostics.Debug and
20035         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
20036         on the command line.
20037
20038         * rootcontext.cs: Global settings for tracing and debugging.
20039
20040         * cs-tokenizer.cs (define): New utility function to track
20041         defines.   Set the global settings for TRACE and DEBUG if found.
20042
20043 2002-05-25  Ravi Pratap  <ravi@ximian.com>
20044
20045         * interface.cs (Populate*): Pass in the TypeContainer as well as
20046         the DeclSpace as parameters so that we can create EmitContexts and
20047         then use that to apply attributes etc.
20048
20049         (PopulateMethod, PopulateEvent, PopulateProperty)
20050         (PopulateIndexer): Apply attributes everywhere.
20051
20052         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
20053         etc.
20054
20055         (ApplyAttributes): Update accordingly.
20056
20057         We now apply interface attributes for all members too.
20058
20059 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
20060
20061         * class.cs (Indexer.Define); Correctly check if we are explicit
20062         implementation (instead of checking the Name for a ".", we
20063         directly look up if the InterfaceType was specified).
20064
20065         Delay the creation of the PropertyBuilder.
20066
20067         Only create the PropertyBuilder if we are not an explicit
20068         interface implementation.   This means that explicit interface
20069         implementation members do not participate in regular function
20070         lookups, and hence fixes another major ambiguity problem in
20071         overload resolution (that was the visible effect).
20072
20073         (DefineMethod): Return whether we are doing an interface
20074         implementation. 
20075
20076         * typemanager.cs: Temporary hack until we get attributes in
20077         interfaces (Ravi is working on that) and we get IndexerName
20078         support in interfaces.
20079
20080         * interface.cs: Register the indexers as properties.
20081
20082         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
20083         warning, I have verified that this is a bug in the .NET runtime
20084         (JavaScript suffers of the same problem).
20085
20086         * typemanager.cs (MemberLookup): When looking up members for
20087         interfaces, the parent of an interface is the implicit
20088         System.Object (so we succeed in searches of Object methods in an
20089         interface method invocation.  Example:  IEnumerable x;  x.ToString
20090         ()) 
20091
20092 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
20093
20094         * class.cs (Event): Events should also register if they do
20095         implement the methods that an interface requires.
20096
20097         * typemanager.cs (MemberLookup); use the new GetInterfaces
20098         method. 
20099
20100         (GetInterfaces): The code used to lookup interfaces for a type is
20101         used in more than one place, factor it here. 
20102
20103         * driver.cs: Track the errors at the bottom of the file, we kept
20104         on going.
20105
20106         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
20107         instance if the method we are calling is static!
20108
20109 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
20110
20111         * attribute.cs (ApplyAttributes): Make this function filter out
20112         the IndexerName attribute (as that attribute in reality is never
20113         applied) and return the string constant for the IndexerName
20114         attribute. 
20115
20116         * class.cs (TypeContainer.Emit): Validate that all the indexers
20117         have the same IndexerName attribute, and if so, set the
20118         DefaultName attribute on the class. 
20119
20120         * typemanager.cs: The return value might contain other stuff (not
20121         only methods).  For instance, consider a method with an "Item"
20122         property and an Item method.
20123
20124         * class.cs: If there is a problem with the parameter types,
20125         return. 
20126
20127 2002-05-24  Ravi Pratap  <ravi@ximian.com>
20128
20129         * ecore.cs (ImplicitConversionExists): Wrapper function which also
20130         looks at user defined conversion after making a call to 
20131         StandardConversionExists - we need this for overload resolution.
20132
20133         * expression.cs : Update accordingly the various method calls.
20134
20135         This fixes 2 bugs filed against implicit user defined conversions 
20136
20137 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
20138
20139         * statement.cs: Track the result of the assignment.
20140
20141 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
20142
20143         * expression.cs (MemberAccess): Improved error reporting for
20144         inaccessible members.
20145
20146 2002-05-22  Martin Baulig  <martin@gnome.org>
20147
20148         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
20149         itself with debugging support.
20150
20151 2002-05-22  Martin Baulig  <martin@gnome.org>
20152
20153         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
20154         Removed, this isn't needed anymore.
20155
20156 2002-05-20  Martin Baulig  <martin@gnome.org>
20157
20158         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
20159         be underlying type for an enum.
20160
20161 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
20162
20163         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
20164         that splits out the loading of just the core types.
20165
20166         * rootcontext.cs (ResolveCore): Split the struct resolution in
20167         two, so we can load the enumeration underlying types before any
20168         enums are used.
20169
20170         * expression.cs (Is): Bandaid until we fix properly Switch (see
20171         bug #24985 for details).
20172
20173         * typemanager.cs (ImplementsInterface): The hashtable will contain
20174         a null if there are no interfaces implemented.
20175
20176 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
20177
20178         * cs-parser.jay (indexer_declarator): It is fine to have array
20179         parameters
20180
20181 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
20182
20183         * typemanager.cs: (RegisterBuilder): New function used to register
20184         TypeBuilders that implement interfaces.  Since
20185         TypeBuilder.GetInterfaces (as usual) does not work with lame
20186         Reflection.Emit. 
20187         (AddUserType): register interfaces.
20188
20189         (ImplementsInterface): Use the builder_to_ifaces hash if we are
20190         dealing with TypeBuilder.  Also, arrays are showing up as
20191         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
20192         methods can not be invoked on them!
20193
20194         * ecore.cs (ExplicitReferenceConversionExists): Made public.
20195         (ImplicitReferenceConversionExists): Split out from
20196         StandardConversionExists. 
20197
20198         * expression.cs (As): We were only implementing one of the three
20199         cases for the as operator.  We now implement them all.
20200         (Is): Implement the various other cases for Is as well.
20201
20202         * typemanager.cs (CACHE): New define used to control if we want or
20203         not the FindMembers cache.  Seems to have a negative impact on
20204         performance currently
20205
20206         (MemberLookup): Nested types have full acess to
20207         enclosing type members
20208
20209         Remove code that coped with instance/static returns for events, we
20210         now catch this in RealFindMembers.
20211
20212         (RealFindMembers): only perform static lookup if the instance
20213         lookup did not return a type or an event.  
20214
20215 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
20216
20217         * assign.cs (CompoundAssign): We pass more semantic information
20218         now to Compound Assignments than we did before: now we have all
20219         the information at hand, and now we resolve the target *before* we
20220         do the expression expansion, which allows the "CacheValue" method
20221         to have the effect we intended (before, a [x] += 1 would generate
20222         two differen ArrayAccess expressions from the ElementAccess,
20223         during the resolution process).
20224
20225         (CompoundAssign.DoResolve): Resolve target and original_source here.
20226
20227 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
20228
20229         * expression.cs (ArrayAccess): dropped debugging information. 
20230
20231         * typemanager.cs: Small bug fix: I was always returning i_members,
20232         instead of one of i_members or s_members (depending on which had
20233         the content).
20234
20235         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
20236         method is invoked before any code generation takes place, and it
20237         is a mechanism to inform that the expression will be invoked more
20238         than once, and that the method should use temporary values to
20239         avoid having side effects
20240
20241         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
20242
20243         * ecore.cs (Expression.CacheTemporaries): Provide empty default
20244         implementation.
20245
20246         * expression.cs (Indirection, ArrayAccess): Add support for
20247         CacheTemporaries in these two bad boys. 
20248
20249         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
20250         ldobj or ldind_ref.  
20251         (StoreFromPtr): Handle stobj as well.
20252
20253         * expression.cs (UnaryMutator): Share more code.
20254
20255         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
20256         down: I was not tracking the Filter function as well, which
20257         was affecting the results of the cache.
20258
20259 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
20260
20261         * attribute.cs: Remove the hack to handle the CharSet property on
20262         StructLayouts. 
20263
20264 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
20265
20266         * attribute.cs (DoResolve): More uglyness, we now only try to
20267         resolve the attribute partially, to extract the CharSet
20268         information (only if we are a StructLayout attribute).  Otherwise 
20269
20270         (GetExtraTypeInfo): Add some code to conditionally kill in the
20271         future this.   I am more and more convinced that the .NET
20272         framework has special code to handle the attribute setting on
20273         certain elements.
20274
20275         * expression.cs (IsParamsMethodApplicable): Revert my previous
20276         foreach change here, it was wrong.
20277
20278 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
20279
20280         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
20281         (pp_expr): do not abort on unknown input, just return.
20282         (eval): abort if there are pending chars.
20283
20284         * attribute.cs (Attribute.Resolve): Positional parameters are
20285         optional.  Deal with that case.
20286
20287         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
20288         the Ansi/Unicode/Auto information for the type.
20289
20290         (TypeContainer.DefineType): instantiate the EmitContext here, as
20291         we will be using it during the type definition (to resolve
20292         attributes) and during the emit phase.
20293
20294         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
20295         to pull type information out of the attributes
20296
20297         (Attribute.Resolve): track the constructor builder, and allow for
20298         multiple invocations (structs and classes will use this).
20299
20300         * ecore.cs (MemberLookupFinal): new version with all the
20301         parameters customizable.
20302
20303         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
20304         constructors.  Return if the result value is null (as the error
20305         would have been flagged already by MemberLookupFinal)
20306
20307         Do not allow instances of abstract classes or interfaces to be
20308         created.
20309
20310         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
20311         We have to compare the assembly property here when dealing with
20312         FamANDAssem and Assembly access modifiers, because we might be
20313         creating an assembly from *modules* (that means that we are not
20314         getting TypeBuilders for types defined in other modules that are
20315         part of this assembly).
20316
20317         (Method.Emit): If the method is marked abstract and has a body,
20318         emit an error. 
20319
20320         (TypeContainer.DefineMembers): If both the defined member and the
20321         parent name match are methods, then do not emit any warnings: let
20322         the Method.Define routine take care of flagging warnings.  But if
20323         there is a mismatch (method overrides something else, or method is
20324         overriwritten by something, then emit warning).
20325
20326         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
20327         set to null, this means `do not check for the return type on the
20328         signature'. 
20329
20330         (Method.Define): set the return type for the method signature to
20331         null, so that we get methods with the same name and parameters and
20332         different return types.  This is used to flag warning 114 (you are
20333         hiding a method, and you probably want to use the new/override
20334         keywords instead).
20335
20336         * typemanager.cs (MemberLookup): Implemented proper access
20337         control, closing a long standing set of bug reports.  The problem
20338         was that the Framework only has two bits: Public and NonPublic,
20339         and NonPublic includes private and protected methods, but we need
20340         to enforce the FamANDAssem, FamOrAssem and Family. 
20341
20342 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
20343
20344         * statement.cs (GotoCase): Return true: Ammounts to giving up
20345         knowledge on whether we return or not, and letting the other case
20346         be responsible for it.
20347
20348 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
20349
20350         * driver.cs: Do not load directories for each file processed, only
20351         do it if there is a pattern.
20352
20353         * ecore.cs: Report readonly assigns here as well, as we might have
20354         been resolved only by MemberAccess.
20355
20356         (SimpleName.SimpleNameResolve): Also be useful for LValue
20357         resolution.   We need this to propagate assign to local readonly variables
20358
20359         * typemanager.cs: Use a ptrhashtable for the criteria, because we
20360         do not want to reuse potential criteria memory.
20361
20362         * class.cs (MyEventBuilder): Set reflected_type;
20363
20364         * ecore.cs (Constantify): Added support for constifying bools.
20365
20366         (RootContext.LookupType): Added a cache for values looked up in
20367         the declaration space.
20368
20369         * typemanager.cs (FindMembers): Now is a front-end to
20370         RealFindMembers, and provides a two-level hashtable-based cache to
20371         the request.  
20372
20373         15% performance improvement: from 22.5 to 19.2 seconds.
20374
20375         * expression.cs (IsParamsMethodApplicable): use foreach.
20376         (Invocation.DoResolve): ditto.
20377         (New.DoResolve): ditto.
20378         (ArrayCreation.DoResolve): ditto.
20379
20380         * ecore.cs (FindMostEncompassingType): use foreach.
20381
20382         * delegate.cs (NewDelegate.DoResolve): Use foreach
20383
20384         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
20385         (RemoveMethods): use foreach.
20386
20387         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
20388         nested foreach statements instead of for, and also break out of
20389         the inner loop once a match is found.
20390
20391         (Invocation.OverloadResolve): Use foreach, simplify the code. 
20392
20393 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
20394
20395         * cfold.cs (BinaryFold): During an enumeration evaluation context,
20396         we actually unwrap the expression to allow for extra information
20397         to be extracted. 
20398
20399         * expression.cs: Use Shr_Un on unsigned operations. 
20400
20401 2002-05-08  Ravi Pratap  <ravi@ximian.com>
20402
20403         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
20404         applicable operators was not being considered correctly. This closes
20405         the bug Miguel reported.
20406
20407 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
20408
20409         * attribute.cs: check that the type derives from System.Attribute
20410         and report the correct error in that case (moved the duplicate code to
20411         its own method, too).
20412
20413 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
20414
20415         * attribute.cs: lookup attribute type name as the spec says: first the
20416         bare attribute name and then name + "Attribute" (nant compiles with
20417         mcs after this fix).
20418
20419 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
20420
20421         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
20422         Because of the way we parse things, we should try to see if a
20423         UIntConstant can fit in an integer.
20424
20425 2002-05-07  Ravi Pratap  <ravi@ximian.com>
20426
20427         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
20428         when we are in an explicit context.
20429
20430         (ConvertReferenceExplicit): When converting from Iface type S to Class
20431         T make sure the rules are implemented as an OR.
20432
20433         * parameter.cs (ParameterType): Make it a property for now although the
20434         purpose really isn't anything immediate.
20435
20436         * expression.cs (Is*Applicable): Do better checking on the parameter type
20437         of a ref/out parameter. The ones from the system assemblies are already 
20438         marked with the correct type so we don't need to do any correction.
20439
20440         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
20441         the object type is standard too so include that.
20442
20443 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20444
20445         * ecore.cs (StandardConversionExists): Augment with missing code:
20446         deal with IntConstant, LongConstants and Enumerations.
20447
20448         * assign.cs: Report the error, instead of failing silently
20449
20450         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
20451         typecontainer that they are declared, because the
20452         typecontainer/namespace will have the list of using clauses that
20453         need to be applied.
20454
20455         Assembly Attributes were escaping the normal registration
20456         mechanism. 
20457
20458         (EmitCode): Apply attributes within an EmitContext that represents
20459         the container they were declared on.
20460
20461         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
20462
20463 2002-05-06  Ravi Pratap  <ravi@ximian.com>
20464
20465         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
20466         Revamp completely - make much cleaner as we now operate only
20467         on a set of Types.
20468
20469         (FindMostSpecificSource, FindMostSpecificTarget): New methods
20470         to implement the logic detailed in the spec more correctly.
20471
20472         (UserDefinedConversion): Update accordingly.
20473
20474 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20475
20476         * statement.cs: Return flow analysis information up.
20477
20478         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
20479         and the default.
20480
20481         (token): Do not consume an extra character before calling
20482         decimal_digits.
20483
20484 2002-05-06  Piers Haken <piersh@friskit.com>
20485
20486         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
20487
20488 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20489
20490         * class.cs (Constructor.Emit): Set the IsStatic flag in the
20491         EmitContext during the instance constructor initializer
20492         resolution, to stop access to instance variables.
20493
20494         This is mandated by the spec, last paragraph of the `constructor
20495         initializers' section. 
20496
20497 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
20498
20499         * cs-parser.jay, class.cs (Accessor): new class used to represent
20500         an accessor (get or set).  In the past we used `null' to represent
20501         a missing accessor.  But this is ambiguous because there was no
20502         way to tell in abstract indexers/properties if one of them was
20503         specified.
20504
20505         Now there is a way of addressing that.
20506
20507         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
20508         instead of FindMembers.
20509
20510         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
20511         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
20512
20513         * attribute.cs: Treat indexers and properties as the same in terms
20514         of applying attributes
20515
20516         * ecore.cs (FindMostEncompassedType): Use statically initialized
20517         EmptyExpressions()s like we do elsewhere to avoid creating useless
20518         objects (and we take this out of the tight loop).
20519
20520         (GetConversionOperators): Move the code to extract the actual
20521         operators to a separate routine to clean things up.
20522
20523 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
20524
20525         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
20526         events are always registered FieldBuilders.
20527
20528         * class.cs (FieldBase): New class shared by Fields 
20529
20530         * delegate.cs: If we are a toplevel delegate, use our full name.
20531         If we are a nested delegate, then only use our tail name.
20532
20533 2002-05-02  Ravi Pratap  <ravi@ximian.com>
20534
20535         * expression.cs (IsApplicable): Ensure that we add the "&" to
20536         ref/out types before comparing it with the type of the argument.
20537
20538         (IsParamsMethodApplicable): Ditto.
20539
20540         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
20541         silly me ;-)
20542
20543         * delegate.cs : Handle the case when we have more than one applicable
20544         method. Flag an error only when we finish checking all.
20545
20546 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
20547
20548         * expression.cs: Add support for boolean static initializers.
20549
20550 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
20551
20552         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
20553
20554         * parameter.cs (ComputeParameterTypes,
20555         ComputeAndDefineParameterTypes): Better error handling: now we
20556         clear the `types' cache if we fail during any of the type lookups.
20557         We also return the status code correctly to our caller
20558
20559         * delegate.cs: If we fail to define a delegate, abort the extra
20560         steps. 
20561
20562         * expression.cs (Binary.ResolveOperator): for
20563         operator==(object,object) and operator !=(object, object) we also
20564         have to verify that there is an implicit conversion from one to
20565         the other.
20566
20567         (ArrayAccess.DoResolve): Array Access can operate on
20568         non-variables. 
20569
20570 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
20571
20572         * assign.cs (CompoundAssign): A new class used as a "flag" that
20573         the assignment actually is happening as part of a compound
20574         assignment operator.
20575
20576         During compound assignment, a few new rules exist to enable things
20577         like:
20578
20579         byte b |= 1 + 2
20580
20581         From the spec:
20582
20583         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
20584         to the type of x) if y is implicitly convertible to the type of x,
20585         and the operator is a builtin operator and the return type of the
20586         operator is explicitly convertible to the type of x. 
20587
20588         * rootcontext.cs: Reset warning level to 2.  4 catches various
20589         "interesting" features in mcs, we must clean this up at some
20590         point, but currently am trying to kill other bugs ;-)
20591
20592         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
20593         in container classes as well.  
20594
20595         * expression.cs (Binary.ResolveOperator): Handle string case
20596         before anything else (as operator overloading does emit an error
20597         before doing anything else).
20598
20599         This code could go away when we move to a table driven model, but
20600         i could not come up with a good plan last night.
20601
20602 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
20603
20604         * typemanager.cs (CSharpName): reimplementation using regex.
20605         * class.cs: added null check for fields in Emit
20606         * rootcontext.cs: set warninglevel to 4
20607
20608 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
20609
20610         * typemanager.cs (CSharpName): reimplemented with Lupus
20611         suggestion.
20612
20613 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
20614
20615         * statement.cs (If): correclty implement Resolve, because we were
20616         not catching sem errors in there.  The same process is needed
20617         everywhere else. 
20618         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
20619
20620
20621         (Statement.Warning_DeadCodeFound): Factorize code.
20622         (While): Report dead code here too.
20623
20624         (Statement): Added Resolve virtual method to allow
20625         for resolution split from the emit code.
20626
20627 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20628
20629         * statement.cs (EmitBoolExpression): No longer try to resolve the
20630         expression here.    
20631         (MakeBoolean): New utility function that resolve, implicitly
20632         converts to boolean and tags the expression. 
20633
20634
20635         (If, Do): Implement dead code elimination.
20636         (While): Implement loop inversion
20637
20638         (Do, While, For, If): Resolve the expression prior to calling our
20639         code generation.
20640
20641 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
20642
20643         * class.cs:
20644           - added method Report28 (warning: program has more than one entry point)
20645           - added method IsEntryPoint, implements paragraph 10.1 of the spec
20646           - modified method Method.Define, the part at the end of the method
20647
20648         * rootcontext.cs: added static public Location EntryPointLocation;
20649           
20650         * ../errors/cs0028.cs : Add test case for the above warning.              
20651
20652         * typemanager.cs:
20653           - modified method CSharpName to allow arrays of primitive type to
20654             be printed nicely (e.g. instead of System.Int32[][] it now prints
20655             int[][])
20656           - added method CSharpSignature: returns the signature of a method
20657             in string format to be used in reporting errors, warnings, etc.
20658
20659         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20660         with String.Empty.
20661
20662 2002-04-26  Ravi Pratap  <ravi@ximian.com>
20663
20664         * delegate.cs (Define): Fix extremely silly bug where I was
20665         setting the type of the 'object' parameter of the BeginInvoke
20666         method to System.IAsyncResult instead of System.Object ;-)
20667
20668 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20669
20670         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20671         here. 
20672
20673         (Constructor.Emit): return if we fail to initialize the
20674         constructor.  Another door closed!  
20675
20676         * expression.cs (New.DoResolve): Improve error message (from -6 to
20677         1501).  Use DeclaredOnly lookup to find the exact constructor.
20678
20679         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20680         loop.  This is useful.
20681
20682         * cs-parser.jay: Adjust the default parameters so that destructors
20683         have the proper signature.
20684
20685 2002-04-26  Martin Baulig  <martin@gnome.org>
20686
20687         * driver.cs (LoadAssembly): If `assembly' contains any characters
20688         which are only valid in path names and not in assembly names
20689         (currently slash, backslash and point), use Assembly.LoadFrom ()
20690         instead of Assembly.Load () on the `assembly' (before iteration
20691         over the link_paths).
20692
20693 2002-04-26  Martin Baulig  <martin@gnome.org>
20694
20695         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20696
20697 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
20698
20699         * class.cs (Property): use the new typemanager.MemberLookup
20700
20701         (TypeContainer.MemberLookup): Implement using the
20702         TypeManager.MemberLookup now. 
20703
20704         * typemanager.cs: Make MemberLookup a function of the TypeManager,
20705         and return MemberInfos, so that these can be used without an
20706         EmitContext (what we had before).
20707
20708 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
20709
20710         * expression.cs: Fix the case where the argument to params if the
20711         type of the params.  I omitted handling this before.   Fixed
20712
20713 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20714
20715         * driver.cs: Call BootCorlib_PopulateCoreType
20716
20717         * class.cs (Property.CheckBase): Check for properties only, not
20718         for all members. 
20719
20720         * interface.cs: Temporary hack: try/catch around the
20721         CustomAttributeBuilder, because I am getting an exception that I
20722         do not understand.
20723
20724         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20725         types whose definitions are required to be there (attributes are
20726         defined before standard types).
20727
20728         Compute definitions as we boot the various types, as they are used
20729         immediately (value_type class will need object_type, but if we do
20730         not initialize object_type, we will pass a null, which will let
20731         the runtime pick the System.Object from the existing corlib, which
20732         is not what we want).
20733
20734 2002-04-22  Patrik Torstensson <totte@labs2.com>
20735
20736         * cs-tokenizer.cs: fixed a number of trim() issues.
20737
20738 2002-04-22  Ravi Pratap  <ravi@ximian.com>
20739
20740         * expression.cs (Argument.Type): Ensure that we return the correct
20741         type when we have out or ref parameters [in which case we 
20742         append a "&"].
20743
20744 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20745
20746         * class.cs (Property, Indexer): Allow extern modifier in there. 
20747
20748         * typemanager.cs (InitBaseTypes): Initializes object_type and
20749         value_type, since those will be used early on during the bootstrap
20750         process to compile corlib.
20751
20752         (InitCoreTypes): Move code from here to InitBaseTypes.
20753
20754 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
20755
20756         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20757         single-dimension arrays as using the ldlen opcode.  
20758
20759         Daniel Lewis discovered this optimization.  
20760
20761         * typemanager.cs: Add signature for System.Array::get_Length
20762
20763 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20764
20765         * statement.cs: report the error when the foreach does not apply to an
20766         array nor a collection.
20767
20768 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
20769
20770         * expression.cs: Add implicit conversions to the operator ~.
20771
20772         * constant.cs (DecimalConstant.Emit): Emit decimal value.
20773
20774         * typemanager.cs: Locate the decimal constructor.
20775
20776 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20777
20778         * attribute.cs: use the new property of TypeOf.
20779         * expression.cs: added 'get' property around typearg.
20780
20781         These changes fix a build breaker reported by NickD. Is this the
20782         correct way to fix?  If not, please, revert my changes and make it
20783         work :-).
20784
20785 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
20786
20787         * attribute.cs: Add support for typeof in attribute invocations.
20788         I am not sure that this is right though.
20789
20790 2002-04-14  Duncan Mak  <duncan@ximian.com>
20791
20792         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20793         Binary.Operator.Division case.
20794
20795 2002-04-13  Ravi Pratap  <ravi@ximian.com>
20796
20797         * class.cs (DefineType): Ensure that we do a proper check on
20798         attribute types and also register it with the TypeManager.
20799
20800         (TypeContainer.Targets): The default for attribute types is
20801         AttributeTargets.All.
20802
20803         * attribute.cs (ApplyAttributes): Registering the attribute type
20804         is done elsewhere, not when we discover we have a Usage attribute.
20805
20806 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20807
20808         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20809         and get rid of is_delegate parameter.
20810
20811         * everywhere : update.
20812
20813 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20814
20815         * cs-parser.jay (compilation_unit): Revamp completely to use
20816         some new ideas that I got from Rhys' grammar to solve the problems
20817         with assembly level attributes.
20818
20819         (outer_declaration): New grammar production.
20820
20821         (attribute_sections): Add.
20822
20823         (opt_attributes): Base on attribute_sections
20824
20825         (namespace_declaration): Allow opt_attributes to tackle the case
20826         when we have assembly level attributes - we are clever in this
20827         regard now ;-)
20828
20829         * attribute.cs (ApplyAttributes): Do not worry about assembly 
20830         attributes in the non-global context.
20831
20832         * rootcontext.cs (AddGlobalAttributes): Go back to using this
20833         instead of SetGlobalAttributes.
20834
20835         * class.cs, rootcontext.cs : Ensure we define and generate 
20836         attribute types before anything else.
20837
20838         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20839         and flag the new error -20 for the case when the attribute type
20840         does not have valid targets specified. csc does not catch this.
20841
20842         * ../errors/errors.txt : update for error # -20
20843
20844 2002-04-11  Ravi Pratap  <ravi@ximian.com>
20845
20846         * support.cs (InternalParameters.ParameterModifier): Do some null
20847         checking and return sane values.
20848
20849         * class.cs (Method.Define): If we are a PInvoke method, ensure
20850         that we are static and extern. Report error # 601
20851
20852         * ../errors/cs0601.cs : Add test case for the above error.
20853
20854 2002-04-07  Ravi Pratap  <ravi@ximian.com>
20855
20856         * rootcontext.cs (attribute_types): We need to keep type of
20857         all attribute types separately and emit code for them first.
20858
20859         (RegisterAttribute) : Implement.
20860
20861         * class.cs (DefineType): Check if the current Type is a custom
20862         attribute type and register it accordingly.
20863
20864         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20865         adding the first attribute twice and rename to
20866
20867         (SetGlobalAttributes): this.
20868
20869         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20870         lookups.
20871
20872         * attribute.cs (ApplyAttributes): Take an additional argument telling us
20873         if we are processing global arguments. Hmm, I am unsure of this.
20874
20875 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20876
20877         * expression.cs: added static array of strings to avoid calling
20878         Enum.ToString () for Operator in Binary. Significant recover of
20879         performance.
20880
20881 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
20882
20883         * class.cs (FindMembers): Allow the Builders of the various
20884         members to be null.  If they are skip them.  This only happens
20885         during the PInvoke declaration.
20886
20887 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
20888
20889         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20890         failure, so we do not keep going afterwards.
20891
20892         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20893         wanted to pass `false' as the `is_delegate' argument.  If this is
20894         the case, why not use delegate_type == null to mean `is_delegate =
20895         false' and anything else as is_delegate = true.
20896
20897 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
20898
20899         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20900         code for the section, not the beginning of the tests.
20901
20902 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
20903
20904         * cfold.cs: Handle operator + (Enum x, Underlying x) 
20905
20906         * expression.cs (Binary): same.  Warn about errors where we have
20907         Enum/Enum in operator + as well.
20908
20909 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
20910
20911         * statement.cs:
20912                 - added support for switch(bool)
20913                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20914                 - add TableSwitchEmit() to handle table-based switch statements
20915
20916 2002-04-05  Ravi Pratap  <ravi@ximian.com>
20917
20918         * expression.cs (Invocation.OverloadResolve): Factor out code which
20919         does parameter compatibility checking with arguments so that we can 
20920         re-use the code even from Delegate.VerifyApplicability
20921
20922         (VerifyArgumentsCompat): Move above code here.
20923
20924         * delegate.cs (VerifyApplicability): Get rid of duplicate code
20925         and instead make a call to the above method.
20926
20927 2002-03-31  Ravi Pratap  <ravi@ximian.com>
20928
20929         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20930         We use it to keep track of classes which are attribute types.
20931
20932 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
20933
20934         * delegate.cs (Delegate.Define): Correctly define the types in the
20935         presence of fixed and array parameters.
20936
20937         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20938         doing FindMembers.
20939
20940         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20941         include NonPublic after the first iteration.
20942
20943         * class.cs (Indexer.CheckBase): Only check if both parents are
20944         non-null. 
20945
20946         * cs-parser.jay (accessor_body): If empty, set to null.
20947
20948         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20949         same code path here to resolve constants names that we did have in
20950         MemberAccess.DoResolve.  There is too much code duplicated here.
20951
20952 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
20953
20954         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20955
20956         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20957         to MakeUnionSet.
20958
20959         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20960         tokens, numbers and strings.
20961
20962         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20963         parenthesis.
20964
20965         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20966         asyncronous parameters and the regular parameters.  
20967
20968         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20969         specify the target directory.
20970
20971         * expression.cs: (This.DoResolve): Simplify
20972         (As.Emit): Optimize, do not generate IsInst if the expression is
20973         always of the given type.
20974
20975         (Is.DoResolve): Bug fix, we were reporting both always/never for
20976         the is expression.
20977
20978         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20979         creating too many unnecessary arrays.
20980
20981 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
20982
20983         * class.cs (EmitFieldInitializer): Use Assign expression to assign
20984         fields instead of rolling our own initializer.   Takes care of all
20985         implicit conversions, and drops unnecessary static checks/argument.
20986
20987 2002-03-31  Dick Porter  <dick@ximian.com>
20988
20989         * driver.cs: use the GetDirectories() return values properly, and
20990         use "/" as path separator.
20991
20992 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
20993
20994         * expression.cs (Unary): Optimize - - expr into expr.
20995         (Binary): Optimize a + (-b) into a -b.
20996
20997         * codegen.cs (CodeGen): Made all methods static.
20998
20999 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
21000
21001         * rootcontext.cs: 
21002
21003         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
21004         TypeBuilder property.
21005
21006         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
21007         instead. 
21008
21009         * tree.cs: Removed the various RecordXXXX, and replaced with a
21010         single RecordDecl.  Removed all the accessor methods, and just
21011         left a single access point Type 
21012
21013         * enum.cs: Rename DefineEnum to DefineType.
21014
21015         * decl.cs: New abstract method `DefineType' used to unify the
21016         Defines for Enumerations, Interfaces, TypeContainers and
21017         Delegates.
21018
21019         (FindType): Moved LookupInterfaceOrClass here.  Moved the
21020         LookupBaseClasses method that used to live in class.cs and
21021         interface.cs here, and renamed to FindType.
21022
21023         * delegate.cs: Implement DefineType.  Take advantage of the
21024         refactored pattern for locating the parent builder without taking
21025         the parent_builder argument (which we know does not work if we are
21026         nested, and triggering a toplevel definition).
21027
21028 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
21029
21030         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
21031         accessibility of a member has changed during override and report
21032         an error if so.
21033
21034         * class.cs (Method.Define, Property.Define): Only complain on
21035         overrides if the method is private, any other accessibility is
21036         fine (and since we just checked the permission is the same, we are
21037         good to go).
21038
21039         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
21040         and elif are processed always.  The other pre-processing
21041         directives are only processed if we are "taking" the path
21042
21043 2002-03-29  Martin Baulig  <martin@gnome.org>
21044
21045         * class.cs (Method.Emit): Only emit symbolic debugging info if the
21046         current location is not Null.
21047
21048         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
21049         a separate method so we can profile it.
21050
21051         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
21052         `span.Seconds' are just seconds, but no minutes or hours.
21053         (MainDriver): Profile the CodeGen.SaveSymbols calls.
21054
21055 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
21056
21057         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
21058         Remove the gratuitous set of Final:
21059
21060                                 // If an interface implementation, then we can set Final.
21061                                 if (((flags & MethodAttributes.Abstract) == 0) &&
21062                                     implementing.DeclaringType.IsInterface)
21063                                         flags |= MethodAttributes.Final;
21064
21065         I do not know what I was smoking when I used that.
21066
21067
21068         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
21069         step into fixing the name resolution issues for delegates and
21070         unifying the toplevel name resolution.
21071
21072 2002-03-28  Martin Baulig  <martin@gnome.org>
21073
21074         * class.cs (Method.Emit): If we have a symbol writer, call its
21075         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
21076         tell it about the current method.
21077
21078         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
21079         writer that we're going to emit the first byte of IL code for a new
21080         statement (a new source line).
21081         (EmitContext.EmitTopBlock): If we have a symbol writer, call
21082         EmitContext.Mark() before emitting any code.
21083
21084         * location.cs (SymbolDocument): Return null when we're Null.
21085
21086         * statement.cs (Statement): Moved the `Location loc' variable here.
21087         (Statement.EmitBoolExpression): If we have a symbol writer, call
21088         ec.Mark() before emitting any code to tell it that we're at the
21089         beginning of a new statement.
21090         (StatementExpression): Added `Location' argument to the constructor.
21091         (Block): Added public readonly variable `StartLocation' and public
21092         variable `EndLocation'.  The latter is to be set using SetEndLocation().
21093         (Block): Added constructor which takes a start and end location.
21094         (Block.SetEndLocation): New method. This sets the end location.
21095         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
21096         local variables we create.
21097         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
21098         each statement and do also mark the begin and end of the block.
21099
21100         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
21101         tell it the current lexer.Location, use Location.Null for the end of the
21102         block.
21103         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
21104         current block, set its end location using SetEndLocation().
21105         (statement_expression): StatementExpression constructor now takes the
21106         lexer.Location as additional argument.
21107         (for_statement, declare_local_variables): Likewise.
21108         (declare_local_variables): When creating a new implicit block, use the
21109         new Block constructor and pass it the lexer.Location.
21110
21111 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
21112
21113         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
21114         members also on the parent interfaces recursively.
21115
21116 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
21117
21118         * report.cs: Use new formats, since Gonzalo finished the missing
21119         bits. 
21120
21121         * expression.cs (Binary.ResolveOperator): added missing operator|
21122         operator& and operator^ for bool/bool.
21123
21124         * cs-parser.jay: CheckDef now takes a Location argument that is
21125         used to report errors more precisly (instead of reporting the end
21126         of a definition, we try to track something which is a lot closer
21127         to the source of the problem).
21128
21129         * cs-tokenizer.cs: Track global token use, so we can properly flag
21130         the use of #define/#undef after the first token has been seen.
21131
21132         Also, rename the reportXXXX to Error_DescriptiveName
21133
21134         * decl.cs (DeclSpace.IsTopLevel): Move property here from
21135         TypeContainer, so that Enum and Interface can use this too.
21136
21137         * class.cs (TypeContainer.LookupInterfaceOrClass,
21138         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
21139         `builder' argument.  Typically this was used to pass the parent
21140         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
21141         the definition).  
21142
21143         The problem is that a nested class could trigger the definition of
21144         a toplevel class, and the builder would be obviously wrong in that
21145         case. 
21146
21147         So we drop this argument, and we compute dynamically the
21148         TypeBuilder/ModuleBuilder (the correct information was available
21149         to us anyways from DeclSpace.Parent)
21150
21151         * interface.cs (Interface.DefineInterface): Drop builder
21152         parameter cleanup like class.cs
21153
21154         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
21155         like class.cs
21156
21157         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
21158         values. 
21159
21160         (Try.Emit): Propagate the returns value from the statement.
21161
21162         (Return.Emit): Even if we are leavning 
21163
21164         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
21165
21166         * modifiers.cs: Fix the computation of MethodAttributes flags.
21167
21168 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
21169
21170         * driver.cs: allow compilation of files that start with '/'.
21171         Add a default case when checking the argument of --target.
21172
21173 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
21174
21175         * interface.cs: Implement the same search algorithm for types in
21176         the interface code.
21177
21178         * delegate.cs: Do not allow multiple definition.
21179
21180         * Recovered ChangeLog that got accidentally amputated
21181
21182         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
21183
21184         * rootcontext.cs: Load manually enum to allow core classes to
21185         contain enumerations.
21186
21187         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
21188         Update to new static methods in TypeManager.
21189
21190         * typemanager.cs (GetMethod, GetConstructor): Use our
21191         implementation of FindMembers to find the members, since during
21192         corlib compilation, the types are TypeBuilders and GetMethod and
21193         GetConstructor do not work.
21194
21195         Make all methods in TypeManager static.
21196
21197         (InitCodeHelpers): Split the functionality from
21198         the InitCodeTypes function.
21199
21200         * driver.cs: Call InitCodeHelpers after we have populated the
21201         types. 
21202
21203         * cs-parser.jay (delegate_declaration): we did not used to compute
21204         the delegate name correctly for void delegates.
21205
21206 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
21207
21208         * rootcontext.cs (RootContext): Init the interface_resolve_order
21209         and type_container_resolve_order always.
21210
21211         (ResolveCore, BootstrapCorlib_ResolveClass,
21212         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
21213         compiler when compiling with --nostdlib
21214
21215         * class.cs (TypeContainer.DefineType): Check that our parent is
21216         not null.  This test is most important when we are bootstraping
21217         the core types.
21218
21219         * codegen.cs: Split out the symbol writing code.
21220
21221 2002-03-25  Martin Baulig  <martin@gnome.org>
21222
21223         * driver.cs (-g): Made -g an alias for --debug.
21224
21225 2002-03-24  Martin Baulig  <martin@gnome.org>
21226
21227         * codegen.cs (SymbolWriter): New public variable. Returns the
21228         current symbol writer.
21229         (CodeGen): Added `bool want_debugging_support' argument to the
21230          constructor. If true, tell the ModuleBuild that we want debugging
21231         support and ask it for the ISymbolWriter.
21232         (Save): If we have a symbol writer, call it's Close() method after
21233         saving the assembly.
21234
21235         * driver.c (--debug): New command line argument to create a
21236         debugger information file.
21237
21238         * location.cs (SymbolDocument): New public property. Returns an
21239         ISymbolDocumentWriter object for the current source file or null
21240         if we don't have a symbol writer.
21241
21242 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
21243
21244         * driver.cs (LoadAssembly): Correctly return when all the paths
21245         have been tried and not before.
21246
21247         * statement.cs (Switch.Emit): return the actual coverage for this
21248         statement (returns/not-returns)
21249
21250         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
21251         switch of the statement if we are the last switch section.  That
21252         kills two problems: try/catch problems (we used to emit an empty
21253         nop at the end) and switch statements where all branches would
21254         return. 
21255
21256 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
21257
21258         * driver.cs: Add default assemblies (the equivalent to the
21259         Microsoft CSC.RSP file)
21260
21261         * cs-tokenizer.cs: When updating `cols and setting it to zero,
21262         also update tokens_seen and set it to false.
21263
21264         * driver.cs: Implement --recurse for Mike.
21265
21266         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
21267         correctly splitting out the paths.
21268
21269 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
21270
21271         * interface.cs (Interface.PopulateProperty): Instead of using
21272         `parent' as the declaration space for the set parameters, use
21273         `this' 
21274
21275         * support.cs (InternalParameters): InternalParameters constructor
21276         takes a DeclSpace instead of a TypeContainer.
21277
21278         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
21279         types are being initialized, load the address of it before calling
21280         the function.  
21281
21282         (New): Provide a mechanism to disable the generation of local
21283         value type temporaries when the caller will be providing us with
21284         an address to store it.
21285
21286         (ArrayCreation.EmitDynamicInitializers): Use it.
21287
21288 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
21289
21290         * expression.cs (Invocation.EmitArguments): Only probe for array
21291         property if there is more than one argument.  Sorry about that.
21292
21293         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
21294         empty param arrays.
21295
21296         * class.cs (Method.LabelParameters): Fix incorrect code path that
21297         prevented the `ParamArrayAttribute' from being applied to the
21298         params attribute.
21299
21300 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
21301
21302         * support.cs (ReflectionParameters): Correctly compute whether the
21303         last argument is a params array.  Fixes the problem with
21304         string.Split ('a')
21305
21306         * typemanager.cs: Make the assemblies array always be non-null
21307         (empty, but non-null)
21308
21309         * tree.cs (RecordDecl): New function that abstracts the recording
21310         of names.  This reports error 101, and provides a pointer to the
21311         previous declaration.  Fixes a crash in the compiler.
21312
21313         * cs-parser.jay (constructor_declaration): Update to new grammar,
21314         and provide a constructor_body that can be empty.
21315
21316 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
21317
21318         * driver.cs: Add support for --resources.
21319
21320         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
21321         Make all types for the various array helper methods be integer.
21322
21323         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
21324         CheckState to ConvCast.
21325
21326         (ConvCast): Now it takes a `checked' state argument, to avoid
21327         depending on the emit context for the conversion, and just using
21328         the resolve time setting.
21329
21330         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
21331         instead of Invocation.EmitArguments.  We do not emit the original
21332         arguments, instead we emit those which have been converted to
21333         unsigned int expressions.
21334
21335         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
21336
21337         * codegen.cs: ditto.
21338
21339         * expression.cs (LocalVariableReference): Drop the use of the
21340         Store function that depended on the variable index.
21341
21342         * statement.cs (VariableInfo): Drop the `Idx' property from this
21343         class, as this is not taking into account the indexes for
21344         temporaries tat we generate during the execution, getting the
21345         indexes wrong.
21346
21347         * class.cs: First emit class initializers, then call the parent
21348         constructor. 
21349
21350         * expression.cs (Binary): Fix opcode emision.
21351         (UnaryMutator.EmitCode): Support checked code generation
21352
21353         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
21354         matches for events for both the Static and Instance scans,
21355         pointing to the same element.   Fix that.
21356
21357 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
21358
21359         * rootcontext.cs (ResolveTree): Always set the
21360         interface_resolve_order, because nested interfaces will be calling
21361         into us.
21362
21363         * class.cs (GetInterfaceOrClass): Track the same resolution
21364         process used by TypeManager.LookupType.  This fixes the nested
21365         type lookups in class declarations (separate path from
21366         LookupType). 
21367
21368         (TypeContainer.DefineType): Also define nested interfaces.
21369         (TypeContainer.RegisterOrder): New public function used to
21370         register the order in which child interfaces need to be closed.
21371
21372         Nested interfaces need to be closed after their parents have been
21373         created. 
21374
21375         * interface.cs (InterfaceAttr): Put all the logic for computing
21376         the interface attribute here. 
21377
21378         (DefineInterface): Register our interface order with the
21379         RootContext or with the TypeContainer depending on the case.
21380
21381 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
21382
21383         * cs-parser.jay: rework foreach statement to work with the new
21384         changes to the policy on SimpleNames.
21385
21386         * report.cs: support Stacktrace on warnings as well.
21387
21388         * makefile: drop --unsafe and /unsafe from the compile.
21389
21390 2002-03-13  Ravi Pratap  <ravi@ximian.com>
21391
21392         * ecore.cs (StandardConversionExists): Modify to take an Expression
21393         as the first parameter. Ensure we do null -> reference type conversion
21394         checking.
21395
21396         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
21397         temporary Expression objects.
21398
21399 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
21400
21401         * interface.cs: workaround bug in method overloading resolution
21402         (there is already a bugzilla bug for it).
21403
21404 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
21405
21406         We could also solve this problem by having a separate path for
21407         performing type lookups, instead of DoResolve, we could have a
21408         ResolveType entry point, and only participating pieces of the
21409         production (simplename, deref, array) would implement this. 
21410
21411         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
21412         signal SimpleName to only resolve type names and not attempt to
21413         resolve anything else.
21414
21415         * expression.cs (Cast): Set the flag.
21416
21417         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
21418
21419         * class.cs: Only report 108 if there is no `new' modifier.
21420
21421         * cs-parser.jay: rework foreach statement to work with the new
21422         changes to the policy on SimpleNames.
21423         
21424         * report.cs: support Stacktrace on warnings as well.
21425
21426         * makefile: drop --unsafe and /unsafe from the compile.
21427
21428 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
21429
21430         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21431         lookups here, instead of doing that at parse time.  This means
21432         that our grammar will not introduce `LocalVariableReferences' as
21433         expressions at this point.  That solves the problem of code like
21434         this:
21435
21436         class X {
21437            static void Main ()
21438            { int X = 1;
21439             { X x = null }}}
21440
21441         This is only half the fix.  The full fix requires parameters to
21442         also be handled in this way.
21443
21444         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
21445         makes the use more obvious of the DeclSpace.  The
21446         ec.TypeContainer.TypeBuilder is now only used to pull the
21447         TypeBuilder for it.
21448
21449         My theory is that I can get rid of the TypeBuilder completely from
21450         the EmitContext, and have typecasts where it is used (from
21451         DeclSpace to where it matters).  
21452
21453         The only pending problem is that the code that implements Aliases
21454         is on TypeContainer, and probably should go in DeclSpace.
21455
21456         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21457         lookups here, instead of doing that at parse time.  This means
21458         that our grammar will not introduce `LocalVariableReferences' as
21459         expressions at this point.  That solves the problem of code like
21460         this:
21461
21462         class X {
21463            static void Main ()
21464            { int X = 1;
21465             { X x = null }}}
21466
21467         This is only half the fix.  The full fix requires parameters to
21468         also be handled in this way.
21469
21470         * class.cs (Property.DefineMethod): When implementing an interface
21471         method, set newslot, when implementing an abstract method, do not
21472         set the flag (before we tried never setting it, or always setting
21473         it, which is the difference).
21474         (Indexer.DefineMethod): same.
21475         (Method.DefineMethod): same.
21476
21477         * ecore.cs: Only set the status used flag if we get back a Field.
21478
21479         * attribute.cs: Temporary hack, so Paolo can keep working.
21480
21481 2002-03-08  Ravi Pratap  <ravi@ximian.com>
21482
21483         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
21484         the unmanaged type in the case we have a MarshalAs attribute.
21485
21486         (Resolve): Handle the case when we are parsing the special MarshalAs
21487         attribute [we need to store the unmanaged type to use later]
21488
21489         * typemanager.cs (marshal_as_attr_type): Built in type for the 
21490         MarshalAs Attribute.
21491
21492         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
21493         on parameters and accordingly set the marshalling info.
21494
21495 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
21496
21497         * class.cs: Optimizing slightly by removing redundant code after
21498         we switched to the `NoTypes' return value.
21499         (Property.DefineMethod): use NoTypes here too.
21500
21501         This fixes the bug I introduced in my last batch of changes.
21502
21503 2002-03-05  Ravi Pratap  <ravi@ximian.com>
21504
21505         * tree.cs (RecordEnum): Add. We now keep track of enums too.
21506
21507         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
21508         Enums since those are types too. 
21509
21510         * cs-parser.jay (enum_declaration): Record enums as we parse them.
21511
21512         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
21513         thanks to a call during the lookup process.
21514
21515 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
21516
21517         * statement.cs (Foreach): Lots of work to accomodate a particular
21518         kind of foreach statement that I had not kept in mind.  It is
21519         possible to have foreachs on classes that provide a GetEnumerator
21520         method that return objects that implement the "pattern" for using
21521         a foreach, there is no need to support GetEnumerator
21522         specifically. 
21523
21524         This is needed to compile nant.
21525
21526         * decl.cs: Only report 114 if the member is not `Finalize' and if
21527         the warning level is at least 2.
21528
21529         * class.cs: Moved the compare function from Method to
21530         MethodSignature. 
21531
21532         (MethodSignature.InheritableMemberSignatureCompare): Add new
21533         filter function that is used to extract inheritable methods from a
21534         class. 
21535
21536         (Method.Define): Use the new `inheritable_method_signature_filter'
21537         delegate
21538
21539         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
21540         command. 
21541
21542 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
21543
21544         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
21545
21546         * cs-parser.jay: Add opt_semicolon to the interface declaration.
21547
21548         * expression.cs: Pass location information to
21549         ConvertImplicitStandard. 
21550
21551         * class.cs: Added debugging code to track return values from
21552         interfaces. 
21553
21554 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
21555
21556         * expression.cs (Is.DoResolve): If either side of the `is' is an
21557         interface, do not flag the warning.
21558
21559         * ecore.cs (ImplicitReferenceConversion): We need a separate test
21560         for interfaces
21561
21562         * report.cs: Allow for --fatal to be used with --probe.
21563
21564         * typemanager.cs (NoTypes): Move the definition for the empty Type
21565         array here. 
21566
21567         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
21568         properties. 
21569         (TypeContainer.DefineProxy): New function used to proxy to parent
21570         implementations when implementing interfaces.
21571         (TypeContainer.ParentImplements): used to lookup if our parent
21572         implements a public function that is required by an interface.
21573         (TypeContainer.VerifyPendingMethods): Hook this up.
21574
21575         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
21576         `modules' and `assemblies' arraylists into arrays.  We only grow
21577         these are the very early start up of the program, so this improves
21578         the speedof LookupType (nicely measured).
21579
21580         * expression.cs (MakeByteBlob): Replaced unsafe code with
21581         BitConverter, as suggested by Paolo.
21582
21583         * cfold.cs (ConstantFold.Binary): Special case: perform constant
21584         folding of string concatenation, but if either side is a string,
21585         and the other is not, then return null, and let the runtime use
21586         the concatenation on the string plus the object (using
21587         `Object.ToString'). 
21588
21589 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
21590
21591         Constant Folding has been implemented now.
21592
21593         * expression.cs (Unary.Reduce): Do not throw an exception, catch
21594         the error instead on types that are not supported in one's
21595         complement. 
21596
21597         * constant.cs (Constant and all children): New set of functions to
21598         perform implict and explicit conversions.
21599
21600         * ecore.cs (EnumConstant): Implement the new functions to perform
21601         conversion by proxying to the child expression.
21602
21603         * codegen.cs: (ConstantCheckState): Constant evaluation has its
21604         own separate setting that can not be turned off from the command
21605         line using --unchecked or --checked and is only controlled using
21606         the checked/unchecked statements and expressions.  This setting is
21607         used by the constant folder to flag errors.
21608
21609         * expression.cs (CheckedExpr, UncheckedExpr): Set the
21610         ConstantCheckState as well.   
21611
21612         During Resolve, they also have to flag the state, because the
21613         constant folder runs completely in the Resolve phase.
21614
21615         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
21616         well.
21617
21618 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21619
21620         * cfold.cs: New file, this file contains the constant folder.
21621
21622         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21623         argument to track whether we are using the resulting address to
21624         load or store a value and provide better error messages. 
21625
21626         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21627         new AddressOf arguments.
21628
21629         * statement.cs (Foreach.EmitCollectionForeach): Update
21630
21631         * expression.cs (Argument.Emit): Call AddressOf with proper
21632         arguments to track usage.
21633
21634         (New.DoEmit): Call AddressOf with new arguments.
21635
21636         (Unary.Emit): Adjust AddressOf call.
21637
21638 2002-03-01  Ravi Pratap  <ravi@ximian.com>
21639
21640         * cs-parser.jay (member_access): Change the case for pre-defined types
21641         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
21642         this suggestion.
21643
21644         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21645         a method body.
21646
21647         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21648         essentially like methods and apply attributes like MethodImplOptions to them too.
21649
21650         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21651         not being null.
21652
21653         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21654         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21655         is the DeclSpace.
21656
21657         * Update code everywhere accordingly.
21658
21659         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21660
21661         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21662
21663 2002-02-28  Ravi Pratap  <ravi@ximian.com>
21664
21665         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21666         try performing lookups against those instead of jumping straight into using
21667         the 'using' clauses.
21668
21669         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21670
21671         (LookupType): Perform lookups in implicit parents too.
21672
21673         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21674         sequence as RootContext.LookupType. 
21675
21676         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
21677         the various cases of namespace lookups into this method.
21678
21679 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21680
21681         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21682         in positional arguments)
21683
21684         * class.cs (Operator): Update the AllowedModifiers to contain
21685         extern. 
21686
21687         * cs-parser.jay: Update operator declaration to allow for the
21688         operator body to be empty.
21689
21690         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21691         values. 
21692
21693 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
21694
21695         * class.cs (Method.Emit): Label parameters.
21696
21697         * driver.cs: Return 1 or 0 as the program exit code.
21698
21699 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
21700
21701         * expression.cs: Special case the `null' object when trying to
21702         auto-compute the type, as anything can be explicitly converted to
21703         that. 
21704
21705         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21706         spotting this Paolo.
21707
21708         (Expression.ImplicitNumericConversion): Perform comparissions of
21709         the type using the underlying type in the case of an enumeration
21710         rather than using the enumeration type for the compare.
21711
21712         Cope with the underlying == type case, which is not possible to
21713         catch before. 
21714
21715         (Expression.ConvertNumericExplicit): Perform comparissions of
21716         the type using the underlying type in the case of an enumeration
21717         rather than using the enumeration type for the compare.
21718
21719         * driver.cs: If the user does not supply an extension, assume .exe
21720
21721         * cs-parser.jay (if_statement): Rewrote so that we can track the
21722         location for the if statement.
21723
21724         * expression.cs (Binary.ConstantFold): Only concat strings when
21725         the operation is "+", not everything ;-)
21726
21727         * statement.cs (Statement.EmitBoolExpression): Take a location
21728         argument. 
21729         (If, While, Do): Track location.
21730
21731         * expression.cs (Binary.ResolveOperator): In the object + string
21732         case, I was missing a call to ConvertImplicit
21733
21734 2002-02-25  Ravi Pratap  <ravi@ximian.com>
21735
21736         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21737         Location arguments. Ensure we use RootContext.LookupType to do our work
21738         and not try to do a direct Type.GetType and ModuleBuilder.GetType
21739
21740         * interface.cs (PopulateMethod): Handle the type of the parameter being
21741         null gracefully.
21742
21743         * expression.cs (Invocation.BetterFunction): Handle the case when we 
21744         have a params method with no fixed arguments and a call is made with no
21745         arguments.
21746
21747 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
21748
21749         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21750         the verbatim-string-literal
21751
21752         * support.cs (InternalParameters.ParameterModifier): handle null
21753         fixed parameters.
21754         (InternalParameters.ParameterType): ditto.
21755
21756         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21757         duplicating the name of the variable parameter.
21758         (GetParameterByName): Fix bug where we were not looking up array
21759         paramters if they were the only present (thanks Paolo!).
21760         (GetParameterInfo): We only have an empty set of types if both
21761         fixed and array are set to null.
21762         (GetParameterInfo-idx): Handle FixedParameter == null
21763
21764         * cs-parser.jay: Handle the case where there is no catch
21765         statements (missing null test).
21766
21767 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
21768
21769         * driver.cs (MainDriver): Be conservative on our command line
21770         handling.
21771
21772         Catch DirectoryNotFoundException when calling GetFiles.
21773
21774         (SplitPathAndPattern): Used to split the input specification into
21775         a path and a pattern that we can feed to Directory.GetFiles.
21776
21777 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
21778
21779         * statement.cs (Fixed): Implement the last case of the Fixed
21780         statement (string handling).
21781
21782         * expression.cs (StringPtr): New class used to return a char * to
21783         a string;  Used by the Fixed statement.
21784
21785         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
21786
21787         * expression.cs (Binary.ResolveOperator): Remove redundant
21788         MemberLookup pn parent type.
21789         Optimize union call, we do not need a union if the types are the same.
21790         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21791         type.
21792
21793         Specialize the use of MemberLookup everywhere, instead of using
21794         the default settings. 
21795
21796         (StackAlloc): Implement stackalloc keyword.
21797
21798         * cs-parser.jay: Add rule to parse stackalloc.
21799
21800         * driver.cs: Handle /h, /help, /?
21801
21802         * expression.cs (MakeByteBlob): Removed the hacks we had in place
21803         before we supported unsafe code.
21804
21805         * makefile: add --unsafe to the self compilation of mcs.
21806
21807 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
21808
21809         * expression.cs (PointerArithmetic): New class that is used to
21810         perform pointer arithmetic.
21811         (Binary.Resolve): Handle pointer arithmetic
21812         Handle pointer comparission.
21813         (ArrayPtr): Utility expression class that is used to take the
21814         address of an array.
21815
21816         (ElementAccess): Implement array access for pointers
21817
21818         * statement.cs (Fixed): Implement fixed statement for arrays, we
21819         are missing one more case before we are done.
21820
21821         * expression.cs (Indirection): Implement EmitAssign and set the
21822         ExprClass to Variable.  This allows pointer dereferences to be
21823         treated as variables, and to have values assigned to them.
21824
21825         * ecore.cs (Expression.StoreFromPtr): New utility function to
21826         store values dereferencing.
21827
21828 2002-02-20  Ravi Pratap  <ravi@ximian.com>
21829
21830         * expression.cs (Binary.ResolveOperator): Ensure that we are
21831         not trying to operate on a void type - this fixes the reported
21832         bug.
21833
21834         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21835         the parent implementation is sealed.
21836
21837         * ../errors/cs0239.cs : Add.
21838
21839         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21840
21841         * typemanager.cs (unverifiable_code_type): Corresponds to 
21842         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21843         which have unsafe code in them.
21844
21845         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
21846         unsafe context.
21847
21848 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
21849
21850         * cs-tokenizer.cs: Add support for @"litreal strings"
21851
21852         Make tokenizer accept pre-processor directives
21853         on any column (remove the old C-like limitation). 
21854
21855         * rootcontext.cs (EmitCode): Emit any global attributes.
21856         (AddGlobalAttributes): Used to keep track of assembly attributes. 
21857
21858         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21859
21860         * cs-parser.jay: Add support for global attributes.  
21861
21862 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
21863
21864         * expression.cs (Indirection): New helper class.  Unary will
21865         create Indirection classes to be able to implement the
21866         IMemoryLocation interface on it.
21867
21868 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
21869
21870         * cs-parser.jay (fixed_statement): reference the right statement.
21871
21872         * statement.cs (Fixed.Emit): Finish implementing the fixed
21873         statement for the &x case.
21874
21875 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
21876
21877         * class.cs (Property.Define, Method.Define): Remove newslot when
21878         `implementing'.  
21879
21880         * modifiers.cs: My use of NewSlot when `Abstract' was set was
21881         wrong.  NewSlot should only be used if the `new' keyword is present.
21882
21883         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21884         locating our system dir.  Sorry about this.
21885
21886 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21887
21888         * driver.cs (GetSystemDir): Compute correctly the location of our
21889         system assemblies.  I was using the compiler directory instead of
21890         the library directory.
21891
21892 2002-02-13  Ravi Pratap  <ravi@ximian.com>
21893
21894         * expression.cs (BetterFunction): Put back in what Miguel commented out
21895         since it is the correct fix. The problem is elsewhere ;-)
21896
21897         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21898         parameters of the parms method are themselves compatible or not !
21899
21900         (StandardConversionExists): Fix very dangerous bug where we were forgetting
21901         to check that a class implements an interface before saying that an implicit
21902         conversion was allowed. Use ImplementsInterface to do the checking.
21903
21904 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21905
21906         * class.cs (Method.Define): Track whether we are an explicit
21907         implementation or not.  And only call DefineMethodOverride if we
21908         are an explicit implementation.
21909
21910         (Property.DefineMethod): Ditto.
21911
21912 2002-02-11  Ravi Pratap  <ravi@ximian.com>
21913
21914         * expression.cs (BetterFunction): Catch hideous bug which was
21915          preventing us from detecting ambiguous calls due to implicit casts i.e
21916         cs0121.
21917
21918 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
21919
21920         * support.cs (Pair): Remove un-needed method.  I figured why I was
21921         getting the error in cs-parser.jay, the variable in a foreach loop
21922         is readonly, and the compiler does not really treat this as a variable.
21923
21924         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
21925         instead of EQUALS in grammar.  
21926
21927         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21928
21929         * expression.cs (Unary.DoResolve): Check whether the argument is
21930         managed or not.
21931
21932 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
21933
21934         * support.cs: Api for Pair to set a value.  Despite the fact that
21935         the variables are public the MS C# compiler refuses to compile
21936         code that accesses the field if the variable is part of a foreach
21937         statement. 
21938
21939         * statement.cs (Fixed): Begin implementation of the fixed
21940         statement.
21941
21942         (Block.AddVariable): Return the VariableInfo on success and null
21943         on failure instead of true/false. 
21944
21945         * cs-parser.jay (foreach): Catch errors on variables already
21946         defined (we were ignoring this value before) and properly unwind
21947         the block hierarchy
21948
21949         (fixed_statement): grammar for the fixed statement.
21950
21951 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
21952
21953         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21954         pointer types to be incretemented.
21955
21956         (SizeOf): Implement.
21957
21958         * cs-parser.jay (pointer_member_access): Implement
21959         expr->IDENTIFIER production.
21960
21961         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21962         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21963         on safe contexts.
21964
21965         (Unary): Implement indirection.
21966
21967         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21968         use in non-unsafe context).
21969
21970         (SimpleName.DoResolve): Check for pointers in field access on safe
21971         contexts. 
21972
21973         (Expression.LoadFromPtr): Factor the load-indirect code in this
21974         function.  This was duplicated in UnboxCast and ParameterReference
21975
21976 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
21977
21978         * expression.cs (ComposedCast): report an error if a pointer cast
21979         is used in a safe region.
21980
21981         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21982         pointer type casts in unsafe context.
21983
21984         * codegen.cs (EmitContext): Set up IsUnsafe.
21985
21986         * cs-parser.jay (non_expression_type): Add productions for pointer
21987         casts. 
21988
21989         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21990         code.  We should not use force into static mode if the method is
21991         not virtual.  Fixes bug in MIS
21992
21993         * statement.cs (Do.Emit, While.Emit, For.Emit,
21994         Statement.EmitBoolExpression): Add support to Do and While to
21995         propagate infinite loop as `I do return' semantics.
21996
21997         Improve the For case to also test for boolean constants.
21998
21999         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
22000         to the list of attributes we can add.
22001
22002         Remove `EmitContext' argument.
22003
22004         * class.cs (Method.Define): Apply parameter attributes.
22005         (Constructor.Define): Apply parameter attributes.
22006         (MethodCore.LabelParameters): Move here the core of labeling
22007         parameters. 
22008
22009         * support.cs (ReflectionParameters.ParameterModifier,
22010         InternalParameters.ParameterModifier): Use IsByRef on the type and
22011         only return the OUT bit for these parameters instead of in/out/ref
22012         flags.
22013
22014         This is because I miss-understood things.  The ParameterInfo.IsIn
22015         and IsOut represent whether the parameter has the [In] and [Out]
22016         attributes set.  
22017
22018 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
22019
22020         * ecore.cs (FieldExpr.Emit): Release temporaries.
22021
22022         * assign.cs (LocalTemporary.Release): new function.
22023
22024         * codegen.cs (EmitContext.GetTemporaryStorage,
22025         EmitContext.FreeTemporaryStorage): Rework the way we deal with
22026         temporary storage.  Now we can "put back" localbuilders when we
22027         are done with them
22028
22029 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
22030
22031         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
22032         need to make a copy of the variable to generate verifiable code.
22033
22034 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
22035
22036         * driver.cs: Compute dynamically the system directory.
22037
22038         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
22039         Slower, but more generally useful.  Used by the abstract
22040         registering implementation. 
22041
22042         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
22043         the rules for the special rule on Type/instances.  First check if
22044         we have the same name, and if so, try that special static path
22045         rather than the instance path.
22046
22047 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
22048
22049         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
22050         for, while and if.
22051
22052         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
22053         Enum, ValueType, Delegate or Array for non-corlib compiles.
22054
22055         * cs-tokenizer.cs: Catch long identifiers (645)
22056
22057         * typemanager.cs (IndexerPropetyName): Ravi never tested this
22058         piece of code.
22059
22060         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
22061         fix, we were returning too early, so we were not registering
22062         pending methods from abstract classes.
22063
22064         Do not register pending methods if the class is abstract.
22065
22066         * expression.cs (Conditional.DoResolve): Report circular implicit
22067         conversions when we neecd to compute it for conditional
22068         expressions. 
22069
22070         (Is.DoResolve): If the expression is always of the provided type,
22071         flag warning 183.  If the expression can not ever be of the
22072         provided type flag warning 184.
22073
22074         * class.cs: Catch 169 as well.
22075
22076         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
22077         read. 
22078
22079 2002-01-18  Nick Drochak  <ndrochak@gol.com>
22080
22081         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
22082
22083 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
22084
22085         * interface.cs: (PopulateMethod): Check for pointers being defined
22086         only if the unsafe context is active.
22087         (PopulateProperty): ditto.
22088         (PopulateIndexer): ditto.
22089
22090         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
22091         specified.  If pointers are present, make sure that they are
22092         present in an unsafe context.
22093         (Constructor, Constructor.Define): ditto.
22094         (Field, Field.Define): ditto.
22095         (Property, Property.Define): ditto.
22096         (Event, Event.Define): ditto.
22097
22098         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
22099         hashtable if there are classes or structs defined.
22100
22101         * expression.cs (LocalVariableReference.DoResolve): Simplify this
22102         code, as the constant resolution moved.
22103
22104         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
22105         the metadata, so we can flag error 133. 
22106
22107         * decl.cs (MemberCore.UnsafeOK): New function to test that a
22108         pointer is being declared in an unsafe context.
22109
22110 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
22111
22112         * modifiers.cs (Modifiers.Check): Require a Location argument.
22113         Report error 227 for Unsafe use.
22114
22115         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
22116
22117         * statement.cs (For.Emit): If the test is null, then report that
22118         we do `return', as we wont reach anything afterwards.
22119
22120         (Switch.SwitchGoverningType): Track the expression that matched
22121         the conversion.
22122
22123         * driver.cs: Allow negative numbers as an error code to flag.
22124
22125         * cs-parser.jay: Handle 1551.
22126
22127         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
22128
22129 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
22130
22131         * cs-parser.jay: Report 1518 (type declaration can only contain
22132         class, struct, interface, enum or delegate)
22133
22134         (switch_label): Report 1523 (keywords `case' or `default' must
22135         preced code)
22136
22137         (opt_switch_sections): Report 1522 (empty switch)
22138
22139         * driver.cs: Report 1515 (response file specified multiple times)
22140         Report 1516 (Source file specified multiple times).
22141
22142         * expression.cs (Argument.Resolve): Signal 1510
22143
22144         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
22145         access not allowed in static code)
22146
22147 2002-01-11  Ravi Pratap  <ravi@ximian.com>
22148
22149         * typemanager.cs (IsPointerType): Utility method which we are going
22150         to need a lot.
22151
22152         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
22153         the object type, so we take care of that.
22154
22155         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
22156
22157         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
22158         added to non-params parameters :-)
22159
22160         * typemanager.cs (CSharpName): Include 'void' type too. 
22161
22162         (void_ptr_type): Include in the set of core types.
22163
22164         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
22165         duplicating code.
22166
22167         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
22168         an unsafe context.
22169
22170         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
22171         completely forgotten about it.
22172
22173 2002-01-10  Ravi Pratap  <ravi@ximian.com>
22174
22175         * cs-parser.jay (pointer_type): Add. This begins our implementation
22176         of parsing rules for unsafe code.
22177
22178         (unsafe_statement): Implement.
22179
22180         (embedded_statement): Modify to include the above.
22181
22182         * statement.cs (Unsafe): Implement new class for unsafe blocks.
22183
22184         * codegen.cs (EmitContext.InUnsafe): Add. This determines
22185         if the current context is an unsafe one.
22186
22187         * cs-parser.jay (local_variable_pointer_type): Since local variable types
22188         are handled differently, we need separate rules for them.
22189
22190         (local_variable_declaration): Update to use local_variable_pointer_type
22191         to allow variable declarations of unmanaged pointer types.
22192
22193         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
22194         in unsafe contexts.
22195
22196         * ../errors/cs0214.cs : Add.
22197
22198 2002-01-16  Nick Drochak  <ndrochak@gol.com>
22199
22200         * makefile: remove 'response' file when cleaning.
22201
22202 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
22203
22204         * cs-parser.jay: Report 1524.
22205
22206 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
22207
22208         * typemanager.cs (RegisterMethod): drop checking if we have
22209         registered this from here
22210
22211 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
22212
22213         * class.cs (Method.EmitDestructor): Implement calling our base
22214         destructor. 
22215
22216         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
22217         value of InFinally.
22218
22219         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
22220         this routine and will wrap the call in a try/catch block.  Deal
22221         with the case.
22222
22223 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
22224
22225         * ecore.cs (Expression.MemberLookup): instead of taking a
22226         parameter `same_type' that was used to tell whether we could
22227         access private members we compute our containing type from the
22228         EmitContext.
22229
22230         (FieldExpr): Added partial support for volatile fields.  This does
22231         not work for volatile fields exposed from assemblies, as I can not
22232         figure out how to extract the modreq from it.
22233
22234         Updated all the source files to use this.
22235
22236         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
22237         because it is referenced by MemberLookup very often. 
22238
22239 2002-01-09  Ravi Pratap  <ravi@ximian.com>
22240
22241         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
22242         TypeBuilder.GetCustomAttributes to retrieve what we need.
22243
22244         Get rid of redundant default_member_attr_type as this is the same as
22245         default_member_type which already exists.
22246
22247         * interface.cs, attribute.cs : Update accordingly.
22248
22249 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
22250
22251         * typemanager.cs: Enable IndexerPropertyName again.  It does not
22252         work for TYpeBuilders though.  Ravi, can you please fix this?
22253
22254         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
22255
22256         * expression.cs (Argument.Emit): Handle the case of ref objects
22257         being passed to ref functions;  
22258
22259         (ParameterReference.EmitLoad): Loads the content of the pointer
22260         without dereferencing.
22261
22262 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
22263
22264         * cs-tokenizer.cs: Implemented the pre-processing expressions.
22265
22266 2002-01-08  Ravi Pratap  <ravi@ximian.com>
22267
22268         * class.cs (Indexer.DefineMethod): Incorporate the interface
22269         type in the name of the method if we are doing explicit interface
22270         implementation.
22271
22272         * expression.cs (ConversionExists): Remove as it is completely obsolete.
22273
22274         (BetterConversion): Fix extremely trivial bug where we were referring to
22275         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
22276         again !
22277
22278         * ../errors/bug16.cs : Add although we have fixed it.
22279
22280 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
22281
22282         * expression.cs (BaseIndexer): Begin implementation.
22283
22284         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
22285
22286         * cs-parser.jay (indexer_declarator): Use qualified_identifier
22287         production directly to remove a shift/reduce, and implement
22288         explicit interface implementation.
22289
22290         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
22291         after a floating point suffix.
22292
22293         * expression.cs (DoNumericPromotions): Improved the conversion for
22294         uint/uint.  If we have a constant, we avoid doing a typecast to a
22295         larger type.
22296
22297         * class.cs (Indexer): Implement explicit interface implementation
22298         for indexers.
22299
22300 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
22301
22302         * class.cs: make the default instance constructor public and hidebysig.
22303
22304 2001-01-03  Ravi Pratap  <ravi@ximian.com>
22305
22306         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
22307         so we can call it from elsewhere.
22308
22309         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
22310         we emit it internally if the class has a defined indexer; otherwise the user
22311         emits it by decorating the class definition with the DefaultMemberAttribute.
22312
22313         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
22314         attribute is not used on a type which defines an indexer.
22315
22316         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
22317         character when we skip whitespace.
22318
22319         * ../errors/cs0646.cs : Add.
22320
22321 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
22322
22323         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
22324         again. 
22325
22326         * makefile: Add practical target `mcs3.exe' which builds the third
22327         generation compiler. 
22328
22329         * expression.cs (New): Fix structures constructor calling.
22330
22331         * class.cs (Property, Method, Indexer): Emit Final flag on the
22332         method if we are an interface implementation and we are not
22333         abstract. 
22334
22335         * ecore.cs (PropertyExpr): New public field `IsBase', tells
22336         whether this property is referencing a `base' method.
22337
22338         * expression.cs (Invocation.EmitCall): take an extra argument:
22339         is_base, this is used to determine whether the `call' or
22340         `callvirt' opcode should be used.
22341
22342
22343         * delegate.cs: update EmitCall.
22344
22345         * class.cs (Method.Define): Set NewSlot for the cases where we are
22346         not implementing an interface method.
22347
22348         (Property.Define): ditto.
22349
22350 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
22351
22352         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
22353         'r'.  Allows mcs to parse itself fully.
22354
22355 2002-01-02  Ravi Pratap  <ravi@ximian.com>
22356
22357         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
22358         of the number of initializers that require the InitializeArray method.
22359
22360         (CheckIndices): Store the Expression in all cases - not the plain value. Also
22361         update the above field where necessary.
22362
22363         (MakeByteBlob): Update accordingly.
22364
22365         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
22366         greater than 2.
22367
22368         (EmitDynamicInitializers): Update in accordance with the new optimization.
22369
22370         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
22371         same OpCode applies.
22372
22373         * cs-parser.jay : Fix some glaring errors I introduced.
22374
22375 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
22376
22377         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
22378         so that we can check for name clashes there too.
22379
22380         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
22381         for interface indexers.
22382
22383         * interfaces.cs (Define): Emit the default member attribute.
22384
22385         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
22386         variable was being referred to while setting the value ;-)
22387
22388 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
22389
22390         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
22391         byte-by-byte information when we know the data is zero.
22392
22393         Make the block always a multiple of 4, because
22394         DefineInitializedData has a bug.
22395
22396         * assign.cs: Fix, we should assign from the temporary, not from
22397         the source. 
22398
22399         * expression.cs (MakeByteBlob): Fix my incorrect code.
22400
22401 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
22402
22403         * typemanager.cs (EnumToUnderlying): This function is used to get
22404         the underlying type from an enumeration, because it does not
22405         always work. 
22406
22407         * constant.cs: Use the I4_S form for values between -128 and 127.
22408
22409         * statement.cs (Block.LookupLabel): Looks up a label.
22410         (Block): Drop support for labeled blocks.
22411
22412         (LabeledStatement): New kind of statement that represents a label
22413         only.
22414
22415         (Goto): Finally implement this bad boy.
22416
22417         * cs-parser.jay: Update to reflect new mechanism to implement
22418         labels.
22419
22420 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
22421
22422         * codegen.cs (EmitContext.This): a codegen property that keeps the
22423         a single instance of this instead of creating many different this
22424         instances. 
22425
22426         * delegate.cs (Delegate.DoResolve): Update to use the property;
22427
22428         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
22429
22430         * expression.cs (BaseAccess.DoResolve): Ditto.
22431
22432 2001-12-29  Ravi Pratap  <ravi@ximian.com>
22433
22434         * typemanager.cs (methodimpl_attr_type): Add to hold the type
22435         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
22436
22437         (InitCoreTypes): Update accordingly.
22438
22439         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
22440         so we can quickly store the state.
22441
22442         (ApplyAttributes): Set the correct implementation flags
22443         for InternalCall methods.
22444
22445 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
22446
22447         * expression.cs (EmitCall): if a method is not virtual, then do
22448         not use callvirt on it.
22449
22450         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
22451         user defined stuff) requires the use of stobj, which takes an
22452         address on the stack instead of an array and an index.  So emit
22453         the Ldelema operation for it.
22454
22455         (EmitStoreOpcode): Use stobj for valuetypes.
22456
22457         (UnaryMutator.EmitCode): Use the right 1 value depending on
22458         whether we are dealing with int64/uint64, float or doubles.
22459
22460         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
22461         constructors that I implemented last night.
22462
22463         (Constructor.IsDefault): Fix to work properly for static
22464         constructors.
22465
22466         * cs-parser.jay (CheckDef): report method signature errors.
22467         Update error number 103 to be 132.
22468
22469         * decl.cs: New AdditionResult enumeration value: MethodExists.
22470         Although we do this check for methods later on in the semantic
22471         analysis, catching repeated default constructors is so easy that
22472         we catch these here. 
22473
22474         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
22475         promotions code.
22476
22477         (ParameterReference.EmitAssign, Emit): handle
22478         bools as bytes.
22479
22480         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
22481         (ArrayAccess.EmitStoreOpcode): ditto.
22482
22483         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
22484
22485         * expression.cs (MakeByteBlob): Complete all the missing types
22486         (uint, short, ushort, byte, sbyte)
22487
22488         * class.cs: Only init instance field initializers on instance
22489         constructors. 
22490
22491         Rename `constructors' to instance_constructors. 
22492
22493         (TypeContainer.AddConstructor): Only add constructors to the list
22494         if it is not static.
22495
22496         Make sure that we handle default_static_constructor independently
22497         everywhere where we handle instance_constructors
22498
22499 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
22500
22501         * class.cs: Do not lookup or create a base initializer for a
22502         static constructor.
22503
22504         (ConstructorInitializer.Resolve): use the proper type to lookup
22505         for constructors.
22506
22507         * cs-parser.jay: Report error 1585 (modifiers between type and name).
22508
22509         * enum.cs, interface.cs: Remove CloseType, this is taken care by
22510         in DeclSpace. 
22511
22512         * decl.cs: CloseType is now an virtual method, the default
22513         implementation just closes this type.
22514
22515 2001-12-28  Ravi Pratap  <ravi@ximian.com>
22516
22517         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
22518         to PreserveSig by default. Also emit HideBySig on such methods.
22519
22520         Basically, set the defaults to standard values.
22521
22522         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
22523         argument, if candidate is better, it can't be worse than the best !
22524
22525         (Invocation): Re-write bits to differentiate between methods being
22526         applicable in their expanded form and their normal form - for params
22527         methods of course.
22528
22529         Get rid of use_standard everywhere as only standard conversions are allowed
22530         in overload resolution. 
22531
22532         More spec conformance.
22533
22534 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22535
22536         * driver.cs: Add --timestamp, to see where the compiler spends
22537         most of its time.
22538
22539         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
22540         `this' in static code.
22541
22542         (SimpleName.DoResolve): Implement in terms of a helper function
22543         that allows static-references to be passed upstream to
22544         MemberAccess.
22545
22546         (Expression.ResolveWithSimpleName): Resolve specially simple
22547         names when called by MemberAccess to implement the special
22548         semantics. 
22549
22550         (Expression.ImplicitReferenceConversion): Handle conversions from
22551         Null to reference types before others, as Null's type is
22552         System.Object. 
22553
22554         * expression.cs (Invocation.EmitCall): Handle the special case of
22555         calling methods declared on a reference type from a ValueType
22556         (Base classes System.Object and System.Enum)
22557
22558         (MemberAccess.Resolve): Only perform lookups on Enumerations if
22559         the left hand side is a TypeExpr, not on every enumeration. 
22560
22561         (Binary.Resolve): If types are reference types, then do a cast to
22562         object on operators != and == of both arguments.
22563
22564         * typemanager.cs (FindMembers): Extract instance and static
22565         members if requested.
22566
22567         * interface.cs (PopulateProperty): Use void_type instead of null
22568         as the return type for the setter method.
22569
22570         (PopulateIndexer): ditto.
22571
22572 2001-12-27  Ravi Pratap  <ravi@ximian.com>
22573
22574         * support.cs (ReflectionParameters): Fix minor bug where we
22575         were examining the wrong parameter for the ParamArray attribute.
22576
22577         Cope with requests for the type of the parameter at position
22578         greater than the params parameter's. We now return the element
22579         type of the params array as that makes more sense.
22580
22581         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
22582         accordingly as we no longer have to extract the element type
22583         ourselves.
22584
22585         (Invocation.OverloadResolve): Update.
22586
22587 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22588
22589         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
22590         against IEnumerator, test whether the return value is a descendant
22591         of the IEnumerator interface.
22592
22593         * class.cs (Indexer.Define): Use an auxiliary method to implement
22594         the other bits of the method definition.  Begin support for
22595         explicit interface implementation.
22596
22597         (Property.DefineMethod): Use TypeManager.void_type instead of null
22598         for an empty return value.
22599
22600 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
22601
22602         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
22603         dealing with a FieldExpr which is composed of a FieldBuilder, in
22604         the code path we did extract the constant, but we should have
22605         obtained the underlying value to be able to cast it (otherwise we
22606         end up in an infinite loop, this is what Ravi was running into).
22607
22608         (ArrayCreation.UpdateIndices): Arrays might be empty.
22609
22610         (MemberAccess.ResolveMemberAccess): Add support for section
22611         14.5.4.1 that deals with the special case of E.I when E is a type
22612         and something else, that I can be a reference to a static member.
22613
22614         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
22615         handle a particular array type to create byte blobs, it is just
22616         something we dont generate byteblobs for.
22617
22618         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
22619         arguments. 
22620
22621         * location.cs (Push): remove the key from the hashtable that we
22622         are about to add.   This happens for empty files.
22623
22624         * driver.cs: Dispose files after we have parsed them.
22625
22626         (tokenize): new function that only runs the tokenizer on its
22627         input, for speed testing.
22628
22629 2001-12-26  Ravi Pratap  <ravi@ximian.com>
22630
22631         * class.cs (Event.Define): Define the private field only if there
22632         are no accessors defined.
22633
22634         * expression.cs (ResolveMemberAccess): If there is no associated
22635         field with the event, that means we have an event defined with its
22636         own accessors and we should flag error cs0070 since transforming
22637         ourselves into a field is not valid in that case.
22638
22639         * ecore.cs (SimpleName.DoResolve): Same as above.
22640
22641         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22642         and charset to sane values.
22643
22644 2001-12-25  Ravi Pratap  <ravi@ximian.com>
22645
22646         * assign.cs (DoResolve): Perform check on events only if they 
22647         are being accessed outside the declaring type.
22648
22649         * cs-parser.jay (event_declarations): Update rules to correctly
22650         set the type of the implicit parameter etc.
22651
22652         (add_accessor, remove_accessor): Set current local parameters.
22653
22654         * expression.cs (Binary): For delegate addition and subtraction,
22655         cast the return value from the method into the appropriate delegate
22656         type.
22657
22658 2001-12-24  Ravi Pratap  <ravi@ximian.com>
22659
22660         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22661         of these as the workaround is unnecessary.
22662
22663         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22664         delegate data - none of that is needed at all.
22665
22666         Re-write bits to extract the instance expression and the delegate method
22667         correctly.
22668
22669         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
22670         on delegates too.
22671
22672         * attribute.cs (ApplyAttributes): New method to take care of common tasks
22673         of attaching attributes instead of duplicating code everywhere.
22674
22675         * everywhere : Update code to do attribute emission using the above method.
22676
22677 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22678
22679         * expression.cs (IsParamsMethodApplicable): if there are not
22680         parameters, return immediately.
22681
22682         * ecore.cs: The 0 literal can be implicity converted to an enum
22683         type. 
22684
22685         (SimpleName.DoResolve): First lookup the type, then lookup the
22686         members. 
22687
22688         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22689         want to get its address.  If the InstanceExpression is not
22690         addressable, store the result in a temporary variable, then get
22691         the address of it.
22692
22693         * codegen.cs: Only display 219 errors on warning level or above. 
22694
22695         * expression.cs (ArrayAccess): Make it implement the
22696         IMemoryLocation interface.
22697
22698         (Binary.DoResolve): handle the operator == (object a, object b)
22699         and operator != (object a, object b) without incurring into a
22700         BoxedCast (because 5 != o should never be performed).
22701
22702         Handle binary enumerator operators.
22703
22704         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22705         value type, otherwise use Ldelem_ref.
22706
22707         Use precomputed names;
22708
22709         (AddressOf): Implement address of
22710
22711         * cs-parser.jay (labeled_statement): Fix recursive block
22712         addition by reworking the production.
22713
22714         * expression.cs (New.DoEmit): New has a special case:
22715                 
22716                  If we are dealing with a ValueType, we have a few
22717                  situations to deal with:
22718                 
22719                     * The target of New is a ValueType variable, that is
22720                       easy, we just pass this as the variable reference
22721                 
22722                     * The target of New is being passed as an argument,
22723                       to a boxing operation or a function that takes a
22724                       ValueType.
22725                 
22726                       In this case, we need to create a temporary variable
22727                       that is the argument of New.
22728
22729
22730 2001-12-23  Ravi Pratap  <ravi@ximian.com>
22731
22732         * rootcontext.cs (LookupType): Check that current_type is not null before
22733         going about looking at nested types.
22734
22735         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22736         not implement the IAssignMethod interface any more.
22737
22738         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22739         where we tranform them into FieldExprs if they are being resolved from within
22740         the declaring type.
22741
22742         * ecore.cs (SimpleName.DoResolve): Do the same here.
22743
22744         * assign.cs (DoResolve, Emit): Clean up code considerably. 
22745
22746         * ../errors/bug10.cs : Add.
22747
22748         * ../errors/cs0070.cs : Add.
22749
22750         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22751
22752         * assign.cs : Get rid of EventIsLocal everywhere.
22753
22754 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22755
22756         * ecore.cs (ConvertIntLiteral): finished the implementation.
22757
22758         * statement.cs (SwitchLabel): Convert the value we are using as a
22759         key before looking up the table.
22760
22761 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22762
22763         * codegen.cs (EmitTopBlock): Require a Location argument now.
22764
22765         * cs-parser.jay (constructor_declarator): We need to setup
22766         current_local_parameters before we parse the
22767         opt_constructor_initializer, to allow the variables to be bound
22768         to the constructor arguments.
22769
22770         * rootcontext.cs (LookupType): First lookup nested classes in our
22771         class and our parents before we go looking outside our class.
22772
22773         * expression.cs (ConstantFold): Extract/debox the values at the
22774         beginnning. 
22775
22776         * rootcontext.cs (EmitCode): Resolve the constants first before we
22777         resolve the types.  This is not really needed, but it helps debugging.
22778
22779         * statement.cs: report location.
22780
22781         * cs-parser.jay: pass location to throw statement.
22782
22783         * driver.cs: Small bug fix.
22784
22785         * report.cs: Updated format to be 4-zero filled digits.
22786
22787 2001-12-22  Ravi Pratap  <ravi@ximian.com>
22788
22789         * expression.cs (CheckIndices): Fix minor bug where the wrong
22790         variable was being referred to ;-)
22791
22792         (DoEmit): Do not call EmitStaticInitializers when the 
22793         underlying type is System.Object.
22794
22795 2001-12-21  Ravi Pratap  <ravi@ximian.com>
22796
22797         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22798         and do the usual workaround for SRE.
22799
22800         * class.cs (MyEventBuilder.EventType): New member to get at the type
22801         of the event, quickly.
22802
22803         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22804
22805         * assign.cs (Assign.DoResolve): Handle the case when the target
22806         is an EventExpr and perform the necessary checks.
22807
22808         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22809         interface.
22810
22811         (SimpleName.MemberStaticCheck): Include check for EventExpr.
22812
22813         (EventExpr): Set the type in the constructor itself since we 
22814         are meant to be born fully resolved.
22815
22816         (EventExpr.Define): Revert code I wrote earlier.
22817                 
22818         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22819         instance expression is null. The instance expression is a This in that case
22820         or a null, depending on whether it is a static method or not.
22821
22822         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22823         refers to more than one method.
22824
22825         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22826         and accordingly flag errors.
22827
22828 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22829
22830         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22831
22832 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22833
22834         * location.cs (ToString): Provide useful rutine.
22835
22836 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22837
22838         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22839         objects, return the actual integral boxed.
22840
22841         * statement.cs (SwitchLabel): define an ILLabel for each
22842         SwitchLabel. 
22843
22844         (Switch.CheckSwitch): If the value is a Literal, extract
22845         the underlying literal.
22846
22847         Also in the unused hashtable we had, add the SwitchLabel so we can
22848         quickly look this value up.
22849
22850         * constant.cs: Implement a bunch of new constants.  Rewrite
22851         Literal based on this.  Made changes everywhere to adapt to this.
22852
22853         * expression.cs (Expression.MakeByteBlob): Optimize routine by
22854         dereferencing array only once, and also copes with enumrations.
22855
22856         bytes are two bytes wide, not one.
22857
22858         (Cast): Perform constant conversions.
22859
22860         * ecore.cs (TryImplicitIntConversion): Return literals instead of
22861         wrappers to the literals here.
22862
22863         * expression.cs (DoNumericPromotions): long literals can converted
22864         to ulong implicity (this is taken care of elsewhere, but I was
22865         missing this spot).
22866
22867         * ecore.cs (Expression.Literalize): Make the return type Literal,
22868         to improve type checking.
22869
22870         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22871
22872 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22873
22874         * literal.cs: Revert code from ravi that checked the bounds.  The
22875         bounds are sane by the definition of the type itself. 
22876
22877         * typemanager.cs: Fix implementation of ImplementsInterface.  We
22878         need to actually look up in our parent hierarchy for interfaces
22879         implemented. 
22880
22881         * const.cs: Use the underlying type for enumerations
22882
22883         * delegate.cs: Compute the basename for the delegate creation,
22884         that should fix the delegate test case, and restore the correct
22885         Type Lookup semantics in rootcontext
22886
22887         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
22888         referencing a nested type with the Reflection API is using the "+"
22889         sign. 
22890
22891         * cs-parser.jay: Do not require EOF token at the end.
22892
22893 2001-12-20  Ravi Pratap  <ravi@ximian.com>
22894
22895         * rootcontext.cs (LookupType): Concatenate type names with
22896         a '.' instead of a '+' The test suite passes again.
22897
22898         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22899         field of the enumeration.
22900
22901         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22902         the case when the member is an EventExpr.
22903
22904         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22905         static has an associated instance expression.
22906
22907         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22908
22909         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22910
22911         * class.cs (Event.Define): Register event and perform appropriate checks
22912         for error #111.
22913
22914         We define the Add and Remove methods even if the use provides none because
22915         in that case, we provide default implementations ourselves.
22916
22917         Define a private field of the type of the event. This is done by the CSC compiler
22918         and we should be doing it too ;-)
22919
22920         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22921         More methods we use in code we generate.
22922
22923         (multicast_delegate_type, delegate_type): Two separate types since the distinction
22924         is important.
22925
22926         (InitCoreTypes): Update accordingly for the above.
22927
22928         * class.cs (Event.Emit): Generate code for default accessors that we provide
22929
22930         (EmitDefaultMethod): Do the job in the above.
22931
22932         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
22933         appropriate place.
22934
22935 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22936
22937         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22938         builders even if we were missing one.
22939
22940         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22941         pass the Basename as our class name instead of the Name.  The
22942         basename will be correctly composed for us.
22943
22944         * parameter.cs (Paramters): Now takes a Location argument.
22945
22946         * decl.cs (DeclSpace.LookupType): Removed convenience function and
22947         make all the code call directly LookupType in RootContext and take
22948         this chance to pass the Location information everywhere.
22949
22950         * Everywhere: pass Location information.
22951
22952 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
22953
22954         * class.cs (Constructor.Define): Updated way of detecting the
22955         length of the parameters.
22956
22957         (TypeContainer.DefineType): Use basename as the type name for
22958         nested types.
22959
22960         (TypeContainer.Define): Do not recursively define types here, as
22961         definition is taken care in order by the RootContext.
22962
22963         * tree.cs: Keep track of namespaces in a per-file basis.
22964
22965         * parameter.cs (Parameter.ComputeSignature): Update to use
22966         DeclSpace. 
22967
22968         (Parameters.GetSignature): ditto.
22969
22970         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22971         instead of a TypeContainer.
22972
22973         (Interface.SemanticAnalysis): Use `this' instead of our parent to
22974         resolve names.  Because we need to be resolve in our context, not
22975         our parents.
22976
22977         * driver.cs: Implement response files.
22978
22979         * class.cs (TypeContainer.DefineType): If we are defined, do not
22980         redefine ourselves.
22981
22982         (Event.Emit): Emit the code for add/remove handlers.
22983         (Event.Define): Save the MethodBuilders for add/remove.
22984
22985         * typemanager.cs: Use pair here too.
22986
22987         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22988         DictionaryEntry requires the first argument to be non-null.  
22989
22990         (enum_declaration): Compute full name for registering the
22991         enumeration.
22992
22993         (delegate_declaration): Instead of using
22994         formal_parameter_list, use opt_formal_parameter_list as the list
22995         can be empty.
22996
22997         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22998         (EventParsing): New property that controls whether `add' and
22999         `remove' are returned as tokens or identifiers (for events);
23000
23001 2001-12-19  Ravi Pratap  <ravi@ximian.com>
23002
23003         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
23004         use MyEventBuilder only and let it wrap the real builder for us.
23005
23006         (MyEventBuilder): Revamp constructor etc.
23007
23008         Implement all operations that we perform on EventBuilder in precisely the same
23009         way here too.
23010
23011         (FindMembers): Update to use the EventBuilder member.
23012
23013         (Event.Emit): Update accordingly.
23014
23015 2001-12-18  Ravi Pratap  <ravi@ximian.com>
23016
23017         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
23018         by calling the appropriate methods.
23019
23020         (GetCustomAttributes): Make stubs as they cannot possibly do anything
23021         useful.
23022
23023         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
23024
23025 2001-12-17  Ravi Pratap  <ravi@ximian.com>
23026
23027         * delegate.cs (Delegate.Populate): Check that the return type
23028         and various parameters types are indeed accessible.
23029
23030         * class.cs (Constructor.Define): Same here.
23031
23032         (Field.Define): Ditto.
23033
23034         (Event.Define): Ditto.
23035
23036         (Operator.Define): Check that the underlying Method defined itself
23037         correctly - so it's MethodBuilder should not be null.
23038
23039         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
23040         expression happens to be null.
23041
23042         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
23043         members but as of now we don't seem to be able to do anything really useful with it.
23044
23045         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
23046         not the EventBuilder.
23047
23048 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
23049
23050         * cs-tokenizer.cs: Add support for defines.
23051         Add support for #if, #elif, #else, #endif
23052
23053         (eval_var): evaluates a variable.
23054         (eval): stubbed for evaluating functions.
23055
23056         * cs-parser.jay: Pass the defines information
23057
23058         * driver.cs: Add --define command line option.
23059
23060         * decl.cs: Move MemberCore here.
23061
23062         Make it the base class for DeclSpace.  This allows us to catch and
23063         report 108 and 109 for everything now.
23064
23065         * class.cs (TypeContainer.Define): Extract all the members
23066         before populating and emit the warning 108 (new keyword required
23067         to override) instead of having each member implement this.
23068
23069         (MemberCore.Define): New abstract method, we will be using this in
23070         the warning reporting engine in Populate.
23071
23072         (Operator.Define): Adjust to new MemberCore protocol. 
23073
23074         * const.cs (Const): This does not derive from Expression, it is a
23075         temporary object we use to create fields, it is a MemberCore. 
23076
23077         * class.cs (Method.Define): Allow the entry point to be in a
23078         specific class.
23079
23080         * driver.cs: Rewrite the argument handler to clean it up a bit.
23081
23082         * rootcontext.cs: Made it just an auxiliary namespace feature by
23083         making everything static.
23084
23085         * driver.cs: Adapt code to use RootContext type name instead of
23086         instance variable.
23087
23088         * delegate.cs: Remove RootContext argument.
23089
23090         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
23091         argument. 
23092
23093         * class.cs (Event.Define): The lookup can fail.
23094
23095         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
23096
23097         * expression.cs: Resolve the this instance before invoking the code.
23098
23099 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
23100
23101         * cs-parser.jay: Add a production in element_access that allows
23102         the thing to become a "type" reference.  This way we can parse
23103         things like "(string [])" as a type.
23104
23105         Note that this still does not handle the more complex rules of
23106         casts. 
23107
23108
23109         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
23110
23111         * ecore.cs: (CopyNewMethods): new utility function used to
23112         assemble the list of methods from running FindMembers.
23113
23114         (MemberLookup): Rework FindMembers so that 
23115
23116 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
23117
23118         * class.cs (TypeContainer): Remove Delegates who fail to be
23119         defined.
23120
23121         * delegate.cs (Populate): Verify that we dont get null return
23122         values.   TODO: Check for AsAccessible.
23123
23124         * cs-parser.jay: Use basename to emit error 574 (destructor should
23125         have the same name as container class), not the full name.
23126
23127         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
23128         possible representation.  
23129
23130         Also implements integer type suffixes U and L.
23131
23132 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
23133
23134         * expression.cs (ArrayCreation.DoResolve): We need to do the
23135         argument resolution *always*.
23136
23137         * decl.cs: Make this hold the namespace.  Hold the root context as
23138         well.
23139         (LookupType): Move here.
23140
23141         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
23142
23143         * location.cs (Row, Name): Fixed the code, it was always returning
23144         references to the first file.
23145
23146         * interface.cs: Register properties defined through interfaces.
23147
23148         * driver.cs: Add support for globbing on the command line
23149
23150         * class.cs (Field): Make it derive from MemberCore as well.
23151         (Event): ditto.
23152
23153 2001-12-15  Ravi Pratap  <ravi@ximian.com>
23154
23155         * class.cs (Event::Define): Check that the type of the event is a delegate
23156         type else flag error #66.
23157
23158         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
23159         same.
23160
23161         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
23162         values of EntryPoint, CharSet etc etc.
23163
23164         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
23165
23166         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
23167         be null and we should ignore this. I am not sure if this is really clean. Apparently,
23168         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
23169         which needs this to do its work.
23170
23171         * ../errors/cs0066.cs : Add.
23172
23173 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
23174
23175         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
23176         helper functions.
23177
23178         * class.cs: (MethodSignature.MethodSignature): Removed hack that
23179         clears out the parameters field.
23180         (MemberSignatureCompare): Cleanup
23181
23182         (MemberCore): New base class used to share code between MethodCore
23183         and Property.
23184
23185         (RegisterRequiredImplementations) BindingFlags.Public requires
23186         either BindingFlags.Instace or Static.  Use instance here.
23187
23188         (Property): Refactored code to cope better with the full spec.
23189
23190         * parameter.cs (GetParameterInfo): Return an empty array instead
23191         of null on error.
23192
23193         * class.cs (Property): Abstract or extern properties have no bodies.
23194
23195         * parameter.cs (GetParameterInfo): return a zero-sized array.
23196
23197         * class.cs (TypeContainer.MethodModifiersValid): Move all the
23198         method modifier validation to the typecontainer so we can reuse
23199         this on properties.
23200
23201         (MethodCore.ParameterTypes): return an empty sized array of types.
23202
23203         (Property.Define): Test property modifier validity.
23204
23205         Add tests for sealed/override too.
23206
23207         (Method.Emit): abstract or extern methods have no bodies.
23208
23209 2001-12-14  Ravi Pratap  <ravi@ximian.com>
23210
23211         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
23212         thing.
23213
23214         (Method::Define, ::Emit): Modify accordingly.
23215
23216         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
23217
23218         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
23219
23220         * makefile: Pass in /unsafe.
23221
23222 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
23223
23224         * class.cs (MakeKey): Kill routine.
23225
23226         * class.cs (TypeContainer.Define): Correctly define explicit
23227         method implementations (they require the full interface name plus
23228         the method name).
23229
23230         * typemanager.cs: Deply the PtrHashtable here and stop using the
23231         lame keys.  Things work so much better.
23232
23233         This of course broke everyone who depended on `RegisterMethod' to
23234         do the `test for existance' test.  This has to be done elsewhere.
23235
23236         * support.cs (PtrHashtable): A hashtable that avoid comparing with
23237         the object stupid Equals method (because, that like fails all over
23238         the place).  We still do not use it.
23239
23240         * class.cs (TypeContainer.SetRequiredInterface,
23241         TypeContainer.RequireMethods): Killed these two routines and moved
23242         all the functionality to RegisterRequiredImplementations.
23243
23244         (TypeContainer.RegisterRequiredImplementations): This routine now
23245         registers all the implementations required in an array for the
23246         interfaces and abstract methods.  We use an array of structures
23247         which can be computed ahead of time to reduce memory usage and we
23248         also assume that lookups are cheap as most classes will not
23249         implement too many interfaces.
23250
23251         We also avoid creating too many MethodSignatures.
23252
23253         (TypeContainer.IsInterfaceMethod): Update and optionally does not
23254         clear the "pending" bit if we find that there are problems with
23255         the declaration.
23256
23257         (TypeContainer.VerifyPendingMethods): Update to report errors of
23258         methods that look like implementations but are not.
23259
23260         (TypeContainer.Define): Add support for explicit interface method
23261         implementation. 
23262
23263 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
23264
23265         * typemanager.cs: Keep track of the parameters here instead of
23266         being a feature of the TypeContainer.
23267
23268         * class.cs: Drop the registration of parameters here, as
23269         InterfaceMethods are also interface declarations.
23270
23271         * delegate.cs: Register methods with the TypeManager not only with
23272         the TypeContainer.  This code was buggy.
23273
23274         * interface.cs: Full registation here.
23275
23276 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
23277
23278         * expression.cs: Remove reducer for binary expressions, it can not
23279         be done this way.
23280
23281         * const.cs: Put here the code that used to go into constant.cs
23282
23283         * constant.cs: Put here the code for constants, this is a new base
23284         class for Literals.
23285
23286         * literal.cs: Make Literal derive from Constant.
23287
23288 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
23289
23290         * statement.cs (Return.Emit): Report error 157 if the user
23291         attempts to return from a finally block.
23292
23293         (Return.Emit): Instead of emitting a return, jump to the end of
23294         the function.
23295
23296         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
23297         LocalBuilder to store the result of the function.  ReturnLabel is
23298         the target where we jump.
23299
23300
23301 2001-12-09  Radek Doulik  <rodo@ximian.com>
23302
23303         * cs-parser.jay: remember alias in current namespace
23304
23305         * ecore.cs (SimpleName::DoResolve): use aliases for types or
23306         namespaces
23307
23308         * class.cs (LookupAlias): lookup alias in my_namespace
23309
23310         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
23311         aliases hashtable
23312         (LookupAlias): lookup alias in this and if needed in parent
23313         namespaces
23314
23315 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
23316
23317         * support.cs: 
23318
23319         * rootcontext.cs: (ModuleBuilder) Made static, first step into
23320         making things static.  I need this to avoid passing the
23321         TypeContainer when calling ParameterType.
23322
23323         * support.cs (InternalParameters.ParameterType): Remove ugly hack
23324         that did string manipulation to compute the type and then call
23325         GetType.  Use Parameter.ParameterType instead.
23326
23327         * cs-tokenizer.cs: Consume the suffix for floating values.
23328
23329         * expression.cs (ParameterReference): figure out whether this is a
23330         reference parameter or not.  Kill an extra variable by computing
23331         the arg_idx during emission.
23332
23333         * parameter.cs (Parameters.GetParameterInfo): New overloaded
23334         function that returns whether a parameter is an out/ref value or not.
23335
23336         (Parameter.ParameterType): The type of the parameter (base,
23337         without ref/out applied).
23338
23339         (Parameter.Resolve): Perform resolution here.
23340         (Parameter.ExternalType): The full type (with ref/out applied).
23341
23342         * statement.cs (Using.Emit, Using.EmitExpression): Implement
23343         support for expressions on the using statement.
23344
23345 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
23346
23347         * statement.cs (Using.EmitLocalVariableDecls): Split the
23348         localvariable handling of the using statement.
23349
23350         (Block.EmitMeta): Keep track of variable count across blocks.  We
23351         were reusing slots on separate branches of blocks.
23352
23353         (Try.Emit): Emit the general code block, we were not emitting it. 
23354
23355         Check the type of the declaration to be an IDisposable or
23356         something that can be implicity converted to it. 
23357
23358         Emit conversions if required.
23359
23360         * ecore.cs (EmptyExpression): New utility class.
23361         (Expression.ImplicitConversionExists): New utility function.
23362
23363 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
23364
23365         * statement.cs (Using): Implement.
23366
23367         * expression.cs (LocalVariableReference): Support read only variables.
23368
23369         * statement.cs: Remove the explicit emit for the Leave opcode.
23370         (VariableInfo): Add a readonly field.
23371
23372 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
23373
23374         * ecore.cs (ConvCast): new class used to encapsulate the various
23375         explicit integer conversions that works in both checked and
23376         unchecked contexts.
23377
23378         (Expression.ConvertNumericExplicit): Use new ConvCast class to
23379         properly generate the overflow opcodes.
23380
23381 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
23382
23383         * statement.cs: The correct type for the EmptyExpression is the
23384         element_type, not the variable type.  Ravi pointed this out.
23385
23386 2001-12-04  Ravi Pratap  <ravi@ximian.com>
23387
23388         * class.cs (Method::Define): Handle PInvoke methods specially
23389         by using DefinePInvokeMethod instead of the usual one.
23390
23391         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
23392         above to do the task of extracting information and defining the method.
23393
23394 2001-12-04  Ravi Pratap  <ravi@ximian.com>
23395
23396         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
23397         of the condition for string type.
23398
23399         (Emit): Move that here. 
23400
23401         (ArrayCreation::CheckIndices): Keep string literals in their expression
23402         form.
23403
23404         (EmitDynamicInitializers): Handle strings appropriately.
23405
23406 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
23407
23408         * codegen.cs (EmitContext): Replace multiple variables with a
23409         single pointer to the current Switch statement.
23410
23411         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
23412         EmitContext.
23413
23414 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
23415
23416         * statement.cs 
23417
23418         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
23419         default'.
23420
23421         (Foreach.Emit): Foreach on arrays was not setting
23422         up the loop variables (for break/continue).
23423
23424         (GotoCase): Semi-implented.
23425
23426 2001-12-03  Ravi Pratap  <ravi@ximian.com>
23427
23428         * attribute.cs (CheckAttribute): Handle system attributes by using
23429         Attribute.GetAttributes to examine information we need.
23430
23431         (GetValidPlaces): Same here.
23432
23433         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
23434
23435         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
23436
23437         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
23438
23439         (Method::Define): Set appropriate flags if we have a DllImport attribute.
23440
23441         (Method::Emit): Handle the case when we are a PInvoke method.
23442
23443 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
23444
23445         * expression.cs: Use ResolveWithSimpleName on compound names.
23446
23447 2001-12-02  Ravi Pratap  <ravi@ximian.com>
23448
23449         * constant.cs (EmitConstant): Make sure we resolve the associated expression
23450         before trying to reduce it.
23451
23452         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
23453
23454         * constant.cs (LookupConstantValue): Implement.
23455
23456         (EmitConstant): Use the above in emitting the constant.
23457
23458         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
23459         that are user-defined by doing a LookupConstantValue on them.
23460
23461         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
23462         too, like above.
23463
23464 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
23465
23466         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
23467
23468         (BaseAccess.DoResolve): Implement.
23469
23470         (MemberAccess.DoResolve): Split this routine into a
23471         ResolveMemberAccess routine that can be used independently
23472
23473 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
23474
23475         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
23476         As that share bits of the implementation.  Is returns a boolean,
23477         while As returns the Type that is being probed.
23478
23479 2001-12-01  Ravi Pratap  <ravi@ximian.com>
23480
23481         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
23482         instead of a Literal - much easier.
23483
23484         (EnumInTransit): Remove - utterly useless :-)
23485
23486         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
23487
23488         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
23489
23490         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
23491         chain when we have no associated expression.
23492
23493 2001-11-30  Ravi Pratap  <ravi@ximian.com>
23494
23495         * constant.cs (Define): Use Location while reporting the errror.
23496
23497         Also emit a warning when 'new' is used and there is no inherited
23498         member to hide.
23499
23500         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
23501         populated.
23502
23503         (LookupEnumValue): Implement to lookup an enum member's value and define it
23504         if necessary.
23505
23506         (Populate): Re-write accordingly to use the above routine.
23507
23508 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
23509
23510         * expression.cs (This): Fix prototype for DoResolveLValue to
23511         override the base class DoResolveLValue.
23512
23513         * cs-parser.cs: Report errors cs574 and cs575 (destructor
23514         declarations) 
23515
23516         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
23517         (we need to load the address of the field here).  This fixes
23518         test-22. 
23519
23520         (FieldExpr.DoResolveLValue): Call the DoResolve
23521         function to initialize the Instance expression.
23522
23523         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
23524         correctly the GetEnumerator operation on a value type.
23525
23526         * cs-parser.jay: Add more simple parsing error catches.
23527
23528         * statement.cs (Switch): Add support for string switches.
23529         Handle null specially.
23530
23531         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
23532
23533 2001-11-28  Ravi Pratap  <ravi@ximian.com>
23534
23535         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
23536
23537         (declare_local_constant): New helper function.
23538
23539         * statement.cs (AddConstant): Keep a separate record of constants
23540
23541         (IsConstant): Implement to determine if a variable is a constant.
23542
23543         (GetConstantExpression): Implement.
23544
23545         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
23546
23547         * statement.cs (IsVariableDefined): Re-write.
23548
23549 2001-11-27  Ravi Pratap  <ravi@ximian.com>
23550
23551         * class.cs (TypeContainer::FindMembers): Look for constants
23552         in the case when we are looking for MemberTypes.Field
23553
23554         * expression.cs (MemberAccess::DoResolve): Check that in the
23555         case we are a FieldExpr and a Literal, we are not being accessed
23556         by an instance reference.
23557
23558         * cs-parser.jay (local_constant_declaration): Implement.
23559
23560         (declaration_statement): Implement for constant declarations.
23561
23562 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
23563
23564         * statement.cs (Switch): Catch double defaults.
23565
23566         (Switch): More work on the switch() statement
23567         implementation.  It works for integral values now, need to finish
23568         string support.
23569
23570
23571 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23572
23573         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
23574         integer literals into other integer literals.  To be used by
23575         switch. 
23576
23577 2001-11-24  Ravi Pratap  <ravi@ximian.com>
23578
23579         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
23580         some memory.
23581
23582         (EmitDynamicInitializers): Cope with the above since we extract data
23583         directly from ArrayData now.
23584
23585         (ExpectInitializers): Keep track of whether initializers are mandatory
23586         or not.
23587
23588         (Bounds): Make it a hashtable to prevent the same dimension being 
23589         recorded for every element in that dimension.
23590
23591         (EmitDynamicInitializers): Fix bug which prevented the Set array method
23592         from being found.
23593
23594         Also fix bug which was causing the indices to be emitted in the reverse
23595         order.
23596
23597 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23598
23599         * expression.cs (ArrayCreation): Implement the bits that Ravi left
23600         unfinished.  They do not work, because the underlying code is
23601         sloppy.
23602
23603 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23604
23605         * cs-parser.jay: Remove bogus fixme.
23606
23607         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
23608         on Switch statement.
23609
23610 2001-11-23  Ravi Pratap  <ravi@ximian.com>
23611
23612         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
23613         the same. 
23614
23615         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
23616         parameter. Apparently, any expression is allowed. 
23617
23618         (ValidateInitializers): Update accordingly.
23619
23620         (CheckIndices): Fix some tricky bugs thanks to recursion.
23621
23622         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
23623         I was being completely brain-dead.
23624
23625         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23626         and re-write acordingly.
23627
23628         (DelegateInvocation): Re-write accordingly.
23629
23630         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23631
23632         (MakeByteBlob): Handle types more correctly.
23633
23634         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23635         initialization from expressions but it is incomplete because I am a complete
23636         Dodo :-|
23637
23638 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23639
23640         * statement.cs (If.Emit): Fix a bug that generated incorrect code
23641         on If.  Basically, we have to return `true' (ie, we do return to
23642         our caller) only if both branches of the if return.
23643
23644         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23645         short-circuit operators, handle them as short circuit operators. 
23646
23647         (Cast.DoResolve): Resolve type.
23648         (Cast.Cast): Take an expression as the target type.
23649
23650         * cs-parser.jay (cast_expression): Remove old hack that only
23651         allowed a limited set of types to be handled.  Now we take a
23652         unary_expression and we resolve to a type during semantic
23653         analysis.
23654
23655         Use the grammar productions from Rhys to handle casts (this is
23656         not complete like Rhys syntax yet, we fail to handle that corner
23657         case that C# has regarding (-x), but we will get there.
23658
23659 2001-11-22  Ravi Pratap  <ravi@ximian.com>
23660
23661         * class.cs (EmitFieldInitializer): Take care of the case when we have a
23662         field which is an array type.
23663
23664         * cs-parser.jay (declare_local_variables): Support array initialization too.
23665
23666         * typemanager.cs (MakeKey): Implement.
23667
23668         (everywhere): Use the above appropriately.
23669
23670         * cs-parser.jay (for_statement): Update for array initialization while
23671         declaring variables.
23672
23673         * ecore.cs : The error message was correct, it's the variable's names that
23674         were misleading ;-) Make the code more readable.
23675
23676         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23677         the correct type etc.
23678
23679         (ConvertExplicit): Handle Enum types by examining the underlying type.
23680
23681 2001-11-21  Ravi Pratap  <ravi@ximian.com>
23682
23683         * parameter.cs (GetCallingConvention): Always return
23684         CallingConventions.Standard for now.
23685
23686 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23687
23688         * expression.cs (Binary.ResolveOperator): Update the values of `l'
23689         and `r' after calling DoNumericPromotions.
23690
23691         * ecore.cs: Fix error message (the types were in the wrong order).
23692
23693         * statement.cs (Foreach.ProbeCollectionType): Need to pass
23694         BindingFlags.Instance as well 
23695
23696         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23697         implicit int literal conversion in an empty cast so that we
23698         propagate the right type upstream.
23699
23700         (UnboxCast): new class used to unbox value types.
23701         (Expression.ConvertExplicit): Add explicit type conversions done
23702         by unboxing.
23703
23704         (Expression.ImplicitNumericConversion): Oops, forgot to test for
23705         the target type before applying the implicit LongLiterals to ULong
23706         literal cast.
23707
23708 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
23709
23710         * cs-parser.jay (for_statement): Reworked the way For works: now
23711         we declare manually any variables that are introduced in
23712         for_initializer to solve the problem of having out-of-band code
23713         emition (that is what got for broken).
23714
23715         (declaration_statement): Perform the actual variable declaration
23716         that used to be done in local_variable_declaration here.
23717
23718         (local_variable_declaration): Do not declare anything, just pass
23719         the information on a DictionaryEntry
23720
23721 2001-11-20  Ravi Pratap  <ravi@ximian.com>
23722
23723         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23724         re-write of the logic to now make it recursive.
23725
23726         (UpdateIndices): Re-write accordingly.
23727
23728         Store element data in a separate ArrayData list in the above methods.
23729
23730         (MakeByteBlob): Implement to dump the array data into a byte array.
23731
23732 2001-11-19  Ravi Pratap  <ravi@ximian.com>
23733
23734         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23735         into CheckIndices.
23736
23737         * constant.cs (Define): Implement.
23738
23739         (EmitConstant): Re-write fully.
23740
23741         Pass in location info.
23742
23743         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23744         respectively.
23745
23746         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23747         DictionaryEntry since we need location info too.
23748
23749         (constant_declaration): Update accordingly.
23750
23751         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23752         code into another method : UpdateIndices.
23753
23754 2001-11-18  Ravi Pratap  <ravi@ximian.com>
23755
23756         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23757         some type checking etc.
23758
23759 2001-11-17  Ravi Pratap  <ravi@ximian.com>
23760
23761         * expression.cs (ArrayCreation::ValidateInitializers): Implement
23762         bits to provide dimension info if the user skips doing that.
23763
23764         Update second constructor to store the rank correctly.
23765
23766 2001-11-16  Ravi Pratap  <ravi@ximian.com>
23767
23768         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23769         and try to implement.
23770
23771         * ../errors/cs0150.cs : Add.
23772
23773         * ../errors/cs0178.cs : Add.
23774
23775 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
23776
23777         * statement.cs: Implement foreach on multi-dimensional arrays. 
23778
23779         * parameter.cs (Parameters.GetParameterByName): Also lookup the
23780         name of the params argument.
23781
23782         * expression.cs: Use EmitStoreOpcode to get the right opcode while
23783         initializing the array.
23784
23785         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23786         we can use this elsewhere.
23787
23788         * statement.cs: Finish implementation of foreach for single
23789         dimension arrays.
23790
23791         * cs-parser.jay: Use an out-of-band stack to pass information
23792         around, I wonder why I need this.
23793
23794         foreach_block: Make the new foreach_block the current_block.
23795
23796         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23797         function used to return a static Parameters structure.  Used for
23798         empty parameters, as those are created very frequently.
23799
23800         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23801
23802 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23803
23804         * interface.cs : Default modifier is private, not public. The
23805         make verify test passes again.
23806
23807 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23808
23809         * support.cs (ReflectionParameters): Fix logic to determine
23810         whether the last parameter is a params one. Test 9 passes again.
23811
23812         * delegate.cs (Populate): Register the builders we define with
23813         RegisterParameterForBuilder. Test 19 passes again.
23814
23815         * cs-parser.jay (property_declaration): Reference $6 instead
23816         of $$ to get at the location.
23817
23818         (indexer_declaration): Similar stuff.
23819
23820         (attribute): Ditto.
23821
23822         * class.cs (Property): Register parameters for the Get and Set methods
23823         if they exist. Test 23 passes again.
23824
23825         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23826         call to EmitArguments as we are sure there aren't any params arguments. 
23827         Test 32 passes again.
23828
23829         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23830         IndexOutOfRangeException. 
23831
23832         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23833         Test 33 now passes again.
23834
23835 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
23836
23837         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23838         broke a bunch of things.  Will have to come up with a better way
23839         of tracking locations.
23840
23841         * statement.cs: Implemented foreach for single dimension arrays.
23842
23843 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23844
23845         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23846         an error.  This removes the lookup from the critical path.
23847
23848         * cs-parser.jay: Removed use of temporary_loc, which is completely
23849         broken. 
23850
23851 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
23852
23853         * support.cs (ReflectionParameters.ParameterModifier): Report
23854         whether the argument is a PARAMS argument or not.
23855
23856         * class.cs: Set the attribute `ParamArrayAttribute' on the
23857         parameter argument.
23858
23859         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23860         and cons_param_array_attribute (ConstructorInfo for
23861         ParamArrayAttribute)., 
23862
23863         * codegen.cs: Emit the return using the `Return' statement, that
23864         way we can report the error correctly for missing return values. 
23865
23866         * class.cs (Method.Emit): Clean up.
23867
23868         * expression.cs (Argument.Resolve): Take another argument: the
23869         location where this argument is used.  Notice that this is not
23870         part of the "Argument" class as to reduce the size of the
23871         structure (we know the approximate location anyways).
23872
23873         Test if the argument is a variable-reference, if not, then
23874         complain with a 206.
23875
23876         (Argument.Emit): Emit addresses of variables.
23877
23878         (Argument.FullDesc): Simplify.
23879
23880         (Invocation.DoResolve): Update for Argument.Resolve.
23881
23882         (ElementAccess.DoResolve): ditto.
23883
23884         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23885         method should be virtual, as this method is always virtual.
23886
23887         (NewDelegate.DoResolve): Update for Argument.Resolve.
23888
23889         * class.cs (ConstructorInitializer.DoResolve): ditto.
23890
23891         * attribute.cs (Attribute.Resolve): ditto.
23892
23893 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
23894
23895         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23896
23897         * expression.cs (ParameterReference): Drop IStackStorage and implement
23898         IAssignMethod instead. 
23899
23900         (LocalVariableReference): ditto.
23901
23902         * ecore.cs (FieldExpr): Drop IStackStorage and implement
23903         IAssignMethod instead. 
23904
23905 2001-11-13  Miguel de Icaza <miguel@ximian.com>
23906
23907         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23908         enumerations that are used in heavily used structures derive from
23909         byte in a laughable and pathetic attempt to reduce memory usage.
23910         This is the kind of pre-optimzations that you should not do at
23911         home without adult supervision.
23912
23913         * expression.cs (UnaryMutator): New class, used to handle ++ and
23914         -- separatedly from the other unary operators.  Cleans up the
23915         code, and kills the ExpressionStatement dependency in Unary.
23916
23917         (Unary): Removed `method' and `Arguments' from this class, making
23918         it smaller, and moving it all to SimpleCall, so I can reuse this
23919         code in other locations and avoid creating a lot of transient data
23920         strucutres when not required.
23921
23922         * cs-parser.jay: Adjust for new changes.
23923
23924 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
23925
23926         * enum.cs (Enum.Populate): If there is a failure during
23927         definition, return
23928
23929         * cs-parser.jay (opt_enum_base): we used to catch type errors
23930         here, but this is really incorrect.  The type error should be
23931         catched during semantic analysis.
23932
23933 2001-12-11  Ravi Pratap  <ravi@ximian.com>
23934
23935         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23936         current_local_parameters as expected since I, in my stupidity, had forgotten
23937         to do this :-)
23938
23939         * attribute.cs (GetValidPlaces): Fix stupid bug.
23940
23941         * class.cs (Method::Emit): Perform check on applicability of attributes.
23942
23943         (Constructor::Emit): Ditto.
23944
23945         (Field::Emit): Ditto.
23946
23947         (Field.Location): Store location information.
23948
23949         (Property, Event, Indexer, Operator): Ditto.
23950
23951         * cs-parser.jay (field_declaration): Pass in location for each field.
23952
23953         * ../errors/cs0592.cs : Add.
23954
23955 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23956
23957         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23958
23959         (InitCoreTypes): Update accordingly.
23960
23961         (RegisterAttrType, LookupAttr): Implement.
23962
23963         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23964         info about the same.
23965
23966         (Resolve): Update to populate the above as necessary.
23967
23968         (Error592): Helper.
23969
23970         (GetValidPlaces): Helper to the above.
23971
23972         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23973
23974         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23975
23976 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23977
23978         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23979
23980         * ../errors/cs0617.cs : Add.
23981
23982 2001-11-11  Ravi Pratap  <ravi@ximian.com>
23983
23984         * enum.cs (Emit): Rename to Populate to be more consistent with what
23985         we expect it to do and when exactly it is called.
23986
23987         * class.cs, rootcontext.cs : Update accordingly.
23988
23989         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23990         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23991
23992         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23993
23994         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23995         of a fieldinfo using the above, when dealing with a FieldBuilder.
23996
23997 2001-11-10  Ravi Pratap  <ravi@ximian.com>
23998
23999         * ../errors/cs0031.cs : Add.
24000
24001         * ../errors/cs1008.cs : Add.
24002
24003         * ../errrors/cs0543.cs : Add.
24004
24005         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
24006         enum type.
24007
24008         (FindMembers): Implement.
24009
24010         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
24011         enums and delegates too.
24012
24013         (enum_types): Rename to builder_to_enum.
24014
24015         (delegate_types): Rename to builder_to_delegate.
24016
24017         * delegate.cs (FindMembers): Implement.
24018
24019 2001-11-09  Ravi Pratap  <ravi@ximian.com>
24020
24021         * typemanager.cs (IsEnumType): Implement.
24022
24023         * enum.cs (Emit): Re-write parts to account for the underlying type
24024         better and perform checking etc.
24025
24026         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
24027         of the underlying type.
24028
24029         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
24030         value
24031
24032         * enum.cs (error31): Helper to report error #31.
24033
24034         * cs-parser.jay (enum_declaration): Store location of each member too.
24035
24036         * enum.cs (member_to_location): New hashtable. 
24037
24038         (AddEnumMember): Update location hashtable.
24039
24040         (Emit): Use the location of each member while reporting errors.
24041
24042 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
24043
24044         * cs-parser.jay: A for_initializer if is a
24045         local_variable_declaration really ammount to have an implicit
24046         block with the variable declaration and no initializer for for.
24047
24048         * statement.cs (For.Emit): Cope with null initializers.
24049
24050         This fixes the infinite loop on for initializers.
24051
24052 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
24053
24054         * enum.cs: More cleanup.
24055
24056         * ecore.cs: Remove dead code.
24057
24058         * class.cs (Property.Emit): More simplification.
24059         (Event.Emit): ditto.
24060
24061         Reworked to have less levels of indentation.
24062
24063 2001-11-08  Ravi Pratap  <ravi@ximian.com>
24064
24065         * class.cs (Property): Emit attributes.
24066
24067         (Field): Ditto.
24068
24069         (Event): Ditto.
24070
24071         (Indexer): Ditto.
24072
24073         (Operator): Ditto.
24074
24075         * enum.cs (Emit): Ditto.
24076
24077         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
24078         Enums too.
24079
24080         * class.cs (Field, Event, etc.): Move attribute generation into the
24081         Emit method everywhere.
24082
24083         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
24084         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
24085         as we had no way of defining nested enums !
24086
24087         * rootcontext.cs : Adjust code accordingly.
24088
24089         * typemanager.cs (AddEnumType): To keep track of enum types separately.
24090
24091 2001-11-07  Ravi Pratap  <ravi@ximian.com>
24092
24093         * expression.cs (EvalConstantExpression): Move into ecore.cs
24094
24095         * enum.cs (Enum): Rename some members and make them public and readonly
24096         according to our convention.
24097
24098         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
24099         nothing else.
24100
24101         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
24102
24103         (Enum::Emit): Write a simple version for now which doesn't try to compute
24104         expressions. I shall modify this to be more robust in just a while.
24105
24106         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
24107
24108         (TypeContainer::CloseType): Create the Enum types too.
24109
24110         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
24111
24112         * expression.cs (EvalConstantExpression): Get rid of completely.
24113
24114         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
24115         user-defined values and other cases.
24116
24117         (IsValidEnumLiteral): Helper function.
24118
24119         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
24120         out there in the case we had a literal FieldExpr.
24121
24122         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
24123
24124         (Literalize): Revamp a bit to take two arguments.
24125
24126         (EnumLiteral): New class which derives from Literal to wrap enum literals.
24127
24128 2001-11-06  Ravi Pratap  <ravi@ximian.com>
24129
24130         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
24131
24132         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
24133
24134         (Resolve): Use the above to ensure we have proper initializers.
24135
24136 2001-11-05  Ravi Pratap  <ravi@ximian.com>
24137
24138         * expression.cs (Expression::EvalConstantExpression): New method to 
24139         evaluate constant expressions.
24140
24141         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
24142
24143 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
24144
24145         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
24146         in an array.
24147
24148         (Binary.ResolveOperator): Handle operator != (object a, object b)
24149         and operator == (object a, object b);
24150
24151         (Binary.DoNumericPromotions): Indicate whether the numeric
24152         promotion was possible.
24153
24154         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
24155         Implement.  
24156
24157         Made the ArrayAccess implement interface IAssignMethod instead of
24158         IStackStore as the order in which arguments are passed reflects
24159         this.
24160
24161         * assign.cs: Instead of using expr.ExprClass to select the way of
24162         assinging, probe for the IStackStore/IAssignMethod interfaces.
24163
24164         * typemanager.cs: Load InitializeArray definition.
24165
24166         * rootcontext.cs (RootContext.MakeStaticData): Used to define
24167         static data that can be used to initialize arrays. 
24168
24169 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
24170
24171         * expression.cs: Handle operator== and operator!= for booleans.
24172
24173         (Conditioal.Reduce): Implement reducer for the ?: operator.
24174
24175         (Conditional.Resolve): Implement dead code elimination.
24176
24177         (Binary.Resolve): Catch string literals and return a new
24178         concatenated string.
24179
24180         (Unary.Reduce): Implement reduction of unary expressions.
24181
24182         * ecore.cs: Split out the expression core handling here.
24183
24184         (Expression.Reduce): New method used to perform constant folding
24185         and CSE.  This is needed to support constant-expressions. 
24186
24187         * statement.cs (Statement.EmitBoolExpression): Pass true and false
24188         targets, and optimize for !x.
24189
24190 2001-11-04  Ravi Pratap  <ravi@ximian.com>
24191
24192         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
24193         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
24194         set custom atttributes.
24195
24196         * literal.cs (Literal::GetValue): New abstract method to return the actual
24197         value of the literal, cast as an object.
24198
24199         (*Literal): Implement GetValue method.
24200
24201         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
24202         expressions to the arraylist but objects of type Argument.
24203
24204         * class.cs (TypeContainer::Emit): Emit our attributes too.
24205
24206         (Method::Emit, Constructor::Emit): Ditto.
24207
24208         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
24209         to be ignoring earlier.
24210
24211 2001-11-03  Ravi Pratap  <ravi@ximian.com>
24212
24213         * attribute.cs (AttributeSection::Define): Implement to do the business
24214         of constructing a CustomAttributeBuilder.
24215
24216         (Attribute): New trivial class. Increases readability of code.  
24217
24218         * cs-parser.jay : Update accordingly.
24219
24220         (positional_argument_list, named_argument_list, named_argument): New rules
24221
24222         (attribute_arguments): Use the above so that we are more correct.
24223
24224 2001-11-02  Ravi Pratap  <ravi@ximian.com>
24225
24226         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
24227         to perform all checks for a method with a params parameter.
24228
24229         (Invocation::OverloadResolve): Update to use the above method and therefore
24230         cope correctly with params method invocations.
24231
24232         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
24233         params too.
24234
24235         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
24236         constructors in our parent too because we can't afford to miss out on 
24237         protected ones ;-)
24238
24239         * attribute.cs (AttributeSection): New name for the class Attribute
24240
24241         Other trivial changes to improve readability.
24242
24243         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
24244         use the new class names.
24245
24246 2001-11-01  Ravi Pratap  <ravi@ximian.com>
24247
24248         * class.cs (Method::Define): Complete definition for params types too
24249
24250         (Indexer::Define): Ditto.
24251
24252         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
24253         Cope everywhere with a request for info about the array parameter.
24254
24255 2001-11-01  Ravi Pratap  <ravi@ximian.com>
24256
24257         * tree.cs (RecordNamespace): Fix up to check for the correct key.
24258
24259         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
24260         local_variable_type to extract the string corresponding to the type.
24261
24262         (local_variable_type): Fixup the action to use the new helper method.
24263
24264         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
24265         go.
24266
24267         * expression.cs : Clean out code which uses the above.
24268
24269 2001-10-31  Ravi Pratap  <ravi@ximian.com>
24270
24271         * typemanager.cs (RegisterMethod): Check if we already have an existing key
24272         and bale out if necessary by returning a false.
24273
24274         (RegisterProperty): Ditto.
24275
24276         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
24277         and print out appropriate error messages.
24278
24279         * interface.cs (everywhere): Ditto.
24280
24281         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
24282         location to constructor.
24283
24284         * class.cs (Property, Event, Indexer): Update accordingly.
24285
24286         * ../errors/cs111.cs : Added.
24287
24288         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
24289         of a method, as laid down by the spec.
24290
24291         (Invocation::OverloadResolve): Use the above method.
24292
24293 2001-10-31  Ravi Pratap  <ravi@ximian.com>
24294
24295         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
24296         now take a TypeContainer and a Parameters object.
24297
24298         (ParameterData): Modify return type of ParameterModifier method to be 
24299         Parameter.Modifier and not a string.
24300
24301         (ReflectionParameters, InternalParameters): Update accordingly.
24302
24303         * expression.cs (Argument::GetParameterModifier): Same here.
24304
24305         * support.cs (InternalParameters::ParameterType): Find a better way of determining
24306         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
24307         symbol in it at all so maybe this is only for now.
24308
24309 2001-10-30  Ravi Pratap  <ravi@ximian.com>
24310
24311         * support.cs (InternalParameters): Constructor now takes an extra argument 
24312         which is the actual Parameters class.
24313
24314         (ParameterDesc): Update to provide info on ref/out modifiers.
24315
24316         * class.cs (everywhere): Update call to InternalParameters to pass in
24317         the second argument too.
24318
24319         * support.cs (ParameterData): Add ParameterModifier, which is a method 
24320         to return the modifier info [ref/out etc]
24321
24322         (InternalParameters, ReflectionParameters): Implement the above.
24323
24324         * expression.cs (Argument::ParameterModifier): Similar function to return
24325         info about the argument's modifiers.
24326
24327         (Invocation::OverloadResolve): Update to take into account matching modifiers 
24328         too.
24329
24330         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
24331         a new SetFormalParameters object which we pass to InternalParameters.
24332
24333 2001-10-30  Ravi Pratap  <ravi@ximian.com>
24334
24335         * expression.cs (NewArray): Merge into the ArrayCreation class.
24336
24337 2001-10-29  Ravi Pratap  <ravi@ximian.com>
24338
24339         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
24340         NewUserdefinedArray into one as there wasn't much of a use in having
24341         two separate ones.
24342
24343         * expression.cs (Argument): Change field's name to ArgType from Type.
24344
24345         (Type): New readonly property which returns the proper type, taking into 
24346         account ref/out modifiers.
24347
24348         (everywhere): Adjust code accordingly for the above.
24349
24350         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
24351         whether we are emitting for a ref or out parameter.
24352
24353         * expression.cs (Argument::Emit): Use the above field to set the state.
24354
24355         (LocalVariableReference::Emit): Update to honour the flag and emit the
24356         right stuff.
24357
24358         * parameter.cs (Attributes): Set the correct flags for ref parameters.
24359
24360         * expression.cs (Argument::FullDesc): New function to provide a full desc.
24361
24362         * support.cs (ParameterData): Add method ParameterDesc to the interface.
24363
24364         (ReflectionParameters, InternalParameters): Implement the above method.
24365
24366         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
24367         reporting errors.
24368
24369         (Invocation::FullMethodDesc): Ditto. 
24370
24371 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
24372
24373         * cs-parser.jay: Add extra production for the second form of array
24374         creation. 
24375
24376         * expression.cs (ArrayCreation): Update to reflect the above
24377         change. 
24378
24379         * Small changes to prepare for Array initialization.
24380
24381 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
24382
24383         * typemanager.cs (ImplementsInterface): interface might be null;
24384         Deal with this problem;
24385
24386         Also, we do store negative hits on the cache (null values), so use
24387         this instead of calling t.GetInterfaces on the type everytime.
24388
24389 2001-10-28  Ravi Pratap  <ravi@ximian.com>
24390
24391         * typemanager.cs (IsBuiltinType): New method to help determine the same.
24392
24393         * expression.cs (New::DoResolve): Get rid of array creation code and instead
24394         split functionality out into different classes.
24395
24396         (New::FormArrayType): Move into NewBuiltinArray.
24397
24398         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
24399         quite useless.
24400
24401         (NewBuiltinArray): New class to handle creation of built-in arrays.
24402
24403         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
24404         account creation of one-dimensional arrays.
24405
24406         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
24407
24408         (NewUserdefinedArray::DoResolve): Implement.
24409
24410         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
24411
24412         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
24413         we maintain inside the TypeManager. This is necessary to perform lookups on the
24414         module builder.
24415
24416         (LookupType): Update to perform GetType on the module builders too.     
24417
24418         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
24419
24420         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
24421
24422 2001-10-23  Ravi Pratap  <ravi@ximian.com>
24423
24424         * expression.cs (New::DoResolve): Implement guts of array creation.
24425
24426         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
24427
24428 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
24429
24430         * expression.cs: Fix bug I introduced lsat night that broke
24431         Delegates. 
24432
24433         (Expression.Resolve): Report a 246 error (can not resolve name)
24434         if we find a SimpleName in the stream.
24435
24436         (Expression.ResolveLValue): Ditto.
24437
24438         (Expression.ResolveWithSimpleName): This function is a variant of
24439         ResolveName, this one allows SimpleNames to be returned without a
24440         warning.  The only consumer of SimpleNames is MemberAccess
24441
24442 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
24443
24444         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
24445         might arrive here.  I have my doubts that this is correct.
24446
24447         * statement.cs (Lock): Implement lock statement.
24448
24449         * cs-parser.jay: Small fixes to support `lock' and `using'
24450
24451         * cs-tokenizer.cs: Remove extra space
24452
24453         * driver.cs: New flag --checked, allows to turn on integer math
24454         checking. 
24455
24456         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
24457         Threading.Monitor.Exit 
24458
24459 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
24460
24461         * expression.cs (IndexerAccess::DoResolveLValue): Set the
24462         Expression Class to be IndexerAccess.
24463
24464         Notice that Indexer::DoResolve sets the eclass to Value.
24465
24466 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
24467
24468         * class.cs (TypeContainer::Emit): Emit code for indexers.
24469
24470         * assign.cs (IAssignMethod): New interface implemented by Indexers
24471         and Properties for handling assignment.
24472
24473         (Assign::Emit): Simplify and reuse code. 
24474
24475         * expression.cs (IndexerAccess, PropertyExpr): Implement
24476         IAssignMethod, clean up old code. 
24477
24478 2001-10-22  Ravi Pratap  <ravi@ximian.com>
24479
24480         * typemanager.cs (ImplementsInterface): New method to determine if a type
24481         implements a given interface. Provides a nice cache too.
24482
24483         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
24484         method.
24485
24486         (ConvertReferenceExplicit): Ditto.
24487
24488         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
24489         various methods, with correct names etc.
24490
24491         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
24492         Operator.UnaryNegation.
24493
24494         * cs-parser.jay (operator_declarator): Be a little clever in the case where
24495         we have a unary plus or minus operator.
24496
24497         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
24498         UnaryMinus.
24499
24500         * everywhere : update accordingly.
24501
24502         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
24503         respectively.
24504
24505         * class.cs (Method::Define): For the case where we are implementing a method
24506         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
24507         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
24508
24509 2001-10-21  Ravi Pratap  <ravi@ximian.com>
24510
24511         * interface.cs (FindMembers): Implement to work around S.R.E
24512         lameness.
24513
24514         * typemanager.cs (IsInterfaceType): Implement.
24515
24516         (FindMembers): Update to handle interface types too.
24517
24518         * expression.cs (ImplicitReferenceConversion): Re-write bits which
24519         use IsAssignableFrom as that is not correct - it doesn't work.
24520
24521         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
24522         and accordingly override EmitStatement.
24523
24524         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
24525         using the correct logic :-)
24526
24527 2001-10-19  Ravi Pratap  <ravi@ximian.com>
24528
24529         * ../errors/cs-11.cs : Add to demonstrate error -11 
24530
24531 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
24532
24533         * assign.cs (Assign::Resolve): Resolve right hand side first, and
24534         then pass this as a hint to ResolveLValue.
24535
24536         * expression.cs (FieldExpr): Add Location information
24537
24538         (FieldExpr::LValueResolve): Report assignment to readonly
24539         variable. 
24540
24541         (Expression::ExprClassFromMemberInfo): Pass location information.
24542
24543         (Expression::ResolveLValue): Add new method that resolves an
24544         LValue. 
24545
24546         (Expression::DoResolveLValue): Default invocation calls
24547         DoResolve. 
24548
24549         (Indexers): New class used to keep track of indexers in a given
24550         Type. 
24551
24552         (IStackStore): Renamed from LValue, as it did not really describe
24553         what this did.  Also ResolveLValue is gone from this interface and
24554         now is part of Expression.
24555
24556         (ElementAccess): Depending on the element access type
24557
24558         * typemanager.cs: Add `indexer_name_type' as a Core type
24559         (System.Runtime.CompilerServices.IndexerNameAttribute)
24560
24561         * statement.cs (Goto): Take a location.
24562
24563 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24564
24565         * delegate.cs (Delegate::VerifyDelegate): New method to verify
24566         if two delegates are compatible.
24567
24568         (NewDelegate::DoResolve): Update to take care of the case when
24569         we instantiate a delegate from another delegate.
24570
24571         * typemanager.cs (FindMembers): Don't even try to look up members
24572         of Delegate types for now.
24573
24574 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24575
24576         * delegate.cs (NewDelegate): New class to take care of delegate
24577         instantiation.
24578
24579         * expression.cs (New): Split the delegate related code out into 
24580         the NewDelegate class.
24581
24582         * delegate.cs (DelegateInvocation): New class to handle delegate 
24583         invocation.
24584
24585         * expression.cs (Invocation): Split out delegate related code into
24586         the DelegateInvocation class.
24587
24588 2001-10-17  Ravi Pratap  <ravi@ximian.com>
24589
24590         * expression.cs (New::DoResolve): Implement delegate creation fully
24591         and according to the spec.
24592
24593         (New::DoEmit): Update to handle delegates differently.
24594
24595         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
24596         because of which we were printing out arguments in reverse order !
24597
24598         * delegate.cs (VerifyMethod): Implement to check if the given method
24599         matches the delegate.
24600
24601         (FullDelegateDesc): Implement.
24602
24603         (VerifyApplicability): Implement.
24604
24605         * expression.cs (Invocation::DoResolve): Update to accordingly handle
24606         delegate invocations too.
24607
24608         (Invocation::Emit): Ditto.
24609
24610         * ../errors/cs1593.cs : Added.
24611
24612         * ../errors/cs1594.cs : Added.
24613
24614         * delegate.cs (InstanceExpression, TargetMethod): New properties.
24615
24616 2001-10-16  Ravi Pratap  <ravi@ximian.com>
24617
24618         * typemanager.cs (intptr_type): Core type for System.IntPtr
24619
24620         (InitCoreTypes): Update for the same.
24621
24622         (iasyncresult_type, asynccallback_type): Ditto.
24623
24624         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24625         correct.
24626
24627         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24628         too.
24629
24630         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24631         the builders for the 4 members of a delegate type :-)
24632
24633         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24634         type.
24635
24636         * expression.cs (New::DoResolve): Implement guts for delegate creation.
24637
24638         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24639
24640 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
24641
24642         * statement.cs (Break::Emit): Implement.   
24643         (Continue::Emit): Implement.
24644
24645         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24646         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24647         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24648         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
24649         end loop
24650
24651         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24652         properties that track the label for the current loop (begin of the
24653         loop and end of the loop).
24654
24655 2001-10-15  Ravi Pratap  <ravi@ximian.com>
24656
24657         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24658         use of emitting anything at all.
24659
24660         * class.cs, rootcontext.cs : Get rid of calls to the same.
24661
24662         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24663
24664         (Populate): Define the constructor correctly and set the implementation
24665         attributes.
24666
24667         * typemanager.cs (delegate_types): New hashtable to hold delegates that
24668         have been defined.
24669
24670         (AddDelegateType): Implement.
24671
24672         (IsDelegateType): Implement helper method.
24673
24674         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24675
24676         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24677         and accordingly handle it.
24678
24679         * delegate.cs (Populate): Take TypeContainer argument.
24680         Implement bits to define the Invoke method. However, I still haven't figured out
24681         how to take care of the native int bit :-(
24682
24683         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
24684         Qualify the name of the delegate, not its return type !
24685
24686         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24687         conversion.
24688
24689         (StandardConversionExists): Checking for array types turns out to be recursive.
24690
24691         (ConvertReferenceExplicit): Implement array conversion.
24692
24693         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24694
24695 2001-10-12  Ravi Pratap  <ravi@ximian.com>
24696
24697         * cs-parser.jay (delegate_declaration): Store the fully qualified
24698         name as it is a type declaration.
24699
24700         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
24701         readonly.
24702
24703         (DefineDelegate): Renamed from Define. Does the same thing essentially,
24704         as TypeContainer::DefineType.
24705
24706         (Populate): Method in which all the definition of the various methods (Invoke)
24707         etc is done.
24708
24709         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24710         see.
24711
24712         (CloseDelegate): Finally creates the delegate.
24713
24714         * class.cs (TypeContainer::DefineType): Update to define delegates.
24715         (Populate, Emit and CloseType): Do the same thing here too.
24716
24717         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24718         delegates in all these operations.
24719
24720 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
24721
24722         * expression.cs: LocalTemporary: a new expression used to
24723         reference a temporary that has been created.
24724
24725         * assign.cs: Handle PropertyAccess back here, so that we can
24726         provide the proper semantic access to properties.
24727
24728         * expression.cs (Expression::ConvertReferenceExplicit): Implement
24729         a few more explicit conversions. 
24730
24731         * modifiers.cs: `NEW' modifier maps to HideBySig.
24732
24733         * expression.cs (PropertyExpr): Make this into an
24734         ExpressionStatement, and support the EmitStatement code path. 
24735
24736         Perform get/set error checking, clean up the interface.
24737
24738         * assign.cs: recognize PropertyExprs as targets, and if so, turn
24739         them into toplevel access objects.
24740
24741 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
24742
24743         * expression.cs: PropertyExpr::PropertyExpr: use work around the
24744         SRE.
24745
24746         * typemanager.cs: Keep track here of our PropertyBuilders again to
24747         work around lameness in SRE.
24748
24749 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
24750
24751         * expression.cs (LValue::LValueResolve): New method in the
24752         interface, used to perform a second resolution pass for LValues. 
24753
24754         (This::DoResolve): Catch the use of this in static methods.
24755
24756         (This::LValueResolve): Implement.
24757
24758         (This::Store): Remove warning, assigning to `this' in structures
24759         is 
24760
24761         (Invocation::Emit): Deal with invocation of
24762         methods on value types.  We need to pass the address to structure
24763         methods rather than the object itself.  (The equivalent code to
24764         emit "this" for structures leaves the entire structure on the
24765         stack instead of a pointer to it). 
24766
24767         (ParameterReference::DoResolve): Compute the real index for the
24768         argument based on whether the method takes or not a `this' pointer
24769         (ie, the method is static).
24770
24771         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24772         value types returned from functions when we need to invoke a
24773         method on the sturcture.
24774
24775
24776 2001-10-11  Ravi Pratap  <ravi@ximian.com>
24777
24778         * class.cs (TypeContainer::DefineType): Method to actually do the business of
24779         defining the type in the Modulebuilder or Typebuilder. This is to take
24780         care of nested types which need to be defined on the TypeBuilder using
24781         DefineNestedMethod.
24782
24783         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
24784         methods in RootContext, only ported to be part of TypeContainer.
24785
24786         (TypeContainer::GetInterfaceOrClass): Ditto.
24787
24788         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24789
24790         * interface.cs (Interface::DefineInterface): New method. Does exactly
24791         what RootContext.CreateInterface did earlier, only it takes care of nested types 
24792         too.
24793
24794         (Interface::GetInterfaces): Move from RootContext here and port.
24795
24796         (Interface::GetInterfaceByName): Same here.
24797
24798         * rootcontext.cs (ResolveTree): Re-write.
24799
24800         (PopulateTypes): Re-write.
24801
24802         * class.cs (TypeContainer::Populate): Populate nested types too.
24803         (TypeContainer::Emit): Emit nested members too.
24804
24805         * typemanager.cs (AddUserType): Do not make use of the FullName property,
24806         instead just use the name argument passed in as it is already fully
24807         qualified.
24808
24809         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24810         to TypeContainer mapping to see if a type is user-defined.
24811
24812         * class.cs (TypeContainer::CloseType): Implement. 
24813
24814         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24815         the default constructor.
24816
24817         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24818         twice.
24819
24820         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24821
24822         * interface.cs (CloseType): Create the type here.
24823
24824         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24825         the hierarchy.
24826
24827         Remove all the methods which are now in TypeContainer.
24828
24829 2001-10-10  Ravi Pratap  <ravi@ximian.com>
24830
24831         * delegate.cs (Define): Re-write bits to define the delegate
24832         correctly.
24833
24834 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
24835
24836         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24837
24838         * expression.cs (ImplicitReferenceConversion): handle null as well
24839         as a source to convert to any reference type.
24840
24841         * statement.cs (Return): Perform any implicit conversions to
24842         expected return type.  
24843
24844         Validate use of return statement.  
24845
24846         * codegen.cs (EmitContext): Pass the expected return type here.
24847
24848         * class.cs (Method, Constructor, Property): Pass expected return
24849         type to EmitContext.
24850
24851 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
24852
24853         * expression.cs: Make DoResolve take an EmitContext instead of a
24854         TypeContainer.
24855
24856         Replaced `l' and `location' for `loc', for consistency.
24857
24858         (Error, Warning): Remove unneeded Tc argument.
24859
24860         * assign.cs, literal.cs, constant.cs: Update to new calling
24861         convention. 
24862
24863         * codegen.cs: EmitContext now contains a flag indicating whether
24864         code is being generated in a static method or not.
24865
24866         * cs-parser.jay: DecomposeQI, new function that replaces the old
24867         QualifiedIdentifier.  Now we always decompose the assembled
24868         strings from qualified_identifier productions into a group of
24869         memberaccesses.
24870
24871 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
24872
24873         * rootcontext.cs: Deal with field-less struct types correctly now
24874         by passing the size option to Define Type.
24875
24876         * class.cs: Removed hack that created one static field. 
24877
24878 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24879
24880         * statement.cs: Moved most of the code generation here. 
24881
24882 2001-10-09  Ravi Pratap  <ravi@ximian.com>
24883
24884         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24885         seem very right.
24886
24887         (ElementAccess): Remove useless bits for now - keep checks as the spec
24888         says.
24889
24890 2001-10-08  Ravi Pratap  <ravi@ximian.com>
24891
24892         * expression.cs (ElementAccess::DoResolve): Remove my crap code
24893         and start performing checks according to the spec.
24894
24895 2001-10-07  Ravi Pratap  <ravi@ximian.com>
24896
24897         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24898         rank_specifiers instead.
24899
24900         (rank_specifiers): Change the order in which the rank specifiers are stored
24901
24902         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24903
24904         * expression.cs (ElementAccess): Implement the LValue interface too.
24905
24906 2001-10-06  Ravi Pratap  <ravi@ximian.com>
24907
24908         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24909         except that user defined conversions are not included.
24910
24911         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
24912         perform the conversion of the return type, if necessary.
24913
24914         (New::DoResolve): Check whether we are creating an array or an object
24915         and accordingly do the needful.
24916
24917         (New::Emit): Same here.
24918
24919         (New::DoResolve): Implement guts of array creation.
24920
24921         (New::FormLookupType): Helper function.
24922
24923 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24924
24925         * codegen.cs: Removed most of the code generation here, and move the
24926         corresponding code generation bits to the statement classes. 
24927
24928         Added support for try/catch/finalize and throw.
24929
24930         * cs-parser.jay: Added support for try/catch/finalize.
24931
24932         * class.cs: Catch static methods having the flags override,
24933         virtual or abstract.
24934
24935         * expression.cs (UserCast): This user cast was not really doing
24936         what it was supposed to do.  Which is to be born in fully resolved
24937         state.  Parts of the resolution were being performed at Emit time! 
24938
24939         Fixed this code.
24940
24941 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24942
24943         * expression.cs: Implicity convert the result from UserCast.
24944
24945 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24946
24947         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24948         prevented it from working correctly. 
24949
24950         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24951         merely ConvertImplicit.
24952
24953 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24954
24955         * typemanager.cs: Make the LookupTypeContainer function static,
24956         and not per-instance.  
24957
24958         * class.cs: Make static FindMembers (the one that takes a Type
24959         argument). 
24960
24961         * codegen.cs: Add EmitForeach here.
24962
24963         * cs-parser.jay: Make foreach a toplevel object instead of the
24964         inline expansion, as we need to perform semantic analysis on it. 
24965
24966 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24967
24968         * expression.cs (Expression::ImplicitUserConversion): Rename to
24969         UserDefinedConversion.
24970
24971         (Expression::UserDefinedConversion): Take an extra argument specifying 
24972         whether we look for explicit user conversions too.
24973
24974         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24975
24976         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24977
24978         (ExplicitUserConversion): Make it a call to UserDefinedConversion
24979         with the appropriate arguments.
24980
24981         * cs-parser.jay (cast_expression): Record location too.
24982
24983         * expression.cs (Cast): Record location info.
24984
24985         (Expression::ConvertExplicit): Take location argument.
24986
24987         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24988         to determine if we are doing explicit conversions.
24989
24990         (UserCast::Emit): Update accordingly.
24991
24992         (Expression::ConvertExplicit): Report an error if everything fails.
24993
24994         * ../errors/cs0030.cs : Add.
24995
24996 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
24997
24998         * modifiers.cs: If the ABSTRACT keyword is present, also set the
24999         virtual and newslot bits. 
25000
25001         * class.cs (TypeContainer::RegisterRequiredImplementations):
25002         Record methods we need.
25003
25004         (TypeContainer::MakeKey): Helper function to make keys for
25005         MethodBases, since the Methodbase key is useless.
25006
25007         (TypeContainer::Populate): Call RegisterRequiredImplementations
25008         before defining the methods.   
25009
25010         Create a mapping for method_builders_to_methods ahead of time
25011         instead of inside a tight loop.
25012
25013         (::RequireMethods):  Accept an object as the data to set into the
25014         hashtable so we can report interface vs abstract method mismatch.
25015
25016 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
25017
25018         * report.cs: Make all of it static.
25019
25020         * rootcontext.cs: Drop object_type and value_type computations, as
25021         we have those in the TypeManager anyways.
25022
25023         Drop report instance variable too, now it is a global.
25024
25025         * driver.cs: Use try/catch on command line handling.
25026
25027         Add --probe option to debug the error reporting system with a test
25028         suite. 
25029
25030         * report.cs: Add support for exiting program when a probe
25031         condition is reached.
25032
25033 2001-10-03  Ravi Pratap  <ravi@ximian.com>
25034
25035         * expression.cs (Binary::DoNumericPromotions): Fix the case when
25036         we do a forcible conversion regardless of type, to check if 
25037         ForceConversion returns a null.
25038
25039         (Binary::error19): Use location to report error.
25040
25041         (Unary::error23): Use location here too.
25042
25043         * ../errors/cs0019.cs : Check in.
25044
25045         * ../errors/cs0023.cs : Check in.
25046
25047         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
25048         case of a non-null MethodInfo object with a length of 0 !
25049
25050         (Binary::ResolveOperator): Flag error if overload resolution fails to find
25051         an applicable member - according to the spec :-)
25052         Also fix logic to find members in base types.
25053
25054         (Unary::ResolveOperator): Same here.
25055
25056         (Unary::report23): Change name to error23 and make first argument a TypeContainer
25057         as I was getting thoroughly confused between this and error19 :-)
25058
25059         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
25060         (::FindMostEncompassedType): Implement.
25061         (::FindMostEncompassingType): Implement.
25062         (::StandardConversionExists): Implement.
25063
25064         (UserImplicitCast): Re-vamp. We now need info about most specific
25065         source and target types so that we can do the necessary conversions.
25066
25067         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
25068         mathematical union with no duplicates.
25069
25070 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
25071
25072         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
25073         in order from base classes to child classes, so that we can in
25074         child classes look up in our parent for method names and
25075         attributes (required for handling abstract, virtual, new, override
25076         constructs: we need to instrospect our base class, and if we dont
25077         populate the classes in order, the introspection might be
25078         incorrect.  For example, a method could query its parent before
25079         the parent has any methods and would determine that the parent has
25080         no abstract methods (while it could have had them)).
25081
25082         (RootContext::CreateType): Record the order in which we define the
25083         classes.
25084
25085 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
25086
25087         * class.cs (TypeContainer::Populate): Also method definitions can
25088         fail now, keep track of this.
25089
25090         (TypeContainer::FindMembers): Implement support for
25091         DeclaredOnly/noDeclaredOnly flag.
25092
25093         (Constructor::Emit) Return the ConstructorBuilder.
25094
25095         (Method::Emit) Return the MethodBuilder. 
25096         Check for abstract or virtual methods to be public.
25097
25098         * rootcontext.cs (RootContext::CreateType): Register all the
25099         abstract methods required for the class to be complete and the
25100         interface methods that must be implemented. 
25101
25102         * cs-parser.jay: Report error 501 (method requires body if it is
25103         not marked abstract or extern).
25104
25105         * expression.cs (TypeOf::Emit): Implement.
25106
25107         * typemanager.cs: runtime_handle_type, new global type.
25108
25109         * class.cs (Property::Emit): Generate code for properties.
25110
25111 2001-10-02  Ravi Pratap  <ravi@ximian.com>
25112
25113         * expression.cs (Unary::ResolveOperator): Find operators on base type
25114         too - we now conform exactly to the spec.
25115
25116         (Binary::ResolveOperator): Same here.
25117
25118         * class.cs (Operator::Define): Fix minor quirk in the tests.
25119
25120         * ../errors/cs0215.cs : Added.
25121
25122         * ../errors/cs0556.cs : Added.
25123
25124         * ../errors/cs0555.cs : Added.
25125
25126 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
25127
25128         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
25129         single integer which is really efficient
25130
25131 2001-10-01  Ravi Pratap  <ravi@ximian.com>
25132
25133         *  expression.cs (Expression::ImplicitUserConversion): Use location
25134         even in the case when we are examining True operators.
25135  
25136         * class.cs (Operator::Define): Perform extensive checks to conform
25137         with the rules for operator overloading in the spec.
25138
25139         * expression.cs (Expression::ImplicitReferenceConversion): Implement
25140         some of the other conversions mentioned in the spec.
25141
25142         * typemanager.cs (array_type): New static member for the System.Array built-in
25143         type.
25144
25145         (cloneable_interface): For System.ICloneable interface.
25146
25147         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
25148         we start resolving the tree and populating types.
25149
25150         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
25151  
25152 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
25153
25154         * expression.cs (Expression::ExprClassFromMemberInfo,
25155         Expression::Literalize): Create literal expressions from
25156         FieldInfos which are literals.
25157
25158         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
25159         type casts, because they were wrong.  The test suite in tests
25160         caught these ones.
25161
25162         (ImplicitNumericConversion): ushort to ulong requires a widening
25163         cast. 
25164
25165         Int32 constant to long requires widening cast as well.
25166
25167         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
25168         for integers because the type on the stack is not i4.
25169
25170 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
25171
25172         * expression.cs (report118): require location argument. 
25173
25174         * parameter.cs: Do not dereference potential null value.
25175
25176         * class.cs: Catch methods that lack the `new' keyword when
25177         overriding a name.  Report warnings when `new' is used without
25178         anything being there to override.
25179
25180         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
25181
25182         * class.cs: Only add constructor to hashtable if it is non-null
25183         (as now constructors can fail on define).
25184
25185         (TypeManager, Class, Struct): Take location arguments.
25186
25187         Catch field instance initialization in structs as errors.
25188
25189         accepting_filter: a new filter for FindMembers that is static so
25190         that we dont create an instance per invocation.
25191
25192         (Constructor::Define): Catch errors where a struct constructor is
25193         parameterless 
25194
25195         * cs-parser.jay: Pass location information for various new
25196         constructs. 
25197
25198         * delegate.cs (Delegate): take a location argument.
25199
25200         * driver.cs: Do not call EmitCode if there were problesm in the
25201         Definition of the types, as many Builders wont be there. 
25202
25203         * decl.cs (Decl::Decl): Require a location argument.
25204
25205         * cs-tokenizer.cs: Handle properly hex constants that can not fit
25206         into integers, and find the most appropiate integer for it.
25207
25208         * literal.cs: Implement ULongLiteral.
25209
25210         * rootcontext.cs: Provide better information about the location of
25211         failure when CreateType fails.
25212
25213 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
25214
25215         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
25216         as well.
25217
25218         * expression.cs (Binary::CheckShiftArguments): Add missing type
25219         computation.
25220         (Binary::ResolveOperator): Add type to the logical and and logical
25221         or, Bitwise And/Or and Exclusive Or code paths, it was missing
25222         before.
25223
25224         (Binary::DoNumericPromotions): In the case where either argument
25225         is ulong (and most signed types combined with ulong cause an
25226         error) perform implicit integer constant conversions as well.
25227
25228 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
25229
25230         * expression.cs (UserImplicitCast): Method should always be
25231         non-null. 
25232         (Invocation::BetterConversion): Simplified test for IntLiteral.
25233
25234         (Expression::ImplicitNumericConversion): Split this routine out.
25235         Put the code that performs implicit constant integer conversions
25236         here. 
25237
25238         (Expression::Resolve): Become a wrapper around DoResolve so we can
25239         check eclass and type being set after resolve.
25240
25241         (Invocation::Badness): Remove this dead function
25242
25243         (Binary::ResolveOperator): Do not compute the expensive argumnets
25244         unless we have a union for it.
25245
25246         (Probe::Emit): Is needs to do an isinst and then
25247         compare against null.
25248
25249         (::CanConvert): Added Location argument.  If the Location argument
25250         is null (Location.Null), then we do not report errors.  This is
25251         used by the `probe' mechanism of the Explicit conversion.  We do
25252         not want to generate an error for something that the user
25253         explicitly requested to be casted.  But the pipeline for an
25254         explicit cast first tests for potential implicit casts.
25255
25256         So for now, if the Location is null, it means `Probe only' to
25257         avoid adding another argument.   Might have to revise this
25258         strategy later.
25259
25260         (ClassCast): New class used to type cast objects into arbitrary
25261         classes (used in Explicit Reference Conversions).
25262
25263         Implement `as' as well.
25264
25265         Reverted all the patches from Ravi below: they were broken:
25266
25267                 * The use of `level' as a mechanism to stop recursive
25268                   invocations is wrong.  That was there just to catch the
25269                   bug with a strack trace but not as a way of addressing
25270                   the problem.
25271
25272                   To fix the problem we have to *understand* what is going
25273                   on and the interactions and come up with a plan, not
25274                   just get things going.
25275
25276                 * The use of the type conversion cache that I proposed
25277                   last night had an open topic: How does this work across
25278                   protection domains.  A user defined conversion might not
25279                   be public in the location where we are applying the
25280                   conversion, a different conversion might be selected
25281                   (ie, private A->B (better) but public B->A (worse),
25282                   inside A, A->B applies, but outside it, B->A will
25283                   apply).
25284
25285                 * On top of that (ie, even if the above is solved),
25286                   conversions in a cache need to be abstract.  Ie, `To
25287                   convert from an Int to a Short use an OpcodeCast', not
25288                   `To convert from an Int to a Short use the OpcodeCast on
25289                   the variable 5' (which is what this patch was doing).
25290
25291 2001-09-28  Ravi Pratap  <ravi@ximian.com>
25292
25293         * expression.cs (Invocation::ConversionExists): Re-write to use
25294         the conversion cache
25295
25296         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
25297         cache all conversions done, not just user-defined ones.
25298
25299         (Invocation::BetterConversion): The real culprit. Use ConversionExists
25300         to determine if a conversion exists instead of acutually trying to 
25301         perform the conversion. It's faster too.
25302
25303         (Expression::ConvertExplicit): Modify to use ConversionExists to check
25304         and only then attempt the implicit conversion.
25305
25306 2001-09-28  Ravi Pratap  <ravi@ximian.com>
25307
25308         * expression.cs (ConvertImplicit): Use a cache for conversions
25309         already found. Check level of recursion and bail out if necessary.
25310
25311 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
25312
25313         * typemanager.cs (string_concat_string_string, string_concat_object_object):
25314         Export standard methods that we expect for string operations.
25315
25316         * statement.cs (Block::UsageWarning): Track usage of variables and
25317         report the errors for not used variables.
25318
25319         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
25320         operator. 
25321
25322 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
25323
25324         * codegen.cs: remove unnneded code 
25325
25326         * expression.cs: Removed BuiltinTypeAccess class
25327
25328         Fix the order in which implicit conversions are
25329         done.  
25330
25331         The previous fixed dropped support for boxed conversions (adding a
25332         test to the test suite now)
25333
25334         (UserImplicitCast::CanConvert): Remove test for source being null,
25335         that code is broken.  We should not feed a null to begin with, if
25336         we do, then we should track the bug where the problem originates
25337         and not try to cover it up here.
25338
25339         Return a resolved expression of type UserImplicitCast on success
25340         rather than true/false.  Ravi: this is what I was talking about,
25341         the pattern is to use a static method as a "constructor" for
25342         objects. 
25343
25344         Also, do not create arguments until the very last minute,
25345         otherwise we always create the arguments even for lookups that
25346         will never be performed. 
25347
25348         (UserImplicitCast::Resolve): Eliminate, objects of type
25349         UserImplicitCast are born in a fully resolved state. 
25350
25351         * typemanager.cs (InitCoreTypes): Init also value_type
25352         (System.ValueType). 
25353
25354         * expression.cs (Cast::Resolve): First resolve the child expression.
25355
25356         (LValue): Add new method AddressOf to be used by
25357         the `&' operator.  
25358
25359         Change the argument of Store to take an EmitContext instead of an
25360         ILGenerator, because things like FieldExpr need to be able to call
25361         their children expression to generate the instance code. 
25362
25363         (Expression::Error, Expression::Warning): Sugar functions for
25364         reporting errors.
25365
25366         (Expression::MemberLookup): Accept a TypeContainer instead of a
25367         Report as the first argument.
25368
25369         (Expression::ResolvePrimary): Killed.  I still want to improve
25370         this as currently the code is just not right.
25371
25372         (Expression::ResolveMemberAccess): Simplify, but it is still
25373         wrong. 
25374
25375         (Unary::Resolve): Catch errors in AddressOf operators.
25376
25377         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
25378         index to a byte for the short-version, or the compiler will choose
25379         the wrong Emit call, which generates the wrong data.
25380
25381         (ParameterReference::Emit, ::Store): same.
25382
25383         (FieldExpr::AddressOf): Implement.
25384
25385         * typemanager.cs: TypeManager: made public variable instead of
25386         property.
25387
25388         * driver.cs: document --fatal.
25389
25390         * report.cs (ErrorMessage, WarningMessage): new names for the old
25391         Error and Warning classes.
25392
25393         * cs-parser.jay (member_access): Turn built-in access to types
25394         into a normal simplename
25395
25396 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25397
25398         * expression.cs (Invocation::BetterConversion): Fix to cope
25399         with q being null, since this was introducing a bug.
25400
25401         * expression.cs (ConvertImplicit): Do built-in conversions first.
25402
25403 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25404
25405         * expression.cs (UserImplicitCast::Resolve): Fix bug.
25406
25407 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25408
25409         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
25410         I had introduced long ago (what's new ?).
25411
25412         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
25413         the work of all the checking. 
25414         (ConvertImplicit): Call CanConvert and only then create object if necessary.
25415         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
25416
25417         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
25418         that is the right way. 
25419
25420         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
25421         overloading resolution. Use everywhere instead of cutting and pasting code.
25422
25423         (Binary::ResolveOperator): Use MakeUnionSet.
25424
25425         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
25426         we have to convert to bool types. Not complete yet.
25427
25428 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
25429
25430         * typemanager.cs (TypeManager::CSharpName): support ushort.
25431
25432         * expression.cs (Expression::TryImplicitIntConversion): Attempts
25433         to provide an expression that performsn an implicit constant int
25434         conversion (section 6.1.6).
25435         (Expression::ConvertImplicitRequired): Reworked to include
25436         implicit constant expression conversions.
25437
25438         (Expression::ConvertNumericExplicit): Finished.
25439
25440         (Invocation::Emit): If InstanceExpression is null, then it means
25441         that we perform a call on this.
25442
25443 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
25444
25445         * expression.cs (Unary::Emit): Remove some dead code.
25446         (Probe): Implement Resolve and Emit for `is'.
25447         (Expression::ConvertImplicitRequired): Attempt to do constant
25448         expression conversions here.  Maybe should be moved to
25449         ConvertImplicit, but I am not sure.
25450         (Expression::ImplicitLongConstantConversionPossible,
25451         Expression::ImplicitIntConstantConversionPossible): New functions
25452         that tell whether is it possible to apply an implicit constant
25453         expression conversion.
25454
25455         (ConvertNumericExplicit): Started work on explicit numeric
25456         conversions.
25457
25458         * cs-parser.jay: Update operator constants.
25459
25460         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
25461         (Parameters::GetSignature): Hook up VerifyArgs here.
25462         (Parameters::VerifyArgs): Verifies that no two arguments have the
25463         same name. 
25464
25465         * class.cs (Operator): Update the operator names to reflect the
25466         ones that the spec expects (as we are just stringizing the
25467         operator names).
25468
25469         * expression.cs (Unary::ResolveOperator): Fix bug: Use
25470         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
25471         previous usage did only work for our methods.
25472         (Expression::ConvertImplicit): Handle decimal implicit numeric
25473         conversions as well.
25474         (Expression::InternalTypeConstructor): Used to invoke constructors
25475         on internal types for default promotions.
25476
25477         (Unary::Emit): Implement special handling for the pre/post
25478         increment/decrement for overloaded operators, as they need to have
25479         the same semantics as the other operators.
25480
25481         (Binary::ResolveOperator): ditto.
25482         (Invocation::ConversionExists): ditto.
25483         (UserImplicitCast::Resolve): ditto.
25484
25485 2001-09-26  Ravi Pratap  <ravi@ximian.com>
25486
25487         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
25488         operator, return after emitting body. Regression tests pass again !
25489
25490         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
25491         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
25492         (Invocation::OverloadResolve): Ditto.
25493         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
25494
25495         * everywhere : update calls to the above methods accordingly.
25496
25497 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
25498
25499         * assign.cs (Assign): Make it inherit from ExpressionStatement.
25500
25501         * expression.cs (ExpressionStatement): New base class used for
25502         expressions that can appear in statements, so that we can provide
25503         an alternate path to generate expression that do not leave a value
25504         on the stack.
25505
25506         (Expression::Emit, and all the derivatives): We no longer return
25507         whether a value is left on the stack or not.  Every expression
25508         after being emitted leaves a single value on the stack.
25509
25510         * codegen.cs (EmitContext::EmitStatementExpression): Use the
25511         facilties of ExpressionStatement if possible.
25512
25513         * cs-parser.jay: Update statement_expression.
25514
25515 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
25516
25517         * driver.cs: Change the wording of message
25518
25519 2001-09-25  Ravi Pratap  <ravi@ximian.com>
25520
25521         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
25522         the type of the expression to the return type of the method if
25523         we have an overloaded operator match ! The regression tests pass again !
25524         (Unary::ResolveOperator): Ditto.
25525
25526         * expression.cs (Invocation::ConversionExists): Correct the member lookup
25527         to find "op_Implicit", not "implicit" ;-)
25528         (UserImplicitCast): New class to take care of user-defined implicit conversions.
25529         (ConvertImplicit, ForceConversion): Take TypeContainer argument
25530
25531         * everywhere : Correct calls to the above accordingly.
25532
25533         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
25534         (ConvertImplicit): Do user-defined conversion if it exists.
25535
25536 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
25537
25538         * assign.cs: track location.
25539         (Resolve): Use implicit conversions on assignment.
25540
25541         * literal.cs: Oops.  Not good, Emit of short access values should
25542         pass (Bytes) or the wrong argument will be selected.
25543
25544         * expression.cs (Unary::Emit): Emit code for -expr.
25545
25546         (Unary::ResolveOperator): Handle `Substract' for non-constants
25547         (substract from zero from the non-constants).
25548         Deal with Doubles as well. 
25549
25550         (Expression::ConvertImplicitRequired): New routine that reports an
25551         error if no implicit conversion exists. 
25552
25553         (Invocation::OverloadResolve): Store the converted implicit
25554         expressions if we make them
25555
25556 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25557
25558         * class.cs (ConstructorInitializer): Take a Location argument.
25559         (ConstructorBaseInitializer): Same here.
25560         (ConstructorThisInitializer): Same here.
25561
25562         * cs-parser.jay : Update all calls accordingly.
25563
25564         * expression.cs (Unary, Binary, New): Take location argument.
25565         Update accordingly everywhere.
25566
25567         * cs-parser.jay : Update all calls to the above to take a location
25568         argument.
25569
25570         * class.cs : Ditto.
25571
25572 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25573
25574         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
25575         (Invocation::BetterConversion): Same here
25576         (Invocation::ConversionExists): Ditto.
25577
25578         (Invocation::ConversionExists): Implement.
25579
25580 2001-09-22  Ravi Pratap  <ravi@ximian.com>
25581
25582         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
25583         Also take an additional TypeContainer argument.
25584
25585         * All over : Pass in TypeContainer as argument to OverloadResolve.
25586
25587         * typemanager.cs (CSharpName): Update to check for the string type and return
25588         that too.
25589
25590         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
25591         a given method.
25592
25593 2001-09-21  Ravi Pratap  <ravi@ximian.com>
25594
25595         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
25596         (Invocation::BetterFunction): Implement.
25597         (Invocation::BetterConversion): Implement.
25598         (Invocation::ConversionExists): Skeleton, no implementation yet.
25599
25600         Okay, things work fine !
25601
25602 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
25603
25604         * typemanager.cs: declare and load enum_type, delegate_type and
25605         void_type. 
25606
25607         * expression.cs (Expression::Emit): Now emit returns a value that
25608         tells whether a value is left on the stack or not.  This strategy
25609         might be reveted tomorrow with a mechanism that would address
25610         multiple assignments.
25611         (Expression::report118): Utility routine to report mismatches on
25612         the ExprClass.
25613
25614         (Unary::Report23): Report impossible type/operator combination
25615         utility function.
25616
25617         (Unary::IsIncrementableNumber): Whether the type can be
25618         incremented or decremented with add.
25619         (Unary::ResolveOperator): Also allow enumerations to be bitwise
25620         complemented. 
25621         (Unary::ResolveOperator): Implement ++, !, ~,
25622
25623         (Invocation::Emit): Deal with new Emit convetion.
25624
25625         * All Expression derivatives: Updated their Emit method to return
25626         whether they leave values on the stack or not.
25627
25628         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25629         stack for expressions that are statements. 
25630
25631 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25632
25633         * expression.cs (LValue): New interface.  Must be implemented by
25634         LValue objects.
25635         (LocalVariableReference, ParameterReference, FieldExpr): Implement
25636         LValue interface.
25637
25638         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25639         interface for generating code, simplifies the code.
25640
25641 2001-09-20  Ravi Pratap  <ravi@ximian.com>
25642
25643         * expression.cs (everywhere): Comment out return statements in ::Resolve
25644         methods to avoid the warnings.
25645
25646 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25647
25648         * driver.cs (parse): Report error 2001 if we can not open the
25649         source file.
25650
25651         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25652         not resolve it.
25653
25654         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25655         object. 
25656
25657         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25658         otherwise nested blocks end up with the same index.
25659
25660         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25661
25662         * expression.cs:  Instead of having FIXMEs in the Resolve
25663         functions, throw exceptions so it is obvious that we are facing a
25664         bug. 
25665
25666         * cs-parser.jay (invocation_expression): Pass Location information.
25667
25668         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25669         Use a basename for those routines because .NET does not like paths
25670         on them. 
25671
25672         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25673         already defined.
25674
25675 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
25676
25677         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25678         are loading the correct data types (throws an exception if not).
25679         (TypeManager::InitCoreTypes): Use CoreLookupType
25680
25681         * expression.cs (Unary::ResolveOperator): return the child
25682         expression for expressions which are just +expr.
25683         (Unary::ResolveOperator): Return negative literals for -LITERAL
25684         expressions (otherwise they are Unary {Literal}).
25685         (Invocation::Badness): Take into account `Implicit constant
25686         expression conversions'.
25687
25688         * literal.cs (LongLiteral): Implement long literal class.
25689         (IntLiteral): export the `Value' of the intliteral. 
25690
25691 2001-09-19  Ravi Pratap  <ravi@ximian.com>
25692
25693         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25694
25695         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
25696         instead of 'Operator'
25697
25698         * expression.cs (Binary::ResolveOperator): Update accordingly.
25699         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25700         and 'Minus'
25701
25702         * cs-parser.jay (unary_expression): Update to use the new names.
25703
25704         * gen-treedump.cs (GetUnary): Same here.
25705
25706         * expression.cs (Unary::Resolve): Implement.
25707         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
25708         operators are found instead of making noise ;-)
25709         (Unary::ResolveOperator): New method to do precisely the same thing which
25710         Binary::ResolveOperator does for Binary expressions.
25711         (Unary.method, .Arguments): Add.
25712         (Unary::OperName): Implement.   
25713         (Unary::ForceConversion): Copy and Paste !
25714
25715         * class.cs (Operator::Define): Fix a small bug for the case when we have 
25716         a unary operator.
25717
25718         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25719         for the inbuilt operators. Only overloading works for now ;-)
25720
25721 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
25722
25723         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25724         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25725
25726         * expression.cs (This::Emit): Implement. 
25727         (This::Resolve): Implement.
25728         (TypeOf:Resolve): Implement.
25729         (Expression::ResolveSimpleName): Add an implicit this to instance
25730         field references. 
25731         (MemberAccess::Resolve): Deal with Parameters and Fields. 
25732         Bind instance variable to Field expressions.
25733         (FieldExpr::Instance): New field used to track the expression that
25734         represents the object instance.
25735         (FieldExpr::Resolve): Track potential errors from MemberLookup not
25736         binding 
25737         (FieldExpr::Emit): Implement.
25738
25739         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25740         the last instruction contains a return opcode to avoid generating
25741         the last `ret' instruction (this generates correct code, and it is
25742         nice to pass the peverify output).
25743
25744         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25745         initializer for static and instance variables.
25746         (Constructor::Emit): Allow initializer to be null in the case of
25747         static constructors.  Only emit initializer for instance
25748         constructors. 
25749
25750         (TypeContainer::FindMembers): Return a null array if there are no
25751         matches.
25752
25753         Also fix the code for the MemberTypes.Method branch, as it was not
25754         scanning that for operators (or tried to access null variables before).
25755
25756         * assign.cs (Assign::Emit): Handle instance and static fields. 
25757
25758         * TODO: Updated.
25759
25760         * driver.cs: Stop compilation if there are parse errors.
25761
25762         * cs-parser.jay (constructor_declaration): Provide default base
25763         initializer for non-static constructors.
25764         (constructor_declarator): Do not provide a default base
25765         initializers if none was specified.
25766         Catch the fact that constructors should not have parameters.
25767
25768         * class.cs: Do not emit parent class initializers for static
25769         constructors, that should be flagged as an error.
25770
25771 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25772
25773         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25774         Move back code into TypeContainer::Populate.
25775
25776 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25777
25778         * class.cs (TypeContainer::AddConstructor): Fix the check to
25779         compare against Name, not Basename. 
25780         (Operator::OpType): Change Plus and Minus to Add and Subtract.
25781
25782         * cs-parser.jay : Update accordingly.
25783
25784         * class.cs (TypeContainer::FindMembers): For the case where we are searching
25785         for methods, don't forget to look into the operators too.
25786         (RegisterMethodBuilder): Helper method to take care of this for
25787         methods, constructors and operators.
25788         (Operator::Define): Completely revamp.
25789         (Operator.OperatorMethod, MethodName): New fields.
25790         (TypeContainer::Populate): Move the registering of builders into
25791         RegisterMethodBuilder.
25792         (Operator::Emit): Re-write.
25793
25794         * expression.cs (Binary::Emit): Comment out code path to emit method
25795         invocation stuff for the case when we have a user defined operator. I am
25796         just not able to get it right !
25797
25798 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25799
25800         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25801         argument. 
25802
25803         (Expression::MemberLookup): Provide a version that allows to
25804         specify the MemberTypes and BindingFlags. 
25805
25806         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25807         so it was not fetching variable information from outer blocks.
25808
25809         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25810         Beforefieldinit as it was buggy.
25811
25812         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25813         that Ravi put here.  
25814
25815         * class.cs (Constructor::Emit): Only emit if block is not null.
25816         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25817         deal with this by semantically definining it as if the user had
25818         done it.
25819
25820         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25821         constructors as we now "emit" them at a higher level.
25822
25823         (TypeContainer::DefineDefaultConstructor): Used to define the
25824         default constructors if none was provided.
25825
25826         (ConstructorInitializer): Add methods Resolve and Emit. 
25827
25828         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25829
25830 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25831
25832         * class.cs (TypeContainer::EmitDefaultConstructor): Register
25833         the default constructor builder with our hashtable for methodbuilders
25834         to methodcores.
25835
25836         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25837         and argument_count is 0 in which case we have a match.
25838         (Binary::ResolveOperator): More null checking and miscellaneous coding
25839         style cleanup.
25840
25841 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25842
25843         * rootcontext.cs (IsNameSpace): Compare against null.
25844
25845         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25846
25847         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25848         and Unary::Operator.
25849
25850         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25851         accordingly.
25852
25853         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25854         we have overloaded operators.
25855         (Binary::ResolveOperator): Implement the part which does the operator overload
25856         resolution.
25857
25858         * class.cs (Operator::Emit): Implement.
25859         (TypeContainer::Emit): Emit the operators we have too.
25860
25861         * expression.cs (Binary::Emit): Update to emit the appropriate code for
25862         the case when we have a user-defined operator.
25863
25864 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25865
25866         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25867
25868 2001-09-16  Ravi Pratap  <ravi@ximian.com>
25869
25870         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25871         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25872         (Constructor::Emit): Implement.
25873         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25874         if we have no work to do. 
25875         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
25876         Emit method.
25877
25878         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25879         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25880
25881         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25882         of parent.parent.
25883
25884 2001-09-15  Ravi Pratap  <ravi@ximian.com>
25885
25886         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25887         in the source.
25888         (Tree::RecordNamespace): Method to do what the name says ;-)
25889         (Tree::Namespaces): Property to get at the namespaces hashtable.
25890
25891         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
25892         keep track.
25893
25894         * rootcontext.cs (IsNamespace): Fixed it :-)
25895
25896 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25897
25898         * class.cs (TypeContainer::FindMembers): Add support for
25899         constructors. 
25900         (MethodCore): New class that encapsulates both the shared aspects
25901         of a Constructor and a Method.  
25902         (Method, Constructor): Factored pieces into MethodCore.
25903
25904         * driver.cs: Added --fatal which makes errors throw exceptions.
25905         Load System assembly as well as part of the standard library.
25906
25907         * report.cs: Allow throwing exceptions on errors for debugging.
25908
25909         * modifiers.cs: Do not use `parent', instead use the real type
25910         container to evaluate permission settings.
25911
25912         * class.cs: Put Ravi's patch back in.  He is right, and we will
25913         have to cope with the
25914
25915 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25916
25917         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25918         FamORAssem, not FamANDAssem.
25919
25920 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25921
25922         * driver.cs: Added --parse option that only parses its input files
25923         and terminates.
25924
25925         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
25926         incorrect.  IsTopLevel is not used to tell whether an object is
25927         root_types or not (that can be achieved by testing this ==
25928         root_types).  But to see if this is a top-level *class* (not
25929         necessarly our "toplevel" container). 
25930
25931 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25932
25933         * enum.cs (Enum::Define): Modify to call the Lookup method on the
25934         parent instead of a direct call to GetType.
25935
25936 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25937
25938         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25939         Modifiers.TypeAttr. This should just be a call to that method.
25940
25941         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25942         object so that we can determine if we are top-level or not.
25943
25944         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
25945         TypeContainer too.
25946
25947         * enum.cs (Enum::Define): Ditto.
25948
25949         * modifiers.cs (FieldAttr): Re-write.
25950
25951         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25952         (TypeContainer::HaveStaticConstructor): New property to provide access
25953         to precisely that info.
25954
25955         * modifiers.cs (MethodAttr): Re-write.
25956         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25957
25958         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25959         of top-level types as claimed.
25960
25961 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25962
25963         * expression.cs (MemberLookup): Fruitless attempt to lookup
25964         constructors.  Maybe I need to emit default constructors?  That
25965         might be it (currently .NET emits this for me automatically).
25966         (Invocation::OverloadResolve): Cope with Arguments == null.
25967         (Invocation::EmitArguments): new function, shared by the new
25968         constructor and us.
25969         (Invocation::Emit): Handle static and instance methods.  Emit
25970         proper call instruction for virtual or non-virtual invocations.
25971         (New::Emit): Implement.
25972         (New::Resolve): Implement.
25973         (MemberAccess:Resolve): Implement.
25974         (MethodGroupExpr::InstanceExpression): used conforming to the spec
25975         to track instances.
25976         (FieldExpr::Resolve): Set type.
25977
25978         * support.cs: Handle empty arguments.
25979                 
25980         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25981         SimpleLookup): Auxiliary routines to help parse a qualifier
25982         identifier.  
25983
25984         Update qualifier_identifier rule.
25985
25986         * codegen.cs: Removed debugging messages.
25987
25988         * class.cs: Make this a global thing, this acts just as a "key" to
25989         objects that we might have around.
25990
25991         (Populate): Only initialize method_builders_to_methods once.
25992
25993         * expression.cs (PropertyExpr): Initialize type from the
25994         PropertyType. 
25995
25996         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25997         Resolve pattern.  Attempt to implicitly convert value to boolean.
25998         Emit code.
25999
26000         * expression.cs: Set the type for the int32/int32 argument case.
26001         (Binary::ResolveOperator): Set the return type to boolean for
26002         comparission operators
26003
26004         * typemanager.cs: Remove debugging print code.
26005
26006         (Invocation::Resolve): resolve type.
26007
26008         * class.cs: Allocate a MemberInfo of the correct size, as the code
26009         elsewhere depends on the test to reflect the correct contents.
26010
26011         (Method::) Keep track of parameters, due to System.Reflection holes
26012
26013         (TypeContainer::Populate): Keep track of MethodBuilders to Method
26014         mapping here.
26015
26016         (TypeContainer::FindMembers): Use ArrayList and then copy an array
26017         of the exact size and return that.
26018
26019         (Class::LookupMethodByBuilder): New function that maps
26020         MethodBuilders to its methods.  Required to locate the information
26021         on methods because System.Reflection bit us again.
26022
26023         * support.cs: New file, contains an interface ParameterData and
26024         two implementations: ReflectionParameters and InternalParameters
26025         used to access Parameter information.  We will need to grow this
26026         as required.
26027
26028         * expression.cs (Invocation::GetParameterData): implement a cache
26029         and a wrapper around the ParameterData creation for methods. 
26030         (Invocation::OverloadResolve): Use new code.
26031
26032 2001-09-13  Ravi Pratap  <ravi@ximian.com>
26033
26034         * class.cs (TypeContainer::EmitField): Remove and move into 
26035         (Field::Define): here and modify accordingly.
26036         (Field.FieldBuilder): New member.
26037         (TypeContainer::Populate): Update accordingly.
26038         (TypeContainer::FindMembers): Implement.
26039
26040 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
26041
26042         * statement.cs: (VariableInfo::VariableType): New field to be
26043         initialized with the full type once it is resolved. 
26044
26045 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
26046
26047         * parameter.cs (GetParameterInfo): Use a type cache to compute
26048         things only once, and to reuse this information
26049
26050         * expression.cs (LocalVariableReference::Emit): Implement.
26051         (OpcodeCast::Emit): fix.
26052
26053         (ParameterReference::Resolve): Implement.
26054         (ParameterReference::Emit): Implement.
26055
26056         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
26057         that are expressions need to stay as Expressions.
26058
26059         * typemanager.cs (CSharpName): Returns the C# name of a type if
26060         possible. 
26061
26062         * expression.cs (Expression::ConvertImplicit): New function that
26063         implements implicit type conversions.
26064
26065         (Expression::ImplicitReferenceConversion): Implements implicit
26066         reference conversions.
26067
26068         (EmptyCast): New type for transparent casts.
26069
26070         (OpcodeCast): New type for casts of types that are performed with
26071         a sequence of bytecodes.
26072
26073         (BoxedCast): New type used for casting value types into reference
26074         types.  Emits a box opcode.
26075
26076         (Binary::DoNumericPromotions): Implements numeric promotions of
26077         and computation of the Binary::Type.
26078
26079         (Binary::EmitBranchable): Optimization.
26080
26081         (Binary::Emit): Implement code emission for expressions.
26082
26083         * typemanager.cs (TypeManager): Added two new core types: sbyte
26084         and byte.
26085
26086 2001-09-12  Ravi Pratap  <ravi@ximian.com>
26087
26088         * class.cs (TypeContainer::FindMembers): Method which does exactly
26089         what Type.FindMembers does, only we don't have to use reflection. No
26090         implementation yet.
26091
26092         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
26093         typecontainer objects as we need to get at them.
26094         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
26095
26096         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
26097         typecontainer object.
26098
26099         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
26100         of just a Report object.
26101
26102 2001-09-11  Ravi Pratap  <ravi@ximian.com>
26103
26104         * class.cs (Event::Define): Go back to using the prefixes "add_" and
26105         "remove_"
26106         (TypeContainer::Populate): Now define the delegates of the type too.
26107         (TypeContainer.Delegates): Property to access the list of delegates defined
26108         in the type.
26109
26110         * delegates.cs (Delegate::Define): Implement partially.
26111
26112         * modifiers.cs (TypeAttr): Handle more flags.
26113
26114 2001-09-11  Ravi Pratap  <ravi@ximian.com>
26115
26116         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
26117         and not <=
26118         (Operator::Define): Re-write logic to get types by using the LookupType method
26119         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
26120         (Indexer::Define): Ditto.
26121         (Event::Define): Ditto.
26122         (Property::Define): Ditto.
26123
26124 2001-09-10  Ravi Pratap  <ravi@ximian.com>
26125
26126         * class.cs (TypeContainer::Populate): Now define operators too. 
26127         (TypeContainer.Operators): New property to access the list of operators
26128         in a type.
26129         (Operator.OperatorMethodBuilder): New member to hold the method builder
26130         for the operator we are defining.
26131         (Operator::Define): Implement.
26132
26133 2001-09-10  Ravi Pratap  <ravi@ximian.com>
26134
26135         * class.cs (Event::Define): Make the prefixes of the accessor methods
26136         addOn_ and removeOn_ 
26137
26138         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
26139         of the location being passed in too. Ideally, this should go later since all
26140         error reporting should be done through the Report object.
26141
26142         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
26143         (Populate): Iterate thru the indexers we have and define them too.
26144         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
26145         for the get and set accessors.
26146         (Indexer::Define): Implement.
26147
26148 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
26149
26150         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
26151         my previous implementation, did not work.
26152
26153         * typemanager.cs: Add a couple of missing types (the longs).
26154
26155         * literal.cs: Use TypeManager.bool_type instead of getting it.
26156
26157         * expression.cs (EventExpr): New kind of expressions.
26158         (Expressio::ExprClassFromMemberInfo): finish
26159
26160 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
26161
26162         * assign.cs: Emit stores to static fields differently.
26163
26164 2001-09-08  Ravi Pratap  <ravi@ximian.com>
26165
26166         * Merge in changes and adjust code to tackle conflicts. Backed out my
26167         code in Assign::Resolve ;-) 
26168
26169 2001-09-08  Ravi Pratap  <ravi@ximian.com>
26170
26171         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
26172         instead Report.Error and also pass in the location.
26173         (CSharpParser::Lexer): New readonly property to return the reference
26174         to the Tokenizer object.
26175         (declare_local_variables): Use Report.Error with location instead of plain 
26176         old error.
26177         (CheckDef): Ditto.
26178
26179         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
26180         (Operator.CheckBinaryOperator): Ditto.
26181
26182         * cs-parser.jay (operator_declarator): Update accordingly.
26183
26184         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
26185         (CheckBinaryOperator): Same here.
26186
26187         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
26188         on the name without any prefixes of namespace names etc. This is because we
26189         already might have something already fully qualified like 
26190         'System.Console.WriteLine'
26191
26192         * assign.cs (Resolve): Begin implementation. Stuck ;-)
26193
26194 2001-09-07  Ravi Pratap  <ravi@ximian.com>
26195
26196         * cs-tokenizer.cs (location): Return a string which also contains
26197         the file name.
26198
26199         * expression.cs (ElementAccess): New class for expressions of the
26200         type 'element access.'
26201         (BaseAccess): New class for expressions of the type 'base access.'
26202         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
26203         respectively.
26204
26205         * cs-parser.jay (element_access): Implement action.
26206         (base_access): Implement actions.
26207         (checked_expression, unchecked_expression): Implement.
26208
26209         * cs-parser.jay (local_variable_type): Correct and implement.
26210         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
26211
26212         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
26213
26214         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
26215         name and the specifiers.
26216
26217         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
26218
26219         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
26220         making them all public ;-)
26221
26222         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
26223         class anyways.
26224
26225 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
26226
26227         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
26228         PropertyExprs.
26229         (FieldExpr, PropertyExprs): New resolved expressions.
26230         (SimpleName::MemberStaticCheck): Perform static checks for access
26231         to non-static fields on static methods. Maybe this should be
26232         generalized for MemberAccesses. 
26233         (SimpleName::ResolveSimpleName): More work on simple name
26234         resolution. 
26235
26236         * cs-parser.jay (primary_expression/qualified_identifier): track
26237         the parameter index.
26238
26239         * codegen.cs (CodeGen::Save): Catch save exception, report error.
26240         (EmitContext::EmitBoolExpression): Chain to expression generation
26241         instead of temporary hack.
26242         (::EmitStatementExpression): Put generic expression code generation.
26243
26244         * assign.cs (Assign::Emit): Implement variable assignments to
26245         local variables, parameters and fields.
26246
26247 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
26248
26249         * statement.cs (Block::GetVariableInfo): New method, returns the
26250         VariableInfo for a variable name in a block.
26251         (Block::GetVariableType): Implement in terms of GetVariableInfo
26252
26253         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
26254         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
26255
26256 2001-09-06  Ravi Pratap  <ravi@ximian.com>
26257
26258         * cs-parser.jay (operator_declaration): Continue on my quest : update
26259         to take attributes argument.
26260         (event_declaration): Ditto.
26261         (enum_declaration): Ditto.
26262         (indexer_declaration): Ditto.
26263
26264         * class.cs (Operator::Operator): Update constructor accordingly.
26265         (Event::Event): Ditto.
26266
26267         * delegate.cs (Delegate::Delegate): Same here.
26268
26269         * enum.cs (Enum::Enum): Same here.
26270
26271 2001-09-05  Ravi Pratap  <ravi@ximian.com>
26272
26273         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
26274
26275         * ../tests/cs0658.cs : New file to demonstrate error 0658.
26276
26277         * attribute.cs (Attributes): New class to encapsulate all attributes which were
26278         being passed around as an arraylist.
26279         (Attributes::AddAttribute): Method to add attribute sections.
26280
26281         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
26282         (struct_declaration): Update accordingly.
26283         (constant_declaration): Update.
26284         (field_declaration): Update.
26285         (method_header): Update.
26286         (fixed_parameter): Update.
26287         (parameter_array): Ditto.
26288         (property_declaration): Ditto.
26289         (destructor_declaration): Ditto.
26290
26291         * class.cs (Struct::Struct): Update constructors accordingly.
26292         (Class::Class): Ditto.
26293         (Field::Field): Ditto.
26294         (Method::Method): Ditto.
26295         (Property::Property): Ditto.
26296         (TypeContainer::OptAttribute): update property's return type.
26297
26298         * interface.cs (Interface.opt_attributes): New member.
26299         (Interface::Interface): Update to take the extra Attributes argument.
26300
26301         * parameter.cs (Parameter::Parameter): Ditto.
26302
26303         * constant.cs (Constant::Constant): Ditto.
26304
26305         * interface.cs (InterfaceMemberBase): New OptAttributes field.
26306         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
26307         the attributes as a parameter.
26308         (InterfaceProperty): Update constructor call.
26309         (InterfaceEvent): Ditto.
26310         (InterfaceMethod): Ditto.
26311         (InterfaceIndexer): Ditto.
26312
26313         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
26314         pass the attributes too.
26315         (interface_event_declaration): Ditto.
26316         (interface_property_declaration): Ditto.
26317         (interface_method_declaration): Ditto.
26318         (interface_declaration): Ditto.
26319
26320 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
26321
26322         * class.cs (Method::Define): Track the "static Main" definition to
26323         create an entry point. 
26324
26325         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
26326         EntryPoint if we find it. 
26327
26328         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
26329         (EmitContext::ig): Make this variable public.
26330
26331         * driver.cs: Make the default output file be the first file name
26332         with the .exe extension.  
26333
26334         Detect empty compilations
26335
26336         Handle various kinds of output targets.  Handle --target and
26337         rename -t to --dumper.
26338
26339         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
26340         methods inherited from Expression return now an Expression.  This
26341         will is used during the tree rewriting as we resolve them during
26342         semantic analysis.
26343
26344         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
26345         the spec.  Missing entirely is the information about
26346         accessability of elements of it.
26347
26348         (Expression::ExprClassFromMemberInfo): New constructor for
26349         Expressions that creates a fully initialized Expression based on
26350         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
26351         a Type.
26352
26353         (Invocation::Resolve): Begin implementing resolution of invocations.
26354
26355         * literal.cs (StringLiteral):  Implement Emit.
26356
26357 2001-09-05  Ravi Pratap  <ravi@ximian.com>
26358
26359         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
26360         member.
26361
26362 2001-09-04  Ravi Pratap  <ravi@ximian.com>
26363
26364         * cs-parser.jay (attribute_arguments): Implement actions.
26365         (attribute): Fix bug in production. Implement action.
26366         (attribute_list): Implement.
26367         (attribute_target): Implement.
26368         (attribute_target_specifier, opt_target_specifier): Implement
26369         (CheckAttributeTarget): New method to check if the attribute target
26370         is valid.
26371         (attribute_section): Implement.
26372         (opt_attributes): Implement.
26373
26374         * attribute.cs : New file to handle attributes.
26375         (Attribute): Class to hold attribute info.
26376
26377         * cs-parser.jay (opt_attribute_target_specifier): Remove production
26378         (attribute_section): Modify production to use 2 different rules to 
26379         achieve the same thing. 1 s/r conflict down !
26380         Clean out commented, useless, non-reducing dimension_separator rules.
26381
26382         * class.cs (TypeContainer.attributes): New member to hold list
26383         of attributes for a type.
26384         (Struct::Struct): Modify to take one more argument, the attribute list.
26385         (Class::Class): Ditto.
26386         (Field::Field): Ditto.
26387         (Method::Method): Ditto.
26388         (Property::Property): Ditto.
26389
26390         * cs-parser.jay (struct_declaration): Update constructor call to
26391         pass in the attributes too.
26392         (class_declaration): Ditto.
26393         (constant_declaration): Ditto.
26394         (field_declaration): Ditto.
26395         (method_header): Ditto.
26396         (fixed_parameter): Ditto.
26397         (parameter_array): Ditto.
26398         (property_declaration): Ditto.
26399
26400         * constant.cs (Constant::Constant): Update constructor similarly.
26401         Use System.Collections.
26402
26403         * parameter.cs (Parameter::Parameter): Update as above.
26404
26405 2001-09-02  Ravi Pratap  <ravi@ximian.com>
26406
26407         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
26408         (TypeContainer.delegates): New member to hold list of delegates.
26409
26410         * cs-parser.jay (delegate_declaration): Implement the action correctly 
26411         this time as I seem to be on crack ;-)
26412
26413 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
26414
26415         * rootcontext.cs (RootContext::IsNamespace): new function, used to
26416         tell whether an identifier represents a namespace.
26417
26418         * expression.cs (NamespaceExpr): A namespace expression, used only
26419         temporarly during expression resolution.
26420         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
26421         utility functions to resolve names on expressions.
26422
26423 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
26424
26425         * codegen.cs: Add hook for StatementExpressions. 
26426
26427         * class.cs: Fix inverted test for static flag in methods.
26428
26429 2001-09-02  Ravi Pratap  <ravi@ximian.com>
26430
26431         * class.cs (Operator::CheckUnaryOperator): Correct error number used
26432         to make it coincide with MS' number.
26433         (Operator::CheckBinaryOperator): Ditto.
26434
26435         * ../errors/errors.txt : Remove error numbers added earlier.
26436
26437         * ../errors/cs1019.cs : Test case for error # 1019
26438
26439         * ../errros/cs1020.cs : Test case for error # 1020
26440
26441         * cs-parser.jay : Clean out commented cruft.
26442         (dimension_separators, dimension_separator): Comment out. Ostensibly not
26443         used anywhere - non-reducing rule.
26444         (namespace_declarations): Non-reducing rule - comment out.
26445
26446         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
26447         with TypeContainer::AddEnum.
26448
26449         * delegate.cs : New file for delegate handling classes.
26450         (Delegate): Class for declaring delegates.
26451
26452         * makefile : Update.
26453
26454         * cs-parser.jay (delegate_declaration): Implement.
26455
26456 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
26457
26458         * class.cs (Event::Define): Implement.
26459         (Event.EventBuilder): New member.
26460
26461         * class.cs (TypeContainer::Populate): Update to define all enums and events
26462         we have.
26463         (Events): New property for the events arraylist we hold. Shouldn't we move to using
26464         readonly fields for all these cases ?
26465
26466 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
26467
26468         * class.cs (Property): Revamp to use the convention of making fields readonly.
26469         Accordingly modify code elsewhere.
26470
26471         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
26472         the Define method of the Property class.
26473
26474         * class.cs : Clean up applied patch and update references to variables etc. Fix 
26475         trivial bug.
26476         (TypeContainer::Populate): Update to define all the properties we have. Also
26477         define all enumerations.
26478
26479         * enum.cs (Define): Implement.
26480
26481 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
26482
26483         * cs-parser.jay (overloadable_operator): The semantic value is an
26484         enum of the Operator class.
26485         (operator_declarator): Implement actions.
26486         (operator_declaration): Implement.
26487
26488         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
26489         validity of definitions.
26490         (Operator::CheckBinaryOperator): Static method to check for binary operators
26491         (TypeContainer::AddOperator): New method to add an operator to a type.
26492
26493         * cs-parser.jay (indexer_declaration): Added line to actually call the
26494         AddIndexer method so it gets added ;-)
26495
26496         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
26497         already taken care of by the MS compiler ?  
26498
26499 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
26500
26501         * class.cs (Operator): New class for operator declarations.
26502         (Operator::OpType): Enum for the various operators.
26503
26504 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
26505
26506         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
26507         ostensibly handle this in semantic analysis.
26508
26509         * cs-parser.jay (general_catch_clause): Comment out
26510         (specific_catch_clauses, specific_catch_clause): Ditto.
26511         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
26512         (catch_args, opt_catch_args): New productions.
26513         (catch_clause): Rewrite to use the new productions above
26514         (catch_clauses): Modify accordingly.
26515         (opt_catch_clauses): New production to use in try_statement
26516         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
26517         and re-write the code in the actions to extract the specific and
26518         general catch clauses by being a little smart ;-)
26519
26520         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
26521         Hooray, try and catch statements parse fine !
26522
26523 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26524
26525         * statement.cs (Block::GetVariableType): Fix logic to extract the type
26526         string from the hashtable of variables.
26527
26528         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
26529         I end up making that mistake ;-)
26530         (catch_clauses): Fixed gross error which made Key and Value of the 
26531         DictionaryEntry the same : $1 !!
26532
26533 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26534
26535         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
26536
26537         * cs-parser.jay (event_declaration): Correct to remove the semicolon
26538         when the add and remove accessors are specified. 
26539
26540 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26541
26542         * cs-parser.jay (IndexerDeclaration): New helper class to hold
26543         information about indexer_declarator.
26544         (indexer_declarator): Implement actions.
26545         (parsing_indexer): New local boolean used to keep track of whether
26546         we are parsing indexers or properties. This is necessary because 
26547         implicit_parameters come into picture even for the get accessor in the 
26548         case of an indexer.
26549         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
26550
26551         * class.cs (Indexer): New class for indexer declarations.
26552         (TypeContainer::AddIndexer): New method to add an indexer to a type.
26553         (TypeContainer::indexers): New member to hold list of indexers for the
26554         type.
26555
26556 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26557
26558         * cs-parser.jay (add_accessor_declaration): Implement action.
26559         (remove_accessor_declaration): Implement action.
26560         (event_accessors_declaration): Implement
26561         (variable_declarators): swap statements for first rule - trivial.
26562
26563         * class.cs (Event): New class to hold information about event
26564         declarations.
26565         (TypeContainer::AddEvent): New method to add an event to a type
26566         (TypeContainer::events): New member to hold list of events.
26567
26568         * cs-parser.jay (event_declaration): Implement actions.
26569
26570 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26571
26572         * cs-parser.jay (dim_separators): Implement. Make it a string
26573         concatenating all the commas together, just as they appear.
26574         (opt_dim_separators): Modify accordingly
26575         (rank_specifiers): Update accordingly. Basically do the same
26576         thing - instead, collect the brackets here.
26577         (opt_rank_sepcifiers): Modify accordingly.
26578         (array_type): Modify to actually return the complete type string
26579         instead of ignoring the rank_specifiers.
26580         (expression_list): Implement to collect the expressions
26581         (variable_initializer): Implement. We make it a list of expressions
26582         essentially so that we can handle the array_initializer case neatly too.
26583         (variable_initializer_list): Implement.
26584         (array_initializer): Make it a list of variable_initializers
26585         (opt_array_initializer): Modify accordingly.
26586
26587         * expression.cs (New::NType): Add enumeration to help us
26588         keep track of whether we have an object/delegate creation
26589         or an array creation.
26590         (New:NewType, New::Rank, New::Indices, New::Initializers): New
26591         members to hold data about array creation.
26592         (New:New): Modify to update NewType
26593         (New:New): New Overloaded contructor for the array creation
26594         case.
26595
26596         * cs-parser.jay (array_creation_expression): Implement to call
26597         the overloaded New constructor.
26598
26599 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
26600
26601         * class.cs (TypeContainer::Constructors): Return member
26602         constructors instead of returning null.
26603
26604 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
26605
26606         * typemanager.cs (InitCoreTypes): Initialize the various core
26607         types after we have populated the type manager with the user
26608         defined types (this distinction will be important later while
26609         compiling corlib.dll)
26610
26611         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
26612         on Expression Classification.  Now all expressions have a method
26613         `Resolve' and a method `Emit'.
26614
26615         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
26616         generation from working.     Also add some temporary debugging
26617         code. 
26618
26619 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
26620
26621         * codegen.cs: Lots of code generation pieces.  This is only the
26622         beginning, will continue tomorrow with more touches of polish.  We
26623         handle the fundamentals of if, while, do, for, return.  Others are
26624         trickier and I need to start working on invocations soon.
26625
26626         * gen-treedump.cs: Bug fix, use s.Increment here instead of
26627         s.InitStatement. 
26628
26629         * codegen.cs (EmitContext): New struct, used during code
26630         emission to keep a context.   Most of the code generation will be
26631         here. 
26632
26633         * cs-parser.jay: Add embedded blocks to the list of statements of
26634         this block.  So code generation proceeds in a top down fashion.
26635
26636 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
26637
26638         * statement.cs: Add support for multiple child blocks.
26639
26640 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
26641
26642         * codegen.cs (EmitCode): New function, will emit the code for a
26643         Block of code given a TypeContainer and its ILGenerator. 
26644
26645         * statement.cs (Block): Standard public readonly optimization.
26646         (Block::Block constructors): Link children. 
26647         (Block::Child): Child Linker.
26648         (Block::EmitVariables): Emits IL variable declarations.
26649
26650         * class.cs: Drop support for MethodGroups here, delay until
26651         Semantic Analysis.
26652         (Method::): Applied the same simplification that I did before, and
26653         move from Properties to public readonly fields.
26654         (Method::ParameterTypes): Returns the parameter types for the
26655         function, and implements a cache that will be useful later when I
26656         do error checking and the semantic analysis on the methods is
26657         performed.
26658         (Constructor::GetCallingConvention): Renamed from CallingConvetion
26659         and made a method, optional argument tells whether this is a class
26660         or a structure to apply the `has-this' bit.
26661         (Method::GetCallingConvention): Implement, returns the calling
26662         convention. 
26663         (Method::Define): Defines the type, a second pass is performed
26664         later to populate the methods.
26665
26666         (Constructor::ParameterTypes): implement a cache similar to the
26667         one on Method::ParameterTypes, useful later when we do semantic
26668         analysis. 
26669
26670         (TypeContainer::EmitMethod):  New method.  Emits methods.
26671
26672         * expression.cs: Removed MethodGroup class from here.
26673
26674         * parameter.cs (Parameters::GetCallingConvention): new method.
26675
26676 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
26677
26678         * class.cs (TypeContainer::Populate): Drop RootContext from the
26679         argument. 
26680
26681         (Constructor::CallingConvention): Returns the calling convention.
26682         (Constructor::ParameterTypes): Returns the constructor parameter
26683         types. 
26684
26685         (TypeContainer::AddConstructor): Keep track of default constructor
26686         and the default static constructor.
26687
26688         (Constructor::) Another class that starts using `public readonly'
26689         instead of properties. 
26690
26691         (Constructor::IsDefault): Whether this is a default constructor. 
26692
26693         (Field::) use readonly public fields instead of properties also.
26694
26695         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26696         track of static constructors;  If none is used, turn on
26697         BeforeFieldInit in the TypeAttributes. 
26698
26699         * cs-parser.jay (opt_argument_list): now the return can be null
26700         for the cases where there are no arguments. 
26701
26702         (constructor_declarator): If there is no implicit `base' or
26703         `this', then invoke the default parent constructor. 
26704
26705         * modifiers.cs (MethodAttr): New static function maps a set of
26706         modifiers flags into a MethodAttributes enum
26707         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
26708         MethodAttr, TypeAttr to represent the various mappings where the
26709         modifiers are used.
26710         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
26711
26712 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
26713
26714         * parameter.cs (GetParameterInfo): Fix bug where there would be no
26715         method arguments.
26716
26717         * interface.cs (PopulateIndexer): Implemented the code generator
26718         for interface indexers.
26719
26720 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
26721
26722         * interface.cs (InterfaceMemberBase): Now we track the new status
26723         here.  
26724
26725         (PopulateProperty): Implement property population.  Woohoo!  Got
26726         Methods and Properties going today. 
26727
26728         Removed all the properties for interfaces, and replaced them with
26729         `public readonly' fields. 
26730
26731 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
26732
26733         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26734         initialize their hashtables/arraylists only when they are needed
26735         instead of doing this always.
26736
26737         * parameter.cs: Handle refs and out parameters.
26738
26739         * cs-parser.jay: Use an ArrayList to construct the arguments
26740         instead of the ParameterCollection, and then cast that to a
26741         Parameter[] array.
26742
26743         * parameter.cs: Drop the use of ParameterCollection and use
26744         instead arrays of Parameters.
26745
26746         (GetParameterInfo): Use the Type, not the Name when resolving
26747         types. 
26748
26749 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
26750
26751         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26752         and instead use public readonly fields.
26753
26754         * class.cs: Put back walking code for type containers.
26755
26756 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
26757
26758         * class.cs (MakeConstant): Code to define constants.
26759
26760         * rootcontext.cs (LookupType): New function.  Used to locate types 
26761
26762
26763 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
26764
26765         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
26766         this System.Reflection code is.  Kudos to Microsoft
26767
26768         * typemanager.cs: Implement a type cache and avoid loading all
26769         types at boot time.  Wrap in LookupType the internals.  This made
26770         the compiler so much faster.  Wow.  I rule!
26771
26772         * driver.cs: Make sure we always load mscorlib first (for
26773         debugging purposes, nothing really important).
26774
26775         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
26776         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
26777
26778         * rootcontext.cs: Lookup types on their namespace;  Lookup types
26779         on namespaces that have been imported using the `using' keyword.
26780
26781         * class.cs (TypeContainer::TypeAttr): Virtualize.
26782         (Class::TypeAttr): Return attributes suitable for this bad boy.
26783         (Struct::TypeAttr): ditto.
26784         Handle nested classes.
26785         (TypeContainer::) Remove all the type visiting code, it is now
26786         replaced with the rootcontext.cs code
26787
26788         * rootcontext.cs (GetClassBases): Added support for structs. 
26789
26790 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
26791
26792         * interface.cs, statement.cs, class.cs, parameter.cs,
26793         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26794         Drop use of TypeRefs, and use strings instead.
26795
26796 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
26797
26798         * rootcontext.cs: 
26799
26800         * class.cs (Struct::Struct): set the SEALED flags after
26801         checking the modifiers.
26802         (TypeContainer::TypeAttr): new property, returns the
26803         TypeAttributes for a class.  
26804
26805         * cs-parser.jay (type_list): Oops, list production was creating a
26806         new list of base types.
26807
26808         * rootcontext.cs (StdLib): New property.
26809         (GetInterfaceTypeByName): returns an interface by type name, and
26810         encapsulates error handling here.
26811         (GetInterfaces): simplified.
26812         (ResolveTree): Encapsulated all the tree resolution here.
26813         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26814         types. 
26815
26816         * driver.cs: Add support for --nostdlib, to avoid loading the
26817         default assemblies.
26818         (Main): Do not put tree resolution here. 
26819
26820         * rootcontext.cs: Beginning of the class resolution.
26821
26822 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
26823
26824         * rootcontext.cs: Provide better error reporting. 
26825
26826         * cs-parser.jay (interface_base): set our $$ to be interfaces.
26827
26828         * rootcontext.cs (CreateInterface): Handle the case where there
26829         are no parent interfaces.
26830
26831         (CloseTypes): Routine to flush types at the end.
26832         (CreateInterface): Track types.
26833         (GetInterfaces): Returns an array of Types from the list of
26834         defined interfaces.
26835
26836         * typemanager.c (AddUserType): Mechanism to track user types (puts
26837         the type on the global type hash, and allows us to close it at the
26838         end). 
26839
26840 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
26841
26842         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26843         RecordInterface instead.
26844
26845         * cs-parser.jay: Updated to reflect changes above.
26846
26847         * decl.cs (Definition): Keep track of the TypeBuilder type that
26848         represents this type here.  Not sure we will use it in the long
26849         run, but wont hurt for now.
26850
26851         * driver.cs: Smaller changes to accomodate the new code.
26852
26853         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26854         when done. 
26855
26856         * rootcontext.cs (CreateInterface):  New method, used to create
26857         the System.TypeBuilder type for interfaces.
26858         (ResolveInterfaces): new entry point to resolve the interface
26859         hierarchy. 
26860         (CodeGen): Property, used to keep track of the code generator.
26861
26862 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
26863
26864         * cs-parser.jay: Add a second production for delegate_declaration
26865         with `VOID'.
26866
26867         (enum_body): Put an opt_comma here instead of putting it on
26868         enum_body or enum_member_declarations so we can handle trailing
26869         commas on enumeration members.  Gets rid of a shift/reduce.
26870
26871         (type_list): Need a COMMA in the middle.
26872
26873         (indexer_declaration): Tell tokenizer to recognize get/set
26874
26875         * Remove old targets.
26876
26877         * Re-add the parser target.
26878
26879 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26880
26881         * cs-parser.jay: Add precendence rules for a number of operators
26882         ot reduce the number of shift/reduce conflicts in the grammar.
26883
26884 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
26885
26886         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26887         and put it here.
26888
26889         Get rid of old crufty code.
26890
26891         * rootcontext.cs: Use this to keep track of the parsed
26892         representation and the defined types available to the program. 
26893
26894         * gen-treedump.cs: adjust for new convention.
26895
26896         * type.cs: Split out the type manager, and the assembly builder
26897         from here. 
26898
26899         * typemanager.cs: the type manager will live here now.
26900
26901         * cil-codegen.cs: And the code generator here. 
26902
26903 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
26904
26905         * makefile: Fixed up for easy making.
26906
26907 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26908
26909         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26910         the 
26911
26912         (unary_expression): Expand pre_increment_expression and
26913         post_decrement_expression to reduce a shift/reduce.
26914
26915 2001-07-11  Simon Cozens
26916
26917         * cs-tokenizer.cs: Hex numbers should begin with a 0.
26918
26919         Improve allow_keyword_as_indent name.
26920
26921 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
26922
26923         * Adjustments for Beta2. 
26924
26925 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
26926
26927         * decl.cs: Added `Define' abstract method.
26928         (InTransit): new property, used to catch recursive definitions. 
26929
26930         * interface.cs: Implement `Define'. 
26931
26932         * modifiers.cs: Map Modifiers.constants to
26933         System.Reflection.TypeAttribute flags.
26934
26935         * class.cs: Keep track of types and user-defined types.
26936         (BuilderInit): New method for creating an assembly
26937         (ResolveType): New function to launch the resolution process, only
26938         used by interfaces for now.
26939
26940         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26941         that are inserted into the name space. 
26942
26943 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
26944
26945         * ARGH.  I have screwed up my tree so many times due to the use of
26946         rsync rather than using CVS.  Going to fix this at once. 
26947
26948         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
26949         load types.
26950
26951 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
26952
26953         * Experiment successful: Use System.Type rather that our own
26954         version of Type.  
26955
26956 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
26957
26958         * cs-parser.jay: Removed nsAliases from here.
26959
26960         Use new namespaces, handle `using XXX;' 
26961
26962         * namespace.cs: Reimplemented namespace handling, use a recursive
26963         definition of the class.  Now we can keep track of using clauses
26964         and catch invalid using clauses.
26965
26966 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
26967
26968         * gen-treedump.cs: Adapted for all the renaming.
26969
26970         * expression.cs (Expression): this class now has a Type property
26971         which returns an expression Type.
26972
26973         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26974         `Type', as this has a different meaning now in the base
26975
26976 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
26977
26978         * interface.cs, class.cs: Removed from all the sources the
26979         references to signature computation, as we can not do method
26980         signature computation during the parsing time, as we are not
26981         trying to solve at that point distinguishing:
26982
26983         class X {
26984                 void a (Blah x) {}
26985                 void a (NS.Blah x) {}
26986         }
26987
26988         Which depending on the context might be valid or not, as we do not
26989         know if Blah is the same thing as NS.Blah at that point.
26990
26991         * Redid everything so the code uses TypeRefs now instead of
26992         Types.  TypeRefs are just temporary type placeholders, that need
26993         to be resolved.  They initially have a pointer to a string and the
26994         current scope in which they are used.  This is used later by the
26995         compiler to resolve the reference to an actual Type. 
26996
26997         * DeclSpace is no longer a CIR.Type, and neither are
26998         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
26999         are all DeclSpaces, but no Types. 
27000
27001         * type.cs (TypeRefManager): This implements the TypeRef manager,
27002         which keeps track of all the types that need to be resolved after
27003         the parsing has finished. 
27004
27005 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
27006
27007         * ARGH.  We are going to have to store `foreach' as a class rather
27008         than resolving it, as we need to verify error 1579 after name
27009         resolution.   *OR* we could keep a flag that says `This request to
27010         IEnumerator comes from a foreach statement' which we can then use
27011         to generate the error.
27012
27013 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
27014
27015         * class.cs (TypeContainer.AddMethod): we now add methods to the
27016         MethodGroup instead of the method hashtable.  
27017
27018         * expression.cs: Add MethodGroup abstraction, which gets us one
27019         step closer to the specification in the way we handle method
27020         declarations.  
27021
27022         * cs-parser.jay (primary_expression): qualified_identifier now
27023         tried to match up an identifier to a local variable reference or
27024         to a parameter reference.
27025
27026         current_local_parameters is now a parser global variable that
27027         points to the current parameters for the block, used during name
27028         lookup.
27029
27030         (property_declaration): Now creates an implicit `value' argument to
27031         the set accessor.
27032
27033 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
27034
27035         * parameter.cs: Do not use `param' arguments as part of the
27036         signature, per the spec.
27037
27038 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
27039
27040         * decl.cs: Base class for classes, structs and interfaces.  This
27041         is the "Declaration Space" 
27042
27043         * cs-parser.jay: Use CheckDef for checking declaration errors
27044         instead of having one on each function.
27045
27046         * class.cs: Factor out some code for handling error handling in
27047         accordance to the "Declarations" section in the "Basic Concepts"
27048         chapter in the ECMA C# spec.
27049
27050         * interface.cs: Make all interface member classes derive from
27051         InterfaceMemberBase.
27052
27053 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
27054
27055         * Many things: all interfaces are parsed and generated in
27056         gen-treedump.  Support for member variables, constructors,
27057         destructors, properties, constants is there.
27058
27059         Beginning of the IL backend, but very little done, just there for
27060         testing purposes. 
27061
27062 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
27063
27064         * cs-parser.jay: Fix labeled statement.
27065
27066         * cs-tokenizer.cs (escape): Escape " and ' always.
27067         ref_line, ref_name: keep track of the line/filename as instructed
27068         by #line by the compiler.
27069         Parse #line.
27070
27071 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
27072
27073         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
27074         to match the values in System.CodeDOM.
27075
27076         Divid renamed to Divide.
27077
27078         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
27079         statements. 
27080         (Statements.set): remove.
27081
27082         * System.CodeDOM/CodeCatchClause.cs: always have a valid
27083         statements. 
27084
27085         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
27086         falseStatements always have valid values. 
27087
27088         * cs-parser.jay: Use System.CodeDOM now.
27089