2007-06-08 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / gmcs / ChangeLog
1 2007-06-08  Marek Safar  <marek.safar@gmail.com>
2
3         * cs-parser.jay: Uses newly defined GroupBy class.
4         
5         * linq.cs (GroupBy): Implemented.
6         (AQueryClause.BuildQueryClause): Refactored to allow customize query
7         method arguments.
8
9 2007-06-08  Marek Safar  <marek.safar@gmail.com>
10
11         * generics.cs (InferTypeArguments): Uses AnonymousMethodExpression
12         InferTypeArguments.
13
14 2007-06-06  Marek Safar  <marek.safar@gmail.com>
15
16         * generics.cs (TypeArguments): New contructor fow known number of
17         arguments.
18
19 2007-06-04  Raja R Harinath  <rharinath@novell.com>
20
21         * linq.cs (Select.DoResolve): Pass the created parameters to the
22         ToplevelBlock too.
23
24 2007-05-29  Raja R Harinath  <rharinath@novell.com>
25
26         * cs-parser.jay: Update to changes in ToplevelBlock.
27         (top_current_block): Remove.
28
29 2007-05-27  Raja R Harinath  <harinath@gmail.com>
30
31         * cs-parser.jay: Update to new ExplicitBlock invariant.
32
33         * cs-parser.jay: Update to changes introduced in Block and
34         ExplicitBlock.
35
36 2007-05-25  Raja R Harinath  <rharinath@novell.com>
37
38         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
39         modifying current_block directly.
40
41 2007-05-22  Scott Peterson  <lunchtimemama@gmail.com>
42         
43         * cs-parser.jay: Implemented automatic properties (C# 3.0)
44
45 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
46         
47         * cs-parser.jay: Improved grammar for object and collection
48           initialization.
49
50 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
51
52         This code is contributed under the MIT X11 license
53         
54         * cs-parser.jay: Added support for C# 3.0 language features:
55           Variable type inference (the "var" keyword)
56           Anonymous types
57           Array type inference
58           Object initialization
59           Collection initialization
60
61 2007-05-06  Marek Safar  <marek.safar@gmail.com>
62
63         A fix for bug #81500
64         * cs-parser.jay: Add special handling for coalescing operator.
65
66 2007-05-02  Raja R Harinath  <rharinath@novell.com>
67
68         Fix regression in cs0631-3.cs
69         * cs-parser.jay (operator_declarator): Add opt_attributes to error
70         fallback.  Make error fallback catch more cases.
71
72 2007-05-01  Miguel de Icaza  <miguel@novell.com>
73
74         * cs-parser.jay: Allow parameters in operator declarations to have
75         attributes. 
76
77 2007-04-27  Miguel de Icaza  <miguel@novell.com>
78
79         * generic.cs (TypeManager.LambdaInfer): now this routine will
80         make only one inference from the list of lambda expression that
81         have not participated in inferring a type.
82
83         (TypeManager.InferTypeArguments): The logic that drives the type
84         inference in lambda expressions is now driven here. 
85
86 2007-04-23  Miguel de Icaza  <miguel@novell.com>
87
88         * generic.cs: Large update to LambdaInfer, this is merely an
89         update to start the lambda type inference.   It is by no means
90         complete.  It is currently merely able to build a sample program
91         (with no iteration for the type parameters).
92
93 2007-04-12  Duncan Mak  <duncan@a-chinaman.com>
94
95         * cs-parser.jay (interface_method_declaration_body): Fixed typo.
96
97 2007-04-08  Marek Safar  <marek.safar@gmail.com>
98
99         * cs-parser.jay, linq.cs: First select implementation (hacky).
100
101         * generic.cs (InferTypeArguments): Simplified.
102
103 2007-03-31  Marek Safar  <marek.safar@gmail.com>
104
105         * generic.cs (InferTypeArguments): Restored validation check.
106         (InferTypeArguments): Move all logic to Compatible method for re-usability.
107
108 2007-03-25  Marek Safar  <marek.safar@gmail.com>
109
110         * generic.cs (InferTypeArguments): Infer arguments before they are used
111         for compatibility check.
112
113 2007-03-15  Marek Safar  <marek.safar@gmail.com>
114
115         * generic.cs (InflatedConstraints): Fixed the check order.
116         (TypeArguments.Resolve): Small optimization for generic parameters.
117         (InferTypeArguments): Add infering support for anonymous methods.
118
119 2007-03-15  Martin Baulig  <martin@ximian.com>
120
121         Fix #79984.
122
123         * generic.cs
124         (TypeParameter.HasConstructorConstraint): Removed.
125         (ConstraintChecker.HasDefaultConstructor): Removed the
126         `TypeBuilder' argument here; correctly check for the ctor
127         constraint on type parameters.
128
129 2007-03-15  Martin Baulig  <martin@ximian.com>
130
131         Fix #79302.
132
133         * generic.cs
134         (TypeParameter): Create a `MemberCache' here as well.  Note that
135         we need to create this on-demand when it's actually used.
136
137 2007-03-10  Marek Safar  <marek.safar@gmail.com>
138
139         * generic.cs (TypeArguments.Resolve): Avoid redundant checks.
140
141 2007-03-09  Raja R Harinath  <rharinath@novell.com>
142
143         * cs-parser.jay (WHERE): Move before QUERY_FIRST_TOKEN.  'where'
144         is a valid keyword outside a linq expression too.
145
146 2007-03-03  Marek Safar  <marek.safar@gmail.com>
147
148         * cs-parser.jay: Implemented basic linq grammar.
149
150         * linq.cs: New file for hosting query specific classes.
151
152 2007-02-26  Marek Safar  <marek.safar@gmail.com>
153
154         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
155
156 2007-02-20  Marek Safar  <marek.safar@gmail.com>
157
158         A fix for bug #80650
159         * cs-parser.jay: Anonymous container starts at constructor declaration
160         and not at block beginning because it has to be usable in constructor
161         initializer.
162
163 2007-02-18  Marek Safar  <marek.safar@gmail.com>
164
165         A fix for bug #80493 by Atsushi Enomoto
166         * cs-parser.jay: Ignore invalid attribute target.
167
168 2007-02-15  Miguel de Icaza  <miguel@novell.com>
169
170         * Remove the call to SetExpression for lambda expressions, we do
171         not actually need it.
172
173         Remove expression tracking code as its not needed.
174
175 2007-02-11  Miguel de Icaza  <miguel@novell.com>
176
177         * cs-parser.jay (lambda_expression_body): when the body is an
178         expression add a statement of the form:
179
180                 contextual-return expression.
181
182         Where `contextual-return' is similar to `return', the difference
183         being that if the delegate that the lambda will be converted to
184         has a void return type, it will check that the result is a
185         ExpressionStatement and the result is a plain ret (no return
186         values on the stack).  If the return type of the delegate is of a
187         given type, this turns into a return with a value and does the
188         regular checking to check that the computed value can be
189         implicitly converted to the delegate return.
190
191 2007-01-30  Miguel de Icaza  <miguel@novell.com>
192
193         * cs-parser.jay (anonymous_method_expression): move the
194         before/after productions to the start_anonymous and end_anonymous
195         methods so the code can be reused for lambda functions.
196
197         (lambda_expression_body): wrap expressions implicitly into a
198         block.
199
200         (block): factor out the setup/teardown of parsing a block so we
201         can reuse that in lambda_expression_body
202
203         (lambda_expression): use new anonymous method helper methods.
204
205 2007-01-29  Miguel de Icaza  <miguel@novell.com>
206
207         * cs-parser.jay: oob_stack make it static (am guessing that is why
208         we no longer initialize it anymore) and reuse it across
209         instances.
210
211 2007-01-28  Miguel de Icaza  <miguel@novell.com>
212
213         * cs-parser.jay (open_parens): Introduce new non-terminal that
214         abstracts OPEN_PARENS and OPEN_PARENS_LAMBDA as the later can now
215         be returned in places where types are followed by identifiers
216         (this is expected in declaration, fixed, using, foreach and catch
217         clauses). 
218
219         Use open_parens in those places, keep OPEN_PARENS in the
220         expressions.  
221
222         cs-parser.jay: New grammar bits for parsing lambda expressions. 
223
224 2007-01-28  Raja R Harinath  <rharinath@novell.com>
225
226         Fix #80534, gtest-309.cs
227         * generic.cs (UnifyType): Rename from InferType.  Make unification
228         of generic insts simpler and don't insist on inferring all generic
229         parameters in a single generic inst unification.
230         (UnifyTypes): New.
231         (InferGenericInstance): Remove.
232         Analysis and initial patch by David Mitchell <dmitchell@logos.com>.
233
234 2007-01-20  Marek Safar  <marek.safar@gmail.com>
235
236         * cs-parser.jay: Better parameter error handling.
237
238 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
239             Raja R Harinath  <rharinath@novell.com>
240
241         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
242         Note the order in which accessors are declared in the source.
243
244 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
245
246         * generic.cs (TypeParameter.FindMembers): Use the generic
247         constraints, not the constraints to check for methods (first fix
248         of 80518).
249
250 2006-12-30  Marek Safar  <marek.safar@gmail.com>
251
252         * cs-parser.jay: Better syntax errors handling.
253
254 2006-11-21  Marek Safar  <marek.safar@gmail.com>
255
256         * cs-parser.jay: Tiny change to work with mcs tokenizer.
257
258         * cs-tokenizer.cs: Remove after unification with mcs.
259
260 2006-10-28  Marek Safar  <marek.safar@gmail.com>
261
262         A fix for bug #78998
263         * generic.cs (ConstructedType.AsAccessible): Check accessibility of type
264         arguments as well.
265
266 2006-10-26  Marek Safar  <marek.safar@gmail.com>
267
268         A fix for bug #76591
269         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous methods.
270
271 2006-10-25  Brian Crowell  <brian@fluggo.com>
272
273         Fix #79703
274         * generic.cs (CheckConstraints): Allow generic parameters with
275         inheritance constraints to satisfy reference type constraints.
276
277 2006-10-09  Martin Baulig  <martin@ximian.com>
278
279         * generic.cs
280         (NullCoalescingOperator.DoResolve): Fix #78964; added gtest-294.cs.
281
282 2006-09-25  Martin Baulig  <martin@ximian.com>
283
284         * class.cs: Remove after unification with mcs source.
285
286 2006-09-24  Raja R Harinath  <harinath@gmail.com>
287
288         * convert.cs: Remove after unification with mcs source.
289
290 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
291
292         * class.cs (MemberBase.VerifyClsCompliance): When method has type
293         parameters verify them as well.
294
295         * generic.cs (Constraints.VerifyClsCompliance): Verify CLS-Compliance of
296         the type parameter constraints.
297         (Generics.VerifyClsCompliance): Ditto.
298
299 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
300
301         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
302         for anonymous block with out argument.
303
304 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
305
306         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
307         not used private events only.
308
309 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
310
311         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
312
313         * cs-parser.jay: Parse correctly cast of default (T).
314
315         * generic.cs (DefaultValueExpression.DoResolve): Check for void type.
316         Store original type via EmptyConstantCast.
317
318 2006-09-22  Martin Baulig  <martin@ximian.com>
319
320         * delegate.cs: Removed; this file is now shared with mcs.
321
322         * attribute.cs: Removed; this file is now shared with mcs.
323
324 2006-09-22  Martin Baulig  <martin@ximian.com>
325
326         * ecore.cs: Removed; this file is now shared with mcs.
327
328 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
329
330         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
331
332         * ecore.cs (NullCast): Derives from NullConstant.
333
334         * generic.cs (DefaultValueExpression): Fixed to cope with the constant
335         results.
336
337 2006-09-21  Martin Baulig  <martin@ximian.com>
338
339         * decl.cs: Removed; this file is now shared with mcs.
340
341 2006-09-21  Raja R Harinath  <rharinath@novell.com>
342
343         * rootcontext.cs: Remove after unification with mcs source.
344
345         * report.cs: Remove after unification with mcs source.
346         * generic.cs (AddTypeParameter, LookupTypeParameter): Move to
347         mcs/typemanager.cs.
348         (InitGenerics, CleanUpGenerics): Remove.
349
350         * support.cs: Remove after unification with mcs source.
351
352 2006-09-20  Raja R Harinath  <rharinath@novell.com>
353
354         * codegen.cs: Remove after unification with mcs source.
355
356 2006-09-19  Martin Baulig  <martin@ximian.com>
357
358         * expression.cs: Removed; this file is now shared with mcs.
359
360 2006-09-19  Martin Baulig  <martin@ximian.com>
361
362         * generic.cs
363         (TypeManager.IsEqual): Moved into ../mcs/typemanager.cs.
364         (TypeManager.DropGenericTypeArguments): Likewise.
365         (TypeManager.DropGenericMethodArguments): Likewise.
366         (TypeManager.GetTypeArguments): Likewise.
367         (TypeManager.HasGenericArguments): Likewise.
368
369 2006-09-19  Martin Baulig  <martin@ximian.com>
370
371         * ecore.cs (PropertyExpr.InstanceResolve): Fix the CS1540 check.
372
373 2006-09-19  Martin Baulig  <martin@ximian.com>
374
375         * typemanager.cs: Removed; this file is now shared with mcs.
376
377 2006-09-16  Raja R Harinath  <rharinath@novell.com>
378
379         * Makefile (LOCAL_MCS_FLAGS): Use instead of PROFILE_MCS_FLAGS.
380         * AssemblyInfo.cs, driver.cs: Remove after unification with mcs source.
381
382 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
383
384         A fix for #79401
385         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
386         only if parent type is class.
387         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
388         update.
389
390 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
391
392         * cs-parser.jay,
393         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
394         keywords are used.
395         * typemanager.cs(CSharpName): Converts NullType to null.
396
397 2006-09-15  Martin Baulig  <martin@ximian.com>
398
399         * pending.cs: Removed; this file is now shared with mcs.
400
401 2006-09-15  Martin Baulig  <martin@ximian.com>
402
403         * statement.cs: Removed; this file is now shared with mcs.
404
405 2006-09-15  Martin Baulig  <martin@ximian.com>
406
407         * rootcontext.cs (RootContext.BrokenCircularDeps): Removed.
408
409         * driver.cs: Removed the `--broken-cycles' argument.
410
411 2006-09-15  Martin Baulig  <martin@ximian.com>
412
413         * namespace.cs: Removed; this file is now shared with mcs.
414
415 2006-09-15  Martin Baulig  <martin@ximian.com>
416
417         * decl.cs (MemberName): Minor code cleanups.
418
419 2006-09-15  Martin Baulig  <martin@ximian.com>
420
421         * parameter.cs: Removed; this file is now shared with mcs.
422
423 2006-09-15  Martin Baulig  <martin@ximian.com>
424
425         * enum.cs: Removed; this file is now shared with mcs.
426
427 2006-09-15  Martin Baulig  <martin@ximian.com>
428
429         * Makefile: Define `GMCS_SOURCE'.
430
431         * flowanalysis.cs: Removed; this file is now shared with mcs.
432
433 2006-09-15  Martin Baulig  <martin@ximian.com>
434
435         Removed modifiers.cs, literal.cs, location.cs, roottypes.cs,
436         assign.cs, const.cs, cfold.cs, constant.cs, symbolwriter.cs and
437         doc.cs - they are now shared with mcs.
438
439         * gmcs.exe.sources: Include these files from ../mcs/.
440
441 2006-09-15  Martin Baulig  <martin@ximian.com>
442
443         * old-code.cs, gen-il.cs, gen-treedump.cs: Removed old stuff.
444         * g1.cs, sample-hello.cs, sample-stack.il: Likewise.
445
446 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
447
448         * assign.cs, ecore.cs, expression.cs: Share error message text.
449         * class.cs (FieldMember.Define): Check for variable of static type.
450         * decl.cs (check_type_parameter): Report correct type name.
451         * driver.cs (LoadAssembly): Uses error output for errors.
452         * generic.cs (Constraints.Resolve): Add check for constraint accessibility
453         (TypeArguments.Resolve): Static class cannot be used as an argument.
454         * statement.cs (ResolveMeta): Constants cannot be generic types.
455
456 2006-09-12  Martin Baulig  <martin@ximian.com>
457
458         * generic.cs (TypeManager.IsIList): Moved into convert.cs.
459
460         * convert.cs (Convert.Array_To_IList): Moved here and correctly
461         implement it; fixes #79345.
462
463 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
464
465         * decl.cs (DeclSpace.SetParameterInfo): Check for nonexistent type
466         parameter.
467         * expression.cs (TypeOf.GetAttributableValue): Check for open generic
468         types.
469         * generic.cs: Improved error messages.
470         * typemanager.cs (RemoveGenericArity): Made public.
471
472 2006-09-08  Martin Baulig  <martin@ximian.com>
473
474         * typemanager.cs (TypeManager.interlocked_type): New public field.
475         (TypeManager.int_interlocked_compare-exchange): New public field.
476         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
477         enumerator types here and call InitGenericCoreTypes().
478         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
479         after calling InitEnumUnderlyingTypes().
480
481         * rootcontext.cs
482         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
483         `classes_second_stage'. 
484
485 2006-09-07  Marek Safar  <marek.safar@seznam.cz>
486  
487         * class.cs, generic.cs (GenericMethod.Define): Check for type parameter
488         collisions.
489         * statement.cs (Block.Variables): Made public.
490
491 2006-09-07  Martin Baulig  <martin@ximian.com>
492
493         * driver.cs
494         (MainDriver): Revert r62663 from Marek; see #70506 for details.
495
496 2006-09-01  Martin Baulig  <martin@ximian.com>
497
498         * generic.cs
499         (TypeManager.IsIList): Also handle base classes and interfaces. 
500
501 2006-09-01  Raja R Harinath  <rharinath@novell.com>
502
503         Fix #79238
504         * expression.cs (Invocation.MoreSpecific): Check for reference
505         types earlier.
506
507 2006-08-29  Miguel de Icaza  <miguel@novell.com>
508
509         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
510
511 2006-08-17  Miguel de Icaza  <miguel@novell.com>
512
513         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
514         #52019 and #79064, the use of the \uXXXX sequence in source code
515         to represent unicode characters.
516
517 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
518  
519         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
520         support.
521         * class.cs, ecore.cs, statement.cs: Merged to one error message.
522
523 2006-08-14  Raja R Harinath  <rharinath@novell.com>
524
525         Fix #79067
526         * cs-tokenizer.cs (parse_less_than): Allow '*' to appear in a type
527         parameter too.  This only avoids a parse error -- the semantic
528         error is caught elsewhere.
529
530 2006-08-13  Miguel de Icaza  <miguel@novell.com>
531
532         * assign.cs: Catch attempts to assign to a method groups in += and
533         report as 1656
534
535 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
536
537         A fix for #79056
538         * cs-parser.jay: Don't destroy current array type by typeof of array's.
539
540 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
541
542         * cs-parser.jay: Check whether a constraint clause has already been
543         specified for type parameter.
544         * generic.cs (Constraints): Exposed location.
545
546 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
547
548         * class.cs (Method.Define): Issue a warning when generic method looks like
549         an entry point.
550         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
551         as well.
552         * report.cs: New warning number.
553
554 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
555  
556         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
557         looking for ctor.
558         * decl.cs (MemberCache.FindMembers): When container is interface we need to
559         search all base interfaces as a member can be ambiguous.
560         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
561         Constructor member type filter. 
562         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
563         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
564         reporting for returned memberinfos.
565         * report.cs: Updated.
566         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
567         version to work on all runtimes.
568         (TypeManager.RealMemberLookup): Removed members filtering.
569
570 2006-08-08  Raja R Harinath  <rharinath@novell.com>
571
572         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
573         (PropertyExpr.EmitAssign): Likewise.
574         * expression.cs (Indirection.EmitAssign): Likewise.
575         (LocalVariableReference.EmitAssign): Likewise.
576         (ParameterReference.EmitAssign): Likewise.
577         (Invocation.EmitArguments): Likewise.
578         (ArrayAccess.EmitAssign): Likewise.
579         (IndexerAccess.EmitAssign): Likewise.
580         (This.EmitAssign): Likewise.
581         (ConditionalLogicalOperator.Emit): Likewise.
582
583         Fix #79026
584         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
585         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
586         leave it in after returning it.
587         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
588
589 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
590
591         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
592         message.
593
594 2006-08-05  Marek Safar  <marek.safar@seznam.cz>
595
596         * class.cs (TypeContainer.AddPartial): Add check for partial declarations
597         with different type names.
598         (TypeContainer.UpdateTypeParameterConstraints): Updated an error message.
599
600 2006-08-03  Raja R Harinath  <rharinath@novell.com>
601
602         Fix cs0146-3.cs and cs0146-4.cs.
603         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
604         enclosing types don't depend on the current type.
605
606 2006-08-02  Raja R Harinath  <rharinath@novell.com>
607
608         Fix #77963
609         * class.cs (TypeContainer.DoDefineMembers): Use
610         FindBaseMemberWithSameName on Parent, since we're interested in
611         whether we hide inherited members or not.
612         (FindBaseMemberWithSameName): Make slightly more robust.
613
614         Fix #77396
615         * codegen.cs (IResolveContext.GenericDeclContainer): New.
616         (EmitContext): Implement new interface requirement.
617         * namespace.cs (UsingEntry, LocalAliasEntry): Likewise.
618         * decl.cs (MemberCore): Likewise.
619         (DeclSpace.GenericDeclContainer): Rename from DeclContainer.
620         * ecore.cs (SimpleName.ResolveAsTypeTerminal): Use
621         ec.GenericDeclContainer to check for generic parameters.
622         (SimpleName.DoSimpleNameResolve): Likewise.
623         * generic.cs (TypeParameter.DeclContainer): Remove override.
624
625         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
626         declspaces for doppelgangers too.
627         (UsingEntry): Implement IResolveContext.
628         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
629         'this' as the resolve context.
630         (LocalAliasEntry): Likewise.
631
632         Implement parts of #77403
633         * roottypes.cs (RootDeclSpace): New.  Used to represent the
634         toplevel declaration space.  Each namespace declaration introduces
635         a "partial" root declaretion space.
636         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
637         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
638         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
639         from 'current_namespace.SlaveDeclSpace'.
640         (namespace_declaration): Likewise.
641         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
642         check.  It can't happen now.
643         * decl.cs (DeclSpace.LookupType): Likewise.
644         * driver.cs (MainDriver): Sanity check.
645
646 2006-08-01  Raja R Harinath  <rharinath@novell.com>
647
648         * decl.cs (DeclSpace.FindNestedType): Remove.
649         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
650         LookupTypeContainer to get the container of the nested type.
651         * class.cs (TypeContainer.FindNestedType): Make non-override.
652
653 2006-07-31  Raja R Harinath  <rharinath@novell.com>
654
655         * decl.cs (DeclSpace.PartialContainer): Move field from ...
656         * class.cs (TypeContainer.PartialContainer): ... here.
657         (TypeContainer.AddBasesForPart): New helper.
658         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
659         instead.
660         * cs-parser.jay (current_class): Convert to DeclSpace.
661         (struct_declaration, interface_declaration, class_declaration):
662         Use AddBasesForPart instead of .Bases directly.
663         * const.cs, iterators.cs: Update to changes.
664
665 2006-07-28  Raja R Harinath  <rharinath@novell.com>
666
667         * class.cs (TypeContainer.AddMemberType): Rename from
668         AddToTypeContainer.
669         (TypeContainer.AddMember): Rename from AddToMemberContainer.
670         (AddTypeContainer): New.  Combine AddClassOrStruct and
671         AddInterface.
672         (AddPartial): Update.  Add 'is_partial' argument.
673         * roottypes.cs: Update to changes.
674         * cs-parser.jay (push_current_class): New helper for handling
675         current_container and current_class.
676         (struct_declaration, interface_declaration, class_declaration):
677         Use it.
678
679 2006-07-26  Raja R Harinath  <rharinath@novell.com>
680
681         * roottypes.cs: Rename from tree.cs.
682
683         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
684         * tree.cs (Tree, ITreeDump): Remove types.
685         * rootcontext.cs (tree, Tree): Remove fields.
686         (root, ToplevelTypes): New.
687         * *.cs: Update to rename.
688
689         * tree.cs (Tree.RecordDecl): Remove.
690         (RootTypes.AddToTypeContainer): Record the toplevel type in its
691         namespace here.
692         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
693
694 2006-07-23  Raja R Harinath  <harinath@gmail.com>
695
696         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
697         DoFlowAnalysis and OmitStructFlowAnalysis here.
698         (ec.With): Rename from WithUnsafe and generalize.
699         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
700         (ec.WithFlowAnalyis): New.
701         * ecore.cs, expression.cs, statement.cs: Update.
702
703 2006-07-22  Raja R Harinath  <harinath@gmail.com>
704
705         * statement.cs (Block.ResolveMeta): Simplify slightly.
706
707         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
708         multiple boolean fields.  Convert InUnsafe, constant_check_state,
709         check_state to flags.
710         (CheckState, ConstantCheckState): Update.
711         (InUnsafe): New read-only property.
712         (FlagsHandle): Rename from CheckStateHandle and convert to handle
713         arbitrary flags.
714         (WithUnsafe): New helper similar to WithCheckState.
715         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
716         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
717
718 2006-07-21  Raja R Harinath  <rharinath@novell.com>
719
720         Make comparisons use the same IL irrespective of whether they're
721         in a 'checked' or 'unchecked' context: one of the issues in #78899
722         * codegen.cs (EmitContext.CheckState): Make read-only property.
723         (EmitContext.ConstantCheckState): Likewise.
724         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
725         helper that implement a save/restore stack for CheckState
726         values.  This is the only way to change check-state.
727         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
728         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
729         (CheckedExpr.EmitBranchable): New forwarding method.
730         (UnCheckedExpr): Likewise.
731         * statement.cs (Block.ResolveMeta): Use WithCheckState.
732         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
733         (Checked.Resolve, checked.DoEmit): Likewise.
734
735 2006-07-21  Martin Baulig  <martin@ximian.com>
736
737         * generic.cs (TypeManager.InferType): When inferring an array
738         type, also allow IList<T> and ICollection<T>.  Fixes #78900.
739
740 2006-07-21  Martin Baulig  <martin@ximian.com>
741
742         * generic.cs (TypeManager.IsIEnumerable): Renamed into IsIList()
743         and allow IList`1 and all its base interfaces.
744
745         * convert.cs (Convert.ImplicitReferenceConversion): Allow
746         converting from an array-type of T to IList<T>.
747
748 2006-07-21  Martin Baulig  <martin@ximian.com>
749
750         * ecore.cs (SimpleName.DoSimpleNameResolve): Added CS0307 check.
751
752 2006-07-20  Miguel de Icaza  <miguel@novell.com>
753
754         * anonymous.cs: Cache the resolved anonymous delegate, and return
755         this so that the ResolveTopBlock is only triggered once, not
756         twice.
757
758         Currently we trigger ResolvetopBlock twice due to a first pass of
759         argument check compatibility, and a second pass that does the
760         actual resolution.   
761
762 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
763
764         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
765         modifiers.
766         * rootcontext.cs (Reset): Add helper_classes.
767
768 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
769
770         A fix for #78860
771         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
772         correctly.
773
774 2006-07-13  Miguel de Icaza  <miguel@novell.com>
775
776         * statement.cs (Lock): Handle expressions of type
777         TypeManager.null_type specially.  Fixes #78770
778
779 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
780
781         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
782         to an event.
783
784 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
785
786         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
787         for accessors as well.
788         * ecore.cs (EventExpr): Add AccessorTable.
789
790 2006-07-03  Martin Baulig  <martin@ximian.com>
791
792         * ecore.cs (UnboxCast.Emit): Also use `Unbox_Any' for generic
793         instances of value types.
794
795         * convert.cs (Convert.ExplicitConversion): Correctly handle
796         object->nullable conversions.   
797
798 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
799
800         A fix for #78738
801         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
802         for CS0122 where appropriate.
803         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
804         level attributes.
805         (Filter): Assembly can be null in the case of top level attributes.
806
807 2006-06-28  Raja R Harinath  <rharinath@novell.com>
808
809         Fix #78716
810         * generic.cs (TypeManager.InferParamsTypeArguments): If there are
811         no arguments, return 'false': nothing can be inferred.
812
813 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
814
815         A fix for #78690
816
817         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
818         is done at global level.
819
820 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
821
822         A fix for #77002, Implemented TypeForwarder support.
823
824         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
825         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Add TypeForwarder
826         attribute handling.
827         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
828         * typemanager.cs (): Add type_forwarder_attr_type.
829
830 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
831
832         * report.cs: Add CS0469 warning.
833
834 2006-06-22  Martin Baulig  <martin@ximian.com>
835
836         * class.cs
837         (TypeContainer.GetNormalBases): Also use ResolveAsBaseTerminal()
838         for interfaces; fixes #78686, which is a modification of #78380
839         with interfaces instead of classes.
840
841 2006-06-21  Martin Baulig  <martin@ximian.com>
842
843         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
844         the `try'-block, so we also report CS0016 etc. there.
845
846 2006-06-21  Martin Baulig  <martin@ximian.com>
847
848         * ecore.cs (FieldExpr.EmitAssign, FieldExpr.AddressOf): Correctly
849         handle SetAssigned() and SetMemberIsUsed() for generic types;
850         fixes #77545.
851
852 2006-06-21  Martin Baulig  <martin@ximian.com>
853
854         * delegate.cs
855         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
856
857 2006-06-21  Martin Baulig  <martin@ximian.com>
858
859         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
860         also report CS1686 for parameters.
861
862 2006-06-21  Martin Baulig  <martin@ximian.com>
863
864         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
865         instead of an error if the value is not implicitly convertible to
866         the switch types; fixes #77964.
867
868 2006-06-21  Raja R Harinath  <rharinath@novell.com>
869
870         Fix #78673
871         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
872         FieldBuilder is null.
873
874         Fix #78662
875         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
876         'left' and 'right' before error-checking.
877
878 2006-06-19  Martin Baulig  <martin@ximian.com>
879
880         * convert.cs
881         (Convert.ImplicitConversionStandard): Cleanup and correctly
882         implement nullable conversions.
883         (Convert.ImplicitStandardConversionExists): Likewise.
884         (Convert.ExplicitConversion): Likewise.
885
886 2006-06-19  Martin Baulig  <martin@ximian.com>
887
888         * generic.cs
889         (Nullable.Wrap.Create, Nullable.Unwrap.Create): New public static
890         methods; make the ctors protected.
891
892 2006-06-19  Martin Baulig  <martin@ximian.com>
893
894         Fixed #78380; added gtest-273.cs.
895
896         * ecore.cs
897         (Expression.ResolveAsBaseTerminal): Move the constraint checking
898         into ResolveAsTypeTerminal().
899
900         * generic.cs
901         (ConstraintChecker.HasDefaultConstructor): Use the non-cache based
902         TypeManager.FindMembers() to check for the default ctor.
903
904 2006-06-18  Marek Safar  <marek.safar@seznam.cz>
905
906         * generic.cs: Fixed NullableInfo accessibility.
907
908 2006-06-16  Martin Baulig  <martin@ximian.com>
909
910         * generic.cs
911         (Constraints.InflatedConstraints.inflate): Correctly inflate
912         generic types; fixes #78400.
913
914 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
915
916         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
917         Fixed bug #78601.
918         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
919         (FieldExpr.DoResolve): likewise.
920         (PropertyExpr.InstanceResolve): likewise.
921         (EventExpr.InstanceResolve): likewise. 
922
923 2006-06-15  Martin Baulig  <martin@ximian.com>
924
925         * statement.cs
926         (SwitchLabel.ResolveAndReduce): Added `bool allow_nullable'
927         argument; always allow a `null' label if true.
928         (Switch.SwitchGoverningType): Take an `Expression expr' argument.
929         (Switch.TableSwitchEmit, Switch.SimpleSwitchEmit): Check whether
930         we have a `null' label and mark the new `null_target' label;
931         default to the `default' label.
932         (Switch.Resolve): Add support for nullable types.  Fixes #78630.
933
934 2006-06-15  Martin Baulig  <martin@ximian.com>
935
936         * class.cs (Operator.Define): Allow an implicit/explicit operator
937         to convert to/from a nullable value of the enclosing type.
938
939         * generic.cs (TypeManager.IsNullableTypeOf): New public method.
940         (Nullable.Unwrap, Nullable.Wrap): Make these classes public.
941
942         * convert.cs
943         (Convert.ImplicitStandardConversionExists): Add support for lifted
944         implicit/explicit conversions.
945         (Convert.ImplicitConversionStandard): Likewise.
946
947 2006-06-13  Martin Baulig  <martin@ximian.com>
948
949         * ecore.cs (SimpleName.DoSimpleNameResolve): Check whether we have
950         type arguments and create a ConstructedType if necessary.  Fixes #78400.
951
952 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
953
954         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
955         attribute applicable tests for attribute argument.
956
957 2006-06-02  Raja R Harinath  <rharinath@novell.com>
958
959         Fix #78079
960         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
961         (Binary.OverloadResolve_PredefinedIntegral): New.
962         (Binary.OverloadResolve_PredefinedFloating): New.
963         (Binary.OverloadResolve_PredefinedString): New.
964         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
965         Follow the standard more closely, and treat numeric promotions in
966         terms of overload resolution.
967         (Binary.CheckShiftArguments): Simplify.
968
969 2006-06-01  Raja R Harinath  <rharinath@novell.com>
970
971         * flowanalysis.cs (MyBitVector): Simplify representation.
972         (MyBitVector.Clone): Avoid allocating BitArray.
973         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
974         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
975         (*): Update.  Change all references to MyBitVector.And and
976         MyBitVector.Or to &= and |=.
977
978 2006-05-31  Raja R Harinath  <rharinath@novell.com>
979
980         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
981         Use bne.un instead of ceq+brfalse.
982
983         Fix cs0208-[23].cs
984         * typemanager.cs (IsUnmanagedType): Disallow generic types and
985         generic parameters.
986
987 2006-05-29  Raja R Harinath  <rharinath@novell.com>
988
989         Fix cs0231-[34].cs.
990         * cs-parser.jay (formal_parameter_list): Extend the pattern below
991         to param arguments too.
992
993 2006-05-26  Miguel de Icaza  <miguel@novell.com>
994
995         * cs-parser.jay: Catch another parsing form for arglist being
996         followed by other arguments.  Fixes #78313.
997
998 2006-05-25  Raja R Harinath  <rharinath@novell.com>
999
1000         Fix #78324
1001         * expression.cs (Binary.DoResolve): Use Nullable.LiftedBinaryOperator
1002         also when one of the operands is a null literal.
1003         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality): Rewrite
1004         to improve clarity, and generate slightly better code.
1005
1006 2006-05-24  Raja R Harinath  <rharinath@novell.com>
1007
1008         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
1009         checking of out parameters to ...
1010         (FlowBranchingToplevel.Merge): ... here.
1011         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
1012         set, propagate the origin upward, and only complain if there was
1013         no other error.
1014         (FlowBranchingException.AddContinueOrigin): Likewise.
1015         (FlowBranchingException.AddReturnOrigin): Likewise.
1016         (FlowBranchingException.AddGotoOrigin): Likewise.       
1017
1018 2006-05-23  Raja R Harinath  <rharinath@novell.com>
1019
1020         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
1021         unreachable, skip it.
1022         (FlowBranchingException.Merge): Always propagate jumps, even if
1023         the finally block renders subsequent code unreachable.
1024
1025 2006-05-18  Raja R Harinath  <rharinath@novell.com>
1026
1027         Fix #77601
1028         * statement.cs (Goto.Resolve): Move responsibility for resolving
1029         'goto' to FlowBranching.AddGotoOrigin.
1030         (Goto.SetResolvedTarget): New.  Callback to set the
1031         LabeledStatement that's the target of the goto.
1032         (Goto.DoEmit): Use Leave instead of Br when crossing an
1033         unwind-protect boundary.
1034         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
1035         LookupLabel and adjust to new semantics.
1036         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
1037         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
1038         Goto.SetResolvedTarget to update target.
1039         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
1040         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
1041         AddBreakOrigin & co.  Delay propagation until ...
1042         (FlowBranchingException.Merge): ... this.
1043
1044         * statement.cs (Block.Resolve): Always depend on flow-branching to
1045         determine unreachability.  Kill workaround that originally emitted
1046         only one statement after an "unreachable" label (see infloop in
1047         test-515.cs).
1048
1049         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
1050         This is still "wrong", but anything better would probably need a
1051         multi-pass algorithm.
1052         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
1053         usage vector.  Force current usage vector to be reachable, to
1054         optimistically signify backward jumps.
1055         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
1056         detected.
1057         (FlowBranchingLabeled.Merge): New.  If no backward jump was
1058         detected, return the original salted-away usage vector instead,
1059         updated with appropriate changes.  Print unreachable warning if
1060         necessary.
1061         * statement.cs (Block.Resolve): Don't print unreachable warning on
1062         a labeled statement.
1063
1064 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
1065
1066         * driver.cs: Pass filename without path to AssemblyBuilder's
1067         AddResourceFile. Fixes bug #78407.
1068
1069 2006-05-17  Raja R Harinath  <rharinath@novell.com>
1070
1071         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
1072         * flowanalysis.cs (FlowBranchingLabeled): ... here.
1073         (FlowBranching.MergeChild): Overwrite
1074         reachability information from Labeled branchings too.
1075
1076 2006-05-16  Raja R Harinath  <rharinath@novell.com>
1077
1078         * statement.cs (Goto.Resolve): Merge jump origins here ...
1079         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
1080
1081         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
1082         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
1083         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
1084         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
1085         here, ...
1086         * statement.cs (Goto.Resolve): ... not here.
1087         (Goto.Emit): Remove CS1632 check.
1088
1089 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
1090
1091         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
1092         error message.
1093
1094 2006-05-11  Raja R Harinath  <rharinath@novell.com>
1095
1096         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
1097         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
1098         (FlowBranchingException.Label): Likewise.
1099
1100         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
1101         given value.
1102         (MyBitVector.Or): Use it to avoid losing information (Count).
1103         (FlowBranching.MergeOrigins): Likewise.
1104
1105         * flowanalysis.cs (UsageVector.IsDirty): Remove.
1106         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
1107         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
1108         (UsageVector.ToString): Simplify.
1109         (UsageVector.MergeSiblings): Move here from ...
1110         (FlowBranching.Merge): ... here.
1111         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
1112         not a MyBitVector.
1113
1114 2006-05-10  Raja R Harinath  <rharinath@novell.com>
1115
1116         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
1117         null bitvector is treated as all-true.
1118
1119         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
1120         (MyBitVector): Rationalize invariants.  'vector != null' implies
1121         that we have our own copy of the bitvector.  Otherwise,
1122         'InheritsFrom == null' implies all inherited bits are true.
1123
1124 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
1125
1126         * statement.cs (LocalInfo): Add IsConstant.
1127         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
1128         local variable for constants.
1129
1130 2006-05-09  Raja R Harinath  <rharinath@novell.com>
1131
1132         * flowanalysis.cs (MyBitVector.Empty): New.
1133         (MyBitVector): Don't allow InheritedFrom to be null.
1134         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
1135         (UsageVector, FlowBranching): Update to changes.
1136
1137         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
1138         recursion.  The 'Parent == null' condition isn't sufficient for
1139         anonymous methods.
1140         (FlowBranching.AddBreakOrigin): Likewise.
1141         (FlowBranching.AddContinueOrigin): Likewise.
1142         (FlowBranching.AddReturnOrigin): Likewise.
1143         (FlowBranching.StealFinallyClauses): Likewise.
1144         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
1145         (FlowBranching.CheckOutParameters): Likewise.
1146         (FlowBranchingToplevel): Terminate all the above recursions here.
1147         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
1148         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
1149
1150         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
1151         toplevel block.
1152         (FlowBranchingToplevel): New.  Empty for now.
1153         (FlowBranching.MergeTopBlock): Update.
1154         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1155         branching for the anonymous delegate.
1156         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1157
1158         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1159         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1160         information at the start of the merge.  Reorganize.
1161
1162 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1163
1164         * class.cs (MethodData.Define): Method cannot implement interface accessor.
1165
1166 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1167
1168         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1169         to newly introduced ctor.
1170
1171         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1172         message to one place.
1173         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1174         global namespace.
1175
1176 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1177
1178         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1179
1180         * ecore.cs (Expression.ResolveAsConstant): Updated.
1181
1182         * statement.cs (ResolveMeta): Updated.
1183
1184 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1185
1186         * cs-parser.jay: __arglist cannot be used in initializer.
1187
1188 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1189
1190         A fix for #77879
1191         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1192         private types.
1193
1194 2006-05-05  Raja R Harinath  <rharinath@novell.com>
1195
1196         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1197         (LabeledStatement): Add 'name' parameter.
1198         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1199         (Block.AddLabel): Update to changes.
1200         * cs-parser.jay (labeled_statement): Likewise.
1201
1202         * flowanalysis.cs (BranchingType.Labeled): New.
1203         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1204         (FlowBranchingLabeled): New.  Does nothing for now, but will
1205         eventually handle 'goto' flows.
1206         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1207         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1208         that's terminated ...
1209         (Block.Resolve): ... here.
1210
1211         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1212         (UsageVector.MergeFinallyOrigins): Likewise.
1213         (FlowBranching.InTryOrCatch): Likewise.
1214         (FlowBranching.AddFinallyVector): Likewise.
1215         (FlowBranchingException): Update to changes.
1216
1217         Fix #78290
1218         * statement.cs (Return.Resolve): Move error checking to ...
1219         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1220         (FlowBranchingException): Handle return origins like break and
1221         continue origins.
1222         (FlowBranching.UsageVector.CheckOutParameters): Remove.
1223
1224 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1225
1226         A fix for #76122
1227         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1228         filter.
1229
1230 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1231
1232         A fix for #77543
1233         * class.cs (MethodData.Define): Do public accessor check only when method
1234         implements an interface.
1235
1236 2006-05-04  Raja R Harinath  <rharinath@novell.com>
1237
1238         Remove special handling of 'break'
1239         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1240         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
1241         (UsageVector.Break): Remove.
1242         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1243         reachability.
1244         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1245
1246         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1247         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
1248
1249 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1250
1251         A fix for #75726
1252         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1253         be the interface member.
1254
1255 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1256
1257         A fix for #60069
1258         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1259         for emitting small (int) values.
1260
1261 2006-05-03  Raja R Harinath  <rharinath@novell.com>
1262
1263         Fix #59427
1264         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1265         control-flow passes through the 'finally' after merging-in all the
1266         control-flows from 'try' and the 'catch' clauses.
1267
1268         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1269         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
1270         always true at the only non-recursive entry point.
1271         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1272         FlowBranchingBreakable.
1273         (FlowBranchingLoop): Remove.
1274         * statement.cs (Return.DoResolve): Update to changes.
1275
1276         Fix #76471, #76665
1277         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1278         (FlowBranching.CreateBranching): Handle it: create a
1279         FlowBranchingContinuable.
1280         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1281         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1282         except that it handles the 'continue' command.
1283         (FlowBranching.UsageVector.MergeOrigins): Rename from
1284         MergeBreakOrigins.
1285         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1286         except that it overrides AddContinueOrigin.
1287         (FlowBranchingException): Override AddContinueOrigin, similar to
1288         AddBreakOrigin.
1289         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1290         Create a new branching around the embedded statement.
1291         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
1292         control flow after the embedded statement.
1293         (Continue.Resolve): Move all error checking to AddContinueOrigin.
1294
1295         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1296         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1297         FlowBranchingBreakable.
1298         (FlowBranchingSwitch): Remove.
1299
1300         Fix test-503.cs
1301         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
1302         error reporting to ...
1303         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1304         Rename from 'AddBreakVector'.  Add new location argument.  Return
1305         a bool indicating whether the 'break' crosses an unwind-protect.
1306         (FlowBranchingException.AddBreakOrigin): Add.
1307         (FlowBranchingException.Merge): Propagate 'break's to surrounding
1308         flowbranching after updating with the effects of the 'finally'
1309         clause.
1310         (FlowBranchingBreakable): New common base class for
1311         FlowBranchingLoop and FlowBranchingSwitch.
1312
1313         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1314         embedded statement.
1315         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1316
1317 2006-05-02  Raja R Harinath  <rharinath@novell.com>
1318
1319         * statement.cs (Do.Resolve): If the loop is infinite, set the
1320         barrier.
1321         (While.Resolve, For.Resolve): Set a barrier after the embedded
1322         statement.  There's no direct control flow that goes from the end
1323         of the embedded statement to the end of the loop.
1324         * flowanalysis.cs (FlowBranching.Infinite): Remove.
1325         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
1326         above ensure that the reachability is correctly computed.
1327
1328         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1329         (UsageVector.MergeBreakOrigins): If the current path is
1330         unreachable, treat it as if all parameters/locals are initialized.
1331         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
1332         infinite loops before merging-in break origins.
1333
1334         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1335         (Reachability.Reachable): Split part into ...
1336         (Reachability.Unreachable): ... this.  Simplify.
1337         (Reachability.IsUnreachable): Use 'Unreachable' instead.
1338
1339         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1340         (Reachability.SetThrowsSometimes): Likewise.
1341         (FlowBranchingBlock.MergeTopBlock): Don't compare against
1342         TriState.Always, use corresponding property.
1343         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1344         (Block.Resolve): Likewise.  Remove some redundant checks.
1345
1346 2006-05-02  Raja R Harinath  <harinath@gmail.com>
1347
1348         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1349         (Reachability.Meet): Don't bother checking AlwaysThrows --
1350         barrier is always set.
1351         (FlowBranchingBlock.Merge): Likewise.
1352
1353 2006-05-01  Rafael Teixeira <rafaelteixeirabr@hotmail.com>
1354
1355         * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
1356         defined, so it's references should also compile only for NET_2_0
1357         (as occurs in mcs version)
1358
1359 2006-05-01  Raja R Harinath  <harinath@gmail.com>
1360
1361         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1362         checks for unreachable.
1363
1364 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
1365
1366         A fix for #77980
1367         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1368
1369         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1370         whether field is really assigned.
1371
1372 2006-04-30  Raja R Harinath  <harinath@gmail.com>
1373
1374         * flowanalysis.cs (Reachability): Make 4-argument constructor
1375         private.
1376         (Reachability.Meet): Rename from 'And'.  Remove static variant.
1377         (Reachability.Always): Rename from the highly misleading
1378         'Reachability.Never'.
1379         (FlowBranching.Merge): Update to changes.  Mark an impossible
1380         situation with a 'throw'.
1381         (*): Update to changes.
1382
1383 2006-04-29  Raja R Harinath  <harinath@gmail.com>
1384
1385         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1386         Remove 'Undefined'.
1387         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1388         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1389         (*): Update to changes.
1390         * statement.cs: Update to changes.
1391
1392 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
1393
1394         A fix for #78049
1395         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1396
1397 2006-04-28  Raja R Harinath  <harinath@gmail.com>
1398
1399         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1400         dummy UsageVector.
1401
1402         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1403         argument to two arguments: an usage-vector and a bool.  Move call
1404         to FlowBranching.Merge () ...
1405         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1406
1407         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1408         handling of loop and switch reachability to ...
1409         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1410
1411 2006-04-27  Raja R Harinath  <harinath@gmail.com>
1412
1413         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1414         handling to FlowBranchingLoop.InLoop.
1415         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1416
1417 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
1418
1419         A fix for #78115
1420         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1421         anonymous method is allowed from AnonymousContainer here.
1422
1423         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1424
1425 2006-04-24  Raja R Harinath  <rharinath@novell.com>
1426
1427         Fix #78156
1428         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1429
1430 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
1431
1432         A fix for #49011.
1433         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1434         (DoubleConstant.Reduce): Ditto.
1435
1436 2006-04-23  Raja R Harinath  <rharinath@novell.com>
1437
1438         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1439         Remove 'lvalue_right_side' argument.  Move parts to ...
1440         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1441         (LocalVariable.DoResolveLValue): ... these.
1442
1443 2006-04-21  Raja R Harinath  <rharinath@novell.com>
1444
1445         Fix cs1655.cs
1446         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1447         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1448         (LocalVariableReference.DoResolveBase): Use it to implement new
1449         CS1655 check.
1450         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1451         (Argument.Resolve): Simplify.  Move CS1510 check ...
1452         * ecore.cs (Expression.ResolveLValue): ... here.
1453         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1454         (PropertyExpr.DoResolveLValue): Likewise.
1455         (FieldExpr.Report_AssignToReadonly): Likewise.
1456         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
1457         LValueMemberAccess or LValueMemberOutAccess on instance depending
1458         on it.
1459         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1460         DoResolve as appropriate.
1461
1462 2006-04-20  Raja R Harinath  <rharinath@novell.com>
1463
1464         Fix #75800
1465         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1466         implicit conversions on 'out' and 'ref' arguments.
1467
1468         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1469         improve clarity.  Remove dead code.
1470
1471         Fix #66031
1472         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1473         (Catch.Resolve): Resolve VarBlock if it exists.
1474
1475 2006-04-19  Miguel de Icaza  <miguel@novell.com>
1476
1477         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1478         twice, this was some residual code, the enumerator was emitted
1479         properly in the two branche of if later.
1480
1481         Fixes #78031
1482         
1483         Thanks to Martin for finding the source of the problem
1484         
1485 2006-04-19  Raja R Harinath  <rharinath@novell.com>
1486
1487         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
1488         cast is never an lvalue.
1489         (Cast.DoResolve, Cast.ResolveRest): Combine.
1490         (Argument.Emit): Simplify slightly.  Move 'Expr is
1491         IMemoryLocation' check ...
1492         (Argument.Resolve): ... here.
1493         (Argument.Error_LValueRequired): Remove.  Inline into only user.
1494
1495         Simplifications.  Fix cs0191-2.cs
1496         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1497         CS1649 and CS1651 to ...
1498         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
1499         the actual selection of the error code and message to a lookup
1500         table.  Add a dummy return value to simplify callsites.
1501         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1502         readonly fields of other instances of the same type.  Move CS0197
1503         warning from ...
1504         * expression.cs (Argument.Resolve): ... here.  Simplify code.
1505         Ensure that ec.InRefOutArgumentResolving is only set during LValue
1506         resolution of an out or ref argument.  The code simplification
1507         above uses this invariant.
1508
1509 2006-04-18  Raja R Harinath  <rharinath@novell.com>
1510
1511         Possibly fix #77752.  Fix cs1690-[4-7].cs.
1512         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1513         CheckMarshallByRefAccess.  Drop parameter.
1514         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
1515         warning.
1516         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1517         InstanceExpression.
1518         * report.cs (AllWarnings): Add CS1690.
1519         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1520         for ref access too.
1521         (LocalVariableReference.DoResolveBase): Update.
1522
1523 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1524
1525         * class.cs (MethodOrOperator): Moved common parts from method class.
1526         detect obsolete attributes.
1527         (Method.Define): Simplified as it reuses code from base.
1528         (Constructor.ValidAttributeTargets): Fixed issue found during
1529         refactoring.
1530         (Destructor.ValidAttributeTargets): Fixed issue found during
1531         refactoring.
1532         (Operator): Finished refactoring set off by #78020. Operator class is now
1533         ordinary method class.
1534
1535         * anonymous.cs: Updated.
1536
1537 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1538
1539         * class.cs (Constructor.Emit): Don't emit the attributes twice.
1540
1541 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1542
1543         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1544         detect obsolete attributes.
1545         (Method.CreateEmitContext): Moved to MethodOrOperator.
1546
1547 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1548
1549         A fix for #78048.
1550         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1551         customized exception to make crash detection easier.
1552         (MethodOrOperator): Started to work on new base class for methods and
1553         operators.
1554         (Method): Derives from MethodOrOperator.
1555         (Constructor.Emit): Emits its own attributes.
1556         (AbstractPropertyEventMethod.Emit): Ditto.
1557         (Operator): Derives from MethodOrOperator, will refactor fully in extra
1558         patch.
1559         (Operator.Emit): It's temporary more tricky than should be.
1560         
1561         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1562
1563         * report.cs (InternalErrorException): Add ctor with inner exception.
1564
1565 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
1566
1567         A fix for #76744.
1568         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1569         only not visible.
1570
1571 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
1572
1573         A fix for #77916.
1574         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1575         array.
1576
1577 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1578
1579         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1580         attribute is present and Guid not.
1581         (Interface.ApplyAttributeBuilder): Ditto.
1582
1583         * attribute.cs: Add error message.
1584
1585 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1586
1587         A fix for #78020.
1588
1589         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1590         sources (it's composite) so hold them in extra array as they are used in
1591         Emit phase only. It worked in the previous versions by mistake.
1592         (Attribute.Emit): Emit attribute for more owners when exist.
1593
1594         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1595         it has now different behaviour.
1596
1597 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
1598
1599         * constant.cs (Constant.IsDefaultInitializer): New method.
1600
1601         * class.cs: Updated.
1602
1603         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1604         re-initialize default values. It saves KBs almost for every assembly.
1605         Thanks Zoltan for the idea.
1606         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1607         (ArrayCreation.DoResolve): Resolve only once.
1608         (ArrayCreation.Emit): Emit static initializer only when it is faster.
1609         (ArrayCreation.GetAttributableValue): Cope with optimized values.
1610
1611 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
1612
1613         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1614         From #77961.
1615
1616 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1617
1618         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1619         in an embedded statement too.
1620
1621 2006-04-01  Raja R Harinath  <rharinath@novell.com>
1622
1623         Fix #77929
1624         * typemanager.cs (IsNestedChildOf): Drop generic arguments before
1625         testing.
1626
1627         Fix #77958
1628         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1629
1630         Fix #77962
1631         * report.cs (SymbolRelatedToPreviousError): Drop generic type
1632         arguments before checking whether a type is reflected or not.
1633
1634         Fix #77954
1635         * expression.cs (Invocation.IsApplicable): Ensure a generic method
1636         definition doesn't take part in overload resolution.
1637         (Invocation.IsParamsMethodApplicable): Likewise.
1638         (Invocation.OverloadResolve): When replacing a reflected override
1639         method with its base definition, ensure that type arguments are
1640         applied.
1641
1642 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1643
1644         A fix for #77966.
1645
1646         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1647         was not specified.
1648
1649         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1650
1651 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
1652
1653         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1654         phase.
1655
1656         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1657         LocalTemporary change.
1658
1659         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1660         TypeContainer.
1661         (ClassOrStruct.DefineFieldInitializers): Implemented static field
1662         initializers optimization.
1663         (ClassOrStruct.TypeAttr): Moved from modifiers.
1664         (Constructor.CheckBase): Don't crash when static ctor has parameters.
1665         (FieldBase.ResolveInitializer): Resolves initializer.
1666         (FieldBase.HasDefaultInitializer): New property.
1667
1668         * cs-parser.jay: Removed message.
1669
1670         * expression.cs (CompilerGeneratedThis): New specialization.
1671
1672         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1673
1674 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
1675
1676         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1677
1678 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1679
1680         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1681         be now EnumConstants only.
1682
1683 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1684
1685         * attribute.cs, driver.cs: Reset more caches.
1686
1687 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1688
1689         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1690
1691 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1692
1693         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1694         for easier reuse. Updated all overrides.
1695         (IntegralConstant): New base class for all integral constants.
1696         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1697         of the constant range, report custom error.
1698         (UIntConstant.Reduce): Fixed uint conversion.
1699
1700         * ecore.cs, literal.cs: Reduce updates.
1701
1702 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1703
1704         A fix for #75813.
1705
1706         * class.cs (Constructor.Define): Removed extra if for default ctors.
1707         A patch from Atsushi Enomoto.
1708
1709 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1710
1711         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1712         GetAttributableValue.
1713
1714         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1715         when required.
1716
1717         * convert.cs (ImplicitConversionRequired): Error message moved to
1718         DoubleLiteral.
1719
1720         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1721         automatic implicit conversion of an output value.
1722         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1723
1724         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1725         conversion.
1726         (TypeOf.GetAttributableValue): Add extra handling for object type.
1727
1728         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1729         special error message.
1730
1731 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
1732
1733         * class.cs (Constructor.Emit): Don't crash when struct ctor is
1734         InternalCall.
1735         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1736         compatible with MS runtime.
1737
1738 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
1739
1740         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1741         attribute arguments here.
1742
1743         * class.cs (Indexer.Define): The check was moved to attribute class.
1744
1745 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1746
1747         * expression.cs (StringConcat.Append): Reverted back to no warning state.
1748
1749 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1750
1751         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1752
1753         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1754         the blocks too.
1755
1756 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
1757
1758         * doc-bootstrap.cs : fix build.
1759
1760 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1761
1762         * expression.cs (StringConcat.Append): Issue a warning when empty string
1763         is going to append.
1764
1765 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1766
1767         * assign.cs (CompoundAssign.ResolveSource): Removed.
1768
1769         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1770         clean up.
1771
1772         * class.cs (TypeContainer.FindMethods): Removed.
1773         (TypeContainer.CheckMemberUsage): Made static.
1774
1775         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1776
1777         * constant.cs (CheckRange): Removed unused type argument.
1778         (CheckUnsigned): Removed unused type argument.
1779
1780         * cs-parser.jay: Updated after MemberAccess clean up.
1781         Uses Length for empty string test.
1782
1783         * cs-tokenizer.cs: Uses Length for empty string test.
1784         (IsCastToken): Made static.
1785         (is_hex): Made static.
1786         (real_type_suffix): Made static.
1787
1788         * decl.cs (SetupCache): Made static.
1789         (OnGenerateDocComment): Removed unused ds argument.
1790
1791         * delegate.cs (VerifyDelegate): Removed unused argument.
1792
1793         * doc.cs: Uses Length for empty string test.
1794
1795         * driver.cs: Uses Length for empty string test.
1796
1797         * enum.cs (IsValidEnumType): Made static
1798
1799         * expression.cs (EnumLiftUp): Removed unused argument.
1800         (ResolveMethodGroup): Ditto.
1801         (BetterConversion): Ditto.
1802         (GetVarargsTypes): Ditto.
1803         (UpdateIndices): Ditto.
1804         (ValidateInitializers): Ditto.
1805         (MemberAccess.ctor): Ditto.
1806         (GetIndexersForType): Ditto.
1807
1808         * flowanalysis.cs: (MergeFinally): Removed unused argument.
1809
1810         * iterators.cs: Updated after MemberAccess clean up.
1811
1812         * location.cs: Uses Length for empty string test.
1813
1814         * namespace.cs: Uses Length for empty string test.
1815
1816          * report.cs (CheckWarningCode): Made static.
1817
1818         * statement.cs (LabeledStatement): Removed unused argument.
1819
1820         * typemanager.cs (FilterNone): Removed.
1821
1822 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1823
1824         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1825         obsolete.
1826
1827         * class.cs: Updated.
1828
1829 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1830
1831         * cs-parser.jay.cs: __arglist is not allowed for delegates.
1832
1833 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1834
1835         A fix for #77816.
1836
1837         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
1838         host container.
1839         (AnonymousMethod.ImplicitStandardConversionExists): New method.
1840         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1841         Add more error reporting; Fixed issue with params.
1842
1843         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1844
1845         * cs-parser.jay: AnonymousMethod requires host container.
1846
1847         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1848
1849 2006-03-18  Raja R Harinath  <harinath@gmail.com>
1850
1851         * class.cs: Change 'TypeContainer ds' constructor argument to
1852         'DeclSpace parent'.  Some classes were missed below due to
1853         different naming convention.
1854
1855         * class.cs (MemberCore.Parent): Delete.  This makes the
1856         ParentContainer changes below enforceable by the compiler.
1857
1858         Treat pointers to enclosing declaration space as 'DeclSpace', not
1859         'TypeContainer'.
1860         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1861         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1862
1863         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1864         of TypeContainer.
1865         (Block.AddThisVariable): Likewise.
1866         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1867         (AbstractPropertyEventMethod.Emit): Likewise.
1868         (AbstractPropertyEventMethod.EmitMethod): Likewise.
1869         (GetMethod.Define, SetMethod.Define): Likewise.
1870         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1871         (DelegateMethod.EmitMethod): Likewise.
1872
1873         Fix regression test-partial-13.cs.
1874         Rationalize use of PartialContainer.  Ensure that the partial
1875         class semantics can be tied to type-correctness, i.e., any
1876         violation will cause a compile error.
1877         * class.cs, const.cs: Access all fields that belong to class
1878         TypeContainer via ParentContainer.  Arguments of EmitContexts and
1879         Resolve()-like functions still use 'Parent'.
1880
1881         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1882         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1883         (PropertyMethod.CheckModifiers): Remove unused argument.
1884         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1885         DeclSpace.
1886
1887 2006-03-28  Raja R Harinath  <rharinath@novell.com>
1888
1889         * decl.cs (DeclSpace.LookupGeneric): Update to changes.
1890
1891 2006-03-17  Raja R Harinath  <harinath@gmail.com>
1892
1893         Make semantics of PartialContainer simpler.
1894         * decl.cs (DeclSpace.IsPartial): Remove.
1895         * class.cs (TypeContainer.IsPartial): Likewise.
1896         (TypeContainer..ctor): Set PartialContainer to point to self.
1897         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1898         (TypeContainer.FindNestedType): Likewise.
1899         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
1900
1901 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
1902
1903         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1904
1905 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1906
1907         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1908         classes.
1909
1910 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1911
1912         * class.cs (Operator.Define): An error for base conversion was not
1913         reported correctly.
1914
1915 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
1916
1917         A fix for #77593, #77574.
1918
1919         * class.cs (MethodCore.CheckBase): Another if for operator.
1920
1921 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1922
1923         A fix for #77822.
1924
1925         * expression.cs (VerifyArgumentsCompat): Reverted to double error
1926         reporting, it's more tricky than I thought.
1927
1928 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
1929
1930         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1931         were not resolved
1932
1933         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1934         (DelegateCreation.ImplicitStandardConversionExists): New method for just
1935         conversion test.
1936         
1937         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1938         not needed.
1939
1940 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
1941
1942         A fix for #77353.
1943
1944         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1945         (Event.Define): ditto
1946         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1947
1948         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1949         Removed redundant code and set NewSlot for Invoke method too.
1950
1951         * parameter.cs (Parameters.ctor): Add custom, type ctor.
1952         (Parameters.MergeGenerated): New method. Use this method when you merge
1953         compiler generated argument with user arguments.
1954
1955 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
1956
1957         * attribute.cs (ResolveAsTypeTerminal): Removed.
1958
1959         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1960         specialization for predefined types; 30% speed up.
1961         Finally placed obsolete check to right place.
1962         (Expression.ResolveType): Removed.
1963
1964         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1965         Updated after ResolveType was removed.
1966
1967         * expression.cs (Cast.ctor): Check void cast.
1968         (Binary.ResolveAsTypeTerminal): Is never type.
1969         (Conditional.ResolveAsTypeTerminal): Is never type.
1970
1971         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1972
1973 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1974
1975         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
1976
1977 2006-03-23  Martin Baulig  <martin@ximian.com>
1978
1979         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
1980         type check if either of the types is an open generic type.
1981
1982 2006-03-23  Martin Baulig  <martin@ximian.com>
1983
1984         * convert.cs
1985         (Convert.ExplicitTypeParameterConversion): New method; implement
1986         explicit type parameter conversions.
1987
1988 2006-03-23  Martin Baulig  <martin@ximian.com>
1989
1990         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
1991         blindly allow all conversions if we do not have any constraints.
1992
1993 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
1994
1995         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1996         these two separated members to simplify the code.
1997         (Attribute.Resolve): Refactored to use new fields and methods.
1998         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1999         implemented obsolete attribute checking.
2000         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
2001         implemented obsolete checking again. It look line never ending quest ;-)
2002         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
2003
2004         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
2005
2006         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
2007
2008         *class.cs (Property.Define): Add RegisterProperty call.
2009
2010         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
2011         argument groups (only 2).
2012
2013         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
2014         encoding expression to arguments.
2015         (Expression.ExprClassToResolveFlags): Just turned to property.
2016
2017         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
2018         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
2019         optimized as well as implemented support for zero-length attributes.
2020
2021         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
2022         Add caching of PropertyInfo's.
2023
2024 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
2025
2026         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
2027         error multiple times.
2028
2029 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
2030
2031         New partial class implementation.
2032         A fix for #77027, #77029, #77403
2033
2034         * attribute.cs (Attributable): Made attributes protected.
2035
2036         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
2037         the replacements of ClassPart and PartialContainer.
2038         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
2039         (TypeContainer.AddInterface): Ditto.
2040         (TypeContainer.AddPartial): The main method for partial classes. It checks
2041         for errors and merges ModFlags and attributes. At the end class is added to
2042         partial_parts list.
2043         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
2044         required here.
2045         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
2046         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
2047         from the rest of partial classes.
2048         (TypeContainer.GetClassBases): Simplified.
2049         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
2050         DefineType.
2051         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
2052         (TypeContainer.HasExplicitLayout): Uses Flags now.
2053         (PartialContainer): Removed.
2054         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
2055         (StaticClass): Was merged with Class.
2056         (Class.GetClassBases): class and static class bases are verified here.
2057         (Class.TypeAttr): Added static attributes when class is static.
2058         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
2059         (MemberBase): In some cases we need to call parent container for partial
2060         class. It should be eliminated but it's not easy now.
2061
2062         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
2063
2064         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
2065         partial classed to accumulate class comments.
2066         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
2067
2068         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
2069
2070         * driver.cs (MainDriver): Tree.GetDecl was removed.
2071
2072         * modifiers.cs (Modifiers): Add partial modifier.
2073
2074         * tree.cs (Tree.decl): Removed.
2075         (RootTypes): Started to use this class more often for root types
2076         specializations.
2077
2078 2006-03-23  Raja R Harinath  <rharinath@novell.com>
2079
2080         * generic.cs (TypeParameter.UpdateConstraints): Update
2081         'constraints' if null.
2082
2083 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
2084
2085         A fix for #77615
2086
2087         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
2088         external interface does not have an attribute.
2089
2090 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
2091
2092         Another prerequisites for new partial classs implementation.
2093         
2094         * attribute.cs (Attribute.Equal): Implemented.
2095         (Attribute.Emit): Changed as attributes can be applied more than twice.
2096         (Attributes.Emit): Check for duplicate attributes here.
2097
2098         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
2099         as a parameter, clean-up.
2100
2101 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2102
2103         A fix for #77485
2104
2105         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
2106         contains obsolete attribute check which can in some cases look for base
2107         type of current class which is not initialized yet.
2108         (TypeContainer.BaseType): Replacement of ptype.
2109
2110         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2111
2112 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2113
2114         First of prerequisites for new partial classs implemention.
2115         
2116         * attribute.cs (Attributable): Extended by ResolveContext;
2117         Attributes finally have correct context for resolving in all cases.
2118         (AttachTo): Attribute owner is assigned here.
2119
2120         * codegen.cs (IResolveContext): Introduce new interface to hold
2121         all information needed in resolving phase.
2122         (EmitContext): Implements IResolveContext; more clean-up needed here.
2123         
2124         * decl.cs (MemberCore): Implemented IResolveContext.
2125
2126         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
2127         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
2128         parameter.cs, statement.cs, tree.cs, typemanager.cs:
2129         Refactored to use new IResolveContext instead of EmitContext; cleanup
2130
2131 2006-03-22  Raja R Harinath  <rharinath@novell.com>
2132
2133         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
2134         mcs to keep code differences small.
2135         * attribute.cs (Attribute.GetParameterDefaultValue): New.
2136         * typemanager.cs (parameter_default_value_attribute_type): New.
2137         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
2138         CS1908 check.
2139
2140 2006-03-22  Martin Baulig  <martin@ximian.com>
2141
2142         * generic.cs
2143         (Nullable.NullableLiteral): Derive from `NullLiteral'.
2144
2145         * convert.cs
2146         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
2147         instead of the normal `NullLiteral'.
2148
2149 2006-03-21  Martin Baulig  <martin@ximian.com>
2150
2151         Fix #77583.
2152         * generic.cs (TypeManager.InferType): If `pt' is a generic
2153         parameter, don't check whether `pt == at'.
2154
2155 2006-03-20  Raja R Harinath  <rharinath@novell.com>
2156
2157         Fix #77852
2158         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
2159         (TypeParameter.Resolve): Update to change.
2160         (ConstraintChecker.CheckConstraints): Resolve type-argument
2161         constraints before use.
2162
2163 2006-03-16  Martin Baulig  <martin@ximian.com>
2164
2165         * generic.cs
2166         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
2167         and don't have any instance constructors, also lookup in the base class.
2168         (TypeManager.IsNullableValueType): New public method.
2169
2170         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
2171         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
2172         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
2173
2174         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
2175         instead of just TypeManager.IsNullableType() to determine whether
2176         a lifted operator exists.
2177         (UnaryMutator.DoResolve): Likewise.
2178         (Conditional.DoResolve): Likewise.
2179         (Binary.DoResolve): A lifted operator only exists if both operands
2180         are valuetypes and at least one of them is a nullable type.
2181
2182 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
2183
2184         * iterator.cs : yield break is allowed in try statement which has
2185           catch clauses. Fixed bug #77767.
2186
2187 2006-03-12  Martin Baulig  <martin@ximian.com>
2188
2189         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
2190         private IsSignatureEqual() to compare types; see the comment in
2191         that method; fixes #77674.
2192
2193 2006-03-10  Raja R Harinath  <rharinath@novell.com>
2194
2195         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
2196         (Expression.ResolveAsTypeTerminal): Likewise.
2197         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
2198         * expression.cs, generic.cs, iterators.cs: Likewise.
2199         * parameter.cs, statement.cs, typemanager.cs: Likewise.
2200
2201 2006-03-09  Martin Baulig  <martin@ximian.com>
2202
2203         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
2204         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
2205
2206 2006-03-09  Martin Baulig  <martin@ximian.com>
2207
2208         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
2209         `prepared' flag is set.
2210
2211         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
2212         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
2213         issues; see gtest-254.cs.
2214
2215 2006-03-07  Martin Baulig  <martin@ximian.com>
2216
2217         * generic.cs (TypeManager.InferType): Allow infering
2218         `IEnumerable<T>' with an array of T; see gtest-251.cs.
2219
2220 2006-03-06  Martin Baulig  <martin@ximian.com>
2221
2222         * generic.cs
2223         (TypeManager.InferType): Fix gtest-250.cs.
2224
2225         * typemanager.cs
2226         (TypeManager.IsSubclassOf): Also check the base class.
2227
2228         * expression.cs
2229         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
2230         fixes gtest-249.cs.
2231
2232 2006-03-01  Raja R Harinath  <rharinath@novell.com>
2233
2234         Fix #77679.
2235         * expression.cs (ParameterReference.DoResolveBase): Change return
2236         type to bool.
2237         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2238         Update.
2239
2240         Fix #77628.
2241         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2242
2243         Fix #77642.
2244         * typemanager.cs (GetFullNameSignature): Don't nullref on
2245         protected accessors.
2246
2247 2006-02-16  Martin Baulig  <martin@ximian.com>
2248
2249         * generic.cs
2250         (TypeManager.GetGenericFieldDefinition): New public method; use it
2251         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
2252
2253 2006-02-14  Martin Baulig  <martin@ximian.com>
2254
2255         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
2256
2257 2006-02-14  Martin Baulig  <martin@ximian.com>
2258
2259         * generic.cs
2260         (TypeManager.DropGenericMethodArguments): New public method; don't
2261         use GetGenericMethodDefinition() on something which is not a
2262         generic method.
2263
2264 2006-02-14  Martin Baulig  <martin@ximian.com>
2265
2266         * generic.cs
2267         (ConstraintChecker.CheckConstraints): If a type parameter has the
2268         `struct' constraint, the type must be a non-nullable valuetype.
2269
2270 2006-02-10  Martin Baulig  <martin@ximian.com>
2271
2272         * typemanager.cs
2273         (TypeManager.IsOverride): Make this work for instantiated methods
2274         in a generic class; fixes #77509.
2275         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
2276         rather than calling it directly; fixes #77488.  
2277
2278 2006-02-08  Martin Baulig  <martin@ximian.com>
2279
2280         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
2281         reporting into CheckConstraint() so we can use the correctly
2282         instantiated type.
2283
2284 2006-02-08  Martin Baulig  <martin@ximian.com>
2285
2286         * expression.cs (BaseAccess): Add support for generic methods.
2287
2288         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
2289         the new MethodGroupExpr.
2290
2291 2006-02-07  Martin Baulig  <martin@ximian.com>
2292
2293         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
2294         also reference types; fixes #77483.
2295
2296 2006-02-07  Martin Baulig  <martin@ximian.com>
2297
2298         * generic.cs
2299         (TypeManager.IsGenericMethod): We now return whether something is
2300         an instantiated generic method (and not a generic method def).
2301         (TypeManager.IsGenericMethodDefinition): New public method.
2302
2303         * typemanager.cs
2304         (TypeManager.CSharpSignature): Only include type arguments for
2305         "real" generic methods, not for any instantiated method.
2306         (TypeManager.GetMethodName): Likewise, but also allow generic
2307         method definitions here.
2308
2309 2006-02-06  Miguel de Icaza  <miguel@novell.com>
2310
2311         * codegen.cs (EmitScopeInitFromBlock): check here the
2312         capture_context, there is no need to make two calls to the
2313         EmitContext. 
2314
2315         * anonymous.cs: Add some debugging messages that might help me
2316         track other instances of this problem in the future (the
2317         regression of test 467).
2318
2319         * cs-parser.jay: track the variable block, as we need to initalize
2320         any captured variables declared in this block for the "catch"
2321         portion of the "Try" statement.
2322
2323         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2324         scope initialization for captured variables. 
2325
2326         Also, move the emit for the variables after the block location has
2327         been marked.
2328
2329 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
2330
2331        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2332         
2333 2006-02-06  Martin Baulig  <martin@ximian.com>
2334
2335         * class.cs (TypeContainer.DefineType): If we're a struct, pass
2336         `TypeManager.value_type' as parent type to
2337         ModuleBuilder.DefineType().  Fixes #77358.      
2338
2339 2006-02-02  Miguel de Icaza  <miguel@novell.com>
2340
2341         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2342         commit yesterday, the initialization for the roots is necessary.
2343         What is not necessary is the scope activation.
2344
2345 2006-02-02  Raja R Harinath  <rharinath@novell.com>
2346
2347         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2348         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2349         CS0206 checks.
2350         (Argument.Resolve): Remove CS0206 checks.
2351
2352 2006-02-01  Miguel de Icaza  <miguel@novell.com>
2353
2354         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2355         scopes for all the roots, the scopes will now be emitted when the
2356         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
2357
2358         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2359         code.  This reduces a lot of existing cruft.
2360         
2361         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2362         that the ScopeInfo is generated as we enter the scope, not at the
2363         time of use, which is what we used to do before.
2364
2365         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2366         every time a Block is about to be emitted if we have a
2367         CaptureContext. 
2368
2369 2006-02-01  Raja R Harinath  <rharinath@novell.com>
2370
2371         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
2372         attribute for mscorlib too.
2373
2374         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2375         (Reset): Update.
2376         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2377
2378         * typemanager.cs (cons_param_array_attribute): Make private.
2379         (Reset): Set it to null.
2380         (InitCoreHelpers): Don't initialize it.
2381         (ConsParamArrayAttribute): New.  Initialize it as needed.
2382         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2383
2384 2006-01-31  Miguel de Icaza  <miguel@novell.com>
2385
2386         * expression.cs: There might be errors reported during the
2387         selection of applicable methods.  If there are errors, do not
2388         continue execution as it will lead the compiler to crash.
2389
2390 2006-01-30  Miguel de Icaza  <miguel@novell.com>
2391
2392         * expression.cs: Member access is not allowed on anonymous
2393         methods.  Fixes #77402.
2394
2395 2006-01-30  Raja R Harinath  <rharinath@novell.com>
2396
2397         Fix #77401
2398         * cs-parser.jay (VariableDeclaration): Don't set
2399         current_array_type to null.
2400         (field_declaration, event_declaration, declaration_statement):
2401         Set it to null here.
2402
2403 2006-01-29  Raja R Harinath  <harinath@gmail.com>
2404
2405         Fix part of #77397
2406         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
2407
2408 2006-01-28  Raja R Harinath  <harinath@gmail.com>
2409
2410         * typemanager.cs (GenericParameterPosition): New.
2411         * doc.cs: Use it.
2412
2413 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
2414
2415         * doc.cs : To process "include" elements, first we should create
2416           another list than XmlNodeList, because it could result in node
2417           removal, which could result in that the XmlNodeList gives up
2418           yielding next node.
2419
2420 2006-01-25  Miguel de Icaza  <miguel@novell.com>
2421
2422         * expression.cs: Introduce an error report that we were not
2423         catching before.   Gonzalo ran into it.
2424
2425 2006-01-23  Miguel de Icaza  <miguel@novell.com>
2426
2427         A fix for bug: #76957
2428         
2429         * iterators.cs (MoveNextMethod.CreateMethodHost): call
2430         ComputeMethodHost before creating the method, this is a new
2431         requirement. 
2432
2433         * anonymous.cs (AnonymousContainer): Now we track all the scopes
2434         that this method references (RegisterScope).  The actual scope
2435         where the method is hosted is computed with the ComputeMethodHost
2436         before we create the method.
2437
2438         Moved the Deepest routine here.
2439
2440         (AnonymousContainer.ComputeMethodHost): New routine used to
2441         compute the proper ScopeInfo that will host the anonymous method.
2442
2443         (ScopeInfo): Deal with multiple roots.  The problem was that we
2444         did not have a unique root where all ScopeInfos could be hanged
2445         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
2446         of roots.  
2447
2448         Remove AdjustMethodScope which is now computed at the end.  Remove
2449         LinkScope which did a partial link, instead link all ScopeInfos
2450         before code generation from the new "LinkScopes" routine. 
2451
2452         Simplify all the Add* routines as they no longer need to maintain
2453         the tree, they just need to record that they are using variables
2454         from a ScopeInfo.
2455
2456         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2457         routines to produce the forest of ScopeInfo trees.
2458
2459         * class.cs (TypeContainer.AppendMethod): This is just like
2460         AddMethod, but ensures that an interface implementation method
2461         (IEnumerable.XXX) is not inserted at the beginning of the queue of
2462         methods, but at the end.
2463
2464         We use this functionality to ensure that the generated MoveNext
2465         method in the iterator class is resolved/emitted before the
2466         enumerator methods created.   
2467
2468         This is required because the MoveNext method computes the right
2469         ScopeInfo for the method.  And the other methods will eventually
2470         need to resolve and fetch information computed from the anonymous
2471         method. 
2472
2473         
2474 2006-01-23  Raja R Harinath  <rharinath@novell.com>
2475
2476         Improve implementation of section 14.4.2.2 (Better function member).
2477         * expression.cs (Invocation.MoreSpecific): Compare all type
2478         arguments before deciding if one type is more specific than
2479         another.  Handle array types too.  Return the more specific type.
2480         (Invocation.BetterFunction): Add more tie-breaking rules from
2481         section 14.4.2.2.  Perform "more specific" check after
2482         other tie-breaking rules.  Compare all parameter types before
2483         choosing the "more specific" method.
2484
2485 2006-01-21  Raja R Harinath  <harinath@gmail.com>
2486             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
2487
2488         Fix rest of #76995.
2489         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2490         the 'aliases' hash.
2491         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2492         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2493
2494 2006-01-18  Martin Baulig  <martin@ximian.com>
2495
2496         * class.cs (TypeContainer.AddToMemberContainer): Use
2497         `symbol.MemberName.MethodName' instead of just `symbol.Name';
2498         fixes #77124.
2499
2500 2006-01-18  Martin Baulig  <martin@ximian.com>
2501
2502         Fix #76417: a generic class may now have methods which may unify
2503         for some type parameter substitutions.
2504
2505         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
2506         for methods which may unify anymore.
2507
2508         * expression.cs (Invocation.MoreSpecific): New private static
2509         method; checks whether one method is more specific than another
2510         according to 14.4.2.2 of the spec.
2511         (Invocation.BetterFunction): Implement the tie-breaking rules from
2512         14.4.2.2 of the spec: if two methods unify for some type parameter
2513         substitution, we need to pick the more specific one.
2514
2515 2006-01-18  Raja R Harinath  <rharinath@novell.com>
2516
2517         Fix #76656, cs0231-2.cs.
2518         * cs-parser.jay (formal_parameter_list): Make error case catch
2519         more issues.
2520         (parenthesized_expression_0): Add CS1026 check.
2521         (invocation_expression): Remove unused { $$ = lexer.Location }.
2522
2523 2006-01-17  Raja R Harinath  <rharinath@novell.com>
2524
2525         Fix #76824.
2526         * cs-parser.jay (statement_expression): Don't list out the
2527         individual statement-expressions.  Convert syntax error into
2528         CS0201 check.
2529
2530 2006-01-16  Raja R Harinath  <rharinath@novell.com>
2531
2532         Fix #76874.
2533         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2534         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
2535         CheckIntermediateModification.
2536         (FieldExpr.DoResolve): Add new two-argument version that
2537         allows us to resolve the InstanceExpression as an lvalue.
2538         The one-argument variant is now just a wrapper.
2539         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2540         Resolve the lhs as an lvalue if the it has a value type.
2541         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2542         from Assign.DoResolve.
2543         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2544         resolved as an lvalue.
2545         (PropertyExpr.DoResolve): Update.
2546         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2547         has a value type.  Move CS1612 check here from
2548         CheckIntermediateModification.
2549         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2550         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
2551         'right_side' of a ResolveLValue on an 'out' argument.
2552         (EmptyExpression.LValueMemberAccess): New.  Used as the
2553         'right_side' of a propagated ResolveLValue on a value type.
2554         (LocalVariableReference.DoResolveBase): Recognize
2555         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2556         Add CS1654 check.
2557         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2558         EmptyExpression.Null.
2559
2560 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
2561
2562         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
2563           Type.IsGenericParameter(). Fixed bug #77183.
2564         * doc.cs : it is now identical to doc.cs in mcs.
2565
2566 2006-01-16  Martin Baulig  <martin@ximian.com>
2567
2568         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
2569
2570 2006-01-16  Martin Baulig  <martin@ximian.com>
2571
2572         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
2573         ctors; fixes #77250.
2574
2575 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2576
2577         This fixes the problem where we used ldfld instead of ldflda to
2578         load the "THIS" pointer on captured parameters, when THIS is a
2579         value type.  See bug #77205.
2580         
2581         * iterators.cs (CapturedThisReference.Emit): Pass false to
2582         EmitThis (we do not need the address).
2583
2584         * codegen.cs (EmitThis): it needs to know whether we need the
2585         address of `this' or not.  This is used by value types.  
2586
2587         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2588         every other call passes false.
2589
2590 2006-01-12  Raja R Harinath  <rharinath@novell.com>
2591
2592         Fix #77221.
2593         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2594         GetOverride.
2595         * expression.cs (Invocation.OverloadResolve): Update.
2596         (Invocation.DoResolve): Avoid double resolution of invocation.
2597
2598 2006-01-11  Raja R Harinath  <rharinath@novell.com>
2599
2600         Fix #77180.
2601         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2602         unary negation of floating point types as 0-expr; negation cannot
2603         overflow in floating point types.
2604
2605         Fix #77204.
2606         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2607         on operands of 'void' type.
2608
2609         Fix #77200.
2610         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2611         and ExclusiveOr for boolean constants too.
2612
2613 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
2614
2615         * expression.cs: Fix Console.WriteLine ((this = x).foo);
2616
2617 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2618
2619         * cs-tokenizer.cs (Position): New class used to save and restore
2620         the position state in the tokenizer.  Before this patch the save
2621         and restore was not complete enough so the line and columns would
2622         start to drift and the debugger and stack traces will get the
2623         wrong data.
2624
2625 2006-01-10  Martin Baulig  <martin@ximian.com>
2626
2627         * generic.cs
2628         (TypeParameter.InflateConstraints): New public method.
2629
2630         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
2631         constraints; fixes #77042.
2632
2633 2006-01-10  Martin Baulig  <martin@ximian.com>
2634
2635         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
2636         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
2637         #77061. 
2638
2639 2006-01-09  Raja R Harinath  <rharinath@novell.com>
2640
2641         Fix #75636.
2642         * expression.cs (Invocation.OverloadResolve): Replace reflected
2643         override methods with their base virtual methods, rather than
2644         skipping over them.
2645         * typemanager.cs (TypeManager.GetOverride): New.
2646
2647 2005-12-21  Miguel de Icaza  <miguel@novell.com>
2648
2649         * driver.cs: Report the case of no source files and no -out:
2650         argument provided.
2651
2652 2005-12-20  Raja R Harinath  <rharinath@novell.com>
2653
2654         Fix #77035.
2655         * expression.cs (ComposedCast.GetSignatureForError): Define.
2656
2657 2006-01-05  Jb Evain  <jbevain@gmail.com>
2658
2659         * class.cs (Property.Define, Indexer.Define): do not tag the
2660         properties as SpecialName | RTSpecialName.
2661
2662 2006-01-04  Miguel de Icaza  <miguel@novell.com>
2663
2664         * class.cs (MethodCore.IsDuplicateImplementation): This method was
2665         doing a low-level comparission of parameter types.  It was lacking
2666         a check for __argslist. 
2667
2668 2005-12-30  Miguel de Icaza  <miguel@novell.com>
2669
2670         * expression.cs (ParameterReference.DoResolveBase): Allow
2671         reference parameters if they are local to this block. 
2672
2673         This allows the ref and out parameters of a delegate to be used in
2674         an anonymous method, for example:
2675
2676         delegate void set (out int x);
2677
2678         set s = delegate (out int x){
2679                 x = 0;
2680         };
2681
2682         This is used by functionality introduced late in the C# language.
2683         
2684         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2685         method that take ref and out parameters. 
2686
2687         Fixes #77119 which was a late change in the spec.
2688
2689 2005-12-23  Miguel de Icaza  <miguel@novell.com>
2690
2691         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2692         parent if its the same scope.  Fixes #77060.
2693
2694 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
2695
2696         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
2697
2698 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2699
2700         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
2701         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
2702         that doesn't contain the full public key. This is a update of the
2703         friend assemblies in .Net 2.0 release.
2704         
2705 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2706
2707         Fix #76995
2708
2709         * namespace.cs (NamespaceEntry): Add extern_aliases as a
2710         ListDictionary, to contain the ExternAliasEntry entries (in
2711         addition to the NamespaceEntry.aliases hashtable). This field is
2712         shared between the original entry and its doppelganger (bodyless 
2713         copy of it).
2714         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2715         extern_aliases field.
2716         (NamespaceEntry.Lookup): Move the IsImplicit check after the
2717         lookup in extern_aliases.
2718
2719 2005-12-16  Raja R Harinath  <rharinath@novell.com>
2720
2721         Fix #77006.
2722         * class.cs (TypeContainer.Mark_HasEquals): New.
2723         (TypeContainer.Mark_HasGetHashCode): New.
2724         (ClassPart): Override them.
2725         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2726
2727         * generic.cs (GenericMethod.DefineMembers): Update to changes.
2728         (TypeParameter.TypeParameter): Change type of 'parent' argument to
2729         DeclSpace.
2730
2731         Fix #77008.
2732         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2733         'parent' argument to the base constructor.
2734
2735         Remove all mention of TypeContainer from decl.cs.
2736         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2737         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2738         (DeclSpace.DeclSpace): Likewise.
2739         (DeclSpace.DefineMembers): Remove unused argument.
2740         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
2741         debugging check -- we don't care if the debug code throws an
2742         InvalidCastException instead of an InternalErrorException.
2743         * class.cs (TypeContainer.DefineMembers): Update to changes.
2744         (TypeContainer.DoDefineMembers): Likewise.
2745         (TypeContainer.GetMethods): Likewise.
2746         (PropertyMember.Define): Likewise.
2747         (MemberBase.Parent): New property that forwards to
2748         MemberCore.Parent, but ensures that we get a TypeContainer.
2749         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2750         (RootContext.PopulateTypes): Likewise.  Remove special case code
2751         for !RootContext.StdLib: DefineMembers is idempotent.
2752
2753 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
2754
2755         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2756
2757 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
2758
2759         * doc.cs : The search for referenced namespace was insufficient to
2760           get global one as it used to do. Fixed bug #76965.
2761
2762 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
2763
2764         * doc.cs : check name in cref in the last phase that whether it is
2765           namespace or not.
2766
2767 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2768
2769         * cs-tokenizer.cs : reverted the latest change: it somehow broke
2770           Mono.C5.
2771
2772 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2773
2774         * doc.cs : so it turned out that we cannot skip override check for 
2775           interface members. Fixed bug #76954.
2776
2777 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2778
2779         * cs-tokenizer.cs : fixed bug #75984:
2780           - #warning and #error should not be handled when the source line
2781             is disabled.
2782           - #line is not checked strictly when the source line is disabled.
2783           - #define and #undef is on the other hand checked strictly at any
2784             state.
2785
2786 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
2787
2788         * cs-tokenizer.cs : missing Location (actually, filename) in one of
2789           CS1027 report.
2790
2791 2005-12-15  Raja R Harinath  <rharinath@novell.com>
2792
2793         * generic.cs (TypeManager.IsGeneric): Remove unused method.
2794
2795         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
2796         nested types.
2797
2798 2005-12-14  Martin Baulig  <martin@ximian.com>
2799
2800         * typemanager.cs (TypeManager.GetFullName): Make this public;
2801         `Type.Fullname' now never returns null.
2802
2803         * class.cs (Method.Define): Use TypeManager.GetFullName() for
2804         explicit interface implementations; we're now using the same
2805         naming convention than csc does.
2806
2807 2005-12-14  Miguel de Icaza  <miguel@novell.com>
2808
2809         * convert.cs (ExplicitConversionCore): Check the return value from
2810         ExplicitConversionCore which can return null on failure.  Fixes #76914
2811
2812 2005-12-09  Raja R Harinath  <rharinath@novell.com>
2813
2814         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
2815         instead of IsGenericInstance.
2816         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
2817         code that's now covered by the more general test.
2818         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
2819
2820         * generic.cs (DropGenericTypeArguments): New.  Captures the common
2821         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
2822         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
2823         * generic.cs, report.cs, typemanager.cs: Likewise.
2824
2825 2005-12-08  Martin Baulig  <martin@ximian.com>
2826
2827         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
2828
2829         * typemanager.cs (TypeManager.CSharpSignature): Include type
2830         arguments in the signature of a generic method.
2831
2832 2005-12-07  Martin Baulig  <martin@ximian.com>
2833
2834         Add support for custom attributes on type parameters.
2835
2836         * cs-parser.jay (type_arguments): Added `opt_attributes'.
2837
2838         * generic.cs (TypeParameterName): New public class; we use this
2839         instead of a `string' to store the name of a type parameter, so we
2840         can also have `Attributes'.
2841         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
2842         array instead of a `string[]' array.
2843         (TypeParameter.ctor): We now also take an `Attributes' argument.
2844         (TypeParameter.EmitAttributes): New public method; emit our
2845         `OptAttributes' here.
2846         (GenericMethod.EmitAttributes): New public method; emit the custom
2847         attributes on all our type parameters.
2848
2849         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
2850         our type parameters.
2851         (MethodData.Define): If we're a generic method, call
2852         EmitAttributes() on it.
2853
2854 2005-12-07  Martin Baulig  <martin@ximian.com>
2855
2856         * generic.cs
2857         (ConstraintChecker): New public abstract class; move the
2858         constraint checking here from `ConstructedType' and also do
2859         constraint checking for generic methods here.
2860
2861         * expression.cs (Invocation.OverloadResolve): Use
2862         ConstraintChecker.CheckConstraints() if we resolved to a generic
2863         method.  Fix #76806.
2864
2865 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2866
2867         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2868
2869         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2870         event initializers.
2871         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2872         (FieldBase.Initializer): Initializer is now optional.
2873         (EventField.Define): Only event field can have initializer.
2874
2875         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2876
2877         * const.cs (Const): Reuse initializer.
2878
2879         * cs-parser.jay: Updated after FieldBase changes.
2880         Added current_array_type to simplify array initializers.
2881
2882         * ecore.cs (NullCast.IsDefaultValue): Implemented.
2883
2884         * expression.cs, iterators.cs: Updated.
2885
2886         * namespace.cs (NamespaceEntry): Made UsingFound private.
2887
2888 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2889
2890         * parameterCollection.cs: Obsolete, removed.
2891         * parser.cs: Obsolete, removed.
2892
2893 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2894
2895         Fix #76849.
2896         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2897
2898         * enum.cs (Enum.Define): Set obsolete context here.
2899
2900 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2901
2902         * doc.cs :
2903           - FindDocumentedMember() now expects 1) paramList as null
2904             when "we don't have to check the number of parameters" and
2905             2) Type.EmptyTypes when "there is no arguments".
2906           - Introduced FoundMember struct to hold the exact type which was
2907             used to find the documented member (the above change broke
2908             test-xml-044; it might be better just to use DeclaringType than
2909             what MS does, like this change does, but it depends on usage.)
2910
2911 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2912
2913         * doc.cs : documented member might be from DeclaringType for nested
2914           types. Fixed bug #76782.
2915
2916 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
2917
2918         * anonymous.cs: Have the param code handle leaving copies on the
2919         stack etc. Allows anonymous params to take part in the assignment
2920         code (++, +=, etc). Fixes bug #76550
2921
2922         * expression.cs: Handle the prepare_for_load/leave_copy by passing
2923         it down to the anon code.
2924
2925         * iterators.cs: Use dummy var here
2926
2927         * codegen.cs: Handle new vars
2928
2929 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2930
2931         Fix #76849.
2932         * class.cs (MethodData.Define): Set proper Obsolete context.
2933
2934         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2935         obsolete context.
2936         (FieldExpr.DoResolve): Ditto.
2937
2938 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2939
2940         Fix #76849.
2941         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2942         parent is not obsolete.
2943
2944 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
2945
2946         * doc.cs : (FindDocumentedMember) find parameterless members first
2947           and get CS0419 in the early stage. Fixed first case of bug #76727.
2948
2949 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
2950
2951         Fix #76859.
2952         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2953         no error was reported.
2954
2955         *expression.cs (Binary.DoResolve): left can be null.
2956
2957 2005-12-06  Raja R Harinath  <rharinath@novell.com>
2958
2959         * class.cs (MethodCore.CheckGenericOverride): Delete unused
2960         abstract method and all overrides.
2961         * support.cs (ParameterData.GenericConstraints): Delete.
2962         (ReflectionParameters.type_params): Delete.
2963         (ReflectionParameters.ReflectionParameters): Make private.
2964         (ReflectionParameters.GetConstaints): New factory method.
2965         * generic.cs (TypeParameterDefineType): Use it.
2966         (TypeManager.GetTypeParameterConstraints): Likewise.
2967
2968 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
2969
2970         Fix #76783.
2971         * class.cs (MethodData.Emit): Parameters should be labeled first.
2972
2973 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
2974
2975         Fix #76761.
2976         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2977
2978 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
2979
2980         * attribute.cs (AreParametersCompliant): Moved to Parameter.
2981
2982         * class.cs (MethodCore): Parameter clean up.
2983         (IMethodData): Added ParameterInfo.
2984         (MethodData): Parameter clean up.
2985         (Indexer.Define): Parameter clean up.
2986
2987         * anonymous.cs,
2988         * codegen.cs,
2989         * cs-parser.jay,
2990         * decl.cs,
2991         * doc.cs,
2992         * ecore.cs,
2993         * flowanalysis.cs,
2994         * iterators.cs,
2995         * pending.cs,
2996         * statement.cs,
2997         * typemanager.cs: Parameter clean up.
2998
2999         * delegate.cs (Define): Get rid of duplicated code.
3000
3001         * expression.cs (ParameterReference): Removed useless parameters
3002         and simplified.
3003         (Invocation): Ditto.
3004
3005         * parameter.cs (ParamsParameter): New class, params specialization.
3006         (ArglistParameter): Attemp to separate arglist.
3007         (Parameter): Refactored to be reusable and faster.
3008         (Parameter.Modifier): Made understandable.
3009         (Parameters): Changed to be used as a class for `this' assembly
3010         parameters. Refactored to use new specialized classes.
3011
3012         * support.cs (ParameterData): Added Types property.
3013         (InternalParameters): Deleted.
3014
3015 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3016
3017         * doc.cs : the previous patch does not actually fix the bug.
3018           PropertyInfo override check is now implemented and really fixed it.
3019         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
3020
3021 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3022
3023         * doc.cs : apply "override filter" also to properties.
3024           Fixed bug #76730.
3025
3026 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3027
3028         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
3029           no need to check overrides. For classes, omit those results from 
3030           interfaces since they must exist in the class. Fixed bug #76726.
3031
3032 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3033
3034         * typemanager.cs : (GetFullNameSignature) differentiate indexers
3035           with different parameters. Fixed the second problem in #76685.
3036
3037 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3038
3039         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
3040           get expected 'protected' access in CheckValidFamilyAccess()).
3041           Fixed bug #76692.
3042
3043 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3044
3045         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
3046           Fixed bug #76705.  CS1569 was incorrectly commented out.
3047
3048 2005-11-23  Martin Baulig  <martin@ximian.com>
3049
3050         * generic.cs (Constraints.Define): Removed.
3051         (TypeParameter.DefineConstraints): Removed.
3052         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
3053         on the GenericTypeParameterBuilder here.
3054
3055 2005-11-23  Martin Baulig  <martin@ximian.com>
3056
3057         * typemanager.cs (TypeManager.GetProperty): Make this public.
3058
3059         * generic.cs (Nullable.NullableInfo.ctor): Use
3060         TypeManager.GetProperty() rather than using reflection directly.
3061
3062 2005-11-17  Martin Baulig  <martin@ximian.com>
3063
3064         * expression.cs (Indexers.GetIndexersForType): Added support for
3065         generic parameters; fixes #76587.
3066
3067 2005-11-17  Martin Baulig  <martin@ximian.com>
3068
3069         * anonymous.cs
3070         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
3071         inherit the scope from our parent.  Fixes #76653.
3072
3073 2005-11-15  Martin Baulig  <martin@ximian.com>
3074
3075         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
3076         instead of `ScopeTypeBuilder' to refer to the "current" type.
3077         (AnonymousMethod.CreateScopeType): Correctly create the helper
3078         class if we're inside a generic type definition.
3079
3080 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
3081
3082         * doc.cs : use Invocation.IsOverride() to do real override check.
3083         * expression.cs : made Invocation.IsOverride() internal.
3084
3085 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
3086
3087         * doc.cs : use TypeManager.FindMembers() instead of (possible)
3088           TypeBuilder.FindMembers() and filter overriden base members out.
3089           Fixed bug #76990.
3090
3091 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3092
3093         * doc.cs : ref/out parameters are represented as '@' (instead of
3094           '&' in type FullName). Fixed bug #76630 (additionally crefs).
3095
3096 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3097
3098         * doc.cs : when there was no '.' in cref to methods in doc comment,
3099           then parameters were missing in the output. Fixed bug #76691.
3100
3101 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3102
3103         * driver.cs : don't output docs when there is an error.
3104           Fixed bug #76693.
3105
3106 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3107
3108         * doc.cs :
3109           Now it should detect indexers. Fixed primary concern in bug #76685.
3110           Fixed CS0419 message to not show the identical member signature in
3111           the message.
3112
3113 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3114
3115         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
3116           instead of Type.FindMembers() since it does not handle events.
3117           Fixed bug #71604.
3118
3119 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
3120
3121         * codegen.cs: Fixed typo (speficied -> specified).
3122
3123 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3124
3125         Fix #76369.
3126         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3127
3128 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3129
3130         * attribute.cs: Changed error message.
3131
3132         * cs-tokenizer.cs: One more check.
3133
3134 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3135
3136         * statement.cs (Block.Resolve): Ignore empty statement.
3137
3138 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3139
3140         * report.cs: Made error/warning methods more strict to avoid
3141         their misuse.
3142
3143         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3144         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3145         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3146         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3147
3148 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3149
3150         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
3151         Use the more explicit AssemblyName.FullName instead of 
3152         AssemblyName.Name to report errors.
3153         
3154 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3155
3156         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
3157         with mcs.
3158
3159 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3160
3161         * class.cs,
3162         * convert.cs,
3163         * cs-parser.jay,
3164         * decl.cs,
3165         * enum.cs,
3166         * expression.cs,
3167         * generic.cs,
3168         * pending.cs,
3169         * report.cs: Fixed error reporting and typos.
3170
3171         * generic.cs (TypeParameter.GetSignatureForError): New method.
3172         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
3173
3174         * typemanager.cs (GetFullName): Refactored.
3175
3176 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
3177
3178         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3179         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3180
3181         * class.cs (TypeContainer.IsComImport): New property.
3182         (Constructor.Define): Create proper ctor for ComImport types.
3183
3184         * expression.cs (New.CheckComImport): Fixed.
3185
3186 2005-11-07  Miguel de Icaza  <miguel@novell.com>
3187
3188         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3189         that a parameter has been captured does not mean that we do not
3190         have to do the rest of the processing.  This fixes the second part
3191         of #76592.  If there was another anonymous method capturing
3192         values in the past, the Scope would never be set for the second
3193         method that captured the same parameter.
3194
3195         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3196         properly manipulate the stack.   Second part of fix for #76592.
3197
3198         * expression.cs (New): Add support for invoking "new" on
3199         interfaces that have been flagged with the ComImport attribute and
3200         the CoClass.  Fixes #76637 
3201
3202         * statement.cs (Try.DoEmit): When a variable is captured, do not
3203         try to emit the vi.LocalBuilder variable as it has been captured.
3204         Create a temporary variable and store the results on the
3205         FieldBuilder.  Fixes #76642
3206
3207 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3208
3209         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3210
3211         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3212
3213         * expression.cs (Binary.DoResolve): Added && optimalization.
3214     
3215         * typemanager.cs (AddUserType): Removed useless argument.
3216
3217 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
3218
3219         * statement.cs (Block.variables): Uses ListDictionary.
3220
3221 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3222
3223         Fix #75969.
3224         * class.cs (PartialContainer.EmitType): Customized to emit
3225         security attributes.
3226         (ClassPart.ApplyAttributeBuilder): Transform security attribute
3227         for partial classes.
3228
3229 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3230
3231         Fix #76599.
3232         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3233         access has to be fixed.
3234         
3235         * typemanager.cs (IsUnmanagedType): Wrong common field type.
3236
3237 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
3238
3239         Fix #76590.
3240         * ecore.cs (NullCast.Reduce): Implemented.
3241
3242         * expression.cs (ArrayCreation.CheckIndices): Correcly check
3243         constant type.
3244         
3245         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3246         properly.
3247         (Foreach.Resolve): Catch null properly.
3248
3249 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3250  
3251         * cs-tokenizer.cs: Warning text fix.
3252
3253         * driver.cs: AllWarningNumbers exposed on public interface.
3254
3255         * report.cs (): Reviewed warning numbers.
3256         (IsValidWarning): Use binary search.
3257
3258 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3259  
3260         * driver.cs: Implemeted resource visibility.
3261         (Resources): New class for code sharing between /res: and
3262         /linkres:
3263  
3264 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3265
3266         decl.cs (CurrentTypeParameters): Fixed to be public.
3267
3268 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3269
3270         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
3271
3272 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3273
3274         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
3275
3276 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
3277
3278         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
3279
3280 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3281
3282         Add friend assembly access support.
3283         * typemanager.cs: assembly_internals_vis_attrs
3284         cache for friend assembly access. 
3285         (TypeManager.IsFriendAssembly): New method for
3286         checking friend assembly access.
3287         (TypeManager.Error_FriendAccessNameNotMatching): New
3288         helper method.
3289         (TypeManager.CompareKeyTokens): Likewise.
3290         (TypeManager.Filter): Handle friend accessible
3291         members.
3292
3293         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
3294         friend accessible types.
3295
3296         * ecore.cs (Expression.IsAccessorAccessible): Handle
3297         friend accessible properties.
3298
3299         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
3300         accessible types.
3301         
3302 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
3303
3304         Fix #76568.
3305         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3306         folding.
3307         
3308         * convert (Convert.ImplicitReferenceConversion): NullCast holds
3309         contants only.
3310         
3311         * ecore.cs (NullCast): Child is contant only.
3312         
3313         * literal.cs (NullLiteral.Reduce): null can be converted to any
3314         reference type.
3315
3316 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
3317
3318         * driver.cs: Use Encoding.Default as default code page instead
3319           of ISO-28591.
3320
3321 2005-10-27  Raja R Harinath  <rharinath@novell.com>
3322
3323         Fix #76085.
3324         * expression.cs (Invocation.Error_InvalidArguments): Handle
3325         __arglist parameters.
3326         (Invocation.VerifyArgumentsCompat): Likewise.
3327         * support.cs (ReflectionParameters.GetSignatureForError): Print
3328         __arglist parameters.
3329         (InternalParamters.GetSignatureForError): Likewise.
3330         * parameter.cs (Parameters.GetSignatureForError): Likewise.
3331
3332 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
3333
3334         * attribute.cs (GetPropertyValue): Made public.
3335
3336         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3337         Resolve.
3338         Add new property WrapNonExceptionThrows to handle 2.0 assembly
3339         attribute.
3340         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3341         is not defined.
3342         
3343         * driver.cs: Reflect method name change.
3344         
3345         * statement.cs (Try.Resolve): Warn when try has both general
3346         exception handlers.
3347         
3348         * typemanager.cs: runtime_compatibility_attr_type new predefined
3349         type.
3350
3351 2005-10-26  Raja R Harinath  <harinath@gmail.com>
3352
3353         Fix #76419.
3354         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3355         treat it as an empty parameter list.
3356
3357 2005-10-26  Raja R Harinath  <rharinath@novell.com>
3358
3359         Fix #76271.     
3360         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
3361         ResolveAsTypeStep silent.
3362         * statement.cs (Block.AddConstant): Mark block as used.
3363         (Block.ResolveMeta): Avoid piling on error messages
3364         if a constant initializer resolution fails.
3365
3366 2005-10-25  Raja R Harinath  <rharinath@novell.com>
3367
3368         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3369         Remove.
3370         (NamespaceEntry.VerifyAllUsing): New.
3371         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
3372         behaviour.  Delegates actual resolution of alias to ...
3373         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
3374         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3375         Update.
3376         * driver.cs (Driver.MainDriver): Update.
3377         
3378         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3379         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3380         property.
3381         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3382         Remove.
3383         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3384         RootNamespace.DefineNamespacesForAll.
3385
3386 2005-10-24  Raja R Harinath  <harinath@gmail.com>
3387
3388         * typemanager.cs (assemblies, external_aliases, modules)
3389         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3390         (ComputeNamespaces, GetRootNamespace): Remove extra staging
3391         overhead.  Move resposibility ...
3392         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
3393         * driver.cs, attribute.cs, codegen.cs: Update to changes.
3394
3395 2005-10-23  Raja R Harinath  <harinath@gmail.com>
3396
3397         * namespace.cs (RootNamespace.all_namespaces): Renamed from
3398         cached_namespaces.  Improve usage.
3399         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3400         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3401         Move from GlobalRootNamespace and simplify.
3402         (RootNamespace.Global): Make instance variable.
3403         (RootNamespace.RootNamespace): Add "alias name" parameter.
3404         (GlobalRootNamespace): Simplify drastically.
3405         (Namespace.Lookup): Don't use GetNamespace.
3406         * typemanager.cs (GetRootNamespace): Rename from
3407         ComputeNamespaceForAlias.
3408         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3409
3410 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3411
3412         * anonymous.cs (AnonymousContainer): Don't crash when container
3413         doesn't exist.
3414
3415 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3416
3417         * expression.cs (Binary.DoResolve): Warn when comparing same
3418         values.
3419
3420 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3421
3422         Fix #76486.
3423         * expression.cs (Binary.DoResolve): It looks like there are no
3424         convetsion rules in enum context.
3425
3426 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3427
3428         Add support for extern alias qualifiers.
3429         * typemanager.cs: Move some LookupTypeReflection code
3430         to namespace.cs, to have cleaner code. Added some methods
3431         to help us keep track of the extern aliased references.
3432         * driver.cs: Add suport for extern alias assemblies on command
3433         line and check for their warnings/errors. Also keep track of the
3434         extern aliased assemblies.
3435         * namespace.cs: Move the global functionality of Namespace
3436         to GlobalRootNamespace/RootNamespace. Now the global namespace
3437         is GlobalRootNamespace.Globa. Also the code moved from 
3438         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
3439         Finally added LocalAliasEntry (AliasEntry before) and
3440         ExternAliasEntry, to handle alias statements.
3441         * cs-parser.jay: Add support in the grammar for extern alias
3442         statement.
3443         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
3444         Update callings to Namespace (now in GlobalRootNamespace).
3445
3446 2005-10-25  Martin Baulig  <martin@ximian.com>
3447
3448         * convert.cs (ImplicitTypeParameterConversion): Make base
3449         interfaces actually work; fixes #76557.
3450
3451 2005-10-25  Martin Baulig  <martin@ximian.com>
3452
3453         * generic.cs
3454         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
3455         all the type parameters; fixes #76551.
3456
3457 2005-10-25  Martin Baulig  <martin@ximian.com>
3458
3459         Fix #76472.
3460
3461         * generic.cs
3462         (GenericMethod.ctor): Added `Expression return_type' and
3463         `Parameters parameters' arguments.
3464         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
3465         parameter and return types to check their constraints if they're
3466         generic types.
3467
3468         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
3469         boolean field.
3470
3471         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3472         constraints of a generic type if `ec.ResolvingGenericMethod'.
3473
3474         * class.cs (MethodCore.DoDefineParameters): Set
3475         `ec.ResolvingGenericMethod' if we're a generic method.
3476         (MemberBase.MemberType): Likewise.
3477
3478 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3479
3480         * typemanager.cs (TypeManager): Added 
3481         TypeManager.internals_visible_attr_type to cache
3482         S.R.CompilerServices.InternalsVisibleToAttribute.
3483
3484         * codegen.cs (AssemblyClass): Added checks for 
3485         InternalsVisibleToAttribute in new method 
3486         CheckInternalsVisibleAttribute () and also cache the
3487         AssemblyName in AssemblyClass.Name.
3488         
3489 2005-10-24  Martin Baulig  <martin@ximian.com>
3490
3491         * typemanager.cs
3492         (TypeManager.ExpandInterfaces): Added overloaded version which
3493         just takes a `Type[]' array.
3494
3495         * generic.cs
3496         (Constraints.Resolve): Don't expand the interfaces here; ie. we
3497         just use the interfaces which were explicitly specified and not
3498         the interfaces they inherit.  Fixes #76482.
3499         (TypeParameter.FindMembers): Expand the interfaces here.
3500
3501 2005-10-21  Martin Baulig  <martin@ximian.com>
3502
3503         * generic.cs
3504         (Constraints.Resolve): Also resolve the actual types here.
3505         (Constraints.ResolveTypes): Just check the constraints here.
3506         Fixes #76363; see gtest-218.cs.
3507
3508 2005-10-21  Martin Baulig  <martin@ximian.com>
3509
3510         * convert.cs
3511         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
3512         instead of a `BoxedCast'; fixes gtest-217.cs.
3513
3514 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
3515
3516         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
3517           1) "new()" is specified as generic parameter constraint and 2) the
3518           type is TypeBuilder and 3) the type is abstract even if it has a
3519           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
3520
3521 2005-10-20  Martin Baulig  <martin@ximian.com>
3522
3523         * generic.cs
3524         (GenericConstraints.TypeParameter): New public property.
3525         (TypeParameter.ctor): Also take a `DeclSpace' argument.
3526         (TypeParameter.DeclSpace): New public property.
3527         (TypeParameter.DefineType): Inflate the constraints if our
3528         `DeclSpace' is an `Iterator'.   
3529
3530 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
3531
3532         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
3533           GenericMethod argument to compare methods' generic type arguments.
3534           Fixed bug #76382.
3535
3536 2005-10-19  Martin Baulig  <martin@ximian.com>
3537
3538         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
3539         not ResolveType() when resolving the base type, so we're not
3540         checking the constraints here.
3541         (TypeContainer.ResolveType): Call ResolveType() on our base_type
3542         if we have any.
3543
3544 2005-10-19  Martin Baulig  <martin@ximian.com>
3545
3546         * generic.cs (ConstructedType.CheckConstraints): Committing
3547         untested fix for #76441.
3548
3549 2005-10-18  Raja R Harinath  <rharinath@novell.com>
3550
3551         Fix #76371.
3552         * class.cs (TypeContainer.DefineType): Move updating of
3553         topological sort earlier in the code.
3554         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3555
3556 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
3557
3558         Fix #76273.
3559         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3560         
3561         * constant.cs (Constant.TryReduce): Moved from Cast class.
3562         (Reduce): Made little bit more OO and fixed missing conversions.
3563         
3564         * ecore.cs (Reduce): Implemented.
3565         (Binary.EnumLiftUp): New method to upgrade values to enum values.
3566         
3567         * literal.cs (Reduce): Implemented.
3568         
3569         * class.cs: Reverted Miguel's wrong commit.
3570
3571 2005-10-14  Miguel de Icaza  <miguel@novell.com>
3572
3573         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3574
3575 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
3576
3577         * cs-parser.jay, expression.cs : CS0214 was missing error location
3578           for constants. Fixed bug #76404.
3579
3580 2005-10-10  Raja R Harinath  <rharinath@novell.com>
3581
3582         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3583         InstanceExpression.
3584         (PropertyExpr.EmitCall): Likewise.
3585         * expression.cs (Invocation.EmitArguments): Handle case where
3586         arguments == null.
3587         (Invocation.EmitCall): Avoid allocating temporary variable if
3588         there are no arguments.
3589
3590 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
3591
3592         Fix #76370.
3593         * convert.cs (ExplicitConversionCore): Fixed object->enum
3594         conversion.
3595
3596 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3597
3598         Fix #76323.
3599         * convert.cs (ImplicitConversionStandard): Move conversion of
3600         void* to arbitrary pointer types ...
3601         (ExplicitConversionStandard): .. here.
3602         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3603         error to always print typenames.
3604
3605 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3606
3607         * convert.cs (GetConversionOperator): Rename from
3608         GetConversionOperators.  Move operator selection code from ...
3609         (UserDefinedConversion): ... here.
3610
3611 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
3612
3613         * convert.cs (ExplicitConversionCore): Removed duplicate enum
3614         conversion.
3615
3616 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
3617
3618         * assign.cs (Assign.DoResolve): Error method changed.
3619
3620         * cfold.cs (DoConstantNumericPromotions): Error method changed.
3621         
3622         * const.cs (ResolveValue): Reset in_transit immediately.
3623         
3624         * constant.cs: Error method changed.
3625         
3626         * convert.cs: Removed useless location parameter.
3627         (ExplicitNumericConversion): Don't do double enum check.
3628         (ExplicitConversionCore): Renamed from ExplicitConversion.
3629         (ExplicitUnsafe): Extracted from ExplicitConversion.
3630         (ExplicitConversion): Uses for error reporting.
3631         
3632         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3633         error messages.
3634         (ResolveBoolean): Uses common error method.
3635         (CastToDecimal): Get rid of ec.
3636         (CastFromDecimal): Optimized.
3637         (ConvCast): Get rid of ec.
3638         
3639         * enum.cs (ResolveValue): Reset in_transit immediately.
3640         (Emit): Return after first error.
3641         
3642         * expression.cs: Convert changes.
3643         
3644         * literal.cs: Error method changed.
3645         
3646         * statement.cs: Error method changed.
3647
3648 2005-10-06  Raja R Harinath  <rharinath@novell.com>
3649
3650         Fix gtest-131.cs and gtest-211.cs.
3651         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
3652         Only emit code for a label if it is used.  Unreachable code can
3653         violate ECMA evaluation stack invariants.
3654
3655 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3656
3657         * anonymous.cs: Implemented ExprClassName.
3658         
3659         * assign.cs (Assign.DoResolve): Don't chrash when type is not
3660         delegate.
3661         
3662         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3663         check.
3664         
3665         * class.cs (StaticClass.DefineContainerMembers): Report protected
3666         members as error.
3667         
3668         * codegen.cs: if(ed) PRODUCTION.
3669         
3670         * convert.cs (Error_CannotImplicitConversion): Better error
3671         distinction.
3672         
3673         * cs-parser.jay: More error checks.
3674         
3675         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3676         
3677         * driver.cs (CSCParseOption): Enabled wrong option check.
3678         
3679         * ecore.cs (Expression.ExprClassName): Turned to property.
3680         (MemberExpr.CheckIntermediateModification): For checking boxed
3681         value types     modification.
3682         
3683         * statement.cs (Fixed.Resolve): Expression type must be
3684         convertible to fixed type.
3685         (CollectionForeach.GetEnumeratorFilter,TryType):
3686         Small refactoring for easier error checking.
3687
3688 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
3689
3690         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3691         attributes.
3692         
3693         * class.cs (GeneratedBaseInitializer): New class for customization
3694         compiler generated initializers.
3695         (MemberBase.DoDefine): Check Obsolete attribute here.
3696         (FieldMember.DoDefine): Ditto.
3697         
3698         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3699         constants.
3700         
3701         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3702         (MemberCore.GetObsoleteAttribute): Removed argument.
3703         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3704         (MemberCore.CheckObsoleteType): New helper.
3705         
3706         * delegate.cs,
3707         * enum.cs,
3708         * statement.cs: Updates after MemberCore changes.
3709         
3710         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3711         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3712         
3713         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3714         obsolete attribute for compiler construct.
3715         (As.DoResolve): Cache result.
3716         
3717         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3718
3719 2005-10-01  Miguel de Icaza  <miguel@novell.com>
3720
3721         * expression.cs (Probe): instead of having a "Type probe_type"
3722         keep the extra information as a TypeExpr probe_type_expr since the
3723         "As" operator needs to perform some type checks.
3724
3725         * (As.DoResolve): If the type is a type parameter, ensure that it
3726         is constrained by a class.
3727
3728 2005-09-22  Miguel de Icaza  <miguel@novell.com>
3729
3730         * statement.cs (Lock): Use the TemporaryVariable class instead of
3731         manually using local variables as those do not work when variables
3732         are captured.
3733
3734         * ecore.cs: Moved the TemporaryVariable class from being a nested
3735         class inside Foreach to be a public class that can be employed in
3736         other places. 
3737
3738 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
3739
3740         * cs-parser.jay: interface_accessors replaced by
3741         accessor_declarations.
3742
3743         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3744         location.
3745         
3746         * statement.cs (GotoCase.Resolve): Convert null constant to
3747         null case.
3748         (SwitchLabel.ResolveAndReduce): Ditto.
3749         (SwitchLabel.NullStringCase): Custom null stamp.
3750         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3751         
3752         typemanager.cs (CSharpSignature): Don't skip first argument
3753         for full names.
3754
3755 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
3756
3757         * cfold.cs, constant.cs, convert.cs, ecore.cs,
3758         expression.cs, iterators.cs, literal.cs: Store constants and
3759         literals location.
3760         
3761         * class.cs (MemberBase.ShortName): Pass location.
3762         
3763         * cs-parser.jay: Some location fixes.
3764         
3765         * ecore.cs (Expression.Location): Made virtual.
3766
3767 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3768
3769         Fix #72930.
3770         * const.cs (Const.ResolveValue): Check for assigning non-null
3771         value to reference type.
3772
3773 2005-09-26  Raja R Harinath  <rharinath@novell.com>
3774
3775         Fix #76133.
3776         * expression.cs (This.VerifyFixed): In a value type T, the type of
3777         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
3778         value type R, 'this' is treated as a value parameter.
3779
3780 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3781
3782         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3783         if the underlying types are the same, otherwise we need to produce
3784         code that will do the proper cast.
3785
3786         This was exposed by Marek's constant rewrite which produced
3787         invalid code for the call site:
3788
3789         enum X : long { a }
3790         void Method (X v) {}
3791
3792         Method ((X) 5)
3793
3794         This fixes test-49.cs
3795
3796 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3797
3798         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3799           Type/Object should be allowed as well. Fixed bug #75968.
3800
3801 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3802
3803         * expression.cs : (Binary.DoResolve): when one is enum constant and
3804           another is constant 0, then return enum one *as enum type*.
3805           Fixed bug 74846.
3806
3807 2005-10-04  Martin Baulig  <martin@ximian.com>
3808
3809         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
3810         `SetMemberIsUsed()' work for generics, too.
3811
3812 2005-10-04  Martin Baulig  <martin@ximian.com>
3813
3814         * expression.cs (DelegateInvocation.EmitStatement): Make this work
3815         for corlib.  Fixes #75691.
3816
3817 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
3818
3819         Fix #76255.
3820         * driver.cs: Fix compilation files with full root path.
3821
3822 2005-09-25  Miguel de Icaza  <miguel@novell.com>
3823
3824         * report.cs (SymbolRelatedToPreviousError): Format the output so
3825         it does not use an open parenthesis that is never closed. 
3826
3827         * driver.cs: Follow coding guidelines
3828
3829 2005-09-18  Miguel de Icaza  <miguel@novell.com>
3830
3831         * driver.cs: Set InEmacs based on the environment variable EMACS. 
3832
3833         * location.cs (InEmacs): in this mode, do not report column
3834         location as it confuses Emacs.
3835
3836 2005-10-03  Raja R Harinath  <rharinath@novell.com>
3837
3838         * support.cs (SeekableStreamReader.Position): Don't error out when
3839         the requested position is just beyond the end of the current
3840         buffered data.
3841
3842 2005-09-28  Raja R Harinath  <rharinath@novell.com>
3843
3844         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
3845         try to keep in sync with the byte count of the underlying Stream.
3846         However, this limits us to a window size of 2048 characters: i.e.,
3847         the maximum lookahead of our lexer/parser can be 2048 characters.
3848
3849 2005-09-22  Martin Baulig  <martin@ximian.com>
3850
3851         * driver.cs: Removed a debugging FIXME.
3852
3853 2005-09-21  Raja R Harinath  <rharinath@novell.com>
3854
3855         * cs-parser.jay (type_arguments): Add CS1644 check.
3856         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
3857
3858 2005-09-15  Raja R Harinath  <rharinath@novell.com>
3859
3860         * Makefile (PROGRAM): Make profile specific.
3861         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
3862         the current directory.
3863
3864         Fix test-455.cs.
3865         * expression.cs (Invocation.EmitCall): Remove optimization on
3866         this_call since it doesn't handle 'this' being a value type.
3867
3868 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
3869
3870         * driver.cs: Ensure file handles are closed after parsing
3871
3872 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3873
3874         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3875         if the underlying types are the same, otherwise we need to produce
3876         code that will do the proper cast.
3877
3878         This was exposed by Marek's constant rewrite which produced
3879         invalid code for the call site:
3880
3881         enum X : long { a }
3882         void Method (X v) {}
3883
3884         Method ((X) 5)
3885
3886         This fixes test-49.cs
3887
3888 2005-09-05  Martin Baulig  <martin@ximian.com>
3889
3890         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
3891         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
3892
3893         * cs-parser.jay (delegate_declaration): Small fix for #75852.
3894
3895 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3896
3897         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
3898           to be a pointer type due to the spec 25.2, so check if declaring
3899           type is generic type definition. Fixed bug #75772.
3900
3901 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3902
3903         Fixed bug #75957.
3904         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
3905           both types are not defined by methods.
3906         * expression.cs : (Invocation.IsApplicable): it should work when
3907           the argument type is equal to the parameter type, not only when
3908           ImplicitConversionExists() returns true.
3909
3910 2005-09-02  Raja R Harinath  <rharinath@novell.com>
3911
3912         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3913         internal.
3914
3915         Fix #75941.
3916         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3917         flow-branching for LocalVariableReferences in case we were invoked
3918         from a MemberAccess.
3919         * expression.cs (LocalVariableReference.VerifyAssigned): New.
3920         Carved out of ...
3921         (LocalVariableReference.DoResolveBase): ... this.
3922         (MemberAccess.Resolve): Do the check that was disabled during
3923         SimpleNameResolve.
3924
3925 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3926
3927         * class.cs :
3928           (PartialContainer.Create): check abstract/sealed/static strictly
3929           but abstract/sealed can exist only at one side. Fixed bug #75883.
3930
3931 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
3932
3933         Fix #75945.
3934         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3935         specified, don't default to UnmanagedType.I4.
3936
3937 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3938
3939         * expression.cs : conditional operator should check possibly
3940           incorrect assign expression. Fixed bug #75946.
3941
3942 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3943
3944         Fix #75934.
3945         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3946         (ScopeInfo.EmitScopeType): Use it to construct field names from
3947         names of captured locals.
3948
3949         Fix #75929.
3950         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3951         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3952         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
3953         (ExplicitConversion): Remove enum cases already handled by
3954         implicit conversion.  Move implicit conversion check to the beginning.
3955         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3956         * expression.cs (ArrayCreation.EmitDynamicInitializers):
3957         Don't treat System.Enum as a struct.
3958
3959 2005-08-30  Jb Evain  <jbevain@gmail.com>
3960
3961         * attribute.cs: handles as expression in parameters.
3962
3963 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3964
3965         Fix #75802.
3966         * class.cs (TypeContainer.VerifyClsName): Don't use a
3967         PartialContainer when verifying CLS compliance.
3968         (AbstractPropertyEventMethod): Set Parent here, ...
3969         (PropertyMethod): ... not here.
3970
3971 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
3972
3973         * attribute.cs : escaped attribute name should not be allowed to be
3974           resolved (e.g. @class as classAttribute). Fixed bug #75930.
3975
3976 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3977
3978         Fix #75927.
3979         * convert.cs (ImplicitStandardConversionExists): Allow zero also
3980         when converting a long constant to unsigned long.
3981         * expression.cs (Invocation.OverloadResolve): Add sanity check to
3982         detect where IsApplicable and VerifyArgumentsCompat disagree.
3983
3984 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3985         and Carlos Alberto Cortez  <carlos@unixmexico.org>
3986
3987         Fix #75848.
3988         * class.cs (TypeContainer.CanElideInitializer): New helper.
3989         (TypeContainer.EmitFieldInitializers): Use it to determine if we
3990         can safely emitting the initializer of a field.
3991
3992 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3993
3994         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3995           allowed inside a switch (without loop). Fixed bug #75433.
3996
3997 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3998
3999         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4000         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4001
4002 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4003
4004         * driver.cs : kinda reverting the default encoding changes (not exact 
4005           revert since I noticed that "codepage:reset" might not work fine).
4006
4007 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4008
4009         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
4010           Location. Now getter and setter store location correctly.
4011           (errors/cs0111-12.cs now reports the expected location.)
4012
4013 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4014
4015         * driver.cs : Use default encoding on the environment.
4016           Removed (now that) extra parameter for SeekableStreamReader.
4017         * support.cs : (SeekableStreamReader) third .ctor() argument for
4018           StreamReader is not required (always true). preamble size could
4019           be acquired in simpler and safe way.
4020
4021 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
4022
4023         * cs-parser.jay: report CS0642 at warning level 3
4024           and report CS0642 for an if else statement also
4025           fixes bug #74745. Patch by John Luke (and a bit
4026           modified by me).
4027           Removed extra CS0642 warning check for "while",
4028           "for" and "fixed".
4029         * statement.cs: In Block.Resolve(), CS0642 check
4030           is reimplemented to check a sequence of an empty
4031           statement and a block.
4032
4033           Both fix bug #66777.
4034
4035 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
4036
4037         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
4038         detection until I fix it.
4039         
4040         * cs-tokenizer.cs: Changed error message.
4041         
4042         * cs-parser.jay: Fixed 2 error locations.
4043         
4044         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
4045         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
4046         properties.
4047         
4048         * enum.cs (GetSignatureForError): Fixed.
4049         
4050         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
4051         method detection.
4052         
4053         * class.cs,
4054         * typemanager.cs (RegisterProperty): Removed.
4055         
4056         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
4057
4058 2005-08-24  Raja R Harinath  <rharinath@novell.com>
4059
4060         Fix #75874.
4061         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
4062         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
4063
4064 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4065
4066         * expression.cs : tiny fix is required for not warning positive ulong.
4067           See test-441.cs.
4068
4069 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4070
4071         * expression.cs : add CS0652 check for constant and integral
4072           expression. Fixed bug #53974.
4073
4074 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4075
4076         * expression.cs : in DoNumericPromotions(), check if there is implicit
4077           conversion overload for string (to check CS0034). Fixed bug #52492.
4078
4079 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4080
4081         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
4082
4083 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4084
4085         * ecore.cs : report location when it is *not* Null.
4086
4087 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4088
4089         * codegen.cs,
4090           ecore.cs,
4091           flowanalysis.cs,
4092           expression.cs:
4093           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
4094           correctly. Fixed bug #75721.
4095
4096 2005-08-23  Raja R Harinath  <rharinath@novell.com>
4097
4098         * support.cs (SeekableStreamReader.Position): Avoid an expensive
4099         loop that performs 'min (pos, char_count)'.
4100
4101         Fix #75862.
4102         * expression.cs (Unary.ResolveOperator): Don't discard implicit
4103         converted value in Operator.OnesComplement.
4104
4105 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
4106
4107         * anonymous.cs: If the anon method is pulled into a helper class,
4108         it needs to be `internal' not `private'. Fixes runtime behavior on
4109         msft. bug #75704
4110
4111 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
4112
4113         Fix #75803
4114         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
4115         is a partial class.
4116
4117 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
4118
4119         The big constants rewrite
4120         Fix #75746, #75685 and more
4121         As a side effect saved 1MB for MWF ;-)
4122         
4123         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
4124         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
4125         enum based for corlib compilation.
4126         
4127         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
4128         subtractions.
4129         
4130         * class.cs (FixedField.Define): Use ResolveAsConstant.
4131         
4132         * const.cs (IConstant): Interface constants and enums.
4133         (Const.ResolveValue): New method for constant resolvning.
4134         (ExternalConstant): Constants from imported assemblies.
4135         
4136         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
4137         conversion; like enums.
4138         (Constant.ToType): Converts this constant to different type.
4139         (Constant.Increment): Adds 1.
4140         
4141         * convert.cs (ImplicitConversionRequired): Simplified.
4142         
4143         * cs-parser.jay: Create EnumMember directly.
4144         
4145         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
4146         
4147         * doc.cs (GenerateEnumDocComment): Removed.
4148         
4149         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
4150         (ConvertIntLiteral): Removed.
4151         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4152         
4153         * enum.cs (EnumMember): Implement IConstant.
4154         (Enum.IsValidEnumConstant): Removed.
4155         (Enum.GetNextDefaultValue): Removed.
4156         (Enum.FindMembers): Updated.
4157         (Enum.GenerateDocComment): Iterate enum members.
4158         
4159         * expression.cs (Cast.TryReduce): Handle enums correctly.
4160         (New.Constantify): Made public.
4161         (MemberAccess.DoResolve): Removed contant specific if(s).
4162         
4163         * literal.cs (NullLiteral): Implement new abstract methods.
4164         
4165         * statement.cs (GotoCase.Resolve): Use new constant methods.
4166         (SwitchLabel.ResolveAndReduce): Use new constant methods.
4167         
4168         * typemanager.cs (LookupEnum): Removed.
4169         (IsEnumType): Fixed to work with corlib.
4170         (RegisterConstant): Removed.
4171         (LookupConstant): Removed.
4172         (GetConstant): Changed to work with IConstant.
4173
4174 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
4175
4176         * location.cs : Fixed overflown (>255) column number.
4177
4178 2005-08-03  Raja R Harinath  <rharinath@novell.com>
4179
4180         First cut of the qualified-alias-member feature.
4181         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4182         token.
4183         * cs-parser.jay (DOUBLE_COLON): New token.
4184         (namespace_or_type_name): Add rule for recognizing
4185         qualified-alias-members.
4186         (primary_expression): Likewise.
4187         (element_access): Allow QualifiedAliasMember as a possible
4188         type-bearing expression.
4189         (local_variable_type, local_variable_pointer_type): Likewise.
4190         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
4191         aliases in the current and enclosing namespace declarations.
4192         (NamespaceEntry.UsingAlias): Add CS0440 warning.
4193         * decl.cs (MemberName.is_double_colon): New.
4194         (MemberName.MemberName): Add new constructor for alias-member.
4195         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4196         * expression.cs (QualifiedAliasMember): New expression type.
4197
4198 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4199
4200         * location.cs : it borked when no argument was specified.
4201
4202 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4203
4204         * location.cs : tiny ToString() format fix.
4205
4206 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4207
4208         * statement.cs : oops, it was missing.
4209
4210 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4211
4212         A set of fixes for precise line/column location.
4213
4214         * location.cs :
4215           "token" field now holds a file/line "delta", a line number offset 
4216           from the segment, and a column number. See also:
4217           http://lists.ximian.com/pipermail/mono-devel-list/2004-
4218           December/009508.html
4219           Removed static IsNull. Use instance IsNull property instead.
4220         * cs-tokenizer.cs :
4221           For some tokens it stores Location. For Identifier it stores
4222           LocatedToken which is a pair of string name and location.
4223           Column numbers are adjusted only at getChar().
4224         * report.cs :
4225           Use Location.ToString() for reporting (it now contains column).
4226         * cs-parser.jay :
4227           Largely modified to use LocatedToken instead of
4228           string (IDENTIFIER), and to acquire Location from some tokens.
4229         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4230           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4231           codegen.cs :
4232           Now MemberName holds Location. DeclSpace.ctor() receives Location
4233           as a parameter. Removed extra parameters to all derived classes.
4234           Replaced Location.IsNull() with instance property.
4235         * assign.cs, expression.cs :
4236           Added .ctor() overload that omits Location.
4237         * attribute.cs :
4238           Added "nameEscaped" flag that indicates the identifier was escaped
4239           in the source file. This fixes bug #57047.
4240
4241 2005-09-02  Martin Baulig  <martin@ximian.com>
4242
4243         * class.cs: Make CS3005 a warning, not an error.
4244
4245 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
4246
4247         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4248         New method, looking for lo-case imported cls type.
4249
4250         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4251         here.
4252
4253         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4254
4255         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4256
4257         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4258         all_imported_types.
4259         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4260
4261         Optimized to save 3.5 MB for SWF compilation.
4262
4263 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4264
4265         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4266         (PartialContainer.Create): Moved logic AddToContainer.
4267         (PartialContainer.MarkForDuplicationCheck): Shares name.
4268         
4269         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4270         place.
4271         
4272         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4273         initialization.
4274         (Namespace.GetSignatureForError): New method.
4275         
4276         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4277         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4278
4279 2005-08-01  Raja R Harinath  <rharinath@novell.com>
4280
4281         Fix #75669.
4282         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4283         member lookup rather than qualifier_type, since qualifier_type can
4284         be null.
4285
4286 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4287
4288         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4289         enum member.
4290
4291 2005-07-31  Miguel de Icaza  <miguel@novell.com>
4292
4293         * statement.cs: Copy the local exception into the exception
4294         captured local.  Fixes 75674
4295
4296 2005-07-31  Raja R Harinath  <harinath@gmail.com>
4297
4298         Fix #75658.
4299         * expression.cs (Invocation.OverloadResolve): Don't report error
4300         CS1501 if error CS1502 has been reported.
4301         (New.DoResolve): Delegate CS1501 reporting to
4302         Invocation.OverloadResolve.
4303
4304         Fix #75656.
4305         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4306         invariant-meaning-in-block property in an enclosing block if
4307         necessary.
4308
4309 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
4310
4311         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4312         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4313         (Switch.CheckSwitch): Just save 50kb for SWF.
4314
4315 2005-07-27  Martin Baulig  <martin@ximian.com>
4316
4317         * anonymous.cs (CaptureContext.AddField): Added
4318         `AnonymousContainer am' argument; compute its toplevel scope if
4319         it's not already computed.  Fixes #75649.
4320
4321 2005-07-26  Raja R Harinath  <rharinath@novell.com>
4322
4323         Fix #75628.
4324         * class.cs (Constructor.Emit): Reset block to null if the block
4325         resolve fails.
4326
4327 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4328
4329         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4330
4331 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4332
4333         * class.cs (MethodData.Define): Check whether accessor implementing
4334         interface is public.
4335
4336         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4337
4338 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
4339
4340         Fix #57245
4341         * namespace.cs (LookupType): Moved same type check to...
4342         
4343         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4344         with the same name.
4345
4346 2005-07-21  Raja R Harinath  <rharinath@novell.com>
4347
4348         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4349         already found a typebuilder.
4350         * class.cs (MethodCore.IsDuplicateImplementation): Compare
4351         MemberNames, not strings.
4352
4353         * const.cs (Error_ExpressionMustBeConst): 
4354         Rename from Error_EpressionMustBeConst.
4355         * const.cs, class.cs, statement.cd: Update.
4356
4357 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
4358
4359         Fix #65573
4360
4361         * const.cs (Const.LookupConstantValue): Report missing contant expression
4362         everytime.
4363         (Error_EpressionMustBeConstant): Only one error method.
4364
4365         * class.cs, statement.c: Updated.
4366
4367 2005-07-20  Raja R Harinath  <rharinath@novell.com>
4368
4369         * statement.cs (Block.Flags): Add back HasVarargs.
4370         (Block.flags): Make protected.
4371         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4372
4373         * typemanager.cs (types, typecontainers, user_types): Remove.
4374         (UserTypes, TypeContainers): Likewise.
4375         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4376         (CleanUp, Reset): Update.
4377         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
4378         (GetNestedType): Use Type.GetNestedType.
4379         (CoreLookupType): Take two arguments, the namespace and the
4380         basename of the type.  Update to use the Namespace.Lookup
4381         mechanism.
4382         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4383         (RealMemberLookup): Use IsNestedChildOf instead of playing with
4384         string concatenation and substring matches.
4385         * class.cs, enum.cs, delegate.cs: Update to changes.
4386
4387 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
4388
4389         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4390         Expression and made virtual.
4391
4392         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4393         (ImplicitStandardConversionExists): Fixed `byte' typo ?
4394
4395         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4396
4397         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4398         error message.
4399
4400         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4401         change.
4402
4403 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
4404
4405         Fix #57707
4406         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4407         AssemblyCultureAttribute is not used on executable.
4408
4409         * rootcontext.cs,
4410         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4411
4412 2005-07-16  Raja R Harinath  <rharinath@novell.com>
4413
4414         Fix #60638.
4415         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4416         New.  Reports CS0252/CS0253.
4417         Mostly taken from preliminary patch by Duncak Mak.
4418         (Binary.DoResolveOperator): Store results of operator lookup.
4419         Use them to detect if we need to warn about unintended reference
4420         comparisons.
4421
4422 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4423
4424         Fix #72969.
4425         * namespace.cs (Namespace.Lookup): Add back location parameter.
4426         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
4427         * delegate.cs, ecore.cs, expression.cs: Update to changes.
4428
4429         * codegen.cs (EmitContext.DeclSpace): Make readonly.
4430         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4431         (Namespace.LookupType): ... this.
4432         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4433         of namespaces.
4434         * typemanager.cs (LookupTypeReflection): Remove buggy code that
4435         purported to handle pointers.
4436         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4437         CoreLookupType.
4438
4439 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
4440
4441         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4442         type as namespace.
4443
4444 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4445
4446         * namespace.cs (Namespace.Lookup): Drop location parameter.
4447         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
4448         (NamespaceEntry.Lookup): ... this.
4449         (NamespaceEntry.Error_AmbiguousTypeReference):
4450         Move here from DeclSpace.
4451         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4452         names ...
4453         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4454         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4455         Move to NamespaceEntry.
4456         * delegate.cs, expression.cs: Update to changes.
4457
4458 2005-08-31  Martin Baulig  <martin@ximian.com>
4459
4460         Committing a patch from Atsushi Enomoto for #75850.
4461
4462         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
4463         Prefer a generic enumerator over a non-generic one.
4464
4465 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
4466
4467         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4468         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4469
4470 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4471
4472         * driver.cs : reverting default encoding change as well as mcs.
4473
4474 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4475
4476         * driver.cs, support.cs : merged r48826.
4477           Marek Safer wrote:
4478           > could you integrate your mcs changes to gmcs otherwise
4479           > gmcs cannot compile some files.
4480
4481 2005-08-20  Martin Baulig  <martin@ximian.com>
4482
4483         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4484         scope if we don't already have it.
4485
4486         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4487         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4488         fixes #75867.
4489
4490 2005-07-31  Miguel de Icaza  <miguel@novell.com>
4491
4492         * statement.cs: Copy the local exception into the exception
4493         captured local.  Fixes 75674
4494
4495 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
4496
4497         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4498         type as namespace.
4499
4500 2005-08-12  Martin Baulig  <martin@ximian.com>
4501
4502         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
4503         for nested types here to avoid hitting the cache too early.
4504
4505 2005-08-09  Miguel de Icaza  <miguel@novell.com>
4506
4507         * enum.cs: On the new compiler CLS error 3005 is now a warning not
4508         an error. 
4509
4510 2005-08-03  Martin Baulig  <martin@ximian.com>
4511
4512         Make iterators in generic methods work; see gtest-191.cs.
4513
4514         * generic.cs
4515         (Constraints.Resolve): Protect against being called twice.
4516
4517         * class.cs
4518         (TypeContainer.GetClassBases): Make this `protected virtual'.
4519
4520         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
4521         (Iterator.GetClassBases): Override this and compute the base
4522         classes here.
4523         (Iterator.DefineNestedTypes): If we're a generic method, all our
4524         method type parameters become class type parameters on the proxy
4525         class.
4526
4527         * statement.cs
4528         (ToplevelBlock.Parameters): Make this a property, not a field.
4529         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
4530
4531 2005-08-03  Martin Baulig  <martin@ximian.com>
4532
4533         * typemanager.cs (TypeManager.IsSubclassOf): Use
4534         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
4535         (TypeManager.GetFullName_recursed): Improved.
4536
4537 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4538
4539         Fix #75417
4540         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
4541         Private accessor case, using TypeManager.IsPrivateAccessible instead of
4542         invocation_type == mi.DeclaringType, since the first one also checks
4543         other condition used by generic instances.
4544         
4545 2005-07-27  Martin Baulig  <martin@ximian.com>
4546
4547         * anonymous.cs (CaptureContext.AddField): Added
4548         `AnonymousContainer am' argument; compute its toplevel scope if
4549         it's not already computed.  Fixes #75649.
4550
4551 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
4552
4553         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4554         CheckAttributeType and refactored.
4555         (Attribute.ResolvePossibleAttributeType): Changed to reuse
4556         ResolveAsTypeTerminal error handling.
4557         (ResolveAsTypeTerminal): Introduced because of global attributes extra
4558         handling.
4559         (GetSignatureForError): Print errors in same way.
4560
4561         * class.cs,
4562         * codegen.cs: Reflect attribute GetSignatureForError change.
4563
4564         * ecore.cs,
4565         * expression.cs: Add silent parameter to ResolveAsTypeStep.
4566
4567         * namespace.cs (UsingEntry): Refactored to make fields private.
4568
4569         * assign.cs,
4570         statement.cs: Error_UnexpectedKind has extra parameter.
4571
4572 2005-07-14  Raja R Harinath  <rharinath@novell.com>
4573
4574         * ecore.cs (IAlias): Remove.
4575         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
4576         that implement the interface.
4577         * namespace.cs (Namespace): Likewise.
4578         (Namespace.declspaces): Renamed from 'defined_names'.
4579         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
4580         DeclSpace instead of an IAlias.
4581         * tree.cs (Tree.AddDecl): Update.
4582
4583 2005-07-12  Raja R Harinath  <rharinath@novell.com>
4584
4585         * statement.cs (Block.Flags); Remove HasVarargs.
4586         (Block.HasVarargs): Move to ToplevelBlock.
4587         (Block.ThisVariable, Block.AddThisVariable): Likewise.
4588         (Block.Variables): Make protected.  Initialize variable hashtable
4589         if necessary.
4590         (Block.AddVariable): Update.
4591         (Block.Resolve): Update to changes.
4592         (ToplevelBlock.HasVarargs): New boolean.
4593         (ToplevelBlock.ThisVariable): Move here from Block.
4594         (ToplevelBlock.AddThisVariable): Likewise.
4595         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
4596         * expression.cs (This.ResolveBase): Update to changes.
4597         (ArglistAccess.DoResolve): Likewise.
4598
4599 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4600
4601         Fix #75321
4602         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4603
4604         * class.cs (TypeContainer.VerifyMembers): Distinguish between
4605         not used and not used & assigned.
4606         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4607
4608 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4609
4610         Fix #75053
4611         * expression.cs (Is.DoResolve): null is never provided type.
4612
4613 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
4614
4615         Fix #52496
4616         * cs-parser.jay: Less strict event error rule to catch more errors.
4617
4618 2005-07-11  Martin Baulig  <martin@ximian.com>
4619
4620         * generic.cs (ConstructedType.CheckConstraints): Improve the check
4621         for the constructor constraint: we do not only have to check
4622         whether the class has a public constructor, but also ensure that
4623         it's parameterless.  Fixes #75492.
4624
4625 2005-07-11  Martin Baulig  <martin@ximian.com>
4626
4627         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
4628         between type parameters if they either have the reference type
4629         constraint or the class constraint.
4630
4631 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
4632
4633         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
4634
4635 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
4636
4637         Fix #74975
4638         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4639         (ExtractSecurityPermissionSet): Cope with self referencing security
4640         attributes properly.
4641
4642         * driver.cs (SetOutputFile): Made public property OutputFile.
4643
4644 2005-07-07  Raja R Harinath  <rharinath@novell.com>
4645
4646         Fix #75486.
4647         * class.cs (TypeContainer.first_nonstatic_field): Rename from
4648         has_nonstatic_fields.  Make into a FieldBase pointer.
4649         (TypeContainer.AddField): Add CS0282 check.
4650         (TypeContainer.EmitType): Update.
4651
4652 2005-07-06  Miguel de Icaza  <miguel@novell.com>
4653
4654         * cs-tokenizer.cs (consume_identifier): Do not create strings to
4655         compare if they start with __.
4656
4657 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4658
4659         * statement.cs (Switch.SwitchGoverningType): Only look at
4660         UserCasts that don't need implicit standard conversions to one of
4661         the allowed switch types (Fixes test-322.cs).
4662         (LocalInfo.Resolve): Re-enable sanity-test.
4663
4664 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
4665
4666         * cs-tokenizer.cs (consume_identifier): Detect double undescores
4667         
4668         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4669         
4670         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4671
4672 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4673
4674         Fix #75472.
4675         * ecore.cs (SimpleName.GetSignatureForError): Add.
4676         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4677         (MemberAccess.GetSignatureForError): Add.
4678
4679 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
4680  
4681         The big error and warning messages review.
4682         
4683         * anonymous.cs,
4684         * assign.cs,
4685         * attribute.cs,
4686         * class.cs,
4687         * codegen.cs,
4688         * convert.cs,
4689         * cs-parser.jay,
4690         * cs-tokenizer.cs,
4691         * decl.cs,
4692         * delegate.cs,
4693         * doc.cs,
4694         * driver.cs,
4695         * ecore.cs,
4696         * enum.cs,
4697         * expression.cs,
4698         * flowanalysis.cs,
4699         * iterators.cs,
4700         * literal.cs,
4701         * location.cs,
4702         * modifiers.cs,
4703         * namespace.cs,
4704         * parameter.cs,
4705         * pending.cs,
4706         * report.cs,
4707         * rootcontext.cs,
4708         * statement.cs,
4709         * support.cs,
4710         * tree.cs,
4711         * typemanager.cs: Updated.
4712         
4713         * class.cs: (MethodCore.SetYields): Moved here to share.
4714         (PropertyMethod.Define): Moved iterator setup here.
4715         
4716         * iterators.cs: Add orig_method to have full access to parent
4717         container.
4718
4719 2005-07-05  Raja R Harinath  <rharinath@novell.com>
4720
4721         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4722         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4723         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4724         variable of struct type.
4725         * expression.cs (Unary.ResolveOperator): Update to change.
4726         (Indirection.VerifyFixed): Likewise.
4727         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4728         (ParameterReference.VerifyFixed): Value parameters are fixed.
4729         (This.VerifyFixed): Treat 'this' as a value parameter.
4730         * statement.cs (LocalInfo.IsFixed): Remove.
4731
4732 2005-07-01  Martin Baulig  <martin@ximian.com>
4733
4734         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4735         `ec.EmitThis ()' to get the correct scope.
4736
4737 2005-07-01  Martin Baulig  <martin@ximian.com>
4738
4739         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4740         instance is a ParameterReference; fixes #75299.
4741
4742 2005-06-30  Raja R Harinath  <rharinath@novell.com>
4743
4744         Fix #75412.
4745         * expression.cs (Indexers.map): Remove.
4746         (Indexers.Append): Filter out inaccessible setters and getters.
4747         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4748
4749         Fix #75283.
4750         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
4751         Refactored from ...
4752         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4753         (FieldExpr.Emit, PropertyExpr.Emit): Update.
4754         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4755         * expression.cs (Invocation.EmitCall): Add CS0120 check.
4756
4757 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
4758
4759         Fix #75322
4760         * class.cs (FieldBase.GetInitializerExpression): One more field
4761         for backup.
4762
4763 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4764
4765         * pending.cs: Do not define a proxy if the base method is virtual,
4766         it will be picked up by the runtime (bug 75270).
4767
4768 2005-07-08  Martin Baulig  <martin@ximian.com>
4769
4770         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4771         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4772
4773 2005-07-07  Martin Baulig  <martin@ximian.com>
4774
4775         * generic.cs (ConstructedType.CheckConstraint): Use
4776         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
4777         called recursively; fixes #75329.
4778
4779 2005-07-06  Martin Baulig  <martin@ximian.com>
4780
4781         * generic.cs (TypeManager.InferTypeArguments): Added support for
4782         anonymous methods; fixes #75461.
4783
4784 2005-07-01  Martin Baulig  <martin@ximian.com>
4785
4786         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4787         `ec.EmitThis ()' to get the correct scope.
4788
4789 2005-07-01  Martin Baulig  <martin@ximian.com>
4790
4791         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
4792         instance is `This'; fixes #75299.
4793
4794 2005-06-30  Martin Baulig  <martin@ximian.com>
4795
4796         * class.cs (Indexer): Implement IIteratorContainer; added support
4797         for iterators in indexers.
4798
4799         * codegen.cs
4800         (EmitContext.CurrentIterator): Make this a property, not a field.
4801
4802         * anonymous.cs (AnonymousContainer.Iterator): New public property.
4803
4804 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4805
4806         * pending.cs: Do not define a proxy if the base method is virtual,
4807         it will be picked up by the runtime (bug 75270).
4808
4809 2005-06-28  Martin Baulig  <martin@ximian.com>
4810
4811         * cs-parser.jay (interface_method_declaration): Avoid a
4812         reduce/reduce conflict by moving some of the code into a separate
4813         `interface_method_declaration_body' rule; fixes #75368.
4814
4815 2005-06-28  Martin Baulig  <martin@ximian.com>
4816
4817         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
4818         array check after the check for TypeBuilder's.
4819
4820 2005-06-21  Raja R Harinath  <rharinath@novell.com>
4821
4822         * convert.cs (FindMostEncompassedType): Add two trivial special
4823         cases (number_of_types == 0 || number_of_types == 1).
4824         (FindMostEncompasingType): Likewise.
4825
4826 2005-06-17  Raja R Harinath  <rharinath@novell.com>
4827
4828         Some cleanups preparing for the fix of #75283.
4829         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4830         error testing.
4831         (EventExpr.InstanceResolve): Likewise.
4832         (EventExpr.DoResolve): Remove redundant checks.
4833
4834 2005-06-08  Miguel de Icaza  <miguel@novell.com>
4835
4836         * class.cs: Small fix.
4837
4838 2005-06-08  Raja R Harinath  <rharinath@novell.com>
4839
4840         Fix #75160.
4841         * class.cs (GetPartialBases): Fix return value check of
4842         part.GetClassBases.
4843
4844 2005-06-07  Raja R Harinath  <rharinath@novell.com>
4845
4846         Ensure that partial classes are registered in their enclosing
4847         namespace.  Initial part of fix of #75160.
4848         * tree.cs (Tree.RecordDecl): Add new namespace argument.
4849         Register declspace with namespace here, not in
4850         DeclSpace.RecordDecl.
4851         * cs-parser.jay: Pass namespace to RecordDecl.
4852         * class.cs (PartialContainer.Create): Likewise.
4853         (ClassPart.DefineType): New sanity-check.  Throws an exception if
4854         called.
4855         * decl.cs (Declspace.RecordDecl): Remove.
4856         * namespace.cs (NamespaceEntry.DefineName): Remove.
4857
4858 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4859
4860         * rootcontext.cs: Reset TargetExt as well.
4861
4862 2005-06-03  Raja R Harinath  <rharinath@novell.com>
4863
4864         * ecore.cs (Expression.Resolve): Emit CS0654 error when
4865         -langversion:ISO-1.
4866
4867 2005-06-02  Raja R Harinath  <rharinath@novell.com>
4868
4869         Fix #75080, cs0119.cs.
4870         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
4871         of ...
4872         (Expression.Resolve): ... this.  Use it.  Remove bogus code
4873         allowing ExprClass.Type and ExprClass.Namespace for
4874         ResolveFlags.VariableOrValue.
4875         (Expression.Resolve) [1-argument variant]: Change default resolve
4876         flags based on language version.
4877         (Expression.Error_UnexpectedKind): Use a simple string array
4878         rather than an ArrayList.
4879         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4880         not ExprClass.Type.
4881         (TypeOfVoid.DoResolve): Likewise.
4882         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
4883         flags argument -- it always has the same value.
4884
4885 2005-05-31  Raja R Harinath  <rharinath@novell.com>
4886
4887         Fix #75081.
4888         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4889         Use it in the error message.
4890         * assign.cs, expression.cs, statement.cs: Update.
4891
4892 2005-05-30  Raja R Harinath  <rharinath@novell.com>
4893
4894         Fix #75088.
4895         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4896         the "almostMatchedMember" case too.
4897         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4898         that failed the accessibility checks to 'almost_match'.
4899
4900 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
4901
4902         * attribute.cs: Use internal MethodBuilder methods to set
4903         ExactSpelling and SetLastError on PInvoke methods, instead
4904         of passing them via charset.  Fixes #75060.
4905
4906 2005-05-27  Raja R Harinath  <rharinath@novell.com>
4907
4908         * parameter.cs (Parameter): Remove TODO comment.
4909         (Parameter.DefineParameter): Remove Location parameter.
4910         (Parameters.LabelParameters): Likewise.
4911         * class.cs (Constructor.Emit): Update to change.
4912         (MethodData.Emit): Likewise.
4913         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
4914         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4915
4916 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
4917
4918         * parameter.cs,
4919           Removed Parameters.Location and added Parameter.Location instead.
4920           Removed Location parameter from Emit() and GetSignature().
4921         * anonymous.cs,
4922           class.cs,
4923           cs-parser.jay,
4924           delegate.cs,
4925           iterators.cs,
4926           statement.cs :
4927           Modified all related calls.
4928
4929 2005-06-21  Martin Baulig  <martin@ximian.com>
4930
4931         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
4932         left-hand side is not a nullable type; fixes #75328.
4933
4934 2005-06-21  Martin Baulig  <martin@ximian.com>
4935
4936         * typemanager.cs
4937         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
4938         (TypeManager.GetFullNameSignature): Likewise.
4939
4940         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
4941         `source.FullName' and `target.FullName' to check whether there are
4942         two conflicting definitions.
4943
4944 2005-06-21  Martin Baulig  <martin@ximian.com>
4945
4946         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
4947         a BoxedCast - also for reference types - to be compatible with csc.
4948
4949 2005-06-21  Martin Baulig  <martin@ximian.com>
4950
4951         * expression.cs (MemberAccess.DoResolve): Add support for nested
4952         types in a generic instance; fixes #75320.
4953
4954 2005-06-20  Martin Baulig  <martin@ximian.com>
4955
4956         * generic.cs (TypeManager.InferType): Also walk the class
4957         hierarchy for generic instances; fixes #75261.
4958
4959 2005-06-17  Martin Baulig  <martin@ximian.com>
4960
4961         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
4962         to make things work for corlib.
4963
4964 2005-06-15  Martin Baulig  <martin@ximian.com>
4965
4966         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
4967         obsolete `SecurityAction' values.
4968
4969 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4970
4971         * rootcontext.cs: Reset TargetExt as well.
4972         
4973 2005-06-09  Martin Baulig  <martin@ximian.com>
4974
4975         * delegate.cs (Delegate.VerifyMethod): Added
4976         `MethodGroupExpr old_mg' argument; inherit its
4977         `HasTypeParameters'; fix #75085.
4978
4979 2005-06-09  Martin Baulig  <martin@ximian.com>
4980
4981         * expression.cs (Invocation.OverloadResolve): Correctly handle
4982         generic methods for the SetMemberIsUsed(); fix #75064.
4983
4984 2005-06-09  Martin Baulig  <martin@ximian.com>
4985
4986         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
4987         fixes #75062.
4988
4989 2005-06-08  Martin Baulig  <martin@ximian.com>
4990
4991         * cs-parser.jay (nullable_type_or_conditional): If we put the
4992         nullable back and our `type' is a `ComposedCast', remove the
4993         nullable from it.  Fixes #75156.
4994
4995         * expression.cs (ComposedCast.RemoveNullable): New public method.
4996
4997 2005-06-08  Martin Baulig  <martin@ximian.com>
4998
4999         The big Iterators rewrite :-)
5000
5001         * iterators.cs: Rewrite this to use the anonymous methods framework.
5002
5003         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
5004         before the TypeContainers; see 2test-21.cs.
5005
5006         * class.cs
5007         (TypeContainer.DefineType): Don't create a new EmitContext if we
5008         already have one (this only happens if we're an Iterator).
5009         (TypeContainer.Define): Also call Define() on all our iterators.
5010         (Method.CreateEmitContext): Added support for iterators.
5011
5012         * anonymous.cs
5013         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
5014         (AnonymousContainer.CreateMethodHost): Moved here from
5015         AnonymousMethod and made abstract.
5016         (AnonymousContainer.CreateScopeType): New abstract method.
5017         (AnonymousContainer.IsIterator): New public property.
5018         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
5019         get the ScopeTypeBuilder rather than manually defining it here. 
5020         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
5021         iterators here.
5022
5023         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
5024         before RootContext.DefineTypes().
5025
5026         * codegen.cs (EmitContext.RemapToProxy): Removed.
5027         (EmitContext.CurrentAnonymousMethod): Changed type from
5028         AnonymousMethod -> AnonymousContainer.
5029         (EmitContext.ResolveTopBlock): Protect from being called twice.
5030         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
5031         (EmitContext.EmitThis): Removed the iterators hacks; use the
5032         anonymous methods framework for that.
5033
5034         * statement.cs
5035         (ToplevelBlock.Container): Make this a property, not a field.
5036         (ToplevelBlock.ReParent): New public method; move the
5037         ToplevelBlock into a new container.
5038         (Foreach.TemporaryVariable): Simplify.
5039
5040 2005-06-05  Martin Baulig  <martin@ximian.com>
5041
5042         * statement.cs (LocalInfo.CompilerGenerated): New flag.
5043         (Block.AddTemporaryVariable): New public method; creates a new
5044         `LocalInfo' for a temporary variable.
5045         (Block.EmitMeta): Create the LocalBuilders for all the temporary
5046         variables here.
5047         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
5048         non-iterator variables.
5049
5050 2005-06-05  Martin Baulig  <martin@ximian.com>
5051
5052         * statement.cs (Foreach.TemporaryVariable): Create the
5053         LocalBuilder in the Emit phase and not in Resolve since in some
5054         situations, we don't have an ILGenerator during Resolve; see
5055         2test-19.cs for an example.
5056
5057 2005-06-04  Martin Baulig  <martin@ximian.com>
5058
5059         The big Foreach rewrite - Part II.
5060
5061         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
5062         with `PropertyInfo ienumerator_getcurrent'.
5063
5064         * codegen.cs (VariableStorage): Removed.
5065
5066         * statement.cs
5067         (Foreach): Derive from Statement, not ExceptionStatement.
5068         (Foreach.CollectionForeach): New nested class.  Moved all the code
5069         dealing with collection foreach here.
5070         (Foreach.ForeachHelperMethods): Removed.
5071         (Foreach.TemporaryVariable): Implement IMemoryLocation.
5072
5073 2005-05-23  Martin Baulig  <martin@ximian.com>
5074
5075         * statement.cs (Try.DoResolve): Don't create a `finally' if we
5076         don't need to.  Fix #75014.
5077
5078 2005-05-26  Raja R Harinath  <rharinath@novell.com>
5079
5080         Improve user-defined conversion handling.
5081         * convert.cs (GetConversionOperators): Rewrite.  Return only the
5082         applicable operators.
5083         (AddConversionOperators): New.  Helper for GetConversionOperators.
5084         (FindMostEncompassedType, FindMostEncompassingType): Verify that
5085         there is only one most encompassed/encompassing type.
5086         (FindMostSpecificSource, FindMostSpecificTarget): Remove
5087         "applicable operator" handling.
5088         (UserConversion): Move cache here from GetConversionOperators.
5089         Directly cache the chosen operator, rather than the whole
5090         MethodGroup.
5091         (ExplicitNumericConversion): Fix buggy implementation of Decimal
5092         case.  Allow conversion of decimal to sbyte and byte too.
5093         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5094         New static methods.  Used to avoid allocating EmptyExpressions in
5095         convert.cs.
5096
5097 2005-05-24  Duncan Mak  <duncan@novell.com>
5098
5099         * ecore.cs (CastFromDecimal): New class for casting a decimal to
5100         another class, used in Convert.ExplicitNumericConversion.
5101         (CastToDecimal): New class, similar to above, but casts to
5102         System.Decimal, used in Convert.ImplicitNumericConversion and also
5103         in explicit convesion from double/float to decimal.
5104
5105         * convert.cs (ImplicitNumericConversion): Handle implicit
5106         conversions to System.Decimal.
5107         (ExplicitNumericConversion): handle explicit conversions to
5108         System.Decimal.
5109
5110         This fixes #68711.
5111         
5112 2005-05-20  Miguel de Icaza  <miguel@novell.com>
5113
5114         * typemanager.cs: Do not throw an exception in the TypeBuilder
5115         case, we take care of it on the TypeCode.
5116
5117 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
5118         
5119         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
5120         is back.
5121         
5122         * cs-parser.jay: Catch more lexical errors.
5123         
5124         * report.cs: Add one more Error method.
5125         
5126         * rootcontext.cs,
5127         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
5128
5129 2005-05-20  Martin Baulig  <martin@ximian.com>
5130
5131         * class.cs (TypeContainer.CircularDepException): Removed.
5132         (TypeContainer.DefineType): Removed the `InTransit' stuff.
5133         (TypeContainer.CheckRecursiveDefinition): Check for circular class
5134         (CS0146) and interface (CS0529) dependencies here.
5135
5136 2005-05-20  Martin Baulig  <martin@ximian.com>
5137
5138         * expression.cs (New.DoResolve): Move the CS0712 check above the
5139         CS0144 check; otherwise it can never be reached.
5140
5141 2005-05-20  Martin Baulig  <martin@ximian.com>
5142
5143         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
5144
5145 2005-05-20  Martin Baulig  <martin@ximian.com>
5146
5147         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
5148
5149         * typemanager.cs (TypeManager.IsAttributeType): New public method.
5150
5151 2005-05-19  Martin Baulig  <martin@ximian.com>
5152
5153         * delegate.cs
5154         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
5155         to disable error reporting.
5156
5157         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
5158         here since we don't want to report an error; see the new test-336.cs.
5159
5160 2005-05-19  Raja R Harinath  <rharinath@novell.com>
5161
5162         * statement.cs (ToplevelBlock.GetParameterReference)
5163         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
5164         Move here from class Block.
5165         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
5166         * expression.cs (ParameterReference.DoResolveBase): Likewise.
5167
5168 2005-05-18  Martin Baulig  <martin@ximian.com>
5169
5170         Fix #74978.
5171
5172         * flowanalysis.cs
5173         (FlowBranching.Reachability): Add non-static public And() and Or()
5174         methods.
5175         (FlowBranchingSwitch): New class; do the `break_origins' thing
5176         like in FlowBranchingLoop.
5177         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5178         reachability, not just locals and parameters.
5179         (FlowBranching.MergeChild): Remove some of the hacks for loop and
5180         switch; MergeBreakOrigins() now takes care of that.
5181
5182 2005-05-18  Martin Baulig  <martin@ximian.com>
5183
5184         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5185         a loop and may leave it, reset the barrier; fixes #74974.
5186
5187 2005-05-16  Raja R Harinath  <rharinath@novell.com>
5188
5189         Fix test-382.cs.  Emit values of decimal constants.
5190         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5191         Carved out of ...
5192         (TypeContainer.AddField): ... this.
5193         (TypeContainer.EmitFieldInitializers): Allow the list of fields
5194         with initializers to include 'Const's.
5195         (ClassPart.RegisterFieldForInitialization): Forward to
5196         PartialContainer.
5197         * const.cs (Const.Const): Pass initializer to base class.
5198         (Const.Define): In case of decimal constants, register them for
5199         initialization in a static constructor.
5200
5201 2005-05-14  Martin Baulig  <martin@ximian.com>
5202
5203         * statement.cs (Block.Resolve): Correctly handle unreachable code;
5204         do not call ResolveUnreachable() on unreachable statements in
5205         here, see the comment in the source code.
5206
5207 2005-05-13  Raja R Harinath  <rharinath@novell.com>
5208
5209         Fix #74934.
5210         * expression.cs (BinaryResolveOperator): If one of the operands of
5211         an equality comparison is 'null' and the other is a pointer type,
5212         convert the null to a NullPointer.
5213         * convert.cs (ImplicitReferenceConversion): If the expression is a
5214         NullLiteral and the target type is a pointer type, return a
5215         NullPointer instead.
5216         (ImplicitConversionStandard): Likewise.
5217
5218 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
5219         
5220         * cs-parser.jay: Set readonly context based on special constructs.
5221         
5222         * expression.cs (LocalVariableReference.DoResolveBase): Improved
5223         readonly variable error handling.
5224         
5225         * rootcontext.cs (EmitCode): Don't verify members when error
5226         occurred.
5227         
5228         * statement.cs (LocalInfo): Add reaodnly context information.
5229         (SetReadOnlyContext, GetReadOnlyContext): New methods.
5230
5231 2005-05-17  Martin Baulig  <martin@ximian.com>
5232
5233         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5234         #70970. 
5235
5236 2005-05-13  Martin Baulig  <martin@ximian.com>
5237
5238         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
5239         handle unreachable blocks.
5240
5241 2005-05-13  Martin Baulig  <martin@ximian.com>
5242
5243         * class.cs
5244         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
5245         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
5246         #74905. 
5247
5248 2005-05-13  Martin Baulig  <martin@ximian.com>
5249
5250         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5251         instance variable, not a local.  Fix #74873.
5252         (Block.ResolveUnreachable): Set it to true here.
5253
5254 2005-05-12  Martin Baulig  <martin@ximian.com>
5255
5256         * cs-parser.jay (property_declaration): Pass the `current_class',
5257         not the `current_container' to Property's .ctor.  Fixes #74912.
5258
5259 2005-05-11  Martin Baulig  <martin@ximian.com>
5260
5261         * typemanager.cs (Closure): Copy this from MCS and merge all the
5262         GMCS-specific changes into it.
5263
5264 2005-05-12  Raja R Harinath  <harinath@gmail.com>
5265
5266         Fix #74920.
5267         * typemanager.cs (unmanaged_enclosing_types): New.
5268         (IsUnmanagedType): Avoid infloops by using
5269         'unmanaged_enclosing_types' to talk with recursive invocations.
5270
5271 2005-05-11  Duncan Mak  <duncan@novell.com>
5272
5273         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5274         continuing to process for 'arg'.
5275         (handle_preprocessing_directive): Check the argument of the #endif
5276         directive and report error CS1025 if there are any trailing
5277         characters.
5278
5279         According to the C# spec, having even whitespace after the #endif
5280         directive is illegal; however, because we call arg.TrimEnd ()
5281         beforehand, we have the same behavior as csc, allowing whitespace
5282         after the directive.
5283
5284         Fixes #74892.
5285
5286 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
5287
5288         Fix #74863.
5289         
5290         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5291         (Constructor.GetObsoleteAttribute): Implemented correctly.
5292
5293 2005-05-10  Martin Baulig  <martin@ximian.com>
5294
5295         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
5296         resolve the type; fixes #74864.
5297         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
5298         in DoResolve(); fixes #74862.
5299
5300 2005-05-10  Martin Baulig  <martin@ximian.com>
5301
5302         * support.cs (ReflectionParameters.ParameterModifier): Use
5303         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5304         and `ParameterAttributes.In'.  Fixes #74884.
5305
5306 2005-05-10  Martin Baulig  <martin@ximian.com>
5307
5308         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
5309         the cache if we're just looking for `MemberTypes.NestedType' in a
5310         generic instance.
5311
5312         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
5313         constraints if we're still resolving the type tree.
5314         (Expression.MemberLookup): If we're resolving the type tree, only
5315         look for `MemberTypes.NestedType' since we're only interested in
5316         getting types.
5317
5318         * class.cs (TypeContainer.DefineType): Don't resolve the type
5319         parameters here; do this later in ResolveType() after the type
5320         tree has been resolved.
5321         (TypeContainer.ResolveType): New public method; this is called
5322         after the type tree is resolved and before the types are being
5323         populated.  We resolve the generic constraints here.
5324         (TypeContainer.DoDefineMember): Check the constraints on our base
5325         class and interfaces.
5326
5327         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
5328         set the `ResolvingTypeTree' flag on the EmitContext.
5329
5330         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
5331
5332 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
5333
5334         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5335         
5336         * expression.cs (Argument.GetParameterModifier): Turned to property.
5337         (Invocation.Error_InvalidArguments): Add more descriptive errors.
5338         
5339         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5340         its C# equivalent.
5341         
5342 2005-05-09  Raja R Harinath  <rharinath@novell.com>
5343
5344         Fix #74852.
5345         * decl.cs (MemberCache.AddMethods): Register override methods,
5346         rather than non-override methods.
5347         * typemanager.cs (RegisterOverride): New.
5348         (IsOverride): Update.
5349
5350 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
5351
5352         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
5353
5354 2005-05-06  Martin Baulig  <martin@ximian.com>
5355
5356         * attribute.cs
5357         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
5358         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
5359
5360 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
5361
5362         Fix #73105.
5363         
5364         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5365         recursive declaration.
5366         
5367         * statement.cs (Block.ResolveMeta): Report any error in resolving.
5368         
5369 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
5370
5371         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5372         
5373         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5374
5375 2005-05-05  Raja R Harinath  <rharinath@novell.com>
5376
5377         Fix #74797.
5378         * decl.cs (DeclSpace.FamilyAccessible): 
5379         Use TypeManager.IsNestedFamilyAccessible.
5380
5381         Fix reopened #64812.
5382         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5383         internal'.
5384
5385 2005-05-04  Raja R Harinath  <rharinath@novell.com>
5386             Abin Thomas  <projectmonokochi@rediffmail.com>
5387             Anoob V E  <projectmonokochi@rediffmail.com>
5388             Harilal P R  <projectmonokochi@rediffmail.com>
5389
5390         Fix #64812.
5391         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5392         allow access to all static members.
5393
5394 2005-05-04  Martin Baulig  <martin@ximian.com>
5395
5396         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5397
5398 2005-05-04  Martin Baulig  <martin@ximian.com>
5399
5400         Fix #74655.
5401
5402         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5403         section at the end; make things work if `default' is not the last
5404         section.        
5405
5406 2005-05-04  Martin Baulig  <martin@ximian.com>
5407
5408         Fix #70400.
5409
5410         * statement.cs (Switch): Replaced the `got_default' field with a
5411         `default_section' one.
5412         (Switch.CheckSwitch): Set `default_section' here.
5413         (Switch.Resolve): If we're a constant switch and the constant is
5414         not found, use the default section.
5415
5416 2005-05-03  Martin Baulig  <martin@ximian.com>
5417
5418         * expression.cs (ArrayAccess.EmitGetLength): New public method.
5419
5420         * statement.cs (Foreach.ArrayForeach): New nested class.
5421         (Foreach.TemporaryVariable): New nested class.
5422         (Foreach.EmitArrayForeach): Removed; this is now in the new
5423         ArrayForeach class.
5424
5425 2005-05-03  Raja R Harinath  <rharinath@novell.com>
5426
5427         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
5428         more conservative.
5429         (VerifyPendingMethods): Revert change below.
5430
5431         * typemanager.cs (IsOverride, RegisterNonOverride): New.
5432         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5433         that used to trigger warning -28.  Remove warning -28.
5434         * expression.cs (Invocation.OverloadResolve): Use
5435         TypeManager.IsOverride to distinguish override methods.
5436
5437         Fix #74773.
5438         * pending.cs (VerifyPendingMethods): If a base type implements the
5439         requested interface, don't bother checking individual methods of
5440         the base type.  As a side-effect, this prevents the creation of
5441         unnecessary proxies.
5442
5443 2005-05-02  Martin Baulig  <martin@ximian.com>
5444
5445         Fix #70182.
5446
5447         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5448         Also `And' the locals if the old vector is null.
5449         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5450         null; in this case we basically reset all the variables.        
5451
5452 2005-05-02  Martin Baulig  <martin@ximian.com>
5453
5454         Fix #74529.
5455
5456         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5457         Added `FlowBranching branching' argument; always `and' the
5458         variables instead of `or'ing them unless we're an infinite loop.
5459
5460         * statement.cs (While.Resolve): Create a new sibling unless we're
5461         infinite.       
5462
5463 2005-05-02  Martin Baulig  <martin@ximian.com>
5464
5465         Fix #70140.
5466
5467         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5468         arguments; use it instead of creating a new TopLevelBlock.
5469         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5470         our ConstructorInitializer.
5471
5472         * statement.cs
5473         (TopLevelBlock.TopLevelBranching): New public property.
5474         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5475         and create our `TopLevelBranching'.
5476
5477         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5478         anonymous method host, use `block.TopLevelBranching' rather than
5479         creating a new branching.
5480
5481 2005-04-20  Miguel de Icaza  <miguel@novell.com>
5482
5483         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5484         a ScopeInfo, if any of the current children is a child of the new
5485         entry, move those children there.
5486
5487 2005-04-30  Martin Baulig  <martin@ximian.com>
5488
5489         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5490         at the beginning of a SwitchSection.  Fix #73335.
5491
5492 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
5493
5494         Fix #74378
5495         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5496         
5497         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5498         (FieldExpr.DoResolve): Obsolete members are ignored for field
5499         initializers.
5500         
5501 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
5502
5503         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5504         of arrays detection.
5505
5506         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5507         verification.
5508         (Field.VerifyClsCompliance): Volatile fields are not compliant.
5509
5510         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5511         arrays report.
5512
5513 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
5514
5515         * cs-parser.jay: Use the prefered version of -unsafe in error
5516         message.
5517
5518 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
5519
5520         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5521         circumstances.
5522
5523 2005-04-20  John Luke  <john.luke@gmail.com>
5524
5525         * driver.cs: fix typo in error message, --outout to --output
5526
5527 2005-04-30  Martin Baulig  <martin@ximian.com>
5528
5529         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
5530         handle the .NET 2.x security attributes.
5531
5532 2005-04-30  Martin Baulig  <martin@ximian.com>
5533
5534         * typemanager.cs
5535         (TypeManager.ExpandInterfaces): Don't add things twice.
5536
5537         * class.cs
5538         (TypeContainer.VerifyClsCompliance): Allow generic instances.
5539
5540 2005-04-29  Martin Baulig  <martin@ximian.com>
5541
5542         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
5543
5544         * anonymous.cs: Added support for anonymous generic methods.
5545
5546 2005-04-29  Martin Baulig  <martin@ximian.com>
5547
5548         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
5549         generic instances.
5550
5551 2005-04-29  Martin Baulig  <martin@ximian.com>
5552
5553         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
5554
5555         * expression.cs (New.DoResolve): Fix the CS0304 check.
5556
5557 2005-04-29  Martin Baulig  <martin@ximian.com>
5558
5559         * typemanager.cs (TypeManager.GetFullName): Updated to the new
5560         naming schema.
5561
5562         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
5563         explicit interface implementation, compare the interface types.
5564         (MethodData.Define): Use the new naming scheme from the latest
5565         .NET 2.x beta2.
5566         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
5567
5568         * decl.cs (MemberName.GetMemberName): Removed.
5569         (MemberName.MethodName, FullName): New properties.
5570
5571 2005-04-25  Raja R Harinath  <rharinath@novell.com>
5572
5573         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
5574
5575 2005-04-22  Martin Baulig  <martin@ximian.com>
5576
5577         * generic.cs (GenericMethod): Create the EmitContext in the
5578         `Define()'; in `Define(MethodBuilder)', create the type parameters
5579         before calling `Define()'.  Fixes #73933.
5580
5581 2005-04-22  Martin Baulig  <martin@ximian.com>
5582
5583         * generic.cs
5584         (Constraints.Resolve): Make things work wrt. the new type lookup system.
5585         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
5586
5587         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
5588         ConstructedType, check its constraints.
5589
5590 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
5591
5592         * codegen.cs (InRefOutArgumentResolving): New field.
5593         
5594         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5595         fields outside contructor.
5596         
5597         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5598         
5599 2005-04-19  Miguel de Icaza  <miguel@novell.com>
5600
5601         * anonymous.cs (CaptureContext.EmitParameterInstance): The
5602         parameter code was not completed ever, so it was not as up-to-date
5603         as local variables.  Must finish it.
5604
5605         The bug fix was to compare the Toplevel of the block, not the
5606         current block.  Thanks for Ben for pointing this out. 
5607
5608 2005-04-19  Raja R Harinath  <rharinath@novell.com>
5609
5610         * decl.cs (AddMethods): Use the declaring type of the problem
5611         method to determine if we want to squash a warning.
5612
5613 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
5614
5615         * attribute.cs: Removed debug output.
5616
5617         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5618         
5619         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5620         Report.Stderr.
5621         
5622 2005-04-18  Raja R Harinath  <rharinath@novell.com>
5623
5624         Fix #74481.
5625         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5626         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5627         all null comparisons against reference types.
5628
5629 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
5630
5631         Fix# 74565
5632         * class.cs (TypeContainer.CircularDepException) New nested
5633         exception class.
5634         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5635         (TypeContainer.DefineType): Removed error, reset InTransit before
5636         exit.
5637         (Class.DefineType): Throw exception when is in Transit.
5638         Catch exception and report error.
5639         (Struct.DefineType): Throw exception when is in Transit.
5640         Catch exception and report error.
5641         (Interface.DefineType): Throw exception when is in Transit.
5642         Catch exception and report error.
5643
5644         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5645         handle nested exception handlers.
5646
5647         * flowanalysis.cs (InTryWithCatch): New method, search for try with
5648         a catch.
5649
5650         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5651         InFinally and InCatch storage.
5652
5653         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5654         (Catch.Resolve): Set and Restore ec.InCatch.
5655         (Try.Resolve): Set and Restore ec.InFinally.
5656         (Try.HasCatch): True when try has catch.
5657
5658 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
5659
5660         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5661           for the same event member, so exclude such cases from warning 419.
5662           Fixed bug #74633.
5663
5664 2005-04-16  Miguel de Icaza  <miguel@novell.com>
5665
5666         * expression.cs (Binary.ResolveOperator): Apply patch from John
5667         Luke to fix bug 59864: operators &, | and ^ on enumerations
5668         require that the same enum type on both sides.
5669
5670         * driver.cs: Add warnings to old flag usage, this is to assist
5671         people who produce Makefiles and hope that the Makefiles will be
5672         used on Windows.
5673
5674         * class.cs (TypeContainer.EmitType): Moved the definition of the
5675         special $PRIVATE$ field from the resolve phase to the Emit phase.
5676         During resolve we do not know if we are a struct with
5677         HasExplicitLayout, we know this only after the attributes for the
5678         type are emitted.
5679
5680         Set the FieldOffset to zero on the dummy field that we create for
5681         the class.   Fixes 74590.
5682
5683 2005-04-16  Raja R Harinath  <rharinath@novell.com>
5684
5685         Fix #73834.
5686         * ecore.cs (PropertyExpr.resolved): New.
5687         (DoResolve): Use it to handle a case of double resolution here.
5688         Handle a case of identical-name-and-type-name.
5689         * expression.cs (ArrayCreation.CheckIndices): Avoid double
5690         resolution by storing the results of expression resolution back
5691         into the "probes" array.
5692
5693 2005-04-15  Raja R Harinath  <rharinath@novell.com>
5694
5695         Fix cs0208-7.cs and cs0208-8.cs.
5696         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5697         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
5698         error reporting to point out the reason a struct is not unmanaged.
5699
5700 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5701
5702         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
5703           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5704
5705 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5706
5707         Fix #74528.
5708         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5709         IdenticalNameAndTypeName here.
5710         (EventExpr.InstanceResolve): Likewise.
5711
5712 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
5713
5714         C# 2.0 DefaultCharSetAttribute implementation
5715         
5716         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5717         which allows us to set GlobalNamespace for every resolve.
5718         (Attribute.ResolveArguments): Cut from Resolve.
5719         (Attribute.GetCharSetValue): Returns CharSet named argument.
5720         (Attribute.DefinePInvokeMethod): Gets default charset from
5721         module settings.
5722         (GlobalAttribute.ResolveAsTypeStep): Override.
5723         (GlobalAttribute.ResolveArguments): Override.
5724         
5725         * class.cs (TypeAttr): Is protected.
5726         
5727         * codegen.cs (ModuleClass.DefaultCharSet): New member.
5728         (ModuleClass.DefaultCharSetType): New memeber.
5729         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5730         
5731         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5732         charset from module.
5733         
5734         * delegate.cs (TypeAttr): Override.
5735         (Delegate.DefineType): Use this TypeAttr.
5736         
5737         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5738         at very early stage (before types are defined) to resolve model
5739         module attributes. It will probably not work with corlib but it
5740         should be ok.
5741         
5742         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5743         charset from module.
5744         
5745         * typemanager.cs (default_charset_type): New type.
5746
5747 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5748
5749         * decl.cs (MemberCache.AddMethods): Don't warn if
5750         System.Object.Finalize has buggy MethodAttributes.
5751
5752         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5753         removed below.
5754
5755 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5756
5757         * doc.cs : detect ambiguous reference to overloaded members.
5758           Fixed bug #71603. MS 1.1 csc does not detect it.
5759
5760 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5761
5762         * doc.cs : delegates must not be referenced with parameters.
5763           Fixed bug #71605.
5764
5765 2005-04-12  Miguel de Icaza  <miguel@novell.com>
5766
5767         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5768
5769 2005-04-10  Miguel de Icaza  <miguel@novell.com>
5770
5771         * driver.cs (MainDriver): Stop processing if the CLS stage found
5772         errors. 
5773
5774         (CompilerCallableEntryPoint.InvokeCompiler): Always
5775         reset after execution;   Take a TextWriter argument for the
5776         output.
5777
5778         * report.cs: Use the error stream instead of hardcoding stderr. 
5779
5780 2005-04-09  Miguel de Icaza  <miguel@novell.com>
5781
5782         * class.cs: Reduce code paths to test, too small of an
5783         optimization to make it worth the extra testing.  Always perform
5784         it. 
5785
5786 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5787
5788         Fix #74510.
5789         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5790         operators that had errors reported on them.
5791
5792 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
5793
5794         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5795         argument types.
5796         (Attribute.Resolve): Add named argument type checking.
5797         
5798         * class.cs (FixedField.Define): Use IsPrimitiveType
5799         
5800         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5801         
5802         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5803         unsafe parameter types.
5804         
5805         * statement.cs (Using.ResolveExpression): Add better error description.
5806         
5807         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5808         
5809 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5810
5811         Fix #74484.
5812         * attribute.cs (Attribute.GetAttributeUsage): Resolve
5813         AttributeUsageAttribute in the emitcontext of the attribute class,
5814         not in the emitcontext of the attributable entity it was attached to.
5815         * cs-parser.jay: Use 'current_class', not 'current_container',
5816         when creating a GlobalAttribute.
5817
5818 2005-04-08  Alp Toker  <alp@atoker.com>
5819
5820         * pending.cs: The fix to #58413 failed to compile methods implementing
5821         interfaces with/without params modifiers and vice versa, even though
5822         params modifiers aren't part of the signature. Make the modifier check
5823         less strict as in csc.
5824
5825 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
5826             Anoob V E  <projectmonokochi@rediffmail.com>
5827             Harilal P R  <projectmonokochi@rediffmail.com>
5828
5829         Fix #58413.
5830         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
5831         modifiers of pending methods.
5832         (PendingImplementation.PendingImplementation): Initialize it.
5833         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5834         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5835         with ParameterData.  Add check for modifiers.
5836         * class.cs (MethodData.Define): Update to changes.
5837
5838 2005-04-07  Raja R Harinath  <rharinath@novell.com>
5839
5840         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5841
5842 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
5843
5844         * class.cs (PropertyMethod.Define): Check private accessor in abstract
5845         property.
5846         
5847         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5848         
5849         * rootcontext.cs,
5850         * typemanager.cs: Registered RequiredAttributeAttribute.
5851         
5852 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
5853
5854         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5855         Warning CS0169 is back at level 3.
5856         (IMethodData.SetMemberIsUsed): New method.
5857         
5858         * decl.cs (IsUsed): New value; moved from FieldBase.Status
5859         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5860         
5861         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5862
5863         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5864         contants.
5865         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5866         is used.
5867         
5868         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5869         is used.
5870         
5871         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5872         to avoid the problems with nested types.
5873
5874 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
5875             Anoob V.E  <projectmonokochi@rediffmail.com>
5876             Harilal P.R  <projectmonokochi@rediffmail.com>
5877             Raja R Harinath  <rharinath@novell.com>
5878
5879         Fix #73820.
5880         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5881         attribute.
5882         * typemanager (GetConstructor): Make public.
5883
5884 2005-04-05  John Luke  <john.luke@gmail.com>
5885             Raja R Harinath  <rharinath@novell.com>
5886
5887         Fix #62232.
5888         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5889         struct too.  Return false quicker in a few cases.
5890         (VerifyUnManaged): Use it.
5891
5892 2005-04-05  Raja R Harinath  <rharinath@novell.com>
5893
5894         Fix #74041.
5895         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5896         not 'unreachable_seen'.
5897
5898 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
5899
5900         * attribute.cs (Attribute.GetValue): Removed unused.
5901         
5902         * codegen.cs (CodeGen.TrimExt): Removed unused.
5903         
5904         * cs-parser.jay (output): Removed unused.
5905         
5906         * cs-tokenizer.cs (hex_digits): Removed unused.
5907         
5908         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5909         
5910         * expression.cs (Indirection.LoadExprValue): Removed unused.
5911         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5912         
5913         * iterators.cs (Iterator.param_types): Removed unused.
5914         
5915         * statement.cs (Goto.block): Removed unused.
5916         (ToplevelBlock.did): Removed unused.
5917         (Switch.ResolveConstantSwitch): Removed unused.
5918
5919 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
5920
5921         * rootcontext.cs: Allow mcs to bootstrap with the compilation
5922         resetting thingy.
5923
5924 2005-04-19  Martin Baulig  <martin@ximian.com>
5925
5926         Merged r42462 from MCS and made it work for GMCS.
5927
5928         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
5929
5930         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
5931
5932 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5933
5934         Fix #74232 and cs0208-3.cs.
5935         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5936         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5937         unmanaged type.  Don't use FieldBuilders when 't' is a
5938         TypeBuilder.  Use ModFlags and MemberType fields.
5939         * class.cs (MemberBase.member_type): Rename from MemberType.
5940         (MemberBase.MemberType): New property.  Determines member_type on
5941         demand.
5942         (MemberBase.DoDefine): Don't initialize MemberType here.
5943         (FieldMember.Define): Likewise.
5944
5945 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
5946
5947         Fix #74241
5948         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5949         Attributes are emitted there.
5950         
5951 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5952
5953         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5954         keyword in 'partial enum' too.
5955         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5956         is not allowed).
5957         Report from Kamil Skalski <nazgul@omega.pl>.
5958
5959         Fix #74309.
5960         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5961         have partial containers too.
5962
5963         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5964         in block' checks to Block.CheckInvariantMeaningInBlock.
5965         * statement.cs (Block.GetKnownVariableInfo): Make private.
5966         (Block.IsVariableUsedInChildBlock): Remove.
5967         (Block.IsVariableUsedInBlock): Likewise.
5968         (Block.CheckInvariantMeaningInBlock): New.  Show location of
5969         conflicting declaration.
5970         (Block.AddVariable): Make error messages less long-winded and more
5971         specific.  Show location of conflicting declaration.
5972         * parameter.cs (Parameters.Location): New readonly property.
5973
5974 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5975
5976         Clean up semantics of invoking ResolveMemberAccess.
5977         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5978         can have an instance, ensure that we pass in a non-TypeExpression
5979         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
5980         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5981         argument.  Update to changes and simplify.
5982         (FieldExpr.Emitinstance): Remove CS0120 check.
5983         (PropertyExpr.EmitInstance): Likewise.
5984         * expression.cs (Argument.Resolve): Likewise.
5985         (Invocation.DoResolve): Update to changes in semantics of
5986         InstanceExpression.
5987
5988 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
5989
5990         Fix #74241
5991         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5992         customization.
5993         
5994         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5995
5996 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5997
5998         Fix difference in behaviour with commandline invocation.
5999         * driver.cs (Driver.Reset): New.
6000         (CompilerCallableEntryPoint): Call it.
6001
6002         * statement.cs (If.Resolve): Avoid spurious "uninitialized
6003         variable" warnings if the boolean expression failed to resolve.
6004
6005 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
6006
6007         * attribute.cs: Fix the union of several permissions when some of them
6008         are unrestricted (so the result isn't an unrestricted permission set).
6009         Fix #74036.
6010
6011 2005-03-30  Raja R Harinath  <rharinath@novell.com>
6012
6013         * ecore.cs (MemberExpr): New class.  Convert from interface
6014         IMemberExpr.
6015         (MemberExpr.ResolveMemberAccess): Refactor and move here from
6016         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
6017         error checks.
6018         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
6019         (MethodGroupExpr.IsExplicitImpl): Remove.
6020         (Expression.GetFieldFromEvent): Remove.
6021         (SimpleName.MemberStaticCheck): Remove.
6022         (SimpleName.DoSimpleNameResolve): Update to changes.
6023         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
6024         (MemberAccess.IdenticalNameAndTypeName): Remove.
6025         (MemberAccess.error176): Move to MemberExpr.
6026         (MemberAccess.DoResolve): Update to changes.
6027         (BaseAccess.DoResolve): Likewise.
6028
6029 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
6030
6031         C# 2.0 Conditional attribute class implementation
6032         
6033         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
6034         Analyzes class whether it has attribute which has ConditionalAttribute
6035         and its condition is not defined.
6036         
6037         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
6038         (Class.IsExcluded): New method. Search for at least one defined
6039         condition in ConditionalAttribute of attribute class.
6040
6041 2005-03-30  Raja R Harinath  <rharinath@novell.com>
6042
6043         * ecore.cs (PropertyExpr): Derive from Expression, not
6044         ExpressionStatement.
6045         (PropertyExpr.EmitStatement): Remove.
6046
6047 2005-03-29  Raja R Harinath  <rharinath@novell.com>
6048
6049         Fix #74060.
6050         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
6051         internal field "value__" of an enum be private.  The examples for
6052         "value__" that I found on MSDN all used FieldAttributes.Private.
6053
6054         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
6055         Don't mention IL method attribute names.
6056
6057         Fix #47991.  Remove a TODO.
6058         * statement.cs (Block.Toplevel): Make into a field.
6059         (Block.Parameters): Move into ToplevelBlock.
6060         (Block.known_variables): Rename from child_variable_names.
6061         (Block.Block): Remove variants that take Parameters.  Initialize
6062         'Toplevel' with the immediately surrounding toplevel block.
6063         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
6064         LocalInfo parameter.
6065         (Block.GetKnownVariableInfo): New.
6066         (Block.IsVariableNameUsedInChildBlock): Update.
6067         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
6068         the block, even though it may not be in scope.
6069         (Block.AddVariable): Remove Parameters parameter.  Use
6070         Toplevel.Parameters instead.
6071         (Block.AddConstant): Remove Parameters parameter.
6072         (Block.GetParameterReference): Update to use Toplevel.Parameters.
6073         (Block.IsParamaterReference): Likewise.
6074         (Block.IsLocalParameter): Likewise.  Simplify a lot.
6075         (ToplevelBlock.Parameters): New.  Moved from Block.
6076         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
6077         initialize Parameters to a non-null value.
6078         * cs-parser.jay: Update to changes.
6079         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
6080         simple names that mean different things in the same block.  Use
6081         Block.IsVariableNameUsedInBlock.
6082
6083 2005-03-28  Raja R Harinath  <rharinath@novell.com>
6084
6085         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
6086
6087 2005-03-26  Raja R Harinath  <harinath@acm.org>
6088
6089         Fix #73038.
6090         * assign.cs (Assign.DoResolve): When the RHS of an assignment
6091         fails to resolve, ensure that the LHS is still resolved as an
6092         lvalue.
6093
6094 2005-03-25  Raja R Harinath  <harinath@acm.org>
6095
6096         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
6097         ec.ContainerType.
6098         (Enum.current_ec): Remove.
6099         (Enum.LookupEnumValue): Remove EmitContext argument.
6100         Just uses the one created during DefineType.
6101         (Enum.FindMembers): Update.
6102         * expression.cs (MemberAccess.DoResolve): Update.
6103
6104 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
6105
6106         * assign.cs (Assign.DoResolve): Check for CS1717 when
6107         source and target are same (uses Equals).
6108
6109         * expression.cs (LocalVariableReference, ParameterReference,
6110         This): Implemented Equals, GetHashCode.
6111
6112         * statement.cs (Block.GetParameterReference): Removed useless
6113         local variable.
6114
6115 2005-03-22  Raja R Harinath  <rharinath@novell.com>
6116
6117         Fix cs0128.cs
6118         * statement.cs (Block.AddVariable): Ensure that we skip implicit
6119         blocks before deciding whether the error is cs0136 or cs0128.
6120
6121         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
6122         (using_alias_directive, using_namespace_directive): Pass
6123         MemberName, not an expression to Namespace.UsingAlias and
6124         Namespace.Using.
6125         (MakeName): Use the MemberName of the namespace.
6126         * namespace.cs (Namespace.MemberName): New.
6127         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
6128         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
6129         Likewise.
6130         * decl.cs (MemberName.Name): Make readonly.
6131         (MemberName.FromDotted): New "constructor".
6132         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
6133         (MemberCore.Name): Compute from MemberName on demand.
6134         (MemberCore.SetMemberName): Provide a way to change the
6135         MemberName.
6136         (MemberCore.AddToContainer): Don't take a fullname parameter.
6137         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
6138         fully qualified name of the container to the member name.
6139         (TypeContainer.AddToTypeContainer): Use a fully qualified name
6140         only if the type is a member of the root container.
6141         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
6142         MemberName.Left rather than searching for an embedded ".".
6143         (PartialContainer.CreatePart): Update to changes in RootContext.
6144         (MemberBase.ShortName): Turn into a property.  Use
6145         MemberCore.SetMemberName.
6146         (MemberBase.ExplicitInterfaceName): Remove.
6147         (MemberBase.UpdateMemberName): Remove.
6148         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
6149         (PropertyBase.SetMemberName): New override.
6150         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
6151         (Tree.GetDecl): New.
6152         (Tree.AllDecls): Rename from Decls.
6153         * attribute.cs, enum.cs, report.cs: Update to changes.
6154         * driver.cs (MainDriver): Use MemberName.FromDotted on
6155         RootContext.MainClass.
6156
6157 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
6158
6159         * class.cs (FixedField.Define): Check for CS1664 and more sanity
6160         checks.
6161
6162         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
6163
6164 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
6165
6166         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
6167         property accessor modifiers.
6168
6169         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
6170         fixed buffer attribute (CS1716).
6171         (PropertyMethod.HasCustomAccessModifier): When property accessor
6172         has custom modifier.
6173
6174         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6175         modifiers.
6176         (PropertyExpr.DoResolveLValue): Add CS0272.
6177
6178 2005-03-17  Miguel de Icaza  <miguel@novell.com>
6179
6180         * convert.cs: When converting to a pointer, use the proper Conv.U
6181         or Conv.I depending on the source data type.
6182
6183         * cs-tokenizer.cs: Make the size for large decimal constants,
6184         fixes #72957.
6185
6186 2005-03-17  Martin Baulig  <martin@ximian.com>
6187
6188         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6189         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
6190
6191 2005-03-17  Martin Baulig  <martin@ximian.com>
6192
6193         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6194         to bool so we can return an error condition.
6195         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6196         returned an error.
6197
6198 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
6199
6200         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6201         attributes.
6202
6203 2005-03-16  Raja R Harinath  <rharinath@novell.com>
6204
6205         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6206         Refactor to avoid traversing the list of assemblies, and to avoid
6207         string concatenation.
6208         * typemanager.cs (guid_attr_type): Remove.
6209         (negative_hits, pointers, references): Remove hashes.
6210         (type_hash): New.
6211         (GetConstructedType): New.  Uses type_hash to handle constructed
6212         types (arrays, references, pointers).
6213         (GetReferenceType, GetPointerType): Use it.
6214         (GetNestedType): New.  Uses type_hash to handle nested types of
6215         reflected types.
6216         (LookupType, LookupTypeDirect): Remove.
6217         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
6218         'types' hash and LookupTypeReflection directly.
6219         (params_string, params_object): Use GetConstructedType.
6220         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
6221         top-level types.
6222         (Namespace.Lookup): Use cached_types.
6223         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6224         provided by old TypeManager.LookupType.
6225         * rootcontext.cs (MakeFQN): Remove.
6226         * decl.cs (DeclSpace.MakeFQN): Likewise.
6227         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
6228         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6229         TypeManager.GetConstructedType.
6230         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
6231
6232 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
6233
6234         * cs-parser.jay: Fix build.
6235
6236 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
6237
6238         * class.cs (TypeContainer.CircularDepException) New nested
6239         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
6240
6241         * cs-parser.jay: Reports CS1527 for any namespace element.
6242
6243         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
6244         Added CS0407.
6245
6246         * expression.cs (ParameterReference.IsAssigned): Changed error to
6247         CS0269.
6248         (Error_WrongNumArguments): Moved CS0245 detection here.
6249
6250         * statement.cs (Return.Resolve): Add CS1622 report.
6251
6252 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
6253
6254         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
6255
6256 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
6257
6258         * attribute.cs expression.cs: Get rid of some allocations.
6259
6260 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
6261
6262         * doc.cs : just eliminate the latest change.
6263
6264 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6265
6266         * doc.cs : commented out the latest change. It breaks xml-030.cs
6267
6268 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6269
6270         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6271           fail. So invoke CreateType() in FindDocumentedType().
6272
6273 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6274
6275         * cs-tokenizer.cs : added IsKeyword().
6276         * doc.cs : Detect keyword incorrectly used as identifier.
6277           Allow identifiers prefixed by @.
6278
6279 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
6280
6281         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6282         It caused exception in namespace resolving (again!).
6283         
6284         * class.cs (Class.ctor): Removed exit.
6285         (PropertyMethod.ctor): ditto.
6286         
6287         * codegen.cs (Codegen.Reset): Reset static data.
6288         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6289         
6290         * cs-tokenizer.cs (Cleanup): Removed.
6291         
6292         * driver.cs (GetSystemDir): Rewrote to one line command.
6293         It caused problem with unloaded dynamic modules.
6294         (UnixParseOption): Removed Exit.
6295         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6296         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6297         Now can be mcs used as library.
6298         
6299         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6300         empty location.
6301         
6302         * location.cs (Reset): Reset static data.
6303         
6304         * namespace.cs (Reset): Reset static data.
6305         
6306         * report.cs (Report.Reset): Reset static data.
6307         
6308         * rootcontext.cs (RootContext.Reset): Reset static data.
6309         
6310         * tree.cs (RootTypes.ctor): Use Location.Null
6311         
6312         * typemanager.cs (TypeManager.Reset): Reset static data.
6313         (CoreLookupType): Removed Exit.
6314         (TypeHandle.Reset): Reset static data.
6315         
6316 2005-03-10  Raja R Harinath  <rharinath@novell.com>
6317
6318         Fix #73516.
6319         * typemanager.cs (ComputeNamespaces): Import namespaces from
6320         referenced modules too.
6321
6322 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6323
6324         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6325         than '.'.
6326
6327 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6328
6329         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6330         enclosing DeclSpace.  This ensures that a name-lookup populates
6331         more caches and there are fewer 'TypeExpression's.  Carve out
6332         nested type lookup into ...
6333         (LookupNestedTypeInHierarchy): ... this.
6334
6335 2005-04-15  Martin Baulig  <martin@ximian.com>
6336
6337         Merged r41590 from MCS and make it work in the generics land.
6338
6339         * generic.cs (TypeParameter.UpdateConstraints): Removed the
6340         `check' argument.
6341
6342         * class.cs (PartialContainer.UpdateConstraints): Removed.
6343         (PartialContainer.CheckConstraints): Removed.
6344         (PartialContainer.SetParameterInfo): Store the constraints here.
6345         (PartialContainer.DefineTypeParameters): New public method;
6346         resolve the type parameter's constraints here.  Note that the
6347         PartialContainer doesn't have an EmitContext anymore, so we must
6348         do this in the ClassPart.
6349
6350 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6351
6352         Clean up a few partial-class semantics.  
6353         Fixes test-357.cs and cs1618-2.cs.
6354         * cs-parser.jay (struct_declaration): Use 'current_class' as
6355         parent of newly-created struct.  Remove call to Register ().
6356         Use 'pop_current_class' to complete handing the current struct.
6357         (interface_declaration): Likewise.
6358         (class_declaration): Likewise.
6359         (enum_declaration): Use 'current_class' as parent of newly created
6360         enum.
6361         (delegate_declaration): Likewise.
6362         (pop_current_class): New function.  This is used to handle closing
6363         up the 'current_class' and 'current_container', and pointing them
6364         to the enclosing class/container.
6365         (CSharpParser): Initialize 'current_class' too.
6366         * decl.cs (MemberCore): Add check for invariant: a partial
6367         container is not a parsed entity, and thus does not enclose any
6368         parsed members.
6369         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6370         (DeclSpace.BaseTypeExpr): Use it.
6371         (DeclSpace.LookupType): Add check for invariant.
6372         * class.cs (TypeContainer): Add check for invariant: a nested
6373         class should have the same NamespaceEntry as its enclosing class.
6374         (TypeContainer.EmitFieldInitializers): Make virtual.
6375         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6376         MemberCore.
6377         (TypeContainer.Register): Remove.
6378         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6379         null.  Use TypeResolveEmitContext for resolving base types and
6380         interfaces.  Move initialization of Parts.TypeBuilder here from
6381         ...
6382         (TypeContainer.DefineNestedTypes): ... here.
6383         (PartialContainer): Take a Namespace not a NamespaceEntry.
6384         (PartialContainer.Create): Don't use Register.  Call the
6385         appropriate Add... function directly.
6386         (ClassPart): Take both the PartialContainer and the enclosing
6387         class as constructor arguments.
6388         (ClassPart.EmitFieldInitializers): Override.
6389         (ClassPart.PartFindNestedTypes): Remove.
6390         (FieldBase.GetInitializerExpression): Resolve the initializer
6391         expression in the emit context of the enclosing class.
6392         * tree.cs (RootTypes): Remove Register ().
6393         
6394 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
6395
6396         * cs-parser.jay: Removed CS0134.
6397         
6398         * driver.cs: Removed CS1901.
6399         
6400         * expression.cs (SizeOf.DoResolve): Don't report CS0233
6401         for predefined types.
6402
6403 2005-03-07  Duncan Mak  <duncan@novell.com>
6404
6405         * codegen.cs (Save):  Catch UnauthorizedAccessException as
6406         well. Fixes bug #73454.
6407
6408 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
6409
6410         * cs-tokenizer.cs (xtoken): Add CS1035.
6411         
6412         * class.cs (MethodData.Define): Add CS0683.
6413         (FieldMember.ctor): Add CS0681.
6414
6415 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6416
6417         * ecore.cs (SimpleName.DoResolve): Rename from
6418         SimpleName.DoResolveAllowStatic.
6419         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6420         Pass 'intermediate' flag to MemberStaticCheck.
6421         (SimpleName.MemberStaticCheck): Skip "static check" only in case
6422         of "intermediate" lookups via MemberAccess.
6423         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
6424         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6425
6426 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6427
6428         Fix #73394.
6429         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6430         slipped in because of variable names that are identical to a
6431         builtin type's BCL equivalent ('string String;', 'int Int32;').
6432         (PropertyExpr.EmitInstance): Likewise.
6433
6434 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
6435
6436         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6437         
6438         * report.cs (warning_ignore_table): Made public.
6439
6440 2005-03-04  Raja R Harinath  <rharinath@novell.com>
6441
6442         Fix #73282.
6443         * class.cs (MethodData.Emit): Pass 'container' to
6444         container.GetObsoleteAttribute instead of 'container.Parent'.
6445
6446 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
6447
6448         * cs-parser.jay: Add 1534 error test.
6449
6450         * iterators.cs (Yield.CheckContext): Add error 1629.
6451         (Iterator.ctor): Save unsafe modifier.
6452         (MoveNextMethod.DoEmit): Restore unsafe context.
6453
6454         * namespace.cs (UsingAlias): Better error message.
6455
6456 2005-03-03  Dan Winship  <danw@novell.com>
6457
6458         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6459         the warning message [#73219]
6460
6461 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6462
6463         Fix compile with MCS 1.0.0.0.
6464         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6465         w_restore to not depend on string constant folding.
6466
6467 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6468
6469         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
6470         CS0246 check to users who passed 'silent = false'.
6471         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6472         check.
6473         (SimpleName.SimpleNameResolve): Update.
6474         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6475         (MemberAccess.IdenticalNameAndTypeName): Update.
6476         * doc.cs (FindDocumentedTypeNonArray): Update.
6477
6478 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
6479
6480         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6481         * parameters.cs (ComputeAndDefineParameters): Remove.
6482         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6483         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6484         Use GetParameterInfo.
6485
6486 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
6487
6488         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6489
6490 2005-03-02  Raja R Harinath  <rharinath@novell.com>
6491
6492         Unify DeclSpace.LookupType and DeclSpace.FindType.
6493         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
6494         is in charge of defining nested types on demand.
6495         (DeclSpace.LookupType): Use it when the current_type is a
6496         TypeBuilder.  Use LookupTypeDirect for reflected types.
6497         (DeclSpace.FindType): Remove.
6498         (DeclSpace.LookupInterfaceOrClass): Likewise.
6499         (DeclSpace.DefineTypeAndParents): Likewise.
6500         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6501         DeclSpace.LookupType.
6502         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6503         * typemanager.cs (LookupType): Simplify.
6504         (AddUserType): Remove type from negative_hits.
6505         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6506         * class.cs (TypeContainer.FindMembers): Move handling of nested
6507         types ...
6508         (TypeContainer.FindMembers_NestedTypes): ... here.
6509         (TypeContainer.FindNestedType): Implement override.
6510         (ClassPart.FindNestedType): Delegate to PartialContainer.
6511         (ClassPart.PartFindNestedType): Looks up the nested types of the
6512         part alone.
6513
6514 2005-04-14  Martin Baulig  <martin@ximian.com>
6515
6516         * generic.cs (ConstructedType): Moved all the type lookup and
6517         nested class logic into SimpleName.
6518         (ConstructedType.ResolveConstructedType): Our underlying type is
6519         already fully resolved; all the type lookup stuff is in
6520         SimpleName.
6521
6522         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
6523         constructed types here instead of in ConstructedType.
6524
6525         * decl.cs (MemberName.GetTypeExpression): Always create a
6526         SimpleName, not a ConstructedType.
6527         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
6528
6529 2005-03-02  Martin Baulig  <martin@ximian.com>
6530
6531         * class.cs (TypeContainer.DoDefineMembers): We also need a default
6532         static constructor in static classes.
6533
6534 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
6535
6536         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6537         sizeParamIndex is not specified.
6538
6539 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
6540
6541         Fix #73117
6542         * report.cs (WarningMessage.IsEnabled): Missing null check.
6543
6544 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6545
6546         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6547         in the fields and not in the properties.
6548
6549 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
6550
6551         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
6552         fields as well.
6553
6554 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6555
6556         * attribute.cs: Small refactoring (improved robustness).
6557         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6558         (ValidateGuid): Removed.
6559         (Resolve): Removed referenced to above mentioned.
6560         (GetAttributeUsage): Made private and changed to work without
6561         class assistance.
6562         (GetIndexerAttributeValue): Don't crash.
6563         (GetConditionalAttributeValue): Ditto.
6564         (GetClsCompliantAttributeValue): Ditto.
6565         (ExtractSecurityPermissionSet): All attributes exceptions are
6566         error 648.
6567         (GetPropertyValue): New helper.
6568         (GetMethodImplOptions): New method.
6569         (DefinePInvokeMethod): Reuse common code. Implemented handling of
6570         some missing properties.
6571         
6572         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6573         (Method.ApplyAttributeBuilder): Updated.
6574         
6575         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6576         exception.
6577
6578 2005-02-28  Raja R Harinath  <rharinath@novell.com>
6579
6580         Fix #73052.
6581         * report.cs (Report.SymbolRelatedToPreviousError): Handle
6582         non-simple types (array, pointer, reference).
6583
6584 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6585
6586         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6587
6588         * class.cs (MethodCore.IsDuplicateImplementation): Special error
6589         for operators.
6590         (Method.CheckBase): Catch wrong destructor here.
6591         (MethodData.Define): Add errors 550, 668.
6592
6593         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6594
6595         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6596
6597         * pending.cs (VerifyPendingMethods): Add error 551.
6598
6599         * typemanager.cs (CSharpName): Next error report helper.
6600
6601 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
6602
6603         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6604         attributes. Removed useless attribute double check.
6605         It saves almost 2MBs for corlib.
6606
6607 2005-02-25  Raja R Harinath  <rharinath@novell.com>
6608
6609         Fix #72924.
6610         * statement.cs (ExpressionStatement.Resolve): Make robust to being
6611         called twice in case of error.
6612
6613 2005-02-23  Chris Toshok  <toshok@ximian.com>
6614
6615         Fix compiler portions of #72827.
6616         * statement.cs (Block.Emit): call Begin/EndScope on the
6617         EmitContext instead of the ILGenerator.
6618
6619         * codegen.cs (EmitContext.BeginScope): new method, call
6620         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6621         we have one.)
6622         (EmitContext.BeginScope): same, but EndScope and CloseScope
6623
6624         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6625         offset and call the superclass's OpenScope(int) with it.
6626         (SymbolWriter.CloseScope): get the current il
6627         offset and call superclass's CloseScope(int) with it.
6628
6629 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
6630
6631         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6632         CS1677 for out and ref as well.
6633
6634         * class.cs (Method.Define): Add error CS1599 detection.
6635         
6636         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6637         
6638         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6639         
6640         * delegate.cs (Delegate.Define): Add error CS1599 detection.
6641         
6642         * support.cs.cs (ModifierDesc): New helper method.
6643
6644 2005-02-23  Raja R Harinath  <rharinath@novell.com>
6645             Abin Thomas  <projectmonokochi@rediffmail.com>
6646             Anoob V E  <projectmonokochi@rediffmail.com>
6647             Harilal P R  <projectmonokochi@rediffmail.com>
6648
6649         Fix #57851, #72718.
6650         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6651         MemberLookup (used for error reporting) actually returns a result.
6652         Fix error report number (122, not 112).
6653
6654 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
6655             Anoob V E  <projectmonokochi@rediffmail.com>
6656             Harilal P R  <projectmonokochi@rediffmail.com>
6657
6658         Fix #71134.
6659         * pending.cs (PendingImplementation.GetAbstractMethods):
6660         Find NonPublic members too.
6661
6662 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
6663
6664         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6665         Fixed error 217.
6666         
6667         * class.cs (MethodCore.CheckMethodAgainstBase):
6668         Add error 239 report.
6669
6670 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6671
6672         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6673         
6674         * class.cs (Operator.Define): Add error 217 report.
6675         
6676 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6677
6678         Fix #68955.
6679         * expression.cs (Invocation.IsApplicable): Make public.
6680         (Invocation.IsParamsMethodApplicable): Likewise.
6681         * delegate.cs (Delegate.VerifyApplicability): Don't use
6682         Invocation.VerifyArgumentCompat for parameter applicability
6683         testing.  Use Invocation.IsApplicable and
6684         Invocation.IsParamsMethodApplicable.
6685
6686 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6687
6688         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6689         
6690         * class.cs (Operator.Define): Add error 217 report.
6691         
6692 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6693
6694         * namespace.cs (UsingEntry.Resolve): Undo change below.
6695
6696 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6697
6698         Fix #72756.
6699         * ecore.cs (Expression.MemberLookupFailed): Add argument to
6700         disable the error message when the extended MemberLookup also
6701         fails.
6702         (Expression.MemberLookupFinal): Update.
6703         (SimpleName.DoSimpleNameResolve): Update.
6704         * expression.cs (MemberAccess.ResolveNamespaceOrType):
6705         Don't use MemberLookupFinal.
6706         (New.DoResolve): Update.
6707         (BaseAccess.CommonResolve): Update.
6708
6709 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6710
6711         Fix #72732.
6712         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6713         occured previously, don't resolve again.
6714
6715 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6716
6717         Fix #69949
6718         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6719         argument. Call ResolveAttributeUsage for unresolved.
6720         when types doesn't match ctor arguments.
6721         
6722         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6723         for nested attribute classes.
6724         (Class.attribute_usage): Removed.
6725         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6726         for attribute class.
6727         
6728         * ecore.cs (IsAttribute): Removed.
6729         
6730         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6731         
6732         * rootcontext.cs (RegisterAttribute): Removed, attributes are
6733         now normal types.
6734         (attribute_types): Removed.
6735         (EmitCode): Global attributes are emited as the latest.
6736
6737 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
6738
6739         * class.cs (EmitFieldInitializers): Don't emit field initializer
6740         for default values when optimilization is on.
6741         
6742         * constant.cs (Constant.IsDefaultValue): New property.
6743         
6744         * driver.cs: Add /optimize handling.
6745         
6746         * constant.cs,
6747         * ecore.cs,
6748         * literal.cs: Implement new IsDefaultValue property.
6749         
6750         * rootcontext.cs (Optimize): New field, holds /optimize option.
6751
6752 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6753
6754         Fix crasher in re-opened #72347.
6755         * namespace.cs (Namespace.Lookup): Return null if
6756         DeclSpace.DefineType returns null.
6757
6758         Fix #72678.
6759         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6760
6761 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6762
6763         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
6764         now returns null if it cannot resolve to an lvalue.
6765         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6766         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6767         returned null.  Remove check for SimpleName.
6768         (EventExpr.DoResolveLValue): New.
6769         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6770         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
6771         error from ...
6772         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
6773         avoid CS0131 error.
6774         (Unary.ResolveOperator): Move CS0211 check ...
6775         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
6776         CS0131 error.
6777         (Unary.DoResolveLValue): Simplify.
6778         (AddressOf.DoResolveLValue): New.
6779         (ArrayAccess.DoResolveLValue): New.
6780
6781 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
6782
6783         * attribute.cs (Attribute.Resolve): Add arguments casting for
6784         when types doesn't match ctor arguments.
6785
6786 2005-02-16  Raja R Harinath  <rharinath@novell.com>
6787
6788         Fix parts of #63202.
6789         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6790         lookup of operator in base type.  Ensure that all checks happen
6791         when the operator resolves to an "op_..." method.
6792
6793 2005-02-15  Raja R Harinath  <rharinath@novell.com>
6794
6795         Fix #71992.
6796         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6797         'ignore_cs0104' parameter.  Pass it to ...
6798         (NamespaceEntry.Lookup): ... this.
6799         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6800         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6801         (TypeLookupExpression.DoResolveAsTypeStep): Update.
6802         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6803         Update.  Request that cs0104 errors be ignored.
6804         (ComposedCast.ResolveAsTypeStep): Update.
6805
6806 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6807
6808         Fix #59209.
6809         * expression.cs (Invocation.BetterFunction): Remove support for
6810         comparing virtual functions and their overrides.
6811         (Invocation.IsOverride): New.
6812         (Invocation.OverloadResolve): Don't consider 'override' functions
6813         during candidate selection.  Store them in a lookaside list.
6814         If the selected method is a 'virtual' function, use the list to
6815         find any overrides that are closer to the LHS type.
6816
6817 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
6818
6819         * expression.cs (New.DoResolve): Add complex core type reduction.
6820         (New.Constantify): Converts complex core type syntax like 'new int ()'
6821         to simple constant.
6822         
6823 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6824
6825         * decl.cs (EntryType.EntryType): New constructor to create an
6826         updated copy of a cache entry.
6827         (MemberCache.AddMethods): Use it.
6828         (MemberCache.ClearDeclaredOnly): Remove.
6829         (MemberCache.MemberCache): Update.
6830
6831 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6832
6833         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6834         variable.  This one is represents the actual low-level declaration
6835         of the method, as opposed to the semantic level `IsStatic'.   
6836
6837         An anonymous method which is hosted into a static method might be
6838         actually an instance method.  IsStatic would reflect the
6839         container, while MethodIsStatic represents the actual code
6840         generated.
6841
6842         * expression.cs (ParameterReference): Use the new MethodIsStatic
6843         instead of IsStatic.
6844
6845         * anonymous.cs (AnonymousMethod.Compatible): Pass the
6846         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6847         set on the current EmitContext. 
6848
6849         * expression.cs (Cast): Overload DoResolveLValue so we can pass
6850         resolve our casted expression as an LValue.  This triggers the
6851         proper LValue processing that is later required by Assign.
6852
6853         This fixes 72347.
6854
6855         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6856
6857 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
6858
6859         C# 2.0 Fixed buffer implementation
6860
6861         * anonymous.cs: Update after RegisterHelperClass renaming.
6862
6863         * attribute.cs (AttributeTester.fixed_buffer_cache):
6864         Cache of external fixed buffers.
6865         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6866         implementation if field is fixed buffer else null.
6867
6868         * class.cs
6869         (TypeContainer.AddField): Accept FieldMember instead of Field.
6870         (FieldBase.IsFieldClsCompliant): Extracted code from
6871         VerifyClsCompliance descendant customization.
6872         (FixedField): New class handles fixed buffer fields.
6873         (FixedFieldExternal): Keeps information about imported fixed
6874         buffer.
6875         (IFixedField): Make access to internal or external fixed buffer
6876         same.
6877
6878         * cs-parser.jay: Add fixed buffer parsing.
6879
6880         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6881         buffer.
6882
6883         * expression.cs (Indirection): Extended implementation to accept
6884         fixed buffer field.
6885         (PointerArithmetic.Emit): Get element from fixed buffer as well.
6886         (ElementAccess.MakePointerAccess): Get type as parameter.
6887         (DoResolve): Add fixed buffer field expression conversion.
6888         (DoResolveLValue): Ditto.
6889         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6890         (ArrayPtr): Derives from FixedBufferPtr.
6891         (ArrayPtr.Emit): Add extra emit for array elements.
6892
6893         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6894
6895         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6896         for compiler generated types.
6897         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6898
6899         * statement.cs (Fixed): Refactored to be easier add fixed buffer
6900         and consume less memory.
6901         (Fixed.Resolve): Add fixed buffer case.
6902
6903         * typemanager.cs (compiler_generated_attr_ctor,
6904         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6905         (HasElementType): Add our own implementation to work on every
6906         runtime.
6907
6908 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6909
6910         * anonymous.cs (CaptureContext): Track whether `this' has been
6911         referenced.   
6912
6913         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
6914         only captured `this' if it was implicitly done (instance
6915         methods/variables were used). 
6916
6917         * codegen.cs (EmitContext.CaptureThis): New method to flag that
6918         `this' must be captured.
6919
6920 2005-01-30  Miguel de Icaza  <miguel@novell.com>
6921  
6922         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6923         is null it means that there has been no need to capture anything,
6924         so we just create a sibling.
6925
6926         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6927
6928         Just a partial fix.  The other half is fairly elusive.
6929         
6930 2005-02-10  Raja R Harinath  <rharinath@novell.com>
6931
6932         Fix #52586, cs0121-4.cs.
6933         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
6934         and return a hashtable.
6935         (MemberCache.ClearDeclaredOnly): New.
6936         (MemberCache.MemberCache): Update to change.  Make a deep copy of
6937         the method_hash of a base type too.
6938         (MemberCache.AddMethods): Adapt to having a deep copy of the base
6939         type methods.  Overwrite entries with the same MethodHandle so
6940         that the ReflectedType is correct.  The process leaves in base
6941         virtual functions and their overrides as distinct entries.
6942         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
6943         matters since it was boxed in a ArrayList before.
6944         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6945         modifier.
6946         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
6947         case of a virtual function and its override (choose the overload
6948         as better).
6949         (Invocation.OverloadResolve): Avoid 'override' members during
6950         'applicable_type' calculation.
6951
6952 2005-03-28  Raja R Harinath  <rharinath@novell.com>
6953
6954         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6955         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6956         GetTypeHandle.  It is possible for a reflected type to derive from
6957         a TypeBuilder (e.g., int[] derives from the TypeBuilder
6958         System.Array during mscorlib compilation).
6959         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6960         contain a method_hash, don't create one either.  Don't create a
6961         deep copy of the base cache's method_hash.
6962         (MemberCache.SetupCache): Rename back from DeepCopy.
6963         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6964         already initialized.  If we see an override function, add its
6965         underlying base virtual function to the member_hash too.
6966
6967 2005-02-09  Raja R Harinath  <rharinath@novell.com>
6968
6969         Combine two near-redundant caches.
6970         * typemanager.cs (method_params): Rename from method_internal_params.
6971         (TypeManager.GetParameterData): New.  Replace
6972         Invocation.GetParameterData.
6973         (TypeManager.LookupParametersByBuilder): Remove.
6974         * expression.cs (Invocation.method_parameter_cache): Remove.
6975         (Invocation.GetParameterData): Remove.
6976         Update to changes.
6977         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6978         Update to changes.
6979
6980 2005-02-08  Raja R Harinath  <rharinath@novell.com>
6981
6982         Fix #72015.
6983         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6984         TypeManager.multicast_delegate_type is null, resolve it by looking
6985         up "System.MulticastDelegate".
6986         * rootcontext.cs (RootContext.ResolveCore): Simplify.
6987
6988 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
6989             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
6990             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
6991
6992         Fix cs0164.cs.
6993         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6994         (LabeledStatement.AddReference): New.  Set 'referenced'.
6995         (Goto.Resolve): Use it.
6996
6997 2005-02-05  John Luke  <john.luke@gmail.com>
6998
6999         * driver.cs: remove duplicate -doc line in Usage ()
7000
7001 2005-02-04  Raja R Harinath  <rharinath@novell.com>
7002
7003         * location.cs (Location.AddFile): Fix CS2002 error report.
7004
7005 2005-02-02  Martin Baulig  <martin@ximian.com>
7006
7007         * delegate.cs (Delegate.DefineType): Report an internal error if
7008         TypeManager.multicast_delegate_type is null.  See bug #72015 for
7009         details.        
7010
7011 2005-02-02  Raja R Harinath  <rharinath@novell.com>
7012
7013         Fix a crasher in a variant of #31984.
7014         * const.cs (Constant.CheckBase): New override that defers the
7015         new-or-override check in case the base type hasn't been populated
7016         yet.
7017         (Constant.Define): Ensure the new-or-override check is performed.
7018
7019 2005-02-01  Duncan Mak  <duncan@ximian.com>
7020
7021         * const.cs (LookupConstantValue): Check that `ce' is not null
7022         before calling GetValue ().
7023
7024 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7025
7026         Fix test-334.cs (#69519).
7027         * cs-parser.jay (using_alias_directive): Pass in an expression to
7028         NamespaceEntry.UsingAlias.
7029         (using_namespace_directive): Pass in an expression to
7030         NamespaceEntry.Using.
7031         (namespace_name): Don't flatten to a string.
7032         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
7033         (NamespaceEntry.AliasEntry.Resolve): Lookup using
7034         ResolveAsTypeStep.
7035         (NamespaceEntry.UsingEntry): Likewise.
7036         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
7037         changes.
7038         (NamespaceEntry.LookupForUsing): Remove.
7039         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
7040         names.
7041         (NamespaceEntry.Lookup): Remove support for dotted names.
7042
7043 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7044
7045         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
7046         split into two.
7047         (NamespaceEntry.ImplicitParent): Compute on demand.
7048         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
7049         parallels the current.
7050         (NamespaceEntry.LookupForUsing): Use it.
7051         (NamespaceEntry.Lookup): If the current namespace-entry is
7052         implicit, don't search aliases and using tables.
7053
7054 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7055
7056         Fix #31984.
7057         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
7058         BaseCache here.
7059         (TypeContainer.BaseCache): Compute on demand.
7060         (TypeContainer.FindMembers): Define constants and types if they're
7061         not already created.
7062         (FieldMember.Define): Move resetting of ec.InUnsafe before error
7063         check.
7064         * const.cs (Constant.Define): Make idempotent.
7065
7066 2005-01-29  Miguel de Icaza  <miguel@novell.com>
7067
7068         * pending.cs: Produce better code (no nops produced by using Ldarg
7069         + value).
7070         
7071         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7072         i - 1' it should be arg + 1.
7073
7074         Fixes bug #71819.
7075
7076 2005-01-28  Raja R Harinath  <rharinath@novell.com>
7077
7078         * attribute.cs (Attribute.CheckAttributeType): Make private
7079         non-virtual.
7080         (Attribute.ResolveType): Make virtual.
7081         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
7082         handling of RootContext.Tree.Types.
7083
7084 2005-01-27  Raja R Harinath  <rharinath@novell.com>
7085
7086         Update attribute-handling to use the SimpleName/MemberAccess
7087         mechanisms.
7088         * cs-parser.jay (attribute): Pass in an expression to the
7089         constructors of Attribute and GlobalAttribute.
7090         * attribute.cs (Attribute): Take an expression for the name.
7091         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
7092         passed in attribute name expression.
7093         (Attribute.CheckAttributeType): Use it.
7094         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
7095         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
7096         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
7097         argument to prevent error messages if the lookup fails.
7098
7099 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
7100
7101         * expression.cs (Indirection): Implemented IVariable interface
7102         to support indirection in AddressOf operator.
7103         (PointerArithmetic.Emit): Add optimalization for case where
7104         result can be precomputed.
7105
7106 2005-01-26  Martin Baulig  <martin@ximian.com>
7107
7108         * class.cs (TypeContainer.AttributeTargets): Return the correct
7109         AttributeTargets depending on our `Kind' instead of throwing an
7110         exception; fixes #71632.
7111
7112 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
7113
7114         Fix #71257
7115         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
7116         constant members.
7117
7118 2005-03-17  Martin Baulig  <martin@ximian.com>
7119
7120         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
7121         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
7122
7123 2005-03-17  Martin Baulig  <martin@ximian.com>
7124
7125         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
7126         to bool so we can return an error condition.
7127         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
7128         returned an error.
7129
7130 2005-03-17  Martin Baulig  <martin@ximian.com>
7131
7132         * generic.cs (TypeMananager.IsIEnumerable): New public method.
7133
7134         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
7135         converting from an array-type of T to `IEnumerable<T>'.
7136
7137 2005-03-16  Martin Baulig  <martin@ximian.com>
7138
7139         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
7140         (Nullable.LiftedUnaryMutator): New public class.
7141
7142         * expression.cs (UnaryMutator.DoResolve): Added support for
7143         Nullable Types.
7144
7145 2005-03-14  Martin Baulig  <martin@ximian.com>
7146
7147         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
7148
7149 2005-03-14  Martin Baulig  <martin@ximian.com>
7150
7151         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
7152         the comparision operators `<', `>', `<=' and `>='.
7153
7154 2005-03-13  Martin Baulig  <martin@ximian.com>
7155
7156         * generic.cs
7157         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
7158         avoid confusion with the `NullLiteral'.
7159         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
7160
7161 2005-03-13  Martin Baulig  <martin@ximian.com>
7162
7163         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
7164         comparing arbitrary types with the null literal.
7165
7166 2005-03-13  Martin Baulig  <martin@ximian.com>
7167
7168         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
7169         boolean operators '&&', '||', '&' and '|'.
7170         (Nullable.OperatorTrueOrFalse): New public class.
7171
7172         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
7173         instead of a `StaticCallExpr'; added support for nullables.
7174
7175 2005-03-10  Martin Baulig  <martin@ximian.com>
7176
7177         * expression.cs
7178         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
7179         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
7180
7181 2005-03-07  Martin Baulig  <martin@ximian.com>
7182
7183         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
7184         it work if `expr' is not an IMemoryLocation.
7185         (Nullable.Lifted): Implement IMemoryLocation.
7186         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
7187         target type.
7188
7189 2005-03-05  Martin Baulig  <martin@ximian.com>
7190
7191         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
7192         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
7193         (Nullable): Added support for lifted unary and binary operators.
7194
7195         * expression.cs (Unary.DoResolve): Added support for nullable types.
7196         (Binary.DoResolve): Likewise.
7197         (Conditional.DoResolve): Likewise.
7198
7199 2005-03-02  Martin Baulig  <martin@ximian.com>
7200
7201         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
7202
7203         * class.cs (ClassPart.SetParameterInfo): Override this.
7204         (PartialContainer.SetParameterInfo): Override this.
7205         (TypeContainer.CheckConstraints): New protected method.
7206         (PartialContainer.CheckConstraints): Override this and check
7207         whether the same contraints were specified in all parts of a
7208         partial generic type definition.
7209         (PartialContainer.UpdateConstraints): New public method.
7210
7211         * generic.cs (TypeParameter.UpdateConstraints): New public method.
7212
7213 2005-03-02  Martin Baulig  <martin@ximian.com>
7214
7215         Committing a patch from Carlos Alberto Cortez to fix #72887.
7216
7217         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
7218         casts from `T []' to `int []'.
7219
7220 2005-03-02  Martin Baulig  <martin@ximian.com>
7221
7222         * generic.cs (TypeManager.IsEqual): Make this symmetric.
7223
7224         * expression.cs (Binary.ResolveOperator): When resolving a
7225         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
7226         `=='.  Fixes #71866.  See gen-127.cs.
7227
7228 2005-03-02  Martin Baulig  <martin@ximian.com>
7229
7230         * class.cs (TypeContainer.DoDefineMembers): We also need a default
7231         static constructor in static classes.
7232
7233 2005-03-02  Martin Baulig  <martin@ximian.com>
7234
7235         * generic.cs
7236         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
7237         (Nullable.LiftedConversion): Added support for user-defined
7238         conversions.
7239
7240         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
7241
7242         * cs-parser.jay: Use ComposedCast everywhere instead of
7243         NullableType, so we don't need to check for NullableType
7244         everywhere.
7245         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
7246         case where we'll be resolved into a `parenthesized_expression_0'
7247         afterwards.
7248
7249         * convert.cs
7250         (Convert.UserDefinedConversion): Added nullable conversions.
7251
7252 2005-02-28  Martin Baulig  <martin@ximian.com>
7253
7254         * generic.cs (TypeManager.IsNullableType): New static method.
7255         (Nullable): New abstract class.
7256         (Nullable.NullLiteral): New public class.
7257         (Nullable.LiftedConversion): New public class.
7258
7259         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
7260         `builtin_types opt_nullable'.
7261
7262         * convert.cs
7263         (Convert.ImplicitConversionStandard): Added nullable conversions.
7264         (Convert.ExplicitConversionStandard): Likewise.
7265         (Convert.ExplicitConversion): Likewise.
7266
7267 2005-02-26  Martin Baulig  <martin@ximian.com>
7268
7269         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
7270         begin with a "?", for instance "?[]".  Don't do a type lookup if
7271         `dim' is empty.
7272
7273 2005-02-25  Martin Baulig  <martin@ximian.com>
7274
7275         The first part of Nullable Types :-)
7276
7277         * generic.cs (NullableType): New public class.
7278         (NullCoalescingOperator): New public class.
7279         (TypeArguments.Resolve): Add a CS0306 check.
7280
7281         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
7282         (opt_nullable): New rule.
7283         (type): Added `opt_nullable' to `namespace_or_type_name',
7284         `builtin_types' and `pointer_type'.
7285         (array_type): Added `opt_nullable'.
7286         (opt_rank_specifier_or_nullable): New rule; this is the
7287         combination of `opt_rank_specifier' and `opt_nullable'.
7288         (opt_error): New rule; catch errors here.
7289         (nullable_type_or_conditional): New rule; we use this to check for
7290         nullable and still detect the conditional operator.
7291         (local_variable_type): Use `opt_rank_specifier_or_nullable'
7292         instead `opt_rank_specifier'.
7293
7294         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
7295         for nullables.
7296
7297 2005-02-24  Martin Baulig  <martin@ximian.com>
7298
7299         * README, README.Changes: Removed; they're old and obsolete.
7300
7301 2005-02-22  Martin Baulig  <martin@ximian.com>
7302
7303         * generic.cs (TypeParameter.Resolve): If resolving the constraints
7304         returned an error, set `constraints' to null to avoid a crash
7305         later on.
7306         (TypeParameter.ResolveType): Likewise.
7307
7308 2005-02-22  Martin Baulig  <martin@ximian.com>
7309
7310         * generic.cs
7311         (Constraints.ResolveTypes): Protect against being called twice.
7312         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
7313         (TypeParameter.ResolveType): New public method; calls
7314         constraints.ResolveTypes().
7315         (TypeParameter.DefineType): Moved constraints.ResolveType() out
7316         into the new ResolveType().
7317         (GenericMethod.Define): Call ResolveType() on all our
7318         TypeParameter's.        
7319
7320 2005-02-21  Martin Baulig  <martin@ximian.com>
7321
7322         * generic.cs
7323         (TypeManager.generic_nullable_type): New static public field.
7324         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
7325
7326         * rootcontext.cs
7327         (RootContext.ResolveCore): Resolve "System.Nullable`1".
7328
7329 2005-02-15  Martin Baulig  <martin@ximian.com>
7330
7331         * generic.cs (ConstructedType.Constraints): Correctly check
7332         constraints if the argument type is a type parameter; fixes
7333         #72326. 
7334
7335 2005-02-02  Martin Baulig  <martin@ximian.com>
7336
7337         * delegate.cs (Delegate.DefineType): Report an internal error if
7338         TypeManager.multicast_delegate_type is null.  See bug #72015 for
7339         details.        
7340
7341 2005-01-29  Miguel de Icaza  <miguel@novell.com>
7342
7343         * pending.cs: Produce better code (no nops produced by using Ldarg
7344         + value).
7345         
7346         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7347         i - 1' it should be arg + 1.
7348
7349         Fixes bug #71819.
7350         
7351 2005-01-26  Martin Baulig  <martin@ximian.com>
7352
7353         * cs-parser.jay (indexer_declarator): Don't report an error if we
7354         have type parameters since we can be an explicit interface
7355         implementation; fixes #71449.
7356
7357 2005-01-26  Martin Baulig  <martin@ximian.com>
7358
7359         * class.cs (TypeContainer.AttributeTargets): Return the correct
7360         AttributeTargets depending on our `Kind' instead of throwing an
7361         exception; fixes #71632.
7362
7363 2005-01-26  Martin Baulig  <martin@ximian.com>
7364
7365         * delegate.cs (Delegate.DefineType): Correctly define our type
7366         parameters.  Fixes #71483.
7367
7368 2005-01-25  Raja R Harinath  <rharinath@novell.com>
7369
7370         Fix #71602.
7371         * expression.cs (MemberAccess.DoResolve): Don't complain with
7372         cs0572 when the LHS of a member access has identical name and type
7373         name.
7374
7375 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
7376
7377         Fix #71651, #71675
7378         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7379         CreatePermission.
7380         Create custom PermissionSet only for PermissionSetAttribute.
7381
7382 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
7383
7384         Fix #71649
7385         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7386         delegates in static class.
7387
7388 2005-01-24  Martin Baulig  <martin@ximian.com>
7389
7390         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7391         merging an implicit block, just use its reachability.
7392
7393         * statement.cs (Block.Resolve): Make the unreachable code check
7394         work wrt. implicit blocks; see test-337 from #63842.
7395
7396 2005-01-21  Alp Toker  <alp@atoker.com>
7397  
7398         * cs-parser.jay: destructor_declaration's container is PartialContainer
7399         not Class when partial types are used, so use Kind prop instead of
7400         'is'.
7401         
7402 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
7403
7404         * cs-parser.jay: Improve error reporting when an interface
7405         declares new types.
7406
7407 2005-01-20  Dick Porter  <dick@ximian.com>
7408
7409         * support.cs: SeekableStreamReader fix from Sandor Dobos
7410         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7411         chars are read.  Fixes bug 70369.
7412
7413 2005-01-20  Raja R Harinath  <rharinath@novell.com>
7414
7415         * cs-parser.jay (catch_clause): Simplify current_block handling
7416         somewhat.
7417
7418 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
7419
7420         * convert.cs (ImplicitStandardConversionExists): Synchronize the
7421         code with ImplicitStandardConversion to handle the implicit
7422         conversion of method groups into valid delegate invocations. 
7423
7424         The problem is that in parameter handling we were using this code
7425         path.  Fixes bug #64698
7426
7427 2005-01-19  Raja R Harinath  <rharinath@novell.com>
7428
7429         * cs-parser.jay: Fix several infelicities.
7430         - Avoid assigning to the parser value stack.  Code like 
7431           '$3 = null' is unclean.  Synthesize a value for the code block
7432           instead. 
7433         - Avoid using oob_stack for storing location information.  Use ...
7434         (_mark_): ... this.  New (empty) rule.  Saves the current location
7435         in $$.
7436         (foreach_statement): Avoid using oob_stack for current_block
7437         handling.  Use technique used in for_statement and
7438         using_statement.  Synthesize a value for the code block to store
7439         additional intermediate information.
7440
7441 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
7442
7443         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7444         of a different type is only allowed to private fields of a
7445         containing type, not on fields of a base class.
7446
7447         See test-174.cs and error cs0122-9.cs
7448
7449 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7450
7451         Fix test-335.cs (bug #58126).
7452         * cs-parser.jay (argument): Split out non-expression parts of the
7453         rule into 'non_simple_argument'.
7454         (invocation_expression): Support parenthesized invocations with
7455         multiple arguments, and with single non-simple arguments.
7456
7457 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7458
7459         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7460         places.
7461
7462 2005-01-12  Raja R Harinath  <rharinath@novell.com>
7463
7464         Fix cs0038-1.cs, cs1640-6.cs.
7465         * ecore.cs (Expression.Resolve): Remove special-case for
7466         SimpleName in error-handling.
7467         (Expression.almostMatchedMembers): Relax access permission to
7468         protected.
7469         (Expression.MemberLookupFailed): Handle duplicates in
7470         almostMatchedMembers list.
7471         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7472         * expression.cs (New.DoResolve): Report CS1540 for more cases.
7473         * typemanager.cs (GetFullNameSignature): Use the MethodBase
7474         overload if the passed in MemberInfo is a MethodBase.
7475
7476 2005-01-25  Martin Baulig  <martin@ximian.com>
7477
7478         * doc.cs
7479         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
7480
7481 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
7482
7483         Fix #70749
7484         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7485         for non-CAS & merge permission sets properly.
7486
7487 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7488
7489         Improve standard-compliance of simple name and member access 
7490         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
7491         * ecore.cs (FullNamedExpression): New abstract base class 
7492         for Namespaces and TypeExpressions.
7493         (ResolveFlags.SimpleName): Remove.
7494         (SimpleName): Remove support for dotted names.
7495         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
7496         DeclSpace.FindType and DeclSpace.LookupType.
7497         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7498         (Expression.ExprClassName): Make member function.
7499         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7500         a namespace.  Remove creation of dotted "SimpleName"s.
7501         (MemberAccess.DoResolve): Likewise.
7502         * decl.cs (DeclSpace.Cache): Make private.
7503         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7504         (DeclSpace.FindType): Update.
7505         (DeclSpace.LookupType): Move here from RootContext.  Return a 
7506         FullNamedExpression.
7507         * namespace.cs (Namespace): Derive from FullNamedExpression
7508         so that it can be part of expression resolution.
7509         (Namespace.Lookup): Return an FullNamedExpression.
7510         (NamespaceEntry.LookupAlias): Lookup aliases only in current
7511         namespace.
7512         * rootcontext.cs (NamespaceLookup): Remove.
7513         (LookupType): Move to DeclSpace.
7514         * attribute.cs (CheckAttributeType): Update.
7515         * doc.cs (FindDocumentedType): Remove allowAlias argument.
7516         (FindDocumentedTypeNonArray): Likewise.
7517
7518 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7519
7520         Fix cs0509.cs, cs1632.cs.
7521         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7522         is the same as IsInterface.
7523         (TypeContainer.GetClassBases): Likewise.
7524         * statement.cs (LabeledStatement.ig): New field.
7525         (LabeledStatement.LabelTarget): Save ILGenerator which created the
7526         label.
7527         (LabeledStatement.DoEmit): Check that the label was created with
7528         the same ILGenerator.
7529
7530 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7531
7532         Fix #71058
7533         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7534         accessors to its properties.
7535
7536         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
7537         from accessors to property.
7538         
7539 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7540
7541         Fix #70722
7542         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
7543         only for overrides.
7544         
7545 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
7546
7547         * attribute.cs: Check for null and empty strings.  
7548
7549         I have lost another battle to Paolo.
7550
7551 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
7552
7553         Fix #70942
7554         * class.cs (PropertyMethod): Set Parent field in ctors.
7555         (SetMethod.InternalParameters): Add unsafe switch hack.
7556         Override MarkForDuplicationCheck where it is appropriate.
7557
7558         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
7559         It says whether container allows members with the same name.
7560         Base default is no.
7561         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
7562         Removed is_method parameter.
7563
7564 2005-01-06  Duncan Mak  <duncan@ximian.com>
7565
7566         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
7567         because the previous change led to incorrect reporting of CS1032
7568         ("Cannot define/undefine preprocessor symbols after first token in
7569         file"). Instead of using `tokens_seen' as the only flag that
7570         triggers CS1040, introduce `comments_seen'. This new flag is used
7571         to signify having seen comments on the current line, so it is
7572         unset after a newline.
7573
7574 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7575
7576         * doc.cs : When searching for a type, find nested type too.
7577           This fixes bug #71040.
7578
7579 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7580
7581         * doc.cs :
7582           - Warn missing member comment on those classes which also does not
7583             have doc comments. Fixed bug #71041.
7584           - Don't warn missing doc comment on default constructor.
7585             Fixed bug #71042.
7586
7587 2005-01-06  Duncan Mak  <duncan@ximian.com>
7588
7589         * cs-tokenizer.cs (xtoken): After handling traditional C-style
7590         comments, set `tokens_seen' to true. This allows us to detect
7591         misplaced preprocessor directives (i.e. not at the beginning of
7592         the a line, nor after whitespaces). In that case, report error
7593         CS1040. This fixes bug #56460.
7594
7595         * cs-parser.jay (interface_member_declaration): Add checks for
7596         IsExplicitImpl, and report CS0541 error if an interface member is
7597         defined as an explicit interface declaration.
7598
7599 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
7600
7601         Fix #70817
7602         * class.cs (PropertyMethod): Set Parent field in ctors.
7603         (SetMethod.InternalParameters): Add unsafe switch hack.
7604         
7605         * decl.cs (MemberCore.Parent): Cannot be readonly.
7606
7607 2005-01-06  Raja R Harinath  <rharinath@novell.com>
7608
7609         * decl.cs (DeclSpace.ResolveType): Remove.
7610         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7611         Merge in code from ...
7612         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
7613         * class.cs, enum.cs: Update to changes.
7614
7615 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
7616
7617         * anonymous.cs: Ensure that we init the scope of our parent if it
7618         has not been initialized yet.
7619
7620 2004-12-30  Duncan Mak  <duncan@ximian.com>
7621
7622         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7623         if field.FieldBuilder is null. Fixes #70758.
7624
7625         * convert.cs: Fixed some typos and updated some of the comments.
7626         (ImplicitStandardConversionExists):
7627         (TryImplicitIntConversion): If `target_type' is an interface and
7628         the type of `ic' implements this interface, return true or a new
7629         BoxedCast instead of null. This fixes #70468.
7630
7631 2004-12-29  Duncan Mak  <duncan@ximian.com>
7632
7633         * expression.cs (Argument.Emit): Check that Expr is
7634         IMemoryLocation before casting to it, and report CS1510 otherwise.
7635
7636         This fixes #70402.
7637
7638 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
7639
7640         * statement.cs (Block.ThisVariable): remove the recursion here, to
7641         make the --profile more sane.
7642
7643 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
7644
7645         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7646         assembly, by JB Evain.
7647
7648 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7649
7650         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
7651           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7652         "parent" refers to enclosing type/class.  "base" refers to superclass.
7653
7654 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7655
7656         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7657         Ensure that we only have GlobalAttributes.
7658         * attribute.cs (Attribute.Emit): Make non-virtual.
7659         (GlobalAttribute.Emit): Remove.
7660         (Attribute.Resolve): Make virtual.
7661         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
7662         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7663         the argument. Don't create one.
7664         (Attribute.GetObsoleteAttribute): Likewise.
7665         (Attribute.GetClsCompliantAttributeValue): Likewise.
7666         * class.cs, decl.cs: Update to changes.
7667
7668 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
7669
7670         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7671         
7672         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7673         
7674         * statement.cs (Foreach.Resolve): Add error 186 report.
7675
7676 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
7677
7678         * expression.cs (Conditional.DoResolve): Add warning 429.
7679         
7680         * statement.cs (If.Resolve): Add warning 665.
7681
7682 2004-12-16  Raja R Harinath  <rharinath@novell.com>
7683
7684         New invariant: RootContext.Tree.Types.NamespaceEntry == null
7685         except when in the parser, and in GlobalAttribute.
7686         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7687         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7688         RootContext.Tree.Types.NamespaceEntry once work is done.
7689         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
7690         and resets RootContext.Tree.Types.NamespaceEntry.
7691
7692 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
7693
7694         * cs-parser.jay: Don't create a block for every variable.
7695
7696 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
7697
7698         * location.cs: Provide extra information.
7699
7700         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7701         variables from the captured environment, it is the ldarg_0.
7702
7703 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7704
7705         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7706         find a conclusion.
7707         
7708         * class.cs: Changed warning level for 169 to avoid developer
7709         displeasure from warning flooding. It will be changed back when they
7710         fix most of current BCL warnings.
7711         
7712         * RootContext.cs: Pushed default WarningLevel to 3.
7713         
7714         * statement.cs: Removed unused variable.
7715
7716 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7717
7718         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7719         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7720         Add error 502 report.
7721         (StaticClass.DefineType): Add error 441 report.
7722         (Class.AllowedModifiersProp): New virtual property as temporary
7723         extension to AllowedModifiers.
7724         (Class.DefineType): Add error 418 report. Moved ModFlags check here
7725         to share implementation with StaticClass and don't call virtual
7726         methods from ctor.
7727         
7728         * driver.cs (MainDriver): Add error 1558 test.
7729
7730         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7731         report. Moved error 36 test here.
7732
7733         * statement.cs (Throw.Resolve): Add error 724 report.
7734
7735         * typemanager.cs: Add out_attribute_type core type.
7736         
7737 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
7738
7739         * class.cs (TypeContainer.VerifyClsCompliance): Add error
7740         3018 report.
7741         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7742
7743         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7744         3017 report.
7745         
7746         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7747
7748         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
7749         Add error 3023 report.
7750         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7751
7752         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7753         implementation.
7754
7755 2004-12-12  John Luke  <john.luke@gmail.com>
7756
7757         * driver.cs (AddArgs): take -- into account when
7758         adding arguments, fixes bug 65710 
7759
7760 2004-12-12  Martin Baulig  <martin@ximian.com>
7761
7762         * expression.cs (Unary.TryReduceNegative): Added support for
7763         SByteConstant and ByteConstant.
7764         (Unary.Reduce): Check error values from TryReduceNegative().
7765
7766 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
7767
7768         * attributes.cs (Attribute.Resolve): Avoid multiple error report
7769         and report exception as error 182.
7770
7771 2004-12-10  Raja R Harinath  <rharinath@novell.com>
7772
7773         * driver.cs (Main): Fix message when there are warnings.
7774
7775 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
7776
7777         * delegate.cs: Fixed my fix from yesterday, sorry about that.
7778
7779 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
7780
7781         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
7782         Reduced number of warnings.
7783         
7784         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7785
7786 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
7787
7788         * driver.cs: Removed message.
7789
7790         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7791
7792 2004-12-08    <vargaz@freemail.hu>
7793
7794         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7795
7796 2004-12-08  Martin Baulig  <martin@ximian.com>
7797
7798         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7799         instead of a CS3002 for properties and indexer.
7800
7801 2004-12-08  Martin Baulig  <martin@ximian.com>
7802
7803         * decl.cs (MemberName.ToString): Make this work again.
7804
7805 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
7806
7807         * attribute.cs (Resolve): Add error 591 detection.
7808
7809         * class.cs (FieldMember.Define): Add error 1547 detection.
7810         (Indexer.Define): Add error 620 detection.
7811         (Operator.Define): Add error 590 detection.
7812
7813         * ecore.cs: Missing argument for error 79.
7814
7815         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7816         detection.
7817
7818 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
7819
7820         Fix #70106
7821         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7822         only.
7823
7824 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7825
7826         * cs-parser.jay : handle doc comments on implicit/explicit operators.
7827           Some operator comments were suppressed.
7828         * doc.cs : Implicit/explicit operator name in doc comments are like
7829           "op_Explicit(type)~returnType", so added suffix handling.
7830
7831 2005-01-21  Alp Toker  <alp@atoker.com>
7832
7833         * cs-parser.jay: destructor_declaration's container is PartialContainer
7834         not Class when partial types are used, so use Kind prop instead of 'is'.
7835
7836 2004-12-12  Martin Baulig  <martin@ximian.com>
7837
7838         * expression.cs (Unary.TryReduceNegative): Added support for
7839         SByteConstant and ByteConstant.
7840         (Unary.Reduce): Check error values from TryReduceNegative().
7841
7842 2004-12-11  Martin Baulig  <martin@ximian.com>
7843
7844         * support.cs (ReflectionParameters.ParameterName): If we have a
7845         `gpd', call `ParameterName' on it.
7846
7847         * parameter.cs (Parameter.GetParameterAttributes): New static method.
7848
7849         * pending.cs (PendingImplementation.DefineProxy): Call
7850         DefineParameter() for all of the MethodBuilder's arguments.
7851
7852 2004-12-09  Martin Baulig  <martin@ximian.com>
7853
7854         * doc.cs (DocUtil): Make this a static class.
7855
7856 2004-12-09  Martin Baulig  <martin@ximian.com>
7857
7858         * expression.cs (Invocation.InferType): Moved the type inference
7859         implementation into TypeManager.
7860
7861         * generics.cs (TypeManager): Moved the type inference
7862         implementation here.
7863
7864 2004-12-09  Martin Baulig  <martin@ximian.com>
7865
7866         * typemanager.cs (TypeManager): Make this a partial class.
7867
7868         * generics.cs
7869         (TypeManager): Move the generics part of `TypeManager' here.
7870
7871 2004-12-08  Martin Baulig  <martin@ximian.com>
7872
7873         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7874         instead of a CS3002 for properties and indexer.  Added CS3024
7875         check for generic interfaces.
7876
7877         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
7878         instances are not CLS-compliant.
7879
7880 2004-12-08  Martin Baulig  <martin@ximian.com>
7881
7882         * cs-parser.jay
7883         (void_pointer_expression): New rule for `void*', `void**' etc.
7884         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
7885
7886 2004-12-08  Martin Baulig  <martin@ximian.com>
7887
7888         * expression.cs (Invocation.InferType): Removed the hack for
7889         MethodCore.MayUnify().  
7890
7891         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
7892         this actually work.
7893
7894         * class.cs (MethodCore.MayUnify): Use
7895         TypeManager.MayBecomeEqualGenericTypes().       
7896
7897 2004-12-08  Martin Baulig  <martin@ximian.com>
7898
7899         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
7900         parameter, box it.  Fixes #69233.
7901
7902 2004-12-08  Martin Baulig  <martin@ximian.com>
7903
7904         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
7905         have the ctor constraint.  Fixes #68326.
7906
7907 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7908
7909         * cs-parser.jay : interface comment was not consumed because of
7910           extra opt_semicolon before doc handling.
7911
7912 2004-12-03  Raja R Harinath  <rharinath@novell.com>
7913
7914         Fix test-327.cs, test-328.cs, and put in early infrastructure
7915         for eventually fixing #52697.
7916         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7917         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7918         from other methods.
7919         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7920         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7921         (VerifyUsing, error246): Update.
7922         * rootcontext.cs (RootContext.NamespaceLookup): Just use
7923         'NamespaceEntry.LookupNamespaceOrType'.
7924
7925 2004-12-07  Martin Baulig  <martin@ximian.com>
7926
7927         * driver.cs: Call it "BETA SOFTWARE" :-)
7928
7929 2004-12-06  Raja R Harinath  <rharinath@novell.com>
7930
7931         Fix crash on cs0657-17.cs.
7932         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7933         Use RootContext.Tree.Types, not 'new RootTypes ()'.
7934         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7935         the case where the NamespaceEntry gets overwritten.
7936
7937 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
7938
7939         Fixed #69195, #56821
7940         * ecore.cs (ResolveBoolean): Tiny refactoring.
7941
7942         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7943         of right expression resolving when left is false constant and
7944         operator is LogicalAnd OR true constant and operator is LogicalOr.
7945
7946         * statement.cs (ResolveUnreachable): Always reports warning.
7947
7948 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
7949
7950         * class.cs: Distinguish between 1721 and 1722 (just a little help
7951         for the programmer).
7952
7953 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
7954
7955         * delegate.cs: Only allow this on new versions of the language. 
7956
7957 2004-12-02  Duncan Mak  <duncan@ximian.com>
7958
7959         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7960         Expression class.
7961         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7962         here as a static method. Take an additional bool out parameter
7963         `must_do_cs1540_check' for signaling to InstanceResolve.
7964         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7965         member field from PropertyExpr class and made it an argument of
7966         the method instead.
7967         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7968         check for MarshalByRefObject, and report CS0122 instead of CS1540.
7969         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7970         and `remove_accessor' as well as InstanceResolve: report CS0122
7971         where applicable.
7972
7973         Fixes #70129.
7974
7975 2004-12-07  Martin Baulig  <martin@ximian.com>
7976
7977         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
7978         and CS0692 where appropriate.
7979
7980 2004-12-06  Martin Baulig  <martin@ximian.com>
7981
7982         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
7983         IsDuplicateImplementation() and improved it.
7984
7985         * expression.cs (Invocation.InferTypeArguments): Added
7986         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
7987         and removed the "ref" modifier from `infered_types'.
7988
7989         * decl.cs (MemberName.ToString): Removed the exception.
7990
7991 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
7992
7993         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7994           comments are allowed.
7995
7996 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7997
7998         * delegate.cs: Add checks for subtypes in paramaters and return values
7999         in VerifyMethod () to add support for Covariance/Contravariance
8000         in delegates.
8001         
8002 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
8003
8004         * report.cs: Remove extra closing parenthesis.
8005
8006         * convert.cs (Error_CannotImplicitConversion): If the name of the
8007         types are the same, provide some extra information.
8008
8009 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
8010
8011         Fix bug #70102
8012         * attribute.cs (Resolve): Improved implementation of params
8013         attribute arguments.
8014
8015         * support.cs (ParameterData): Add HasParams to be faster.
8016
8017 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
8018
8019         all things are for /doc support:
8020
8021         * doc.cs: new file that supports XML documentation generation.
8022         * mcs.exe.sources: added doc.cs.
8023         * driver.cs:
8024           Handle /doc command line option.
8025           Report error 2006 instead of 5 for missing file name for /doc.
8026           Generate XML documentation when required, after type resolution.
8027         * cs-tokenizer.cs:
8028           Added support for picking up documentation (/// and /** ... */),
8029           including a new XmlCommentState enumeration.
8030         * cs-parser.jay:
8031           Added lines to fill Documentation element for field, constant,
8032           property, indexer, method, constructor, destructor, operator, event
8033           and class, struct, interface, delegate, enum.
8034           Added lines to warn incorrect comment.
8035         * rootcontext.cs :
8036           Added Documentation field (passed only when /doc was specified).
8037         * decl.cs:
8038           Added DocComment, DocCommentHeader, GenerateDocComment() and
8039           OnGenerateDocComment() and some supporting private members for
8040           /doc feature to MemberCore.
8041         * class.cs:
8042           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
8043         * delegate.cs:
8044           Added overriden DocCommentHeader.
8045         * enum.cs:
8046           Added overriden DocCommentHeader and GenerateDocComment().
8047
8048 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
8049
8050         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
8051         unwrapping the enumeration values, chain to
8052         DoConstantNumericPromotions again, so we can promote things to the
8053         fundamental types (takes care of enums that are bytes, sbytes).
8054
8055         Fixes bug #62054.
8056
8057 2004-12-01  Raja R Harinath  <rharinath@novell.com>
8058
8059         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
8060         Fix long-standing bug in type-lookup.  Use FindType instead of
8061         LookupType when ec.ResolvingTypeTree.
8062         (Attribute.ResolveType, Attribute.Resolve)
8063         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
8064         Update to changes.
8065         (Attributes.Search): Remove internal version.  Update.
8066         (Attributes.SearchMulti): Update.
8067         (Attributes.GetClsCompliantAttribute): Remove.
8068         (Attributes.GetIndexerNameAttribute): Remove.
8069         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
8070         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
8071         * class.cs (Indexer.Define): Likewise.
8072
8073 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
8074
8075         Fix bug #68790
8076         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
8077         MarshallByReference members access.
8078
8079         * expression.cs: Use CheckMarshallByRefAccess;
8080         Better error CS0197 message.
8081
8082         * report.cs: Print whole related error message.
8083
8084 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8085
8086         * class (GetClassBases): Better error 60 report.
8087         (EventProperty): Disabled warning 67 detection.
8088
8089 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8090
8091         Fix bug #60324
8092         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
8093
8094         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
8095         precise values.
8096
8097 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8098
8099         Fix bug #49488
8100         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
8101
8102         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
8103
8104 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
8105
8106         * attribute.cs (Attribute.Resolve): Refine error reporting and
8107         report a cs0117 if the identifier does not exist, to distinguish
8108         from 0617 which is a miss-use of the actual identifier.
8109
8110         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
8111         between cs0070 and cs0079.
8112
8113         * class.cs (MemberBase.DoDefine): When reporting a wrong
8114         accessibility level, we use MethodCore to compare instead of
8115         Method (this was a regression in some refactoring effort).
8116
8117         So now we correctly report cs0056 again.
8118
8119         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
8120         testing the target_type (which was known to be object_type) and
8121         not the source type (which is anonymous_method).
8122
8123         Fixed reporting of error cs1660.
8124
8125         * expression.cs (UserCast.Source): Expose the underlying cast.
8126
8127         * statement.cs (Switch.SwitchGoverningType): Sort the list of
8128         allowed types to find a match to int32 first (most common).
8129
8130         In addition, it ignores any ImplicitUserConversions that did an
8131         internal implicit conversion (as the switch statement allows only
8132         one integral conversion to exist).
8133
8134         * class.cs (PartialContainer.Create): rename `name' to
8135         `member_name' for clarity.  Then replace the string calls with a
8136         call to MemberName.GetPartialName, as now using
8137         MemberName.ToString is an error (this is due to the side effects
8138         it had, that were fixed in the past).
8139
8140         This will restore the error reporting on a number of partial class
8141         errors that were missusing this (and getting an exception as a
8142         results, which is now just a plain textual warning, because
8143         yyparse debug output would crash otherwise).
8144
8145 2004-11-26  Raja R Harinath  <rharinath@novell.com>
8146
8147         * Makefile (PROGRAM_INSTALL_DIR): Remove.
8148
8149 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
8150
8151         * rootcontext.cs (LookupType): Make sure to cache lookups that
8152         don't give us a negative result. This saves about 5% of corlib
8153         compilation time.
8154
8155 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8156
8157         * report.cs (AbstractMessage.Print): messages are sent to stderr
8158
8159         * class.cs (TypeContainer.GetClassBases): It is an error to have a
8160         non-interface in the list of interfaces (at this point, either
8161         parent was properly set, or a base class is being listed in the
8162         interfaces section).
8163
8164         This flags error 1722, and resolves the crash from bug 69259.
8165
8166 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
8167
8168         * statement.cs (Using.EmitExpressionFinally): make this work right
8169         for valuetypes. Fixes 69926.
8170
8171 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8172
8173         * const.cs (Const.ChangeType): Cope with the "0 literal can be
8174         converted to an enum" here, before we try to change the underlying
8175         type.  This code exists, but it is a different code path than the
8176         one used while encoding constants.
8177
8178         (ImplicitReferenceConversionExists): In addition, resynchronized
8179         the code here, so it matches the same code in
8180         ImplicitReferenceConversionExists for the `from any class-type S
8181         to any interface-type T'.       
8182
8183 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
8184
8185         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
8186
8187 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
8188
8189         * cs-parser.jay: Use verbosity accordingly. 
8190
8191 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8192
8193         * expression.cs (Unary.ResolveOperator): Do not report warning;
8194         AddressOf reads from variable.
8195         
8196         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
8197
8198 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8199
8200         Fix bug #69462
8201
8202         * attribute.cs (Attributable): Removed CheckTargets.
8203         (Attributes.Emit): Explicit attribute targets are tested here.
8204
8205         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
8206         not enabled for interfaces.
8207
8208         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
8209         (GetAssemblyName): Ouch next bug there.
8210
8211 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8212
8213         * expression.cs: Error 275 added.
8214         
8215 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
8216
8217         Fix bug #69177 (Implemented decimal constant support)
8218
8219         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
8220         (BinaryFold): Add DecimalConstant.
8221
8222         * const.cs (Define): Decimal constant 
8223         (is not constant.
8224         (ChangeType): Add decimal type handling.
8225         (LookupConstantValue): Don't set value for decimal type but
8226         emit DecimalConstantAttribute. Needed for constant optimization.
8227
8228         * constant.cs (ToDecimal): New method.
8229         (ConvertToDecimal): New method.
8230         (IntConstant): Implemented ConvertToDecimal.
8231         (DecimalConstant.Emit): Emit optimized version for decimals in
8232         int range.
8233
8234         * expression.cs (ResolveOperator): Changed order of constant
8235         reduction to work correctly with native types which have
8236         overloaded operators.
8237         (ResolveMemberAccess): Extract constant value from attribute
8238         for decimal type.
8239
8240         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8241
8242         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8243         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8244         (ChangeType): Decimal is special.
8245         (TypeToCoreType): Add decimal type.
8246
8247 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8248
8249         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8250         decimal types.
8251
8252 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8253
8254         * class.cs (EventField.ApplyAttributeBuilder): Fix error
8255         test cs1667-5.cs.
8256
8257 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8258
8259         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8260
8261         * pending.cs (PendingImplementation): Grab only interfaces.
8262
8263 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8264
8265         * statement.cs (ForeachHelperMethods): Add location member and
8266         error 202 detection.
8267
8268 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
8269
8270         * expression.cs (DoResolveBase): Fixed wrong warning for out
8271         variables.
8272
8273 2004-12-04  Martin Baulig  <martin@ximian.com>
8274
8275         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
8276         to check whether the conversion is ok.
8277
8278         * typemanager.cs (TypeManager.GetTypeArguments): Just return
8279         `Type.EmptyTypes' if we're not a generic TypeContainer.
8280
8281 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8282
8283         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8284         old bug: when converting from the null literal to a pointer,
8285         return an EmptyCast, not the NullLiteral.
8286
8287         This fixes #69921, the recent null_type changes probably made this
8288         bug more prominent.
8289
8290 2004-12-03  Martin Baulig  <martin@ximian.com>
8291
8292         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8293         method as our child, call AnonymousMethod.Compatible() on it.
8294
8295 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
8296
8297         * class.cs (FieldBase): Use an unused bit field from the field to
8298         encode the `has_offset' property from the FieldMember.  This saves
8299         a couple of Ks on bootstrap compilation.
8300
8301         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8302         method as our child, return the AnonymousMethod resolved
8303         expression.
8304
8305         * expression.cs (New.DoResolve): Allow return values from
8306         NewDelegate to also include AnonymousMethods.
8307
8308         Fixes #70150.
8309
8310 2004-11-29  Raja R Harinath  <rharinath@novell.com>
8311
8312         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
8313         cs1648 report.
8314         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
8315         System.Runtime.InteropServices._Exception, since it's a base
8316         interface of the core type System.Exception in the net_2_0 profile.
8317
8318 2004-11-27  Martin Baulig  <martin@ximian.com>
8319
8320         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
8321
8322 2004-11-26  Raja R Harinath  <rharinath@novell.com>
8323
8324         * Makefile: Convert to use executable.make.
8325         * gmcs.exe.sources: New.
8326
8327 2004-11-25  Martin Baulig  <martin@ximian.com>
8328
8329         * expression.cs (Invocation.InferType): Added support for byref types.
8330
8331 2004-11-25  Martin Baulig  <martin@ximian.com>
8332
8333         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
8334         in TypeManager.TypeToCoreType().
8335
8336 2004-11-25  Martin Baulig  <martin@ximian.com>
8337
8338         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
8339         "Dispose" method from the `current_type'.
8340         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
8341         DoDefineMembers() instead of using the MethodBuilder; this is
8342         required for generic iterators.
8343
8344         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
8345
8346 2004-11-24  Martin Baulig  <martin@ximian.com>
8347
8348         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
8349
8350 2004-11-20  Martin Baulig  <martin@ximian.com>
8351
8352         * expression.cs (Invocation.InferType): Correctly infer generic
8353         instances; see gen-103.cs.
8354         (Invocation.InferTypeArguments): If a generic method doesn't have
8355         any unbound type parameters, we don't need to infer anything.
8356
8357 2004-11-19  Raja R Harinath  <rharinath@novell.com>
8358
8359         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
8360
8361 2004-11-17  Raja R Harinath  <rharinath@novell.com>
8362
8363         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8364         (TypeHandle.GetMemberCache): New.
8365         (TypeHandle.TypeHandle): Update.
8366         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8367         (TypeManager.LookupParentInterfacesCache):
8368         Rename from LookupInterfaceCache.  Optimize slightly.
8369         (TypeManager.MemberLookup_FindMembers): Update.
8370         * decl.cs (MemberCache.MemberCache): Set Container to null in the
8371         multi-type variant.
8372         (AddCacheContents): Rename from AddHashtable.
8373         * class.cs (TypeContainer.parent_container): Remove.
8374         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8375         (TypeContainer.DoDefineMembers): Don't initialize it.
8376         Update to name changes.
8377         
8378 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
8379
8380         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8381         that factors the code to check access modifiers on override.  
8382
8383         (PropertyBase): Use the code here.
8384
8385         Patch from Lluis S'anchez, fixes bug #69361.
8386
8387 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
8388
8389         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8390         routine that is used to report the use of a captured variable
8391         whose address has been taken.
8392
8393         There are two checks: one when variables are being captured and
8394         the other check is when the address of a variable is taken. 
8395         
8396         (because an anonymous methods might be resolved before *or* after
8397         the address has been taken) and 
8398
8399         * expression.cs (Conditional.DoResolve): Remove the special
8400         casing that Martin added to trueExpr and falseExpr being both
8401         NullLiteral.  We get the right behavior now just by introducing
8402         the null_type into the compiler. 
8403
8404         * convert.cs (ExplicitConversion): Change the code to use
8405         null_type instead of testing `expr is NullLiteral'.
8406         (ImplicitConversionStandard): use null_type too.
8407         (ImplicitReferenceConversionExists): use null_type too.
8408         (ImplicitReferenceConversion): use null_type too.
8409
8410         * literal.cs: The type of `NullLiteral' is now null_type instead
8411         of object_type. 
8412         (Resolve): Set the type here.
8413
8414         * typemanager.cs: Introduce null_type.
8415
8416 2004-11-18  Martin Baulig  <martin@ximian.com>
8417
8418         * rootcontext.cs
8419         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
8420
8421 2004-11-18  Martin Baulig  <martin@ximian.com>
8422
8423         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
8424
8425 2004-11-18  Martin Baulig  <martin@ximian.com>
8426
8427         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
8428         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
8429         call ResolveConstructedType() on it to resolve it without checking
8430         constraints.
8431         (Constraints.ResolveTypes): Check them here.
8432         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
8433         but don't check constraints.
8434         (ConstructedType.ResolveAsTypeTerminal): Override this and also
8435         check constraints here.
8436         (ConstructedType.ResolveConstructedType): New public method.  This
8437         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
8438         resolve ourselves without checking constraints.
8439
8440         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
8441
8442 2004-11-18  Martin Baulig  <martin@ximian.com>
8443
8444         * decl.cs
8445         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
8446
8447         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
8448
8449 2004-11-18  Martin Baulig  <martin@ximian.com>
8450
8451         * ecore.cs (TypeExpr.ResolveType): Removed.
8452         (Expression.ResolveAsTypeTerminal): We always return a fully
8453         resolved `TypeExpr', so we can just access its `Type'.
8454
8455         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
8456
8457 2004-11-17  Martin Baulig  <martin@ximian.com>
8458
8459         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
8460         sure we don't return any unresolved TypeExpr's.
8461         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
8462         a `TypeExpr'.
8463         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
8464
8465         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
8466         unresolved `ConstructedType's.
8467
8468 2004-11-17  Martin Baulig  <martin@ximian.com>
8469
8470         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
8471
8472 2004-11-17  Martin Baulig  <martin@ximian.com>
8473
8474         * ecore.cs
8475         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
8476
8477         * decl.cs (DeclSpace.ResolveType): Removed.
8478         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
8479
8480 2004-11-17  Martin Baulig  <martin@ximian.com>
8481
8482         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8483         direction, like FindMembers() does.  Fixes #69546, testcase is in
8484         test-315.cs.    
8485
8486 2004-11-16  Martin Baulig  <martin@ximian.com>
8487
8488         This is based on a patch from Marek Safar, see bug #69082.
8489         Fixes bugs #63705 and #67130.
8490
8491         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8492         method; create a MemberCache for an interface type and cache the
8493         result.
8494
8495         * decl.cs (IMemberContainer.ParentContainer): Removed.
8496         (IMemberContainer.ParentCache): New property.
8497         (MemberCache.SetupCacheForInterface): Removed.
8498         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8499         to create a cache for an interface's "parent".
8500
8501         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8502         interfaces too.
8503
8504 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
8505
8506         * statement.cs: Avoid adding bools to a hashtable.
8507
8508 2004-11-15  Martin Baulig  <martin@ximian.com>
8509
8510         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
8511
8512 2004-11-11  Martin Baulig  <martin@ximian.com>
8513
8514         * typemanager.cs (TypeManager.GetMethodName): New method.
8515
8516         * class.cs (MethodData.Define): Include the generic arity in the
8517         name of an explicit interface; also add it to the method name.
8518
8519         * pending.cs (PendingImplementation.InterfaceMethod): The method
8520         name now includes the generic arity.
8521
8522 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
8523
8524         * expression.cs (Invocation.OverloadResolve): Flag error if we are
8525         calling an unsafe method from a safe location.
8526
8527 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
8528
8529         Fix #69167
8530         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8531
8532 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
8533
8534         * namespace.cs (VerifyUsing): use GetPartialName instead of
8535         ToString. 
8536
8537 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
8538
8539         * statement.cs (Return.Resolve): Fix regression in typo: if
8540         `in_exc', we have to request a NeedReturnLabel, this was a typo
8541         introduced in the anonymous method check-in.  Fixes #69131.
8542
8543         * Indexers were using the ShortName when defining themselves,
8544         causing a regression in the compiler bootstrap when applying the
8545         patch from 2004-11-02 (first part), now they use their full name
8546         and the bug is gone.
8547
8548 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
8549
8550         * driver.cs: Strip the path from the names of embedded resources. Fixes
8551         #68519.
8552
8553 2004-11-04  Raja R Harinath  <rharinath@novell.com>
8554
8555         Fix error message regression: cs0104-2.cs.
8556         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8557         (AliasEntry.Resolve): Update.
8558         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
8559         'silent' flag.
8560         (RootContext.LookupType): Update.
8561
8562 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
8563
8564         * cs-parser.jay: Add support for handling accessor modifiers
8565         * class: Add support port accessor modifiers and error checking,
8566         define PropertyMethod.Define as virtual (not abstract anymore)
8567         * ecore.cs: Add checking for proeprties access with access modifiers
8568         * iterators.cs: Modify Accessor constructor call based in the modified
8569         constructor
8570 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
8571
8572         * expression.cs (StringConcat): Handle being called twice,
8573         as when we have a concat in a field init with more than two
8574         ctors in the class
8575
8576 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
8577
8578         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8579         special case explicit implementations, we should always produce
8580         the .property or .event declaration.
8581         
8582         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8583         since it will not return correct data if people use this
8584         unresolved in the presence of using statements (see test-313).
8585
8586         * class.cs (MethodData.Define): If we are an explicit interface
8587         implementation, set the method name to the full name of the
8588         interface plus the name of the method.  
8589
8590         Notice that using the method.MethodName.GetFullName() does not
8591         work, as it will only contain the name as declared on the source
8592         file (it can be a shorthand in the presence of using statements)
8593         and not the fully qualifed type name, for example:
8594
8595         using System;
8596
8597         class D : ICloneable {
8598                 object ICloneable.Clone ()  {
8599                 }
8600         }
8601
8602         Would produce a method called `ICloneable.Clone' instead of
8603         `System.ICloneable.Clone'.
8604
8605         * namespace.cs (Alias.Resolve): Use GetPartialName.
8606         
8607 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8608
8609         * cs-parser.jay: Add error 1055 report.
8610
8611 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
8612
8613         * assign.cs (Assign.DoResolve): Only do the transform of
8614         assignment into a New if the types are compatible, if not, fall
8615         through and let the implicit code deal with the errors and with
8616         the necessary conversions. 
8617
8618 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8619
8620         * cs-parser.jay: Add error 1031 report.
8621
8622         * cs-tokenizer.cs: Add location for error 1038.
8623
8624 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8625
8626         * cs-parser.jay: Add error 1016 report.
8627
8628 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8629
8630         * cs-parser.jay: Add errors 1575,1611 report.
8631
8632 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8633
8634         * cs-parser.jay: Add error 1001 report.
8635
8636 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8637
8638         Fix #68850
8639         * attribute.cs (GetMarshal): Add method argument for
8640         caller identification.
8641
8642         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8643         agument for GetMarshal and RuntimeMissingSupport.
8644
8645 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8646
8647         * attribute.cs (ExtractSecurityPermissionSet): Removed
8648         TypeManager.code_access_permission_type.
8649
8650         * typemanager.cs: Removed TypeManager.code_access_permission_type.
8651
8652 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
8653
8654         * expression.cs (LocalVariableReference.DoResolveLValue): Check
8655         for obsolete use of a variable here.   Fixes regression on errors
8656         cs0619-25 and cs0619-26.
8657
8658 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
8659
8660         Fix #62358, implemented security attribute encoding.
8661
8662         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8663         Tests permitted SecurityAction for assembly or other types.
8664         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8665         data from SecurityPermissionAttribute to PermisionSet class.
8666
8667         * class.cs (ApplyAttributeBuilder): Added special handling
8668         for System.Security.Permissions.SecurityAttribute based types.
8669
8670         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8671         special handling for System.Security.Permissions.SecurityAttribute
8672         based types.
8673
8674         * enum.cs (ApplyAttributeBuilder): Added special handling
8675         for System.Security.Permissions.SecurityAttribute based types.
8676
8677         * parameter.cs (ApplyAttributeBuilder): Added special handling
8678         for System.Security.Permissions.SecurityAttribute based types.
8679
8680         * rootcontext.cs: Next 2 core types.
8681
8682         * typemanager.cs (TypeManager.security_permission_attr_type):
8683         Built in type for the SecurityPermission Attribute.
8684         (code_access_permission_type): Build in type.
8685
8686 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
8687
8688         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8689         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8690         all of this information into
8691         EmitContext.EmitCapturedVariableInstance.
8692         
8693         * codegen.cs (EmitCapturedVariableInstance): move here the
8694         funcionality of emitting an ldarg.0 in the presence of a
8695         remapping.   This centralizes the instance emit code.
8696
8697         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8698         then emit a load of this: it means that we have reached the
8699         topmost ScopeInfo: the one that contains the pointer to the
8700         instance of the class hosting the anonymous method.
8701
8702         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8703         captures to the topmost CaptureContext.
8704
8705 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
8706
8707         * expression.cs (LocalVariableReference): Move the knowledge about
8708         the iterators into codegen's EmitCapturedVariableInstance.
8709
8710 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
8711
8712         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8713         all code paths return a value from an anonymous method (it is the
8714         same as the 161 error, but for anonymous methods).
8715
8716 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
8717
8718         The introduction of anonymous methods in the compiler changed
8719         various ways of doing things in the compiler.  The most
8720         significant one is the hard split between the resolution phase
8721         and the emission phases of the compiler.
8722
8723         For instance, routines that referenced local variables no
8724         longer can safely create temporary variables during the
8725         resolution phase: they must do so from the emission phase,
8726         since the variable might have been "captured", hence access to
8727         it can not be done with the local-variable operations from the runtime.
8728         
8729         * statement.cs 
8730
8731         (Block.Flags): New flag `IsTopLevel' to indicate that this block
8732         is a toplevel block.
8733
8734         (ToplevelBlock): A new kind of Block, these are the blocks that
8735         are created by the parser for all toplevel method bodies.  These
8736         include methods, accessors and anonymous methods.
8737
8738         These contain some extra information not found in regular blocks:
8739         A pointer to an optional CaptureContext (for tracking captured
8740         local variables and parameters).  A pointer to the parent
8741         ToplevelBlock.
8742         
8743         (Return.Resolve): Catch missmatches when returning a value from an
8744         anonymous method (error 1662).
8745         Invoke NeedReturnLabel from the Resolve phase instead of the emit
8746         phase.
8747
8748         (Break.Resolve): ditto.
8749
8750         (SwitchLabel): instead of defining the labels during the
8751         resolution phase, we now turned the public ILLabel and ILLabelCode
8752         labels into methods called GetILLabelCode() and GetILLabel() that
8753         only define the label during the Emit phase.
8754
8755         (GotoCase): Track the SwitchLabel instead of the computed label
8756         (its contained therein).  Emit the code by using
8757         SwitchLabel.GetILLabelCode ().
8758
8759         (LocalInfo.Flags.Captured): A new flag has been introduce to track
8760         whether the Local has been captured or not.
8761
8762         (LocalInfo.IsCaptured): New property, used to tell whether the
8763         local has been captured.
8764         
8765         * anonymous.cs: Vastly updated to contain the anonymous method
8766         support.
8767
8768         The main classes here are: CaptureContext which tracks any
8769         captured information for a toplevel block and ScopeInfo used to
8770         track the activation frames for various local variables.   
8771
8772         Each toplevel block has an optional capture context associated
8773         with it.  When a method contains an anonymous method both the
8774         toplevel method and the anonymous method will create a capture
8775         context.   When variables or parameters are captured, they are
8776         recorded on the CaptureContext that owns them, for example:
8777
8778         void Demo () {
8779              int a;
8780              MyDelegate d = delegate {
8781                  a = 1;
8782              }
8783         }
8784
8785         Here `a' will be recorded as captured on the toplevel
8786         CapturedContext, the inner captured context will not have anything
8787         (it will only have data if local variables or parameters from it
8788         are captured in a nested anonymous method.
8789
8790         The ScopeInfo is used to track the activation frames for local
8791         variables, for example:
8792
8793         for (int i = 0; i < 10; i++)
8794                 for (int j = 0; j < 10; j++){
8795                    MyDelegate d = delegate {
8796                         call (i, j);
8797                    }
8798                 }
8799
8800         At runtime this captures a single captured variable `i', but it
8801         captures 10 different versions of the variable `j'.  The variable
8802         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8803         recorded on a child.  
8804
8805         The toplevel ScopeInfo will also track information like the `this'
8806         pointer if instance variables were referenced (this is necessary
8807         as the anonymous method lives inside a nested class in the host
8808         type of the method). 
8809
8810         (AnonymousMethod): Expanded to track the Toplevel, implement
8811         `AnonymousMethod.Compatible' to tell whether an anonymous method
8812         can be converted to a target delegate type. 
8813
8814         The routine now also produces the anonymous method content
8815
8816         (AnonymousDelegate): A helper class that derives from
8817         DelegateCreation, this is used to generate the code necessary to
8818         produce the delegate for the anonymous method that was created. 
8819
8820         * assign.cs: API adjustments for new changes in
8821         Convert.ImplicitStandardConversionExists.
8822
8823         * class.cs: Adjustments to cope with the fact that now toplevel
8824         blocks are of type `ToplevelBlock'. 
8825
8826         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8827         insteda of standard blocks.
8828
8829         Flag errors if params arguments are passed to anonymous methods.
8830
8831         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8832         `CurrentAnonymousMethod' which points to the current Anonymous
8833         Method.  The variable points to the AnonymousMethod class that
8834         holds the code being compiled.  It is set in the new EmitContext
8835         created for the anonymous method.
8836
8837         (EmitContext.Phase): Introduce a variable and an enumeration to
8838         assist in enforcing some rules about when and where we are allowed
8839         to invoke certain methods (EmitContext.NeedsReturnLabel is the
8840         only one that enfonces this right now).
8841
8842         (EmitContext.HaveCaptureInfo): new helper method that returns
8843         whether we have a CapturedContext initialized.
8844
8845         (EmitContext.CaptureVariable): New method used to register that a
8846         LocalInfo must be flagged for capturing. 
8847
8848         (EmitContext.CapturedParameter): New method used to register that a
8849         parameters must be flagged for capturing. 
8850         
8851         (EmitContext.CapturedField): New method used to register that a
8852         field must be flagged for capturing. 
8853
8854         (EmitContext.HaveCapturedVariables,
8855         EmitContext.HaveCapturedFields): Return whether there are captured
8856         variables or fields. 
8857
8858         (EmitContext.EmitMethodHostInstance): This is used to emit the
8859         instance for the anonymous method.  The instance might be null
8860         (static methods), this (for anonymous methods that capture nothing
8861         and happen to live side-by-side with the current method body) or a
8862         more complicated expression if the method has a CaptureContext.
8863
8864         (EmitContext.EmitTopBlock): Routine that drives the emission of
8865         code: it will first resolve the top block, then emit any metadata
8866         and then emit the code.  The split is done so that we can extract
8867         any anonymous methods and flag any captured variables/parameters.
8868         
8869         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8870         during this phase, the ILGenerator should not be used as labels
8871         and local variables declared here might not be accessible to any
8872         code that is part of an anonymous method.  
8873
8874         Exceptions to this include the temporary variables that are
8875         created by some statements internally for holding temporary
8876         variables. 
8877         
8878         (EmitContext.EmitMeta): New routine, in charge of emitting all the
8879         metadata for a cb
8880
8881         (EmitContext.TemporaryReturn): This method is typically called
8882         from the Emit phase, and its the only place where we allow the
8883         ReturnLabel to be defined other than the EmitMeta.  The reason is
8884         that otherwise we would have to duplicate a lot of logic in the
8885         Resolve phases of various methods that today is on the Emit
8886         phase. 
8887
8888         (EmitContext.NeedReturnLabel): This no longer creates the label,
8889         as the ILGenerator is not valid during the resolve phase.
8890
8891         (EmitContext.EmitThis): Extended the knowledge in this class to
8892         work in anonymous methods in addition to iterators. 
8893
8894         (EmitContext.EmitCapturedVariableInstance): This emits whatever
8895         code is necessary on the stack to access the instance to a local
8896         variable (the variable will be accessed as a field).
8897
8898         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8899         EmitContext.EmitAddressOfParameter): Routines to support
8900         parameters (not completed at this point). 
8901         
8902         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
8903         will also remove the parameters.
8904
8905         * convert.cs (Convert): Define a `ConstantEC' which points to a
8906         null.  This is just to prefity some code that uses
8907         ImplicitStandardConversion code and do not have an EmitContext
8908         handy.
8909
8910         The idea is to flag explicitly that at that point in time, it is
8911         known that the conversion will not trigger the delegate checking
8912         code in implicit conversions (which requires a valid
8913         EmitContext). 
8914
8915         Everywhere: pass new EmitContext parameter since
8916         ImplicitStandardConversionExists now requires it to check for
8917         anonymous method conversions. 
8918
8919         (Convert.ImplicitStandardConversionExists): If the type of an
8920         expression is the anonymous_method_type, and the type is a
8921         delegate, we invoke the AnonymousMethod.Compatible method to check
8922         whether an implicit conversion is possible. 
8923
8924         (Convert.ImplicitConversionStandard): Only do implicit method
8925         group conversions if the language level is not ISO_1.
8926
8927         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8928         MethodInfo for the Invoke method.  used by Delegate and
8929         AnonymousDelegate.
8930
8931         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8932         method conversions if the target type is a delegate.
8933
8934         Removed extra debugging nops.
8935
8936         (LocalVariableReference): Turn the `local_info' into a public
8937         field. 
8938
8939         Add `prepared' field, the same hack used for FieldExprs to cope
8940         with composed assignments, as Local variables do not necessarily
8941         operate purely on the stack as they used to: they can be captured
8942         fields. 
8943
8944         Add `temp' for a temporary result, like fields.
8945
8946         Refactor DoResolve and DoResolveLValue into DoResolveBase.
8947
8948         It now copes with Local variables that are captured and emits the
8949         proper instance variable to load it from a field in the captured
8950         case. 
8951
8952         (ParameterReference.DoResolveBase): During the resolve phase,
8953         capture parameters if we are in an anonymous method.
8954
8955         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8956         anonymous method, use the EmitContext helper routines to emit the
8957         parameter reference.
8958
8959         * iterators.cs: Set RemapToProxy to true/false during the
8960         EmitDispose class.
8961
8962         * parameters.cs (GetParameterByName): New helper method. 
8963
8964         * typemanager.cs (anonymous_method_type) a new type that
8965         represents an anonyous method.  This is always an internal type,
8966         used as a fencepost to test against the anonymous-methodness of an
8967         expression. 
8968         
8969 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
8970
8971         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8972         561 report.
8973         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8974
8975 2004-11-10  Martin Baulig  <martin@ximian.com>
8976
8977         * expression.cs (Invocation.BetterFunction): If two methods have
8978         equal parameter types, but only one of them is generic, the
8979         non-generic one wins.
8980         (New.DoResolve): Don't set `is_struct' to false if we're a generic
8981         instance; just use `Type.IsValueType' to determine whether
8982         something is a struct or not.
8983         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
8984         so we can be called multiple times.
8985
8986 2004-11-10  Martin Baulig  <martin@ximian.com>
8987
8988         * generic.cs (TypeParameter.DefineConstraints): New public method.
8989         (TypeParameter.CheckAccessLevel): Override this and return true.
8990         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
8991         override ResolveType() anymore.
8992         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
8993
8994 2004-11-10  Martin Baulig  <martin@ximian.com>
8995
8996         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
8997         call DeclSpace.ResolveNestedType() on it.
8998
8999 2004-11-10  Martin Baulig  <martin@ximian.com>
9000
9001         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
9002         non-null, call ParameterModifier() on it.
9003
9004 2004-11-10  Martin Baulig  <martin@ximian.com>
9005
9006         * iterators.cs
9007         (Iterators): Added `current_type' and `this_type' fields.
9008         (Iterators.DefineIterator): Create a new EmitContext and store it
9009         in `ec'; compute `this_type'.
9010
9011 2004-11-10  Martin Baulig  <martin@ximian.com>
9012
9013         * typemanager.cs
9014         (TypeManager.IsPrivateAccessible): New public method.
9015         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
9016
9017 2004-11-10  Martin Baulig  <martin@ximian.com>
9018
9019         * class.cs (TypeContainer.DefineType): Call
9020         TypeBuilder.DefineGenericParameters() before resolving the type
9021         parameters.
9022         (MethodData.parent_method): New protected field.
9023         (MethodData..ctor): Added `MethodInfo parent_method' argument.
9024         (MethodData.Define): Compute `parent_method'.
9025
9026         * decl.cs
9027         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
9028         (MemberCore.GetClsCompliantAttributeValue): Likewise.
9029         (DeclSpace.ec): New protected field; store the EmitContext here.
9030         (DeclSpace.EmitContext): New public property.
9031         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
9032         (DeclSpace.ResolveNestedType): New public method.
9033         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
9034         (DeclSpace.NestedAccessible): Added `Type tb' argument.
9035         (DeclSpace.FamilyAccessible): Likewise.
9036         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
9037         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
9038         EmitContext.
9039
9040         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
9041         field.
9042
9043         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
9044         (Enum.Emit): Don't create a new EmitContext.
9045
9046 2004-10-18  Martin Baulig  <martin@ximian.com>
9047
9048         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
9049         `Type' directly, but call ResolveType() on it.
9050         (Catch.Resolve): Likewise.
9051         (Foreach.Resolve): Likewise.
9052
9053 2004-10-18  Martin Baulig  <martin@ximian.com>
9054
9055         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
9056         `Type' directly, but call ResolveType() on it.
9057         (Probe.DoResolve): Likewise.
9058         (ArrayCreation.LookupType): Likewise.
9059         (TypeOf.DoResolve): Likewise.
9060         (SizeOf.DoResolve): Likewise.
9061
9062 2004-10-18  Raja R Harinath  <rharinath@novell.com>
9063
9064         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
9065         the ResolveType.
9066
9067 2004-10-17  John Luke  <john.luke@gmail.com>
9068
9069         * class.cs (Operator.GetSignatureForError): use CSharpName
9070
9071         * parameter.cs (Parameter.GetSignatureForError): Returns
9072         correct name even if was not defined.
9073
9074 2004-10-13  Raja R Harinath  <rharinath@novell.com>
9075
9076         Fix #65816.
9077         * class.cs (TypeContainer.EmitContext): New property.
9078         (DefineNestedTypes): Create an emitcontext for each part.
9079         (MethodCore.DoDefineParameters): Use container's emitcontext.
9080         Pass type array to InternalParameters.
9081         (MemberBase.DoDefine): Use container's emitcontext.
9082         (FieldMember.Define): Likewise.
9083         (Event.Define): Likewise.
9084         (SetMethod.GetParameterInfo): Change argument to EmitContext.
9085         Pass type array to InternalParameters.
9086         (SetIndexerMethod.GetParameterInfo): Likewise.
9087         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9088         * delegate.cs (Define): Pass emitcontext to
9089         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
9090         array to InternalParameters.
9091         * expression.cs (ParameterReference.DoResolveBase): Pass
9092         emitcontext to GetParameterInfo.
9093         (ComposedCast.DoResolveAsTypeStep): Remove check on
9094         ec.ResolvingTypeTree.
9095         * parameter.cs (Parameter.Resolve): Change argument to
9096         EmitContext.  Use ResolveAsTypeTerminal.
9097         (Parameter.GetSignature): Change argument to EmitContext.
9098         (Parameters.ComputeSignature): Likewise.
9099         (Parameters.ComputeParameterTypes): Likewise.
9100         (Parameters.GetParameterInfo): Likewise.
9101         (Parameters.ComputeAndDefineParameterTypes): Likewise.
9102         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
9103         * support.cs (InternalParameters..ctor): Remove variant that takes
9104         a DeclSpace.
9105         * typemanager.cs (system_intptr_expr): New.
9106         (InitExpressionTypes): Initialize it.
9107
9108 2004-10-12  Chris Toshok  <toshok@ximian.com>
9109
9110         * cs-parser.jay: fix location for try_statement and catch_clause.
9111
9112 2004-10-18  Martin Baulig  <martin@ximian.com>
9113
9114         * class.cs (FieldMember.Define): Don't access the TypeExpr's
9115         `Type' directly, but call ResolveType() on it.
9116         (MemberBase.DoDefine): Likewise.
9117
9118         * expression.cs (New.DoResolve): Don't access the TypeExpr's
9119         `Type' directly, but call ResolveType() on it.
9120         (ComposedCast.DoResolveAsTypeStep): Likewise.
9121
9122         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
9123         `Type' directly, but call ResolveType() on it.
9124
9125 2004-10-17  John Luke  <john.luke@gmail.com>
9126
9127         * class.cs (Operator.GetSignatureForError): use CSharpName
9128
9129         * parameter.cs (Parameter.GetSignatureForError): Returns
9130         correct name even if was not defined.
9131
9132 2004-10-13  Raja R Harinath  <rharinath@novell.com>
9133
9134         Fix #65816.
9135         * class.cs (TypeContainer.EmitContext): New property.
9136         (DefineNestedTypes): Create an emitcontext for each part.
9137         (MethodCore.DoDefineParameters): Use container's emitcontext.
9138         Pass type array to InternalParameters.
9139         (MemberBase.DoDefine): Use container's emitcontext.
9140         (FieldMember.Define): Likewise.
9141         (Event.Define): Likewise.
9142         (SetMethod.GetParameterInfo): Change argument to EmitContext.
9143         Pass type array to InternalParameters.
9144         (SetIndexerMethod.GetParameterInfo): Likewise.
9145         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9146         * delegate.cs (Define): Pass emitcontext to
9147         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
9148         array to InternalParameters.
9149         * expression.cs (ParameterReference.DoResolveBase): Pass
9150         emitcontext to GetParameterInfo.
9151         (ComposedCast.DoResolveAsTypeStep): Remove check on
9152         ec.ResolvingTypeTree.
9153         * parameter.cs (Parameter.Resolve): Change argument to
9154         EmitContext.  Use ResolveAsTypeTerminal.
9155         (Parameter.GetSignature): Change argument to EmitContext.
9156         (Parameters.ComputeSignature): Likewise.
9157         (Parameters.ComputeParameterTypes): Likewise.
9158         (Parameters.GetParameterInfo): Likewise.
9159         (Parameters.ComputeAndDefineParameterTypes): Likewise.
9160         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
9161         * support.cs (InternalParameters..ctor): Remove variant that takes
9162         a DeclSpace.
9163         * typemanager.cs (system_intptr_expr): New.
9164         (InitExpressionTypes): Initialize it.
9165
9166 2004-10-12  Chris Toshok  <toshok@ximian.com>
9167
9168         * cs-parser.jay: fix location for try_statement and catch_clause.
9169
9170 2004-10-07  Raja R Harinath  <rharinath@novell.com>
9171
9172         More DeclSpace.ResolveType avoidance.
9173         * decl.cs (MemberCore.InUnsafe): New property.
9174         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
9175         with newly created EmitContext.
9176         (FieldMember.Define): Likewise.
9177         * delegate.cs (Delegate.Define): Likewise.
9178         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
9179         only if normal name-lookup fails.
9180         (TypeExpr.DoResolve): Enable error-checking.
9181         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
9182         (SizeOf.DoResolve): Likewise.
9183         (ComposedCast.DoResolveAsTypeStep): Likewise.
9184         (StackAlloc.DoResolve): Likewise.
9185         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
9186         (Block.Unsafe): New property.
9187         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
9188         (Unsafe): Set 'unsafe' flag of contained block.
9189         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
9190         (Fixed.Resolve): Likewise.
9191         (Catch.Resolve): Likewise.
9192         (Using.ResolveLocalVariableDecls): Likewise.
9193         (Foreach.Resolve): Likewise.
9194
9195 2004-10-05  John Luke <john.luke@gmail.com>
9196
9197         * cs-parser.jay: add location to error CS0175
9198
9199 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
9200
9201         * ecore.cs (Expression.Constantity): Add support for turning null
9202         into a constant.
9203
9204         * const.cs (Const.Define): Allow constants to be reference types
9205         as long as the value is Null.
9206
9207 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
9208
9209         * namespace.cs (NamespaceEntry.Using): No matter which warning
9210         level is set, check if this namespace name has already been added.
9211
9212 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
9213
9214         * expression.cs: reftype [!=]= null should always use br[true,false].
9215         # 67410
9216
9217 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
9218
9219         Fix #67108
9220         * attribute.cs: Enum conversion moved to 
9221         GetAttributeArgumentExpression to be applied to the all
9222         expressions.
9223
9224 2004-10-01  Raja R Harinath  <rharinath@novell.com>
9225
9226         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
9227         * class.c (TypeContainer.DefineType): Flag error if
9228         base types aren't accessible due to access permissions.
9229         * decl.cs (DeclSpace.ResolveType): Move logic to
9230         Expression.ResolveAsTypeTerminal.
9231         (DeclSpace.ResolveTypeExpr): Thin layer over
9232         Expression.ResolveAsTypeTerminal.
9233         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
9234         Refactor code into NestedAccess.  Use it.
9235         (DeclSpace.NestedAccess): New.
9236         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
9237         argument to silence errors.  Check access permissions.
9238         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
9239         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
9240         (Cast.DoResolve): Likewise.
9241         (New.DoResolve): Likewise.
9242         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
9243         (TypeOf.DoResolve): Likewise.
9244
9245         * expression.cs (Invocation.BetterConversion): Return the Type of
9246         the better conversion.  Implement section 14.4.2.3 more faithfully.
9247         (Invocation.BetterFunction): Make boolean.  Make correspondence to
9248         section 14.4.2.2 explicit.
9249         (Invocation.OverloadResolve): Update.
9250         (Invocation): Remove is_base field.
9251         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
9252         (Invocation.Emit): Likewise.
9253
9254 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
9255
9256         * cs-parser.jay: Reverted 642 warning fix.
9257
9258 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9259
9260         Fix bug #66615
9261         * decl.cs (FindMemberWithSameName): Indexer can have more than
9262         1 argument.
9263
9264 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9265
9266         * expression.cs (LocalVariableReference.DoResolveLValue):
9267         Do not report warning 219 for out values.
9268         (EmptyExpression.Null): New member to avoid extra allocations.
9269
9270 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9271
9272         * cs-parser.jay: Fix wrong warning 642 report.
9273
9274         * cs-tokenizer.cs (CheckNextToken): New helper;
9275         Inspect next character if is same as expected.
9276
9277 2004-09-23  Martin Baulig  <martin@ximian.com>
9278
9279         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9280         (Convert.ImplicitReferenceConversionExists): Likewise.
9281
9282 2004-11-09  Raja R Harinath  <rharinath@novell.com>
9283
9284         * Makefile (DISTFILES): Comment out a few missing files.
9285
9286 2004-10-29  Raja R Harinath  <rharinath@novell.com>
9287
9288         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
9289         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
9290         (gmcs.exe): Invoke bootstrap-libs.
9291         (clean-local): Clean the net_2_0_bootstrap profile too.
9292         (PROGRAM_INSTALL_DIR): New.
9293         (install-local): Use it.
9294
9295 2004-10-13  Martin Baulig  <martin@ximian.com>
9296
9297         * generic.cs (TypeManager.InflatedConstraints): New nested class.
9298         (TypeParameter.DefineType): If we're a method type parameter and
9299         that method is overriding something, "inflate" its constraints.
9300
9301 2004-10-12  Martin Baulig  <martin@ximian.com>
9302
9303         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
9304         and have type arguments, create and resolve a ConstructedType.
9305
9306 2004-10-12  Martin Baulig  <martin@ximian.com>
9307
9308         * decl.cs (MemberCache.FindMemberToOverride): Use
9309         TypeManager.IsEqual() to compare the parameters and Type.Equals()
9310         to compare the invocationType.
9311
9312         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
9313         When comparing two type parameters, only do the signature-only
9314         comparision for method type parameters.
9315
9316 2004-10-11  Martin Baulig  <martin@ximian.com>
9317
9318         * report.cs: Don't make --fatal abort on warnings, we have
9319         -warnaserror for that.
9320
9321 2004-10-11  Martin Baulig  <martin@ximian.com>
9322
9323         * typemanager.cs
9324         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
9325         (TypeManager.IsEqual): Call ourself recursively instead of using
9326         Type.IsEqual(). 
9327
9328 2004-10-11  Martin Baulig  <martin@ximian.com>
9329
9330         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
9331         on our own type parameters, not on the ones we inherit from a containing
9332         class.
9333
9334         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
9335         the comparision.
9336
9337         * generic.cs (TypeParameter.Define): We may only be called once.
9338
9339         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
9340         instead of TypeManager.IsEqual().
9341
9342 2004-09-28  Martin Baulig  <martin@ximian.com>
9343
9344         * generic.cs
9345         (GenericConstraints.EffectiveBaseClass): New public property.
9346         (TypeParameter.GenericConstraints): New public property.
9347         (ConstructedType.CheckConstraints): Improved.
9348
9349         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
9350         (Convert.TypeParameterConversion): New private method; use this in
9351         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
9352         for all conversions related to type parameters.
9353
9354 2004-09-24  Martin Baulig  <martin@ximian.com>
9355
9356         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
9357         type parameter conversions for type parameters which are known to
9358         be reference types.
9359
9360 2004-09-24  Martin Baulig  <martin@ximian.com>
9361
9362         * generic.cs (GenericConstraints): Added `IsReferenceType' and
9363         `IsValueType' properties.
9364
9365         * support.cs (ReflectionConstraints): Use
9366         Type.GetGenericParameterConstraints() instead of the old hack.
9367
9368 2004-09-24  Martin Baulig  <martin@ximian.com>
9369
9370         * generic.cs (GenericConstraints): Moved here and made it an
9371         abstract class.
9372
9373         * support.cs (GenericConstraints): Moved to generic.cs.
9374
9375 2004-09-24  Martin Baulig  <martin@ximian.com>
9376
9377         * support.cs
9378         (ReflectionConstraints): Un-nested this class and made it public.
9379
9380         * typemanager.cs
9381         (TypeManager.GetTypeParameterConstraints): New public method.
9382         (TypeManager.HasConstructorConstraint): Use the attributes.
9383
9384 2004-09-24  Martin Baulig  <martin@ximian.com>
9385
9386         * support.cs (GenericConstraints): Replaced `HasConstructor',
9387         `IsReferenceType' and `IsValueType' with `Attributes'.
9388         (ReflectionParameters.ReflectionConstraints): Removed the Create()
9389         method and made the .ctor public.
9390
9391         * generic.cs (Constraints.Attributes): New public property.
9392         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
9393         `IsReferenceType' -> `HasReferenceTypeConstraint' and
9394         `IsValueType' -> `HasValueTypeConstraint'.
9395
9396 2004-09-23  Martin Baulig  <martin@ximian.com>
9397
9398         * generic.cs (Constraints): Reflect latest runtime changes.
9399
9400 2004-09-23  Martin Baulig  <martin@ximian.com>
9401
9402         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9403         (Convert.ImplicitReferenceConversionExists): Likewise.
9404
9405 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9406
9407         * class.cs (Operator.Define): Add error 448 and 559 report.
9408         
9409 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9410
9411         * class.cs (MemberBase.IsTypePermitted): New protected
9412         method for checking error CS0610.
9413
9414 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9415
9416         * class.cs (TypeContainer.HasExplicitLayout): New property
9417         Returns whether container has StructLayout attribute set Explicit.
9418         (FieldMember): New abstract class for consts and fields.
9419         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
9420         (Field): Reuse FieldMember.
9421
9422         * const.cs (Const): Reuse FieldMember.
9423
9424         * rootcontext.cs: EmitConstants call moved to class.
9425
9426 2004-09-22  Martin Baulig  <martin@ximian.com>
9427
9428         Marek and me just fixed one of our oldest bugs: #28562 :-)
9429
9430         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
9431
9432         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
9433         we're an EnumConstant, just return that.
9434         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
9435         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
9436         to get the value which'll actually be written into the attribute.
9437         However, we have to use GetValue() to access the attribute's value
9438         in the compiler.        
9439
9440 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9441
9442         * constant.cs (Constant.IsNegative): New abstract property
9443         IsNegative.
9444
9445         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
9446         (StackAlloc.DoResolve): Reused IsNegative.
9447
9448 2004-09-22  Martin Baulig  <martin@ximian.com>
9449
9450         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
9451         public method; like LookupTypeContainer, but also works for
9452         generic instances.
9453
9454         * report.cs (Report.SymbolRelatedToPreviousError): Use
9455         TypeManager.LookupGenericTypeContainer().       
9456
9457 2004-09-22  Martin Baulig  <martin@ximian.com>
9458
9459         Thanks to Peter Sestoft for this bug report.
9460
9461         * expression.cs (Conditional): If both the `trueExpr' and the
9462         `falseExpr' is a NullLiteral, return a NullLiteral.
9463
9464 2004-09-22  Martin Baulig  <martin@ximian.com>
9465
9466         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
9467         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
9468         for the "get_Current" call.
9469
9470 2004-09-21  Martin Baulig  <martin@ximian.com>
9471
9472         * convert.cs (Convert.ImplicitReferenceConversion): When
9473         converting to an interface type, first check whether we're
9474         converting from a reference type.
9475
9476 2004-09-14  Martin Baulig  <martin@ximian.com>
9477
9478         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
9479
9480 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
9481
9482         Fixed bug #61902
9483         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
9484         called and is obsolete then this member suppress message
9485         when call is inside next [Obsolete] method or type.
9486
9487         * expression.cs: Use TestObsoleteMethodUsage member.
9488
9489 2004-09-14  Martin Baulig  <martin@ximian.com>
9490
9491         * genericparser.cs: Removed.
9492
9493 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
9494
9495         * class.cs (MethodCore.CheckBase): Fix bug #65757.
9496
9497 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
9498
9499         * attribute.cs (Attribute.Resolve): Add error 653 report.
9500
9501         * class.cs (Class.ApplyAttributeBuilder): Add error 641
9502         report.
9503         (Method.ApplyAttributeBuilder): Add error 685 report.
9504         (Operator.Define): Add error 564 report.
9505
9506         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9507
9508         * expression.cs (Invocation.DoResolve): Add error
9509         245 and 250 report.
9510
9511         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9512         error 674 report.
9513
9514 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9515
9516         * class.cs (ConstructorInitializer.Resolve):
9517         Wrong error number (515->516).
9518
9519 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9520
9521         * class.cs (Indexer.Define): Add error 631 report.
9522
9523 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9524
9525         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9526
9527 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9528
9529         * expression.cs (Probe.DoResolve): Add error CS0241 report.
9530
9531 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
9532
9533         * cs-parser.jay: Added error CS0241 report.
9534
9535 2004-09-10  Raja R Harinath  <rharinath@novell.com>
9536
9537         * cs-parser.jay (fixed_statement): Introduce a scope for the
9538         declaration in the 'fixed' statement.
9539
9540 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9541
9542         * cs-parser.jay: Added CS0230 error report.
9543
9544 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9545
9546         * cs-parser.jay: Added errors CS0231 and CS0257 report.
9547
9548 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9549
9550         * expression.cs (Argument.Resolve): Added error CS0192 and
9551         CS0199 report.
9552
9553 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9554
9555         C# 2.0 #pragma warning feature
9556
9557         * cs-tokenizer.cs (PreProcessPragma): New method; 
9558         Handles #pragma directive.
9559
9560         * report.cs (WarningRegions): New class; Support
9561         class for #pragma warning directive. It tests whether
9562         warning is enabled for a given line.
9563
9564 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
9565
9566         * const.cs: Add more descriptive error report, tahnks to
9567         Sebastien. 
9568
9569 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
9570
9571         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9572
9573 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
9574
9575         * expression.cs: Apply patch from Ben: Remove dead code from
9576         ArrayCreation, and remove the TurnintoConstant call in const.cs,
9577         as that code just threw an exception anwyays.
9578
9579         * const.cs: Remove the call to the turnintoconstant, for details
9580         see bug: #63144
9581         
9582         * literal.cs: The type of the null-literal is the null type;  So
9583         we use a placeholder type (literal.cs:System.Null, defined here)
9584         for it.
9585
9586         * expression.cs (Conditional.DoResolve): Remove some old code that
9587         is no longer needed, conversions have been fixed.
9588
9589         (ArrayCreationExpression.DoResolve): Return false if we fail to
9590         resolve the inner expression.
9591
9592 2004-09-07  Raja R Harinath  <rharinath@novell.com>
9593
9594         Fix test-290.cs.
9595         * cs-parser.jay (delegate_declaration): Record a delegate
9596         declaration as a type declaration.
9597         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9598
9599 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
9600
9601         * parameter.cs: Do not crash if the type can not be resolved. 
9602
9603         * expression.cs: Report errors with unsafe pointers, fixes #64896
9604
9605 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9606
9607         * expression.cs: Pointer arith always needs to do a conv.i
9608         if the operand is a long. fix 65320
9609
9610 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9611
9612         Fixed cs0619-37.cs, cs0619-38.cs
9613
9614         * enum.cs (GetObsoleteAttribute): Removed.
9615
9616         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9617         on Enum member is double staged. The first is tested member
9618         and then enum.
9619
9620 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9621
9622         Fixed #56986, #63631, #65231
9623
9624         * class.cs: (TypeContainer.AddToMemberContainer): New method,
9625         adds member to name container.
9626         (TypeContainer.AddToTypeContainer): New method, adds type to
9627         name container.
9628         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9629         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9630         AddOperator): Simplified by reusing AddToMemberContainer.
9631         (TypeContainer.UserDefinedStaticConstructor): Changed to property
9632         instead of field.
9633         (Method.CheckForDuplications): Fixed implementation to test all
9634         possibilities.
9635         (MemberBase): Detection whether member is explicit interface
9636         implementation is now in constructor.
9637         (MemberBase.UpdateMemberName): Handles IndexerName.
9638         (Accessor): Changed to keep also location information.
9639         (AbstractPropertyEventMethod): Is derived from MemberCore.
9640         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9641         will be emited or not.
9642         (PropertyBase.AreAccessorsDuplicateImplementation):
9643         Tests whether accessors are not in collision with some method.
9644         (Operator): Is derived from MethodCore to simplify common
9645         operations.
9646
9647         * decl.cs (Flags.TestMethodDuplication): Test for duplication
9648         must be performed.
9649         (DeclSpace.AddToContainer): Adds the member to defined_names
9650         table. It tests for duplications and enclosing name conflicts.
9651
9652         * enum.cs (EnumMember): Clean up to reuse the base structures
9653
9654 2004-09-03  Martin Baulig  <martin@ximian.com>
9655
9656         Merged latest changes into gmcs.  Please keep this comment in
9657         here, it makes it easier for me to see what changed in MCS since
9658         the last time I merged.
9659
9660 2004-09-03  Martin Baulig  <martin@ximian.com>
9661
9662         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9663         into TypeContainer, to make partial classes work again.
9664
9665 2004-09-03  Martin Baulig  <martin@ximian.com>
9666
9667         * rootcontext.cs (RootContext.V2): Removed.
9668
9669 2004-03-23  Martin Baulig  <martin@ximian.com>
9670
9671         * expression.cs (Invocation.OverloadResolve): Added `bool
9672         may_fail' argument and use it instead of the Location.IsNull() hack.
9673
9674 2004-09-09  Martin Baulig  <martin@ximian.com>
9675
9676         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
9677
9678 2004-09-09  Martin Baulig  <martin@ximian.com>
9679
9680         * generic.cs (TypeParameter.DefineType): Added support for
9681         explicit interface methods.
9682
9683 2004-09-09  Martin Baulig  <martin@ximian.com>
9684
9685         * README.Changes: New document.  Started to list important changes
9686         between MCS and GMCS here.
9687
9688 2004-09-08  Martin Baulig  <martin@ximian.com>
9689
9690         * class.cs
9691         (TypeContainer.CheckRecursiveDefinition): New protected method.
9692         (TypeContainer.DefineType): Move the CS0146 check into
9693         CheckRecursiveDefinition().     
9694
9695 2004-09-06  Martin Baulig  <martin@ximian.com>
9696
9697         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
9698         types for the constructor constraint.
9699
9700 2004-09-03  Martin Baulig  <martin@ximian.com>
9701
9702         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9703         into TypeContainer, to make partial classes work again.
9704
9705 2004-09-03  Martin Baulig  <martin@ximian.com>
9706
9707         * rootcontext.cs (RootContext.V2): Removed.
9708
9709 2004-03-23  Martin Baulig  <martin@ximian.com>
9710
9711         * expression.cs (Invocation.OverloadResolve): Added `bool
9712         may_fail' argument and use it instead of the Location.IsNull() hack.
9713
9714 2004-09-03  Martin Baulig  <martin@ximian.com>
9715
9716         Merged latest changes into gmcs.  Please keep this comment in
9717         here, it makes it easier for me to see what changed in MCS since
9718         the last time I merged.
9719
9720 2004-09-03  Raja R Harinath  <rharinath@novell.com>
9721
9722         Fix #61128.
9723         * expression.cs (BetterConversion): Don't allow either conversion 
9724         to be null.  Remove redundant implicit conversion test when 'q ==
9725         null' -- when this function is invoked, we already know that the
9726         implicit conversion exists.
9727         (BetterFunction): Assume that 'best' is non-null.  Remove
9728         redundant reimplementation of IsApplicable when 'best' is null.
9729         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9730         number of arguments.
9731         (IsAncestralType): Extract from OverloadResolve.
9732         (OverloadResolve): Make robust to the MethodGroupExpr being
9733         unsorted.  Implement all the logic of Section 14.5.5.1, and
9734         support overloading of methods from multiple applicable types.
9735         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
9736
9737         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9738         (RealError, Warning): Append type of report to related symbol.
9739
9740 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
9741
9742         * enum.cs: Fixed CLS-Compliance checks for enum members.
9743         Error tests cs3008-8.cs, cs3014-8.cs
9744
9745 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9746
9747         Fixed bug #62342, #63102
9748         * class.cs: ImplementIndexer uses member.IsExplicitImpl
9749         like ImplementMethod.
9750
9751 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9752
9753         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9754         Fixed bug #65170.
9755
9756 2004-09-02  Martin Baulig  <martin@ximian.com>
9757
9758         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9759         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9760         on the MethodBase.
9761
9762 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
9763
9764         C# 2.0 Static classes implemented
9765
9766         * class.cs (TypeContainer): instance_constructors,
9767         initialized_fields, initialized_static_fields,
9768         default_constructor, base_inteface_types are protected to be
9769         accessible from StaticClass.
9770         (TypeContainer.DefineDefaultConstructor): New virtual method
9771         for custom default constructor generating
9772         (StaticClass): New class to handle "Static classes" feature.
9773
9774         * cs-parser.jay: Handle static keyword on class like instance
9775         of StaticClass.
9776
9777         * driver.cs: Added "/langversion" command line switch with two
9778         options (iso-1, default).
9779
9780 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
9781
9782         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9783
9784 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
9785
9786         * delegate.cs: Style.
9787
9788 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9789
9790         * delegate.cs: Add seperate instance expr field for miguel.
9791
9792 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9793
9794         * PointerArithmetic (Resolve): make sure we are not doing
9795         pointer arith on void*. Also, make sure we are resolved
9796         by not setting eclass until resolve.
9797
9798         All callers: Make sure that PointerArithmetic gets resolved.
9799
9800 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9801
9802         * ArrayCreation (LookupType): If the type does not resolve 
9803         to an array, give an error.
9804
9805 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
9806
9807         * statement.cs (Try.Resolve): Fixed bug #64222
9808
9809 2004-08-27  Martin Baulig  <martin@ximian.com>
9810
9811         * class.cs
9812         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9813         crash here.     
9814
9815 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9816
9817         * ecore.cs (Constantify): Get underlying type via
9818         System.Enum.GetUnderlyingType to avoid StackOverflow on the
9819         Windows in special cases.
9820
9821 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9822
9823         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9824         for obtaining also private methods.
9825         (GetRemoveMethod): Used GetRemoveMethod (true)
9826         for obtaining also private methods.
9827
9828 2004-09-02  Martin Baulig  <martin@ximian.com>
9829
9830         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9831         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9832         on the MethodBase.
9833
9834 2004-08-27  Martin Baulig  <martin@ximian.com>
9835
9836         * class.cs
9837         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9838         crash here.     
9839
9840 2004-08-25  Martin Baulig  <martin@ximian.com>
9841
9842         * support.cs (ReflectionParameters..ctor): If this is a generic
9843         method, retrieve and store its type parameters.
9844         (InternalParameters..ctor): Added `TypeParameter[]' argument.
9845         (ReflectionParameters.GenericConstraints): The argument specifies
9846         the type parameter, not the method parameter.
9847         (InternalParameters.GenericConstraints): Likewise.
9848
9849         * generic.cs (TypeParameter.DefineType): Correctly handle
9850         constraints wrt. generic methods in interfaces and their
9851         implementations.        
9852
9853 2004-08-24  Martin Baulig  <martin@ximian.com>
9854
9855         * generic.cs (TypeParameter.IsSubclassOf): New public method.
9856         (Constraints.IsSubclassOf): New internal method.
9857
9858         * typemanager.cs (TypeManager.FindMembers): Added special support
9859         for GenericTypeParameterBuilder's.      
9860         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
9861         type parameters.
9862
9863 2004-08-24  Martin Baulig  <martin@ximian.com>
9864
9865         * typemanager.cs
9866         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
9867         this for accessibility checks.
9868         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
9869         IsNestedFamilyAccessible.
9870         (TypeManager.IsSubclassOf): New method, do what the name actually
9871         says.   
9872
9873 2004-08-24  Martin Baulig  <martin@ximian.com>
9874
9875         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
9876         as a SimpleName, include the generic arity.
9877
9878 2004-08-24  Martin Baulig  <martin@ximian.com>
9879
9880         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9881         MethodAttributes.HideBySig for operators.
9882
9883 2004-08-23  Martin Baulig  <martin@ximian.com>
9884
9885         Back to the old error reporting system :-)
9886
9887         * report.cs (Message): Removed.
9888         (Report.MessageData, ErrorData, WarningData): Removed.
9889         (Report.Error, Warning): Back to the old system.
9890
9891 2004-08-23  Martin Baulig  <martin@ximian.com>
9892
9893         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9894
9895         * class.cs (TypeContainer.ParentContainer): New public virtual
9896         method; replaces the explicit interface implementation.
9897         (ClassPart.ParentContainer): Override.
9898
9899 2004-08-23  Martin Baulig  <martin@ximian.com>
9900
9901         * statement.cs (Switch): Added support for constant switches; see
9902         #59428 or test-285.cs.
9903
9904 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9905
9906         Fixed bug #62740.
9907         * statement.cs (GetEnumeratorFilter): Removed useless
9908         logic because C# specs is strict. GetEnumerator must be
9909         public.
9910
9911 2004-08-22  Martin Baulig  <martin@ximian.com>
9912
9913         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9914         a switch and may break, reset the barrier.  Fixes #59867.
9915
9916 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9917
9918         CLS-Compliance speed up (~5% for corlib)
9919
9920         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9921         New method. Tests container for CLS-Compliant names
9922
9923         * class.cs (TypeContainer.VerifyClsName): New method.
9924         Checks whether container name is CLS Compliant.
9925         (Constructor): Implements IMethodData.
9926
9927         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9928         low-case table for CLS Compliance test.
9929         (MemberCache.VerifyClsParameterConflict): New method.
9930         Checks method parameters for CS3006 error.
9931
9932         * enum.cs (EnumMember): Is derived from MemberCore.
9933         (Enum.VerifyClsName): Optimized for better performance.
9934
9935 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9936
9937         * report.cs: Renamed Error_T to Error and changed all
9938         references.
9939
9940 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9941
9942         * class.cs (TypeContainer.IndexerArrayList): New inner class
9943         container for indexers.
9944         (TypeContainer.DefaultIndexerName): New constant for default
9945         indexer name. Replaced all "Item" with this constant.
9946         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9947
9948         * typemanager.cs (TypeManager.default_member_ctor): Cache here
9949         DefaultMemberAttribute constructor.
9950
9951 2004-08-05  Martin Baulig  <martin@ximian.com>
9952
9953         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9954         Fix bug #59429.
9955
9956 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
9957
9958         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9959         multi platforms problem.
9960
9961         * compiler.csproj: Included shared files.
9962
9963 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9964
9965         Fix bug 60333, 55971 in the more general way
9966         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9967         Added arg_type argument for constant conversion.
9968         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9969
9970 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9971
9972         Fix bug #59760
9973         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
9974         OperatorArrayList, MethodCoreArrayList for typecontainer
9975         containers. Changed class member types to these new types.
9976         (MethodArrayList.DefineMembers): Added test for CS0659.
9977
9978 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
9979
9980         * cfold.cs: Synchronize the folding with the code in expression.cs
9981         Binary.DoNumericPromotions for uint operands.
9982
9983         * attribute.cs: Revert patch from Raja, it introduced a regression
9984         while building Blam-1.2.1 (hard to isolate a test case).
9985
9986 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9987
9988         Fix for #55382
9989         * class.cs:
9990         (TypeContainer.Define): Renamed to DefineContainerMembers because of
9991         name collision.
9992         (MethodCore.parent_method): New member. The method we're overriding
9993         if this is an override method.
9994         (MethodCore.CheckBase): Moved from Method class and made common.
9995         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9996         private.
9997         (MethodCore.CheckForDuplications): New abstract method. For custom
9998         member duplication search in a container
9999         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
10000         method and its return type.
10001         (Event.conflict_symbol): New member. Symbol with same name in the
10002         parent class.
10003
10004         * decl.cs:
10005         (MemberCache.FindMemberWithSameName): New method. The method
10006         is looking for conflict with inherited symbols.
10007
10008 2004-08-04  Martin Baulig  <martin@ximian.com>
10009
10010         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10011
10012         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10013
10014 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10015
10016         * report.cs (Message): New enum for better error, warning reference in
10017         the code.
10018         (MessageData): New inner abstract class. It generally handles printing of
10019         error and warning messages.
10020         Removed unused Error, Warning, Message methods.
10021
10022 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10023
10024         Fix for cs0592-8.cs test
10025         * attribute.cs
10026         (Attributable.ValidAttributeTargets): Made public.
10027         (Attribute.ExplicitTarget): New member for explicit target value.
10028         (Attribute.CheckTargets): Now we translate explicit attribute
10029         target to Target here.
10030
10031 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
10032
10033         * ecore.cs (MethodGroupExpr): new IsBase property.
10034
10035         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
10036
10037         * delegate.cs (DelegateCreation): store a MethodGroupExpr
10038         rather than an instance expr.
10039
10040         (DelegateCreation.Emit): Use the method group rather than
10041         the instance expression. Also, if you have base.Foo as the
10042         method for a delegate, make sure to emit ldftn, not ldftnvirt.
10043
10044         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
10045
10046         (NewDelegate.DoResolve): Only check for the existance of Invoke
10047         if the method is going to be needed. Use MethodGroupExpr.
10048
10049         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
10050
10051         * expression.cs: For pointer arith., make sure to use
10052         the size of the type, not the size of the pointer to
10053         the type.
10054
10055 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10056
10057         Fix for #60722
10058         * class.cs (Class): Added error CS0502 test.
10059
10060 2004-08-03  John Luke  <jluke@cfl.rr.com>
10061             Raja R Harinath  <rharinath@novell.com>
10062
10063         Fix for #60997.
10064         * attribute.cs (Attribute.complained_before): New flag.
10065         (Attribute.ResolveType, Attribute.Resolve),
10066         (Attribute.DefinePInvokeMethod): Set it.
10067         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
10068         
10069 2004-08-03  Martin Baulig  <martin@ximian.com>
10070
10071         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10072         use a user-defined operator; we still need to do numeric
10073         promotions in case one argument is a builtin type and the other
10074         one has an implicit conversion to that type.  Fixes #62322.
10075
10076 2004-08-18  Martin Baulig  <martin@ximian.com>
10077
10078         * class.cs (Method.Define): Use the correct method name when
10079         creating the MethodBuilder for a generic method.
10080
10081 2004-08-17  Martin Baulig  <martin@ximian.com>
10082
10083         * generic.cs (Constraints): Support type parameter constraints.
10084
10085 2004-08-16  Martin Baulig  <martin@ximian.com>
10086
10087         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
10088         (Token.GENERIC_DIMENSION): New token; this is returned if we
10089         encounter an unbound generic type in a typeof() expression.
10090
10091         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
10092         this token is only generated while parsing a typeof() expression.
10093         (typeof_expression): Removed the old unbound_type hack.
10094
10095         * generic.cs (TypeArguments.IsUnbound): New public property.
10096
10097         * decl.cs (MemberName): Added support for unbound types.
10098
10099 2004-08-14  Martin Baulig  <martin@ximian.com>
10100
10101         * typemanager.cs
10102         (TypeManager.IsEqualGenericInstance): New static method.
10103         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
10104         just used to check accessibility, so follow the rules of 26.1.6.        
10105
10106         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
10107         ConstructedType instead of a TypeExpression if we have type arguments.
10108
10109         * cs-parser.jay (typeof_expression): Support unbound generic types.
10110
10111         * ecore.cs (UnboundTypeExpression): New public class.
10112
10113 2004-08-12  Martin Baulig  <martin@ximian.com>
10114
10115         * typemanager.cs (TypeManager.IsNestedChildOf): Use
10116         TypeManager.IsEqual() rather than `=='.
10117
10118         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
10119         generic instances as well.
10120
10121 2004-08-12  Martin Baulig  <martin@ximian.com>
10122
10123         * expression.cs (Invocation.InferType): We can only infer method
10124         type parameters.  Fixes #62647.
10125
10126 2004-08-11  Martin Baulig  <martin@ximian.com>
10127
10128         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
10129         before resolving the base classes.
10130
10131 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10132
10133         * Makefile: install .mdb file too.
10134
10135 2004-08-05  Martin Baulig  <martin@ximian.com>
10136
10137         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
10138         initializer, the current type is just the TypeBuilder, not the
10139         instantiated generic type.
10140         (FieldExpr.IsFieldInitializer): New public property.
10141
10142 2004-08-04  Martin Baulig  <martin@ximian.com>
10143
10144         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10145
10146         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10147
10148 2004-08-03  Martin Baulig  <martin@ximian.com>
10149
10150         * class.cs (MethodData.Define): If we're an explicit
10151         implementation, remove the generic arity from the type name.
10152
10153 2004-08-03  Martin Baulig  <martin@ximian.com>
10154
10155         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10156         use a user-defined operator; we still need to do numeric
10157         promotions in case one argument is a builtin type and the other
10158         one has an implicit conversion to that type.  Fixes #62322.
10159
10160 2004-08-02  Martin Baulig  <martin@ximian.com>
10161
10162         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
10163         `TypeExpr[]' array.
10164         (TypeContainer.GetClassBases): Return the unexpanded list of
10165         interfaces; we expand them later.
10166         (TypeContainer.DefineType): After creating the TypeBuilder, call
10167         TypeManager.ExpandInterfaces() to get an expanded and resolved
10168         list of interfaces.
10169
10170         * ecore.cs (TypeExpr.GetInterfaces): Removed
10171
10172         * generics.cs (Constraints.InterfaceConstraints): Remove.
10173         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
10174         register the interface constraints.
10175
10176         * typemanager.cs
10177         (TypeManager.AddUserType): Removed the `ifaces' argument.
10178         (TypeManager.AddTypeParameter): Likewise.
10179         (TypeManager.AddUserInterface): Removed, was unused.
10180         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
10181         `TypeExpr[]' array for the interfaces.
10182         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
10183         has been defined, returns a list of the resolved interfaces types.
10184         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
10185         (TypeManager.GetExplicitInterfaces): Likewise.  
10186
10187 2004-08-02  Martin Baulig  <martin@ximian.com>
10188
10189         * expression.cs (Invocation.EmitCall): If we're invoking a method
10190         on a type parameter, use the new `Constrained' prefix opcode.
10191
10192 2004-08-02  Martin Baulig  <martin@ximian.com>
10193
10194         * statement.cs (LocalInfo.Flags): Added `IsThis'.
10195         (LocalInfo.IsThis): New public property.
10196         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10197
10198 2004-08-01  Martin Baulig  <martin@ximian.com>
10199
10200         * class.cs (TypeContainer.GetClassBases): Don't set the default
10201         here since we may get called from GetPartialBases().
10202         (TypeContainer.DefineType): If GetClassBases() didn't return a
10203         parent, use the default one.
10204
10205 2004-07-30  Martin Baulig  <martin@ximian.com>
10206
10207         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10208
10209         * class.cs (SourceMethod): New public class, derive from the
10210         symbol writer's ISourceMethod.
10211         (Method): Use the new symbol writer API.
10212
10213         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10214         as argument and use the new symbol writer.
10215
10216         * location.cs
10217         (SourceFile): Implement the symbol writer's ISourceFile.
10218         (Location.SymbolDocument): Removed.
10219         (Location.SourceFile): New public property.
10220
10221         * symbolwriter.cs: Use the new symbol writer API.
10222
10223 2004-07-30  Raja R Harinath  <rharinath@novell.com>
10224
10225         * Makefile (install-local): Remove.  Functionality moved to
10226         executable.make.
10227
10228 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
10229
10230         * Makefile: Install mcs.exe.config file together with mcs.exe.
10231         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10232         correct runtime version.
10233         
10234 2004-07-25  Martin Baulig  <martin@ximian.com>
10235
10236         * class.cs
10237         (TypeContainer.RegisterOrder): Removed, this was unused.
10238         (TypeContainer, interface_order): Removed.
10239         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10240         TypeContainer as argument since we can also be called with a
10241         `PartialContainer' for a partial class/struct/interface.
10242         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10243         of checking whether we're an `Interface' - we could be a
10244         `PartialContainer'.
10245         (PartialContainer.Register): Override; call
10246         AddClass()/AddStruct()/AddInterface() on our parent.
10247
10248         * cs-parser.jay (interface_member_declaration): Add things to the
10249         `current_container', not the `current_class'.
10250
10251         * rootcontext.cs (RegisterOrder): The overloaded version which
10252         takes an `Interface' was unused, removed.
10253
10254         * typemanager.cs (TypeManager.LookupInterface): Return a
10255         `TypeContainer', not an `Interface'.
10256         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10257         contain a `PartialContainer' for an interface, so check it's
10258         `Kind' to figure out what it is.
10259
10260 2004-07-25  Martin Baulig  <martin@ximian.com>
10261
10262         * class.cs (Class.DefaultTypeAttributes): New public constant.
10263         (Struct.DefaultTypeAttributes): Likewise.
10264         (Interface.DefaultTypeAttributes): Likewise.
10265         (PartialContainer.TypeAttr): Override this and add the
10266         DefaultTypeAttributes.
10267
10268 2004-07-25  Martin Baulig  <martin@ximian.com>
10269
10270         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10271         we can just use the `Parent' field instead.
10272
10273 2004-07-25  Martin Baulig  <martin@ximian.com>
10274
10275         * class.cs (TypeContainer.Emit): Renamed to EmitType().
10276
10277 2004-07-25  Martin Baulig  <martin@ximian.com>
10278
10279         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10280         our parts before defining any methods.
10281         (TypeContainer.VerifyImplements): Make this virtual.
10282         (ClassPart.VerifyImplements): Override and call VerifyImplements()
10283         on our PartialContainer.
10284
10285 2004-07-25  Martin Baulig  <martin@ximian.com>
10286
10287         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10288
10289         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10290         argument, we can just use the `Parent' field instead.
10291
10292         * class.cs
10293         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
10294         (MemberBase.DoDefine): Likewise.
10295
10296 2004-07-24  Martin Baulig  <martin@ximian.com>
10297
10298         * decl.cs (MemberCore.Parent): New public field.
10299         (DeclSpace.Parent): Moved to MemberCore.
10300
10301         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10302         (MemberBase.ctor): Added TypeContainer argument, pass it to our
10303         parent's .ctor.
10304         (FieldBase, Field, Operator): Likewise.
10305         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10306         (EventField, Event): Likewise.
10307
10308 2004-07-23  Martin Baulig  <martin@ximian.com>
10309
10310         * class.cs (PartialContainer): New public class.
10311         (ClassPart): New public class.
10312         (TypeContainer): Added support for partial classes.
10313         (TypeContainer.GetClassBases): Splitted some of the functionality
10314         out into GetNormalBases() and GetPartialBases().
10315
10316         * cs-tokenizer.cs (Token.PARTIAL): New token.
10317         (Tokenizer.consume_identifier): Added some hacks to recognize
10318         `partial', but only if it's immediately followed by `class',
10319         `struct' or `interface'.
10320
10321         * cs-parser.jay: Added support for partial clases.
10322
10323 2004-07-23  Martin Baulig  <martin@ximian.com>
10324
10325         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10326         a `DeclSpace' and also made it readonly.
10327         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10328         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10329         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10330
10331         * cs-parser.jay: Pass the `current_class', not the
10332         `current_container' (at the moment, this is still the same thing)
10333         to a new Method, Property, Event, Indexer or Constructor.
10334
10335 2004-07-23  Martin Baulig  <martin@ximian.com>
10336
10337         * cs-parser.jay (CSharpParser): Added a new `current_class' field
10338         and removed the `current_interface' one.
10339         (struct_declaration, class_declaration, interface_declaration):
10340         Set `current_class' to the newly created class/struct/interface;
10341         set their `Bases' and call Register() before parsing their body.
10342
10343 2004-07-23  Martin Baulig  <martin@ximian.com>
10344
10345         * class.cs (Kind): New public enum.
10346         (TypeContainer): Made this class abstract.
10347         (TypeContainer.Kind): New public readonly field.
10348         (TypeContainer.CheckDef): New public method; moved here from
10349         cs-parser.jay.
10350         (TypeContainer.Register): New public abstract method.
10351         (TypeContainer.GetPendingImplementations): New public abstract
10352         method.
10353         (TypeContainer.GetClassBases): Removed the `is_class' and
10354         `is_iface' parameters.
10355         (TypeContainer.DefineNestedTypes): Formerly known as
10356         DoDefineType().
10357         (ClassOrStruct): Made this class abstract.
10358
10359         * tree.cs (RootTypes): New public type. 
10360
10361 2004-07-20  Martin Baulig  <martin@ximian.com>
10362
10363         * tree.cs (Tree.RecordNamespace): Removed.
10364         (Tree.Namespaces): Removed.
10365
10366         * rootcontext.cs (RootContext.IsNamespace): Removed.
10367
10368         * cs-parser.jay (namespace_declaration): Just create a new
10369         NamespaceEntry here.
10370
10371 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
10372
10373         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
10374         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
10375         entry to make sure it runs in the correct runtime version.
10376         
10377 2004-07-18  Martin Baulig  <martin@ximian.com>
10378
10379         * generic.cs (ConstructedType.CheckConstraints): Improved
10380         constraints checking.
10381
10382 2004-07-18  Martin Baulig  <martin@ximian.com>
10383
10384         * expression.cs (Invocation.BetterMethod): Call
10385         TypeManager.TypeToCoreType() on all types and removed my previous
10386         hack; we're already doig the right thing here.
10387
10388 2004-07-17  Martin Baulig  <martin@ximian.com>
10389
10390         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
10391
10392 2004-07-16  Martin Baulig  <martin@ximian.com>
10393
10394         * iterators.cs: Added generics support.
10395
10396 2004-07-16  Martin Baulig  <martin@ximian.com>
10397
10398         * iterators.cs: Rewrote this.  We're now using one single Proxy
10399         class for both the IEnumerable and the IEnumerator interface and
10400         `Iterator' derives from Class so we can use the high-level API.
10401
10402         * class.cs (TypeContainer.AddIterator): New method.
10403         (TypeContainer.DoDefineType): New protected virtual method, which
10404         is called from DefineType().
10405         (TypeContainer.DoDefineMembers): Call DefineType() and
10406         DefineMembers() on all our iterators.
10407         (TypeContainer.Emit): Call Emit() on all our iterators.
10408         (TypeContainer.CloseType): Call CloseType() on all our iterators.
10409
10410         * codegen.cs (EmitContext.CurrentIterator): New public field.
10411
10412 2004-07-15  Martin Baulig  <martin@ximian.com>
10413
10414         * typemanager.cs
10415         (TypeManager.not_supported_exception_type): New type.   
10416
10417 2004-07-14  Martin Baulig  <martin@ximian.com>
10418
10419         * typemanager.cs
10420         (TypeManager.generic_ienumerable_type): New type.
10421         (TypeManager.generic_ienumerator_type): New type.
10422
10423         * rootcontext.cs
10424         (RootContext.interfaces_first_stage): Added
10425         "System.Collections.Generic.IEnumerator`1" and
10426         "System.Collections.Generic.IEnumerable`1".     
10427
10428 2004-07-14  Martin Baulig  <martin@ximian.com>
10429
10430         * iterators.cs: Use real error numbers.
10431
10432 2004-07-14  Martin Baulig  <martin@ximian.com>
10433
10434         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
10435         requires this to be a System.Collection.IEnumerable and not a
10436         class implementing that interface.
10437         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
10438
10439 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
10440
10441         * class.cs: Fixed previous fix, it broke some error tests.
10442
10443 2004-07-12  Martin Baulig  <martin@ximian.com>
10444
10445         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
10446         Fixes #61293.
10447
10448 2004-07-14  Martin Baulig  <martin@ximian.com>
10449
10450         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
10451         an exclamation mark (!) for the generic arity to reflect the
10452         latest spec changes; ie. use "System.Collections.Generic.IList`1".
10453
10454 2004-07-13  Martin Baulig  <martin@ximian.com>
10455
10456         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
10457         specifiers being part of a type argument.
10458
10459 2004-07-13  Martin Baulig  <martin@ximian.com>
10460
10461         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
10462         name for generic types.
10463
10464 2004-07-13  Martin Baulig  <martin@ximian.com>
10465
10466         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
10467         bit to fix #60119.
10468
10469 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
10470
10471         * assign.cs (LocalTemporary): Add new argument: is_address,If
10472         `is_address' is true, then the value that we store is the address
10473         to the real value, and not the value itself.
10474         
10475         * ecore.cs (PropertyExpr): use the new local temporary
10476         stuff to allow us to handle X.Y += z (where X is a struct)
10477
10478 2004-07-08  Martin Baulig  <martin@ximian.com>
10479
10480         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
10481         not always return, just like we're doing in Using.Resolve().
10482
10483 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
10484
10485         * cs-parser.jay (fixed_statement): flag this as Pinned.
10486
10487 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
10488
10489         * typemanager.cs (TypeManager): Removed MakePinned method, this
10490         mechanism is replaced with the .NET 2.x compatible mechanism of
10491         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
10492
10493         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
10494         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
10495         `IsFixed' property which has a different meaning.
10496
10497 2004-07-02  Raja R Harinath  <rharinath@novell.com>
10498
10499         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
10500         visible from inside a nested class, not just the names of the
10501         immediately enclosing class.
10502         Fix for bug #60730.
10503
10504 2004-06-24  Raja R Harinath  <rharinath@novell.com>
10505
10506         * expression.cs (BetterConversion): Remove buggy special-case
10507         handling of "implicit constant expression conversions".  At this
10508         point, we already know that the conversion is possible -- we're
10509         only checking to see which is better.
10510
10511 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10512
10513         * cs-parser.jay: Added error CS0210 test.
10514
10515 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10516
10517         * cs-parser.jay: Added error CS0134 test.
10518
10519 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10520
10521         Fix bug #52507
10522         * cs-parser.jay: Added error CS0145 test.
10523
10524 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10525
10526         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
10527
10528 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
10529         
10530         * expression.cs (StackAlloc.Resolve): The argument may not
10531         be a constant; deal with this case.
10532         
10533 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
10534
10535         * attribute.cs (IndexerName_GetIndexerName): Renamed to
10536         GetIndexerAttributeValue.
10537         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10538
10539         * class.cs (Indexer.Define): Added error tests for CS0415,
10540         CS0609.
10541
10542 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
10543
10544         * attribute.cs (Attribute.Resolve): Keep field code in sync with
10545         property code.
10546
10547 2004-06-23  Martin Baulig  <martin@ximian.com>
10548
10549         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
10550         neither return nor throw, reset the barrier as well.  Fixes #60457.
10551
10552 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
10553
10554         * class.cs : EventAttributes is now set to None by default.
10555           This fixes bug #60459.
10556
10557 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10558
10559         Fix bug #60219
10560         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10561         Don't throw exception but return null (it's sufficient now).
10562
10563 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10564
10565         * typemanager.cs (GetArgumentTypes): Faster implementation.
10566
10567 2004-06-18  Martin Baulig  <martin@ximian.com>
10568
10569         * attribute.cs (Attribute.Resolve): Check whether we're an
10570         EmptyCast which a Constant child.  Fixes #60333.
10571
10572 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
10573
10574         * statement.cs (EmitCollectionForeach): Account for the fact that
10575         not all valuetypes are in areas which we can take the address of.
10576         For these variables, we store to a temporary variable. Also, make
10577         sure that we dont emit a `callvirt' on a valuetype method.
10578
10579 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10580
10581         * expression.cs (StackAlloc.DoReSolve): Added test for
10582         negative parameter (CS0247).
10583
10584 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10585
10586         Fix bug #59792
10587         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
10588
10589 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10590
10591         Fix bug #59781
10592         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10593         ulong.
10594
10595 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10596
10597         Fix bug #58254 & cs1555.cs, cs1556.cs
10598         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10599
10600 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10601
10602         * cs-parser.jay: Added error CS1669 test for indexers.
10603
10604 2004-06-18  Martin Baulig  <martin@ximian.com>
10605
10606         * generics.cs (GenericMethod.ctor): Don't take an Attributes
10607         argument.  Fixes #60441.
10608
10609 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
10610         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
10611         The name needs to have the actual name of the method in order
10612         for other tests (such as the one in OverloadResolve for Invoke
10613         on a delegate) to work. As well, it does not really help
10614         error reporting because the method group had multiple methods.
10615         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
10616         Make profiling work.
10617         
10618 2004-06-13  Martin Baulig  <martin@ximian.com>
10619
10620         * cs-parser.jay: Don't allow generic attributes.
10621
10622 2004-06-13  Martin Baulig  <martin@ximian.com>
10623
10624         * class.cs (MemberBase.DoDefineBase): New protected method.
10625         (MemberBase.DoDefine): Compute the `flags' in the new
10626         DoDefineBase() which must be called first.
10627         (Method.Define): Call DoDefineBase() first so we have the flags
10628         when defining the generic method.
10629
10630         * cs-parser.jay (interface_method_declaration): Support generic methods.
10631
10632 2004-06-13  Martin Baulig  <martin@ximian.com>
10633
10634         * decl.cs (TypeName): Removed.
10635         (MemberName): Removed TypeName and MemberNow; now we just have
10636         MemberName.
10637
10638         * cs-parser.jay: Don't distinguish between type arguments and type
10639         parameters in the grammar and simplified the rules a bit.  The
10640         reduce/reduce conflicts are now gone (except the one we inherited
10641         from mcs).
10642
10643 2004-06-11  Martin Baulig  <martin@ximian.com>
10644
10645         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10646         call this twice: for params and varargs methods.
10647
10648 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10649
10650         * class.cs:
10651         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10652
10653 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10654
10655         * attribute.cs (Attribute.GetValidTargets): Made public.
10656
10657         * class.cs: 
10658         (AbstractPropertyEventMethod): New class for better code sharing.
10659         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10660         CS1667 report.
10661         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10662
10663 2004-06-09  Martin Baulig  <martin@ximian.com>
10664
10665         * cs-parser.jay: Removed a reduce/reduce conflict.
10666
10667 2004-06-03  Martin Baulig  <martin@ximian.com>
10668
10669         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
10670         GetSimpleName() and return a SimpleName.
10671
10672         * ecore.cs (SimpleName.Arguments): New public field.
10673         (SimpleName): Added overloaded ctor which takes an additional
10674         TypeArguments argument.
10675         (SimpleName.SimpleNameResolve): Added support for generic methods.
10676         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
10677         formerly in MemberAccess.DoResolve(), but we also need it in
10678         SimpleNameResolve().
10679
10680         * expression.cs (MemberAccess.DoResolve): Use the new
10681         MethodGroupExpr.ResolveGeneric().       
10682
10683 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10684
10685         * decl.cs: If possible, use lookuptypedirect here. We can only do
10686         this if there is no `.' after the namespace. Avoids using
10687         LookupType, which does lots of slow processing.
10688         (FindNestedType) New method, does what it says :-).
10689         * namespace.cs: use LookupTypeDirect.
10690         * rootcontext.cs: use membercache, if possible.
10691         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10692
10693 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10694
10695         * expression.cs:
10696         According to the spec, 
10697
10698         In a member access of the form E.I, if E is a single identifier,
10699         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10700         field, property, localvariable, or parameter with the same type as
10701         the meaning of E as a type-name (§3.8), then both possible
10702         meanings of E are permitted.
10703
10704         We did not check that E as a simple-name had the same type as E as
10705         a type name.
10706
10707         This trivial check gives us 5-7% on bootstrap time.
10708
10709 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10710
10711         * expression.cs (Invocation.OverloadResolve): Avoid the
10712         use of hashtables and boxing here by allocating on demand.
10713
10714 2004-05-30  Martin Baulig  <martin@ximian.com>
10715
10716         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10717         we're doing a silent lookup.  Don't try to lookup nested types in
10718         TypeManager.object_type (thanks to Ben Maurer).
10719
10720 2004-05-30  Martin Baulig  <martin@ximian.com>
10721
10722         Committing a patch from Ben Maurer.
10723
10724         * rootcontext.cs (RootContext.LookupType): Cache negative results.
10725
10726 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10727
10728         * convert.cs: add a trivial cache for overload operator resolution.
10729
10730 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
10731
10732         * attribute.cs
10733         (AttributeTester.GetObsoleteAttribute): Returns instance of
10734         ObsoleteAttribute when type is obsolete.
10735
10736         * class.cs
10737         (TypeContainer.VerifyObsoleteAttribute): Override.
10738         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10739         (MethodCode.VerifyObsoleteAttribute): Override.
10740         (MemberBase.VerifyObsoleteAttribute): Override.
10741
10742         * decl.cs
10743         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10744         and report proper error.
10745
10746         *delegate.cs
10747         (Delegate.VerifyObsoleteAttribute): Override.
10748
10749         * ecore.cs
10750         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10751         and report proper error.
10752         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10753
10754         * enum.cs
10755         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10756         and enum member.
10757
10758         * expression.cs
10759         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10760         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10761         Added test for ObsoleteAttribute.
10762
10763         * statement.cs
10764         (Catch): Derived from Statement.
10765
10766 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10767
10768         * decl.cs: If possible, use lookuptypedirect here. We can only do
10769         this if there is no `.' after the namespace. Avoids using
10770         LookupType, which does lots of slow processing.
10771         (FindNestedType) New method, does what it says :-).
10772         * namespace.cs: use LookupTypeDirect.
10773         * rootcontext.cs: use membercache, if possible.
10774         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10775
10776 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10777
10778         * expression.cs:
10779         According to the spec, 
10780
10781         In a member access of the form E.I, if E is a single identifier,
10782         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10783         field, property, localvariable, or parameter with the same type as
10784         the meaning of E as a type-name (§3.8), then both possible
10785         meanings of E are permitted.
10786
10787         We did not check that E as a simple-name had the same type as E as
10788         a type name.
10789
10790         This trivial check gives us 5-7% on bootstrap time.
10791
10792 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
10793
10794         Fixed bug #59071 & cs0160.cs
10795         * statement.cs (Try.Resolve): Check here whether order of catch
10796         clauses matches their dependencies.
10797
10798 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
10799
10800         Fixed bug #58624
10801         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
10802         unsafe type.
10803
10804 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10805
10806         * expression.cs (Invocation.OverloadResolve): Avoid the
10807         use of hashtables and boxing here by allocating on demand.
10808
10809 2004-05-30  Martin Baulig  <martin@ximian.com>
10810
10811         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10812         we're doing a silent lookup.  Don't try to lookup nested types in
10813         TypeManager.object_type (thanks to Ben Maurer).
10814
10815 2004-05-30  Martin Baulig  <martin@ximian.com>
10816
10817         Committing a patch from Ben Maurer.
10818
10819         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
10820
10821 2004-05-29  Martin Baulig  <martin@ximian.com>
10822
10823         * class.cs (IMethodData.ShouldIgnore): New method.
10824
10825         * typemanager.cs (TypeManager.MethodFlags): Don't take a
10826         `Location' argument, we don't need it anywhere.  Use
10827         `IMethodData.ShouldIgnore ()' instead of
10828         `MethodData.GetMethodFlags ()'.
10829         (TypeManager.AddMethod): Removed.
10830         (TypeManager.AddMethod2): Renamed to AddMethod.
10831
10832 2004-05-29  Martin Baulig  <martin@ximian.com>
10833
10834         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10835
10836         * convert.cs (Convert.ImplicitReferenceConversion): If we're
10837         converting from a class type S to an interface type and we already
10838         have an object on the stack, don't box it again.  Fixes #52578.
10839
10840 2004-05-29  Martin Baulig  <martin@ximian.com>
10841
10842         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10843         Added support for `params' parameters.  Fixes #59267.
10844
10845 2004-05-29  Martin Baulig  <martin@ximian.com>
10846
10847         * literal.cs (NullPointer): Provide a private .ctor which sets
10848         `type' to TypeManager.object_type.  Fixes #59048.
10849
10850 2004-05-29  Martin Baulig  <martin@ximian.com>
10851
10852         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10853         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
10854
10855         * ecore.cs (EventExpr.instance_expr): Make the field private.
10856
10857 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
10858
10859         Fixed bug #50080 & cs0214-2.cs
10860         * expression.cs (Cast.DoResolve): Check unsafe context here.
10861         
10862         * statement.cs (Resolve.DoResolve): Likewise.
10863
10864 2004-05-26  Martin Baulig  <martin@ximian.com>
10865
10866         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10867
10868         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10869         (RootContext.LookupType): Pass down the `silent' flag.
10870
10871 2004-05-25  Martin Baulig  <martin@ximian.com>
10872
10873         * expression.cs
10874         (MethodGroupExpr.IdenticalTypeName): New public property.
10875         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10876         expression actually refers to a type.
10877
10878 2004-05-25  Martin Baulig  <martin@ximian.com>
10879
10880         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10881         for #56176 and made it actually work.
10882
10883 2004-05-25  Martin Baulig  <martin@ximian.com>
10884
10885         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10886         (FieldExpr, PropertyExpr): Override and implement
10887         CacheTemporaries.  Fixes #52279.
10888
10889 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
10890
10891         * location.cs: In the new compiler listing a file twice is a
10892         warning, not an error.
10893
10894 2004-05-24  Martin Baulig  <martin@ximian.com>
10895
10896         * enum.cs (Enum.DefineType): For the `BaseType' to be a
10897         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
10898
10899 2004-05-24  Martin Baulig  <martin@ximian.com>
10900
10901         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10902         walking the `using' list.  Fixes #53921.
10903
10904 2004-05-24  Martin Baulig  <martin@ximian.com>
10905
10906         * const.cs (Const.LookupConstantValue): Added support for
10907         EmptyCast's; fixes #55251.
10908
10909 2004-05-24  Martin Baulig  <martin@ximian.com>
10910
10911         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10912         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10913         which does the CS0135 check.  The reason is that we first need to
10914         check whether the variable actually exists.
10915
10916 2004-05-24  Martin Baulig  <martin@ximian.com>
10917
10918         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10919         than RootContext.LookupType() to find the explicit interface
10920         type.  Fixes #58584.
10921
10922 2004-05-24  Raja R Harinath  <rharinath@novell.com>
10923
10924         * Makefile: Simplify.  Use executable.make.
10925         * mcs.exe.sources: New file.  List of sources of mcs.exe.
10926
10927 2004-05-24  Anders Carlsson  <andersca@gnome.org>
10928
10929         * decl.cs:
10930         * enum.cs:
10931         Use the invariant culture when doing String.Compare for CLS case
10932         sensitivity.
10933         
10934 2004-05-23  Martin Baulig  <martin@ximian.com>
10935
10936         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10937         don't have any dots.  Fixes #52622, added cs0246-8.cs.
10938
10939         * namespace.cs (NamespaceEntry.Lookup): Likewise.
10940
10941 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10942
10943         * class.cs (MemberBase.Define): Reuse MemberType member for 
10944         resolved type. Other methods can use it too.
10945
10946 2004-05-23  Martin Baulig  <martin@ximian.com>
10947
10948         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10949         the variable also exists in the current block (otherwise, we need
10950         to report a CS0103).  Fixes #58670.
10951
10952 2004-05-23  Martin Baulig  <martin@ximian.com>
10953
10954         * flowanalysis.cs (Reachability.Reachable): Compute this
10955         on-the-fly rather than storing it as a field.
10956
10957 2004-05-23  Martin Baulig  <martin@ximian.com>
10958
10959         * flowanalysis.cs (Reachability.And): Manually compute the
10960         resulting `barrier' from the reachability.      
10961        
10962 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10963
10964         Fix bug #57835
10965         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10966         instance of ObsoleteAttribute when symbol is obsolete.
10967
10968         * class.cs
10969         (IMethodData): Extended interface for ObsoleteAttribute support.
10970
10971 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10972
10973         * attribute.cs: Fix bug #55970
10974
10975 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10976
10977         Fix bug #52705
10978         * attribute.cs
10979         (GetObsoleteAttribute): New method. Creates the instance of
10980         ObsoleteAttribute.
10981         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10982         ObsoleteAttribute when member is obsolete.
10983         (AttributeTester.Report_ObsoleteMessage): Common method for
10984         Obsolete error/warning reporting.
10985
10986         * class.cs
10987         (TypeContainer.base_classs_type): New member for storing parent type.
10988
10989         * decl.cs
10990         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10991         for this MemberCore.
10992
10993 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10994
10995         * attribute.cs, const.cs: Fix bug #58590
10996
10997 2004-05-21  Martin Baulig  <martin@ximian.com>
10998
10999         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
11000         out parameters if the end of the method is unreachable.  Fixes
11001         #58098. 
11002
11003 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11004
11005         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
11006         Hari was right, why extra method.
11007
11008 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11009
11010         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
11011
11012 2004-05-20  Martin Baulig  <martin@ximian.com>
11013
11014         * delegate.cs: Convert this file to Unix mode - like the original
11015         version in mcs is.
11016
11017 2004-05-20  Martin Baulig  <martin@ximian.com>
11018
11019         * attribute.cs: Convert this file to Unix mode - like the original
11020         version in mcs is.
11021
11022 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
11023
11024        Fix bug #58688 (MCS does not report error when the same attribute
11025        is assigned twice)
11026
11027        * attribute.cs (Attribute.Emit): Distinction between null and default.
11028
11029 2004-05-19  Raja R Harinath  <rharinath@novell.com>
11030
11031        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
11032        of a top-level attribute without an attribute target.
11033        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
11034        Make non-static.
11035        (Attribute.Conditional_GetConditionName), 
11036        (Attribute.Obsolete_GetObsoleteMessage): Update.
11037        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
11038        part of ScanForIndexerName.
11039        (Attribute.CanIgnoreInvalidAttribute): New function.
11040        (Attribute.ScanForIndexerName): Move to ...
11041        (Attributes.ScanForIndexerName): ... here.
11042        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
11043        (Attributes.Search): New internal variant that can choose not to
11044        complain if types aren't resolved.  The original signature now
11045        complains.
11046        (Attributes.GetClsCompliantAttribute): Use internal variant, with
11047        complaints suppressed.
11048        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
11049        only if it not useful.
11050        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
11051        top-level for attributes that are shared between the assembly
11052        and a top-level class.
11053        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
11054        * class.cs: Update to reflect changes.
11055        (DefineIndexers): Fuse loops.
11056        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
11057        a couple more variants of attribute names.
11058
11059 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
11060
11061         Fix bug #52585 (Implemented explicit attribute declaration)
11062
11063         * attribute.cs:
11064         (Attributable.ValidAttributeTargets): New abstract method. It gets
11065         list of valid attribute targets for explicit target declaration.
11066         (Attribute.Target): It holds target itself.
11067         (AttributeSection): Removed.
11068         (Attribute.CheckTargets): New method. It checks whether attribute
11069         target is valid for the current element.
11070
11071         * class.cs:
11072         (EventProperty): New class. For events that are declared like
11073         property (with add and remove accessors).
11074         (EventField): New class. For events that are declared like field.
11075         class.cs
11076
11077         * cs-parser.jay: Implemented explicit attribute target declaration.
11078
11079         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
11080         Override ValidAttributeTargets.
11081
11082         * parameter.cs:
11083         (ReturnParameter): Class for applying custom attributes on 
11084         the return type.
11085         (ParameterAtribute): New class. Class for applying custom
11086         attributes on the parameter type.
11087
11088 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
11089
11090         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
11091         definitions. 
11092
11093         (Method): Allow UNSAFE here.
11094
11095         * modifiers.cs: Support unsafe reporting.
11096
11097 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
11098
11099         * decl.cs: Fix bug #58478.
11100
11101 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11102
11103         * statement.cs: When checking for unreachable code on an EmptyStatement,
11104         set the location. Fixes bug #58488.
11105
11106 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
11107
11108         * driver.cs: Add -pkg handling.
11109
11110         From Gonzalo: UseShelLExecute=false
11111
11112 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
11113
11114         * attribute.cs:
11115         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
11116         for attribute.
11117         (Attribute.IsClsCompliaceRequired): Moved to base for better
11118         accesibility.
11119         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
11120         when attribute is AttributeUsageAttribute.
11121         (Attribute.GetValidTargets): Simplified.
11122         (Attribute.GetAttributeUsage): New method returns AttributeUsage
11123         attribute for this type.
11124         (Attribute.ApplyAttributes): Method renamed to Emit and make
11125         non-static.
11126         (GlobalAttributeSection): New class for special handling of global
11127         attributes (assembly, module).
11128         (AttributeSection.Emit): New method.
11129
11130         * class.cs: Implemented Attributable abstract methods.
11131         (MethodCore.LabelParameters): Moved to Parameter class.
11132         (Accessor): Is back simple class.
11133         (PropertyMethod): Implemented Attributable abstract class.
11134         (DelegateMethod): Implemented Attributable abstract class.
11135         (Event): New constructor for disctintion between normal Event
11136         and Event with accessors.
11137
11138         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
11139
11140         * codegen.cs, const.cs, decl.cs, delegate.cs:
11141         (CommonAssemblyModulClass): Implemented Attributable abstract class
11142         and simplified.
11143
11144         * enum.cs: Implement IAttributeSupport interface.
11145         (EnumMember): New class for emum members. Implemented Attributable
11146         abstract class
11147
11148         * parameter.cs:
11149         (ParameterBase): Is abstract.
11150         (ReturnParameter): New class for easier [return:] attribute handling.
11151
11152         * typemanager.cs: Removed builder_to_attr.
11153
11154 2004-05-11  Raja R Harinath  <rharinath@novell.com>
11155
11156         Fix bug #57151.
11157         * attribute.cs (Attribute.GetPositionalValue): New function.
11158         * class.cs (TypeContainer.VerifyMembers): New function.
11159         (TypeContainer.Emit): Use it.
11160         (ClassOrStruct): New base class for Class and Struct.
11161         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
11162         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
11163         class.
11164         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
11165         then each non-static field should have a FieldOffset attribute.
11166         Otherwise, none of the fields should have a FieldOffset attribute.
11167         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
11168         and FieldOffset attributes.
11169         * typemanager.cs (TypeManager.struct_layout_attribute_type)
11170         (TypeManager.field_offset_attribute_type): New core types.
11171         (TypeManager.InitCoreTypes): Initialize them.
11172
11173 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
11174
11175         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11176         Return correct type.
11177         From bug #58270.
11178
11179 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
11180
11181         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11182         be implicitly converted to ulong.
11183         
11184         * expression.cs: The logic for allowing operator &, | and ^ worked
11185         was wrong, it worked before because we did not report an error in
11186         an else branch.  Fixes 57895.
11187
11188         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11189         allow volatile fields to be reference types.
11190
11191 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
11192
11193         * driver.cs: Add support for /debug-
11194
11195 2004-05-07  Raja R Harinath  <rharinath@novell.com>
11196
11197         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
11198         Add a 'complain' parameter to silence errors.
11199         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
11200         silently overlooked type-resolutions.
11201         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11202         to reflect changes.
11203         (Attributes.Search): New function.
11204         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11205         (Attributes.GetAttributeFullName): Remove hack.
11206         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
11207         Update to reflect changes.
11208         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11209         Use Attributes.Search instead of nested loops.
11210
11211 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
11212
11213         * decl.cs:
11214         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11215         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11216         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11217
11218         * report.cs: (Report.Warning): Renamed to Warning_T because of
11219         parameter collision.
11220
11221 2004-05-05  Raja R Harinath  <rharinath@novell.com>
11222
11223         * expression.cs (MemberAccess.ResolveMemberAccess):
11224         Exit with non-zero status after Report.Error.
11225         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
11226         Likewise.
11227         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
11228
11229 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11230
11231         * support.cs: Don't hang when the file is empty.
11232
11233 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11234
11235         * support.cs: In SeekableStreamReader, compute the preamble size of the
11236           underlying stream. Position changes should take into account that initial
11237           count of bytes.
11238
11239 2004-05-03  Todd Berman  <tberman@sevenl.net>
11240
11241         * driver.cs: remove unused GetSysVersion function.
11242
11243 2004-05-03  Todd Berman  <tberman@sevenl.net>
11244
11245         * driver.cs: Remove the hack from saturday, as well as the hack
11246         from jackson (LoadAssemblyFromGac), also adds the CWD to the
11247         link_paths to get that bit proper.
11248
11249 2004-05-01  Todd Berman  <tberman@sevenl.net>
11250
11251         * driver.cs: Try a LoadFrom before a Load, this checks the current
11252         path. This is currently a bug in mono that is be fixed, however, this
11253         provides a workaround for now. This will be removed when the bug
11254         is fixed.
11255
11256 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
11257
11258         * CryptoConvert.cs: Updated to latest version. Fix issue with 
11259         incomplete key pairs (#57941).
11260
11261 2004-05-01  Todd Berman  <tberman@sevenl.net>
11262
11263         * driver.cs: Remove '.' from path_chars, now System.* loads properly
11264         from the GAC
11265
11266 2004-04-30  Jackson Harper  <jackson@ximian.com>
11267
11268         * codegen.cs: Open keys readonly.
11269         
11270 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11271
11272         * typemanager.cs: don't report cyclic struct layout when a struct
11273         contains 2 or more fields of the same type. Failed for Pango.AttrShape
11274         which has 2 Pango.Rectangle fields.
11275
11276 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11277
11278         * expression.cs: Handle IntPtr comparisons with IL code
11279         rather than a method call.
11280
11281 2004-04-29  Martin Baulig  <martin@ximian.com>
11282
11283         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
11284         the list of PropertyInfo's in class hierarchy and find the
11285         accessor.  Fixes #56013.
11286
11287 2004-04-29  Martin Baulig  <martin@ximian.com>
11288
11289         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
11290
11291 2004-04-29  Martin Baulig  <martin@ximian.com>
11292
11293         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11294
11295         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
11296
11297 2004-04-29  Martin Baulig  <martin@ximian.com>
11298
11299         * class.cs (ConstructorInitializer.Resolve): Check whether the
11300         parent .ctor is accessible.  Fixes #52146.
11301
11302 2004-04-29  Martin Baulig  <martin@ximian.com>
11303
11304         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11305
11306         * statement.cs (Using.EmitLocalVariableDecls): Use
11307         TypeManager.idisposable_type, not typeof (IDisposable).
11308         (Foreach.EmitCollectionForeach): Added support for valuetypes.
11309
11310 2004-04-29  Martin Baulig  <martin@ximian.com>
11311
11312         * class.cs (Event.Define): Don't emit the field and don't set
11313         RTSpecialName and SpecialName for events on interfaces.  Fixes
11314         #57703. 
11315
11316 2004-04-29  Raja R Harinath  <rharinath@novell.com>
11317
11318         Refactor Attribute.ApplyAttributes.
11319         * attribute.cs (Attributable): New base class for objects that can
11320         have Attributes applied on them.
11321         (Attribute): Make AttributeUsage fields public.
11322         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
11323         (Attribute.IsInternalCall): New property.
11324         (Attribute.UsageAttr): Convert to a public read-only property.
11325         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
11326         (Attribute.ResolveType, Attribute.Resolve)
11327         (Attribute.ScanForIndexerName): Update to reflect changes.
11328         (Attribute.CheckAttributeTarget): Re-format.
11329         (Attribute.ApplyAttributes): Refactor, to various
11330         Attributable.ApplyAttributeBuilder methods.
11331         * decl.cs (MemberCore): Make Attributable.
11332         * class.cs (Accessor): Make Attributable.
11333         (MethodData.ApplyAttributes): Use proper attribute types, not
11334         attribute names.
11335         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
11336         (TypeContainer.ApplyAttributeBuilder)
11337         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
11338         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
11339         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
11340         (Operator.ApplyAttributeBuilder): New factored-out methods.
11341         * const.cs (Const.ApplyAttributeBuilder): Likewise.
11342         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
11343         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
11344         * parameter.cs (ParameterBase): New Attributable base class
11345         that can also represent Return types.
11346         (Parameter): Update to the changes.
11347
11348 2004-04-29  Jackson Harper  <jackson@ximian.com>
11349
11350         * driver.cs: Prefer the corlib system version when looking for
11351         assemblies in the GAC. This is still a hack, but its a better hack
11352         now.
11353         
11354 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
11355
11356         * decl.cs, enum.cs: Improved error 3005 reporting.
11357   
11358         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
11359         (related_symbols): New private member for list of symbols
11360         related to reported error/warning.
11361         
11362         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
11363
11364 2004-04-29  Martin Baulig  <martin@ximian.com>
11365
11366         * ecore.cs (Expression.Constantify): If we're an enum and
11367         TypeManager.TypeToCoreType() doesn't give us another type, use
11368         t.UnderlyingSystemType.  Fixes #56178.  
11369
11370 2004-04-29  Martin Baulig  <martin@ximian.com>
11371
11372         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
11373         interfaces and for each interface, only add members directly
11374         declared in that interface.  Fixes #53255.
11375
11376 2004-04-28  Martin Baulig  <martin@ximian.com>
11377
11378         * expression.cs (ConditionalLogicalOperator): Use a temporary
11379         variable for `left' to avoid that we evaluate it more than once;
11380         bug #52588.
11381
11382 2004-04-28  Martin Baulig  <martin@ximian.com>
11383
11384         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
11385         `void[]' (CS1547).
11386
11387 2004-04-28  Martin Baulig  <martin@ximian.com>
11388
11389         * statement.cs (LocalInfo.Resolve): Check whether the type is not
11390         void (CS1547).
11391
11392         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
11393         whether the type is not void (CS1547).
11394
11395 2004-04-28  Martin Baulig  <martin@ximian.com>
11396
11397         * expression.cs (Unary.DoResolveLValue): Override this and report
11398         CS0131 for anything but Operator.Indirection.
11399
11400 2004-04-28  Martin Baulig  <martin@ximian.com>
11401
11402         Committing a patch from Ben Maurer; see bug #50820.
11403
11404         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11405         check for classes.
11406
11407         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11408         classes.        
11409
11410 2004-04-28  Martin Baulig  <martin@ximian.com>
11411
11412         Committing a patch from Ben Maurer; see bug #50820.
11413
11414         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11415         check for classes.
11416
11417         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11418         classes.        
11419
11420 2004-04-28  Martin Baulig  <martin@ximian.com>
11421
11422         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
11423         (Block.AddLabel): Call DoLookupLabel() to only search in the
11424         current block.
11425
11426 2004-04-28  Martin Baulig  <martin@ximian.com>
11427
11428         * cfold.cs (ConstantFold.BinaryFold): Added special support for
11429         comparing StringConstants and NullLiterals in Equality and Inequality.
11430
11431 2004-04-28  Jackson Harper  <jackson@ximian.com>
11432
11433         * driver.cs: Attempt to load referenced assemblies from the
11434         GAC. This is the quick and dirty version of this method that
11435         doesnt take into account versions and just takes the first
11436         canidate found. Will be good enough for now as we will not have more
11437         then one version installed into the GAC until I update this method.
11438
11439 2004-04-28  Martin Baulig  <martin@ximian.com>
11440
11441         * typemanager.cs (TypeManager.CheckStructCycles): New public
11442         static method to check for cycles in the struct layout.
11443
11444         * rootcontext.cs (RootContext.PopulateTypes): Call
11445         TypeManager.CheckStructCycles() for each TypeContainer.
11446         [Note: We only need to visit each type once.]
11447
11448 2004-04-28  Martin Baulig  <martin@ximian.com>
11449
11450         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11451
11452         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11453         success and added `out object value'.  Use a `bool resolved' field
11454         to check whether we've already been called rather than
11455         `ConstantValue != null' since this breaks for NullLiterals.
11456
11457 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11458
11459         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11460         setting of this flag, since the 'set' method may be non-public.
11461
11462 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11463
11464         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
11465         check on current_vector.Block.
11466
11467 2004-04-27  Martin Baulig  <martin@ximian.com>
11468
11469         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
11470         a field initializer.  Fixes #56459.
11471
11472 2004-04-27  Martin Baulig  <martin@ximian.com>
11473
11474         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
11475         we're not attempting to use an indexer.  Fixes #52154.
11476
11477 2004-04-27  Martin Baulig  <martin@ximian.com>
11478
11479         * statement.cs (Return): Don't create a return label if we don't
11480         need it; reverts my change from January 20th.  Thanks to Ben
11481         Maurer for this.
11482
11483 2004-04-27  Martin Baulig  <martin@ximian.com>
11484
11485         According to the spec, `goto' can only leave a nested scope, but
11486         never enter it.
11487
11488         * statement.cs (Block.LookupLabel): Only lookup in the current
11489         block, don't recurse into parent or child blocks.
11490         (Block.AddLabel): Check in parent and child blocks, report
11491         CS0140/CS0158 if we find a duplicate.
11492         (Block): Removed this indexer for label lookups.
11493         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
11494         this already does the error reporting for us.
11495
11496         * flowanalysis.cs
11497         (FlowBranching.UsageVector.Block): New public variable; may be null.
11498         (FlowBranching.CreateSibling): Added `Block' argument.
11499         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
11500         label for the target of a `goto' and check whether we're not
11501         leaving a `finally'.
11502
11503 2004-04-27  Martin Baulig  <martin@ximian.com>
11504
11505         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11506         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
11507         just for returns).
11508
11509 2004-04-27  Martin Baulig  <martin@ximian.com>
11510
11511         * statement.cs (Block.AddLabel): Also check for implicit blocks
11512         and added a CS0158 check.
11513
11514 2004-04-27  Martin Baulig  <martin@ximian.com>
11515
11516         * flowanalysis.cs (FlowBranchingLoop): New class.
11517         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11518         UsageVector's instead of an ArrayList.
11519         (FlowBranching.Label): Likewise.
11520         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11521         (FlowBranching.AddBreakVector): New method.
11522
11523 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
11524
11525         * attribute.cs: Small regression fix: only convert the type if we
11526         the type is different, fixes System.Drawing build.
11527
11528 2004-04-27  Martin Baulig  <martin@ximian.com>
11529
11530         * attribute.cs (Attribute.Resolve): If we have a constant value
11531         for a named field or property, implicity convert it to the correct
11532         type.
11533
11534 2004-04-27  Raja R Harinath  <rharinath@novell.com>
11535
11536         * statement.cs (Block.Block): Implicit blocks share
11537         'child_variable_names' fields with parent blocks.
11538         (Block.AddChildVariableNames): Remove.
11539         (Block.AddVariable): Mark variable as "used by a child block" in
11540         every surrounding block.
11541         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11542         been used in a child block, complain about violation of "Invariant
11543         meaning in blocks" rule.
11544         * cs-parser.jay (declare_local_variables): Don't use
11545         AddChildVariableNames.
11546         (foreach_statement): Don't create an implicit block: 'foreach'
11547         introduces a scope.
11548
11549 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
11550
11551         * convert.cs (ImplicitNumericConversion): 0 is also positive when
11552         converting from 0L to ulong.  Fixes 57522.
11553
11554 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11555
11556         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11557         derived class hides via 'new' keyword field from base class (test-242.cs).
11558         TODO: Handle this in the more general way.
11559         
11560         * class.cs (CheckBase): Ditto.
11561
11562 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11563
11564         * decl.cs (caching_flags): New member for storing cached values
11565         as bit flags.
11566         (MemberCore.Flags): New enum where bit flags for caching_flags
11567         are defined.
11568         (MemberCore.cls_compliance): Moved to caching_flags.
11569         (DeclSpace.Created): Moved to caching_flags.
11570
11571         * class.cs: Use caching_flags instead of DeclSpace.Created
11572         
11573 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
11574
11575         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11576         if we are only a derived class, not a nested class.
11577
11578         * typemanager.cs: Same as above, but do this at the MemberLookup
11579         level (used by field and methods, properties are handled in
11580         PropertyExpr).   Allow for the qualified access if we are a nested
11581         method. 
11582
11583 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
11584
11585         * class.cs: Refactoring.
11586         (IMethodData): New inteface; Holds links to parent members
11587         to avoid member duplication (reduced memory allocation).
11588         (Method): Implemented IMethodData interface.
11589         (PropertyBase): New inner classes for get/set methods.
11590         (PropertyBase.PropertyMethod): Implemented IMethodData interface
11591         (Event): New inner classes for add/remove methods.
11592         (Event.DelegateMethod): Implemented IMethodData interface.
11593
11594         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11595         EmitContext (related to class.cs refactoring).
11596
11597 2004-04-21  Raja R Harinath  <rharinath@novell.com>
11598
11599         * delegate.cs (Delegate.VerifyApplicability): If the number of
11600         arguments are the same as the number of parameters, first try to
11601         verify applicability ignoring  any 'params' modifier on the last
11602         parameter.
11603         Fixes #56442.
11604
11605 2004-04-08  Martin Baulig  <martin@ximian.com>
11606
11607         Merged latest changes into gmcs.  Please keep this comment in
11608         here, it makes it easier for me to see what changed in MCS since
11609         the last time I merged.
11610
11611 2004-04-16  Raja R Harinath  <rharinath@novell.com>
11612
11613         * class.cs (TypeContainer.AddIndexer): Use
11614         'ExplicitInterfaceName' to determine if interface name was
11615         explicitly specified.  'InterfaceType' is not initialized at this time.
11616         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
11617         Indexers array is already in the required order.  Initialize
11618         'IndexerName' only if there are normal indexers.
11619         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11620         (TypeContainer.Emit): Emit DefaultMember attribute only if
11621         IndexerName is initialized.
11622         Fixes #56300.
11623
11624 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
11625
11626         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11627         Fixes #57007
11628
11629 2004-04-15  Raja R Harinath  <rharinath@novell.com>
11630
11631         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11632         attributes.
11633         Fix for #56456.
11634
11635         * attribute.cs (Attribute.Resolve): Check for duplicate named
11636         attributes.
11637         Fix for #56463.
11638
11639 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
11640
11641         * iterators.cs (MarkYield): track whether we are in an exception,
11642         and generate code accordingly.  Use a temporary value to store the
11643         result for our state.
11644
11645         I had ignored a bit the interaction of try/catch with iterators
11646         since their behavior was not entirely obvious, but now it is
11647         possible to verify that our behavior is the same as MS .NET 2.0
11648
11649         Fixes 54814
11650
11651 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
11652
11653         * iterators.cs: Avoid creating temporaries if there is no work to
11654         do. 
11655
11656         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11657         Enumerations, use TypeManager.EnumToUnderlying and call
11658         recursively. 
11659
11660         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11661         bug #57013
11662
11663         (This.Emit): Use EmitContext.EmitThis to emit our
11664         instance variable.
11665
11666         (This.EmitAssign): Ditto.
11667
11668         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11669         codepaths, we will move all the functionality into
11670         Mono.CSharp.This 
11671
11672         (FieldExpr.EmitAssign): Ditto.
11673
11674         This fixes several hidden bugs that I uncovered while doing a code
11675         review of this today.
11676
11677         * codegen.cs (EmitThis): reworked so the semantics are more clear
11678         and also support value types "this" instances.
11679
11680         * iterators.cs: Changed so that for iterators in value types, we
11681         do not pass the value type as a parameter.  
11682
11683         Initialization of the enumerator helpers is now done in the caller
11684         instead of passing the parameters to the constructors and having
11685         the constructor set the fields.
11686
11687         The fields have now `assembly' visibility instead of private.
11688
11689 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
11690
11691         * expression.cs (Argument.Resolve): Check if fields passed as ref
11692         or out are contained in a MarshalByRefObject.
11693
11694         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11695         another compiler type.
11696
11697 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
11698
11699         * class.cs (Indexer.Define): use the new name checking method.
11700         Also, return false on an error.
11701         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11702         (is_identifier_[start/part]_character): make static.
11703
11704 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
11705
11706         * expression.cs (Binary.ResolveOperator): Do no append strings
11707         twice: since we can be invoked more than once (array evaluation)
11708         on the same concatenation, take care of this here.  Based on a fix
11709         from Ben (bug #56454)
11710
11711 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11712
11713         * codegen.cs: Fix another case where CS1548 must be reported (when 
11714         delay-sign isn't specified and no private is available #56564). Fix
11715         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11716         error when MCS is used on the MS runtime and we need to delay-sign 
11717         (which seems unsupported by AssemblyBuilder - see #56621).
11718
11719 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
11720
11721         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11722         (TypeManager.ComputeNamespaces): Faster implementation for
11723         Microsoft runtime.
11724
11725         * compiler.csproj: Updated AssemblyName to mcs.
11726
11727 2004-05-11  Jackson Harper  <jackson@ximian.com>
11728
11729         * Makefile: Preserve MONO_PATH
11730         
11731 2004-05-11  Jackson Harper  <jackson@ximian.com>
11732
11733         * Makefile: Use mono and mcs to build gmcs
11734         
11735 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
11736
11737         * codegen.cs: Add patch from Robert Shade
11738         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
11739         sync with mcs.
11740
11741 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
11742
11743         * CryptoConvert.cs: Updated to latest version. Fix issue with 
11744         incomplete key pairs (#57941).
11745
11746 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11747
11748         * codegen.cs: Fix another case where CS1548 must be reported (when 
11749         delay-sign isn't specified and no private is available #56564). Fix
11750         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11751         error when MCS is used on the MS runtime and we need to delay-sign 
11752         (which seems unsupported by AssemblyBuilder - see #56621).
11753
11754 2004-04-29  Jackson Harper  <jackson@ximian.com>
11755
11756         * Makefile: Set MONO_PATH to use the bootstrap corlib
11757         * driver.cs: Check the GAC for referenced assemblies.
11758                 
11759 2004-04-29  Martin Baulig  <martin@ximian.com>
11760
11761         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
11762
11763 2004-04-07  Martin Baulig  <martin@ximian.com>
11764
11765         * expression.cs (Binary.ResolveOperator): Added special case for
11766         Equality/Inequality between a type parameter and a null literal.
11767
11768 2004-04-07  Martin Baulig  <martin@ximian.com>
11769
11770         * convert.cs: Check null literal -> type parameter conversions.
11771
11772 2004-04-07  Martin Baulig  <martin@ximian.com>
11773
11774         * generic.cs (ConstructedType.CheckConstraints): Enforce the
11775         `class' and `struct' constraints.
11776
11777 2004-04-07  Martin Baulig  <martin@ximian.com>
11778
11779         * generic.cs (SpecialConstraint): New public enum.
11780         (Constraints.Resolve): Added support for the `class' and `struct'
11781         constraints.
11782
11783         * cs-parser.jay (type_parameter_constraint): Added support for the
11784         `class' and `struct' constraints.
11785
11786 2004-04-07  Martin Baulig  <martin@ximian.com>
11787
11788         * support.cs (GenericConstraints): Replaced `Types' by
11789         `ClassConstraint' and `InterfaceConstraints'; added
11790         `HasClassConstraint'.   
11791
11792 2004-04-07  Martin Baulig  <martin@ximian.com>
11793
11794         * generic.cs
11795         (Constraints.InterfaceConstraints): New public property.
11796         (Constraints.Types): Make this property public
11797         (TypeParameter): Implement IMemberContainer.
11798         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
11799         instead of a TypeBuilder/MethodBuilder; pass the interface
11800         constraints to TypeManager.AddTypeParameter().
11801         (TypeParameter.DefineType): Just take an EmitContext and no
11802         TypeBuilder/MethodBuilder.  Use the new public API.
11803
11804         * typemanager.cs (TypeManager.AddTypeParameter): Added
11805         `TypeExpr[]' argument; add the interfaces to the
11806         `builder_to_ifaces' hash.
11807         (TypeManager.LookupMemberContainer): For
11808         GenericTypeParameterBuilders, get the TypeParameter from the
11809         `builder_to_type_param'.
11810         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
11811         the TypeParameter and call FindMembers on it.
11812
11813 2004-04-07  Martin Baulig  <martin@ximian.com>
11814
11815         * class.cs
11816         (MethodCore.GenericMethod): Moved this field here from Method.
11817         (MethodCore.IsDuplicateImplementation): Take the number of type
11818         parameters into account if we're a generic method.
11819
11820         * expression.cs (Invocation.InferTypeArguments): Don't return true
11821         if `arguments' is null; we still need to check whether we actually
11822         don't need to infer anything in this case.
11823         (MemberAccess): Merged the functionality from GenericMemberAccess
11824         into this class.
11825
11826         * generic.cs (GenericMemberAccess): Removed.
11827
11828 2004-04-05  Martin Baulig  <martin@ximian.com>
11829
11830         * decl.cs (MemberCore): For generic classes, interfaces and
11831         structs, `Name' now includes the number of type parameters
11832         ("Stack!1.Node!1").
11833         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
11834         encode the number of type arguments in the type name.
11835
11836         * expression.cs (Expression.MemberLookup): Removed the
11837         `num_type_args' argument; we now encode the number of type
11838         arguments in the type name.
11839
11840         * ecore.cs (SimpleName): Encode the number of type arguments in
11841         the type name itself.
11842
11843         * generic.cs (ConstructedType): Likewise.
11844
11845         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
11846         `MemberName'; we now include the number of type parameters in the
11847         type name.
11848
11849         * typemanager.cs (TypeManager.CheckGeneric): Removed.
11850         (TypeManager.MemberLookup): Removed the
11851         `num_type_args' argument; we now encode the number of type
11852         arguments in the type name.     
11853
11854 2004-04-03  Martin Baulig  <martin@ximian.com>
11855
11856         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
11857         (MemberCore.MemberName): Moved here from MemberBase.
11858         (DeclSpace.SetParameterInfo): Just take the constraints as an
11859         ArrayList; we already have the type parameters in our
11860         `MemberName'; also do the CS0080 reporting here.
11861
11862         * cs-parser.jay (struct_declaration): Use `member_name' instead of
11863         `IDENTIFIER opt_type_parameter_list'; when constructing our
11864         `MemberName', it'll already include our type parameters.
11865         (class_declaration, interface_declaration): Likewise.
11866         (delegate_declaration): Likewise.
11867         (MakeName): Take a MemberName and return a MemberName.
11868         The following two changes are required to avoid shift/reduce conflicts:
11869         (member_name): Don't include a TypeName anymore; ie. this is now
11870         just 'IDENTIFIER opt_type_parameter_list'.
11871         (property_declaration, event_declaration): Use a
11872         `namespace_or_type_name' instead of a `member_name'.            
11873
11874 2004-04-03  Martin Baulig  <martin@ximian.com>
11875
11876         * decl.cs (MemberName): Renamed to `TypeName' and created a new
11877         `MemberName' class.
11878         (TypeName): Formerly known as MemberName.
11879
11880         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
11881         instead of a `MemberName'.
11882
11883         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
11884         (member_name): New rule; create a MemberName.
11885
11886 2004-04-02  Martin Baulig  <martin@ximian.com>
11887
11888         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
11889         (CS0305 and CS0308).
11890
11891 2004-04-02  Martin Baulig  <martin@ximian.com>
11892
11893         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
11894         support for nested types.
11895
11896 2004-04-02  Martin Baulig  <martin@ximian.com>
11897
11898         * ecore.cs (IAlias): New public interface.
11899         (TypeExpr, TypeExpression): Implement IAlias.
11900         (TypeAliasExpression): New public class.
11901
11902         * namespace.cs (Namespace): Implement IAlias.
11903         (Namespace.Lookup): Return an IAlias instead on an object.
11904         (Namespace.DefineName): Take an IAlias instead of an object.
11905         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
11906         an object.
11907         (NamespaceEntry.UsingAlias): Take a Membername instead of an
11908         Expression.
11909         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
11910         object.
11911         (NamespaceEntry.Lookup): Likewise.
11912
11913         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
11914         instead of a Type.      
11915
11916         * decl.cs (DeclSpace): Implement IAlias.
11917         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
11918
11919         * generic.cs (ConstructedType): Improved error checking.
11920
11921 2004-04-02  Martin Baulig  <martin@ximian.com>
11922
11923         * convert.cs: Added type parameter conversions.
11924
11925         * ecore.cs
11926         (UnboxCast.Emit): Emit an `unbox.any' for type params.
11927         (ClassCast.Emit): If the source type is a type parameter, box it.
11928         If the target type is a type parameter, emit an `unbox.any'
11929         instead of a `classcast'.1      
11930
11931 2004-04-01  Martin Baulig  <martin@ximian.com>
11932
11933         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
11934
11935 2004-04-01  Martin Baulig  <martin@ximian.com>
11936
11937         * generic.cs (ConstructedType.CheckConstraints): Use
11938         Convert.ImplicitStandardConversionExists(); user-defined implicit
11939         conversions are not allowed according to the spec.
11940
11941 2004-03-30  Martin Baulig  <martin@ximian.com>
11942
11943         * expression.cs (New): Added support for type parameters.
11944
11945         * typemanager.cs
11946         (TypeManager.activator_type): New public static field.
11947         (TypeManager.activator_create_instance): Likewise.
11948
11949 2004-03-30  Martin Baulig  <martin@ximian.com>
11950
11951         * typemanager.cs (TypeManager.HasConstructorConstraint): New
11952         public method.
11953
11954 2004-03-30  Martin Baulig  <martin@ximian.com>
11955
11956         * generic.cs (ConstructedType.CheckConstraints): Actually follow
11957         the spec here: the argument type must be convertible to the
11958         constraints.
11959
11960 2004-03-30  Martin Baulig  <martin@ximian.com>
11961
11962         * generic.cs
11963         (TypeParameter.Define, TypeParameter.DefineMethod): Call
11964         TypeManager.AddTypeParameter().
11965         (ConstructedType.CheckConstraints): Re-enable this and actually
11966         check whether we have a constructor constraint.
11967
11968         * typemanager.cs
11969         (TypeManager.builder_to_type_param): New static field.
11970         (TypeManager.AddTypeParameter): New static method.
11971         (TypeManager.LookupTypeParameter): New public method.
11972
11973 2004-03-30  Martin Baulig  <martin@ximian.com>
11974
11975         * generic.cs (TypeParameter.DefineType): Return a boolean and use
11976         the new API to actually define the constructor constraint.
11977
11978         * typemanager.cs
11979         (TypeManager.new_constraint_attr_type): New static field.
11980         (TypeManager.InitCoreTypes): Initialize it.
11981
11982 2004-03-30  Martin Baulig  <martin@ximian.com>
11983
11984         * generic.cs (Constraints): Completed error checking, use correct
11985         error numbers.
11986
11987 2004-03-29  Martin Baulig  <martin@ximian.com>
11988
11989         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
11990
11991         * expression.cs (Invocation.InferTypeArguments): Added overloaded
11992         public version which takes a `ParameterData pd' instead of an
11993         `ArrayList args'.
11994
11995 2004-03-29  Martin Baulig  <martin@ximian.com>
11996
11997         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
11998         not a MethodInfo.       
11999
12000 2004-03-29  Martin Baulig  <martin@ximian.com>
12001
12002         * expression.cs (Argument.ResolveMethodGroup): If we're a
12003         ConstructedType, call GetMemberAccess() on it.  
12004
12005 2004-03-29  Martin Baulig  <martin@ximian.com>
12006
12007         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
12008         (MethodCore.CheckGenericOverride): When overriding a generic
12009         method, check whether the constraints match.
12010
12011         * support.cs (GenericConstraints): New public interface.
12012         (ParameterData.GenericConstraints): New public method.
12013
12014         * parameter.cs (Parameter.Resolve): Check whether we're a generic
12015         method parameter and compute our constraints if appropriate.
12016         (Parameter.GenericConstraints): New public property.
12017
12018         * generic.cs (Constraints): Implement GenericConstraints.
12019
12020 2004-03-29  Martin Baulig  <martin@ximian.com>
12021
12022         * decl.cs (MemberCache.FindMemberToOverride): Use
12023         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
12024
12025 2004-03-29  Martin Baulig  <martin@ximian.com>
12026
12027         * generic.cs (GenericMethod.Define): Resolve our type parameters.
12028
12029 2004-03-29  Martin Baulig  <martin@ximian.com>
12030
12031         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
12032         not allowed on non-generic declarations").
12033
12034 2004-03-29  Martin Baulig  <martin@ximian.com>
12035
12036         * expression.cs (Invocation.InferTypeArguments): Added overloaded
12037         public version of this method.
12038
12039         * class.cs (MethodCore.IsDuplicateImplementation): Use
12040         Invocation.InferTypeArguments() to check this.
12041
12042 2004-03-29  Martin Baulig  <martin@ximian.com>
12043
12044         * convert.cs: Use TypeManager.IsDelegateType() instead of
12045         comparing types correctly.
12046
12047 2004-03-29  Martin Baulig  <martin@ximian.com>
12048
12049         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
12050         types directly to make it work for generic instances.
12051
12052         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
12053
12054 2004-03-29  Martin Baulig  <martin@ximian.com>
12055
12056         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
12057         support for arrays.     
12058
12059 2004-03-24  Martin Baulig  <martin@ximian.com>
12060
12061         * decl.cs (DeclSpace.FindType): Also use
12062         TypeManager.CheckGeneric() for types from the using clauses.
12063
12064 2004-03-23  Martin Baulig  <martin@ximian.com>
12065
12066         * expression.cs (Invocation.OverloadResolve): Added `bool
12067         may_fail' argument and use it instead of the Location.IsNull() hack.
12068
12069 2004-03-23  Martin Baulig  <martin@ximian.com>
12070
12071         * expression.cs (Invocation.InferType): Use correct type inference
12072         rules here.     
12073
12074 2004-03-23  Martin Baulig  <martin@ximian.com>
12075
12076         * ecore.cs (MethodGroupExpr.Name): Use
12077         TypeManager.CSharpSignature() instead of just the name.
12078
12079         * expression.cs (Invocation.OverloadResolve): Provide better error
12080         reporting.
12081         (Invocation.DoResolve): OverloadResolve() never returns null
12082         without reporting an error, so removed the error -6 reporting here.
12083
12084 2004-03-23  Martin Baulig  <martin@ximian.com>
12085
12086         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
12087         generic methods.
12088
12089         * cs-parser.jay (delegate_declaration): Support generic delegates.
12090
12091         * delegate.cs: Support generic delegates.
12092
12093 2004-03-22  Martin Baulig  <martin@ximian.com>
12094
12095         * expression.cs (Invocation.InferParamsTypeArguments): New static
12096         method; does type inference for params arguments.
12097
12098 2004-03-21  Martin Baulig  <martin@ximian.com>
12099
12100         * typemanager.cs (TypeManager.IsGenericMethod): New public static
12101         method; checks whether a method is a generic method.    
12102
12103         * expression.cs (Invocation.InferTypeArguments): New static method;
12104         infer type arguments for generic method invocation.
12105
12106         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
12107         property; we set this to true if we're resolving a generic method
12108         invocation and the user specified type arguments, ie. we're not
12109         doing type inference.
12110
12111 2004-03-20  Martin Baulig  <martin@ximian.com>
12112
12113         * class.cs (MethodData.DeclaringType): New public property.
12114         (MethodData.Define): Set DeclaringType here.
12115         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
12116         instead of OperatorMethodBuilder.DeclaringType.
12117
12118 2004-03-20  Martin Baulig  <martin@ximian.com>
12119
12120         * cs-tokenizer.cs (xtoken): Return a special
12121         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
12122
12123         * cs-parser.jay (default_value_expression): Switch to the new
12124         syntax (14.5.13).
12125
12126 2004-03-19  Martin Baulig  <martin@ximian.com>
12127
12128         * decl.cs (MemberName): New class.  We use this to "construct"
12129         namespace_or_type_name's.
12130
12131         * generics.cs (TypeArguments.GetDeclarations): New public method;
12132         returns the type arguments as a string[] and reports a CS0081 if
12133         one of them is not an identifier.
12134
12135         * class.cs (MemberBase): The .ctor now takes the name as a
12136         MemberName instead of a string.
12137         (MemberBase.ExplicitInterfaceName): Changed type from string to
12138         Expression.
12139         (MemberBase.DoDefine): If we're an explicit implementation, the
12140         InterfaceType may be a generic instance.
12141
12142         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
12143         (namespace_name): Call MemberName.GetName () to transform the
12144         MemberName into a string and ensure we don't have any type
12145         arguments.
12146         (type_name): Call MemberName.GetTypeExpression() to transfrom the
12147         MemberName into an expression.
12148         (method_header): Use namespace_or_type_name instead of member_name.     
12149
12150 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
12151
12152         * rootcontext.cs: Add new types to the boot resolution.
12153
12154         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
12155         MulticastDelegate is not allowed.
12156
12157         * typemanager.cs: Add new types to lookup: System.TypedReference
12158         and ArgIterator.
12159
12160         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
12161         check for TypedReference or ArgIterator, they are not allowed. 
12162
12163         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
12164         makes us properly catch 1510 in some conditions (see bug 56016 for
12165         details). 
12166
12167 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
12168
12169         * CryptoConvert.cs: update from corlib version
12170         with endian fixes.
12171
12172 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
12173
12174         * class.cs (Indexer.Define): Check indexername declaration
12175
12176 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
12177
12178         * attribute.cs (IsClsCompliant): Fixed problem with handling
12179         all three states (compliant, not-compliant, undetected).
12180
12181 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
12182
12183         * attribute.cs (Attribute): Location is now public.
12184         (Resolve): Store resolved arguments (pos_values) in attribute class.
12185         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
12186         (GetClsCompliantAttributeValue): New method that gets
12187         CLSCompliantAttribute value.
12188         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
12189         if exists else null.
12190         (AttributeTester): New class for CLS-Compliant verification routines.
12191
12192         * class.cs (Emit): Add CLS-Compliant verification.
12193         (Method.GetSignatureForError): Implemented.
12194         (Constructor.GetSignatureForError): Implemented
12195         (Constructor.HasCompliantArgs): Returns if constructor has
12196         CLS-Compliant arguments.
12197         (Constructor.Emit): Override.
12198         (Construcor.IsIdentifierClsCompliant): New method; For constructors
12199         is needed to test only parameters.
12200         (FieldBase.GetSignatureForError): Implemented.
12201         (TypeContainer): New member for storing base interfaces.
12202         (TypeContainer.FindMembers): Search in base interfaces too.
12203
12204         * codegen.cs (GetClsComplianceAttribute): New method that gets
12205         assembly or module CLSCompliantAttribute value.
12206         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
12207         for assembly.
12208         (ModuleClass.Emit): Add error 3012 test.
12209
12210         * const.cs (Emit): Override and call base for CLS-Compliant tests.
12211
12212         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
12213         state for all decl types.
12214         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
12215         if CLS-Compliant tests are required.
12216         (IsClsCompliaceRequired): New method. Analyze whether code
12217         must be CLS-Compliant.
12218         (IsExposedFromAssembly): New method. Returns true when MemberCore
12219         is exposed from assembly.
12220         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
12221         value or gets cached value.
12222         (HasClsCompliantAttribute): New method. Returns true if MemberCore
12223         is explicitly marked with CLSCompliantAttribute.
12224         (IsIdentifierClsCompliant): New abstract method. This method is
12225         used to testing error 3005.
12226         (IsIdentifierAndParamClsCompliant): New method. Common helper method
12227         for identifier and parameters CLS-Compliant testing.
12228         (VerifyClsCompliance): New method. The main virtual method for
12229         CLS-Compliant verifications.
12230         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
12231         null. I don't know why is null (too many public members !).
12232         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
12233         and get value of first CLSCompliantAttribute that found.
12234
12235         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
12236         (VerifyClsCompliance): Override and add extra tests.
12237
12238         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
12239         clscheck- disable CLS-Compliant verification event if assembly is has
12240         CLSCompliantAttribute(true).
12241
12242         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
12243         ApllyAttribute is now called in emit section as in the other cases.
12244         Possible future Emit integration.
12245         (IsIdentifierClsCompliant): New override.
12246         (VerifyClsCompliance): New override.
12247         (GetEnumeratorName): Returns full enum name.
12248
12249         * parameter.cs (GetSignatureForError): Implemented.
12250
12251         * report.cs (WarningData): New struct for Warning message information.
12252         (LocationOfPreviousError): New method.
12253         (Warning): New method. Reports warning based on the warning table.
12254         (Error_T): New method. Reports error based on the error table.
12255
12256         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
12257         verifications are done here.
12258
12259         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
12260
12261         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
12262         CLSCompliantAttribute.
12263         (all_imported_types): New member holds all imported types from other
12264         assemblies.
12265         (LoadAllImportedTypes): New method fills static table with exported types
12266         from all referenced assemblies.
12267         (Modules): New property returns all assembly modules.
12268
12269 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
12270
12271         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
12272         throwing a parser error.
12273
12274         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
12275         which removes the hardcoded get_/set_ prefixes for properties, as
12276         IL allows for the properties to be named something else.  
12277
12278         Bug #56013
12279
12280         * expression.cs: Do not override operand before we know if it is
12281         non-null.  Fix 56207
12282
12283 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12284
12285         * typemanager.cs: support for pinned variables.
12286
12287 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12288
12289         * decl.cs, typemanager.cs: Avoid using an arraylist
12290         as a buffer if there is only one result set.
12291
12292 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12293
12294         * expression.cs: Make sure you cant call a static method
12295         with an instance expression, bug #56174.
12296
12297 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
12298
12299         * class.cs (IsDuplicateImplementation): Improve error reporting to
12300         flag 663 (method only differs in parameter modifier).
12301
12302         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12303         in preprocessor directives.
12304
12305         * location.cs (LookupFile): Allow for the empty path.
12306
12307         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
12308         better approach for some of that patch, but its failing with the
12309         CharSet enumeration.  For now try/catch will do.
12310
12311         * typemanager.cs: Do not crash if a struct does not have fields.
12312         Fixes 56150.
12313
12314 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12315
12316         * expression.cs: cs0213, cant fix a fixed expression.
12317         fixes 50231.
12318
12319 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12320
12321         * cs-parser.jay: detect invalid embeded statements gracefully.
12322         bug #51113.
12323
12324 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12325
12326         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12327         As a regex:
12328         s/
12329         the invocation type may not be a subclass of the tye of the item/
12330         The type of the item must be a subclass of the invocation item.
12331         /g
12332
12333         Fixes bug #50820.
12334
12335 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
12336
12337         * attribute.cs: Added methods to get a string and a bool from an
12338         attribute. Required to information from AssemblyKeyFileAttribute,
12339         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12340         * codegen.cs: Modified AssemblyName creation to include support for
12341         strongnames. Catch additional exceptions to report them as CS1548.
12342         * compiler.csproj: Updated include CryptoConvert.cs.
12343         * compiler.csproj.user: Removed file - user specific configuration.
12344         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
12345         Mono.Security assembly. The original class is maintained and tested in
12346         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12347         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12348         like CSC 8.0 (C# v2) supports.
12349         * Makefile: Added CryptoConvert.cs to mcs sources.
12350         * rootcontext.cs: Added new options for strongnames.
12351
12352 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
12353
12354         * driver.cs: For --expect-error, report error code `2'
12355         if the program compiled with no errors, error code `1' if
12356         it compiled with an error other than the one expected.
12357
12358 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
12359
12360         * compiler.csproj: Updated for Visual Studio .NET 2003.
12361         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12362         * compiler.sln: Updated for Visual Studio .NET 2003.
12363
12364 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
12365
12366         * expression.cs: Fix bug #47234. We basically need to apply the
12367         rule that we prefer the conversion of null to a reference type
12368         when faced with a conversion to 'object' (csc behaviour).
12369
12370 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12371
12372         * statement.cs: Shorter form for foreach, eliminates
12373         a local variable. r=Martin.
12374
12375 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12376
12377         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12378         checks if we can use brtrue/brfalse to test for 0.
12379         * expression.cs: use the above in the test for using brtrue/brfalse.
12380         cleanup code a bit.
12381
12382 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12383
12384         * expression.cs: Rewrite string concat stuff. Benefits:
12385
12386         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12387         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12388         rather than a concat chain.
12389
12390         * typemanager.cs: Add lookups for more concat overloads.
12391
12392 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12393
12394         * expression.cs: Emit shorter il code for array init.
12395
12396         newarr
12397         dup
12398         // set 1
12399
12400         // set 2
12401
12402         newarr
12403         stloc.x
12404
12405         ldloc.x
12406         // set 1
12407
12408         ldloc.x
12409         // set 2
12410
12411 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
12412
12413         * statement.cs: Before, two switch blocks would be merged if the
12414         total size of the blocks (end_item - begin_item + 1) was less than
12415         two times the combined sizes of the blocks.
12416
12417         Now, it will only merge if after the merge at least half of the
12418         slots are filled.
12419
12420         fixes 55885.
12421
12422 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
12423
12424         * class.cs : csc build fix for GetMethods(). See bug #52503.
12425
12426 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
12427
12428         * expression.cs: Make sure fp comparisons work with NaN.
12429         This fixes bug #54303. Mig approved this patch a long
12430         time ago, but we were not able to test b/c the runtime
12431         had a related bug.
12432
12433 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
12434
12435         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
12436
12437 2004-03-19  Martin Baulig  <martin@ximian.com>
12438
12439         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
12440         two overloads may unify for some type parameter substitutions and
12441         report a CS0408 if appropriate.
12442
12443 2004-03-19  Martin Baulig  <martin@ximian.com>
12444
12445         * class.cs (MemberCore.IsDuplicateImplementation): Report the
12446         error here and not in our caller.
12447
12448 2004-03-19  Martin Baulig  <martin@ximian.com>
12449
12450         * interface.cs: Completely killed this file.
12451         (Interface): We're now a TypeContainer and live in class.cs.
12452
12453         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12454         argument; we're now also called for interfaces.
12455         (TypeContainer.DefineMembers): Allow this method being called
12456         multiple times.
12457         (TypeContainer.GetMethods): New public method; formerly known as
12458         Interface.GetMethod().  This is used by PendingImplementation.
12459         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12460         it's now private and non-static.
12461         (Interface): Moved this here; it's now implemented similar to
12462         Class and Struct.
12463         (Method, Property, Event, Indexer): Added `bool is_interface'
12464         argument to their .ctor's.
12465         (MemberBase.IsInterface): New public field.
12466
12467         * cs-parser.jay: Create normal Method, Property, Event, Indexer
12468         instances instead of InterfaceMethod, InterfaceProperty, etc.
12469         (opt_interface_base): Removed; we now use `opt_class_base' instead.
12470         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12471
12472 2004-03-19  Martin Baulig  <martin@ximian.com>
12473
12474         * class.cs (MethodCore.IsDuplicateImplementation): New private
12475         method which does the CS0111 checking.
12476         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12477         Use IsDuplicateImplementation().
12478
12479 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
12480
12481         * decl.cs (FindMemberToOverride): New method to find the correct
12482         method or property to override in the base class.
12483         * class.cs
12484             - Make Method/Property use the above method to find the
12485               version in the base class.
12486             - Remove the InheritableMemberSignatureCompare as it is now
12487               dead code.
12488
12489         This patch makes large code bases much faster to compile, as it is
12490         O(n) rather than O(n^2) to do this validation.
12491
12492         Also, it fixes bug 52458 which is that nested classes are not
12493         taken into account when finding the base class member.
12494
12495         Reviewed/Approved by Martin.
12496
12497 2004-03-17  Martin Baulig  <martin@ximian.com>
12498
12499         * expression.cs (MemberAccess.DoResolve): Take the parent's number
12500         of type arguments into account; use the `real_num_type_args'
12501         approach like in DoResolveAsTypeStep().
12502
12503         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
12504         nested types.
12505
12506 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
12507
12508         * interface.cs: In all interface classes removed redundant
12509         member initialization.
12510
12511 2004-03-16  Martin Baulig  <martin@ximian.com>
12512
12513         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12514
12515 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12516
12517         * decl.cs (DefineTypeAndParents): New helper method to define a
12518         type's containers before the type itself is defined;  This is a
12519         bug exposed by the recent changes to Windows.Forms when an
12520         implemented interface was defined inside a class that had not been
12521         built yet.   
12522
12523         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12524
12525         (Check): Loop correctly to report errors modifiers
12526         (UNSAFE was not in the loop, since it was the same as TOP).
12527
12528         * interface.cs: Every interface member now takes a ModFlags,
12529         instead of a "is_new" bool, which we set on the base MemberCore. 
12530
12531         Every place where we called "UnsafeOk" in the interface, now we
12532         call the proper member (InterfaceMethod.UnsafeOK) instead to get
12533         the unsafe settings from the member declaration instead of the
12534         container interface. 
12535
12536         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
12537
12538         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12539         `set_indexer_name' to the pending bits (one per type).
12540
12541         We fixed a bug today that was picking the wrong method to
12542         override, since for properties the existing InterfaceMethod code
12543         basically ignored the method name.  Now we make sure that the
12544         method name is one of the valid indexer names.
12545
12546 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
12547  
12548         * support.cs (SeekableStreamReader): Keep track of stream byte
12549         positions and don't mix them with character offsets to the buffer.
12550
12551         Patch from Gustavo Giráldez
12552
12553 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
12554
12555         * interface.cs (InterfaceSetGetBase): Removed double member
12556         initialization, base class does it as well.
12557
12558 2004-03-13  Martin Baulig  <martin@ximian.com>
12559
12560         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12561         when compiling corlib.
12562
12563 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
12564
12565         * convert.cs (ExplicitConversion): We were reporting an error on
12566         certain conversions (object_type source to a value type, when the
12567         expression was `null') before we had a chance to pass it through
12568         the user defined conversions.
12569
12570         * driver.cs: Replace / and \ in resource specifications to dots.
12571         Fixes 50752
12572
12573         * class.cs: Add check for duplicate operators.  Fixes 52477
12574
12575 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
12576
12577         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12578         that are in the middle of the statements, not only at the end.
12579         Fixes #54987
12580
12581         * class.cs (TypeContainer.AddField): No longer set the
12582         `HaveStaticConstructor' flag, now we call it
12583         `UserDefineStaticConstructor' to diferentiate the slightly
12584         semantic difference.
12585
12586         The situation is that we were not adding BeforeFieldInit (from
12587         Modifiers.TypeAttr) to classes that could have it.
12588         BeforeFieldInit should be set to classes that have no static
12589         constructor. 
12590
12591         See:
12592
12593         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12594
12595         And most importantly Zoltan's comment:
12596
12597         http://bugzilla.ximian.com/show_bug.cgi?id=44229
12598
12599         "I think beforefieldinit means 'it's ok to initialize the type sometime 
12600          before its static fields are used', i.e. initialization does not need
12601          to be triggered by the first access to the type. Setting this flag
12602          helps the JIT to compile better code, since it can run the static
12603          constructor at JIT time, and does not need to generate code to call it
12604          (possibly lots of times) at runtime. Unfortunately, mcs does not set
12605          this flag for lots of classes like String. 
12606          
12607          csc sets this flag if the type does not have an explicit static 
12608          constructor. The reasoning seems to be that if there are only static
12609          initalizers for a type, and no static constructor, then the programmer
12610          does not care when this initialization happens, so beforefieldinit
12611          can be used.
12612          
12613          This bug prevents the AOT compiler from being usable, since it 
12614          generates so many calls to mono_runtime_class_init that the AOT code
12615          is much slower than the JITted code. The JITted code is faster, 
12616          because it does not generate these calls if the vtable is type is
12617          already initialized, which is true in the majority of cases. But the
12618          AOT compiler can't do this."
12619
12620 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
12621
12622         * class.cs (MethodData.Emit): Refactor the code so symbolic
12623         information is generated for destructors;  For some reasons we
12624         were taking a code path that did not generate symbolic information
12625         before. 
12626
12627 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12628
12629         * class.cs: Create a Constructor.CheckBase method that
12630         takes care of all validation type code. The method
12631         contains some code that was moved from Define.
12632
12633         It also includes new code that checks for duplicate ctors.
12634         This fixes bug #55148.
12635
12636 2004-03-09  Joshua Tauberer <tauberer@for.net>
12637
12638         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12639         a { ... }-style array creation invokes EmitStaticInitializers
12640         which is not good for reference-type arrays.  String, decimal
12641         and now null constants (NullCast) are not counted toward
12642         static initializers.
12643
12644 2004-03-05  Martin Baulig  <martin@ximian.com>
12645
12646         * location.cs (SourceFile.HasLineDirective): New public field;
12647         specifies whether the file contains or is referenced by a "#line"
12648         directive.
12649         (Location.DefineSymbolDocuments): Ignore source files which
12650         either contain or are referenced by a "#line" directive.        
12651
12652 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
12653
12654         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12655         direct access to our parent, so check the method inline there.
12656
12657 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12658
12659         * expression.cs (Invocation.EmitCall): Miguel's last commit
12660         caused a regression. If you had:
12661
12662             T t = null;
12663             t.Foo ();
12664
12665         In Foo the implict this would be null.
12666
12667 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
12668
12669         * expression.cs (Invocation.EmitCall): If the method is not
12670         virtual, do not emit a CallVirt to it, use Call.
12671
12672         * typemanager.cs (GetFullNameSignature): Improve the method to
12673         cope with ".ctor" and replace it with the type name.
12674
12675         * class.cs (ConstructorInitializer.Resolve): Now the method takes
12676         as an argument the ConstructorBuilder where it is being defined,
12677         to catch the recursive constructor invocations.
12678
12679 2004-03-16  Martin Baulig  <martin@ximian.com>
12680
12681         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
12682         ConstructedType, call ResolveType() on it to get the type rather
12683         than just using `expr.Type'.
12684
12685 2004-03-16  Martin Baulig  <martin@ximian.com>
12686
12687         * generics.cs (ConstructedType.GetMemberAccess): Take the
12688         EmitContext instead on the TypeExpr and use
12689         ec.TypeContainer.CurrentType/ec.ContainerType.
12690
12691 2004-03-16  Martin Baulig  <martin@ximian.com>
12692
12693         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
12694         parameters before aliases.
12695
12696 2004-03-16  Martin Baulig  <martin@ximian.com>
12697
12698         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
12699         New oublic function; checks whether two generic instances may become
12700         equal under some instantiations (26.3.1).
12701
12702         * class.cs (TypeContainer.Define): Call
12703         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
12704         error.
12705
12706 2004-03-16  Martin Baulig  <martin@ximian.com>
12707
12708         * class.cs (TypeContainer.GetClassBases): Moved
12709         Error_TypeParameterAsBase() here and also check whether the base
12710         class is not an attribute.
12711
12712 2004-03-16  Martin Baulig  <martin@ximian.com>
12713
12714         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12715
12716 2004-03-16  Martin Baulig  <martin@ximian.com>
12717
12718         * class.cs (Error_TypeParameterAsBase): Use correct error number
12719         here (CS0689).  
12720
12721 2004-03-16  Martin Baulig  <martin@ximian.com>
12722
12723         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
12724         for generics.
12725
12726         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
12727         error reporting.
12728
12729 2004-03-15  Martin Baulig  <martin@ximian.com>
12730
12731         * typemanager.cs (TypeManager.GetFullName): New public method.
12732         (TypeManager.MemberLookup): Added `int_num_type_arguments'
12733         argument; only return members with the correct number of type
12734         arguments.
12735         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
12736         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
12737         whether the number of type arguments matches.
12738
12739         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
12740         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
12741
12742         * expression.cs (MemberAccess): Added public `NumTypeArguments'
12743         field; it's set by the protected .ctor when we're actually a
12744         GenericMemberAccess.
12745         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
12746         arguments and pass it to MemberLookupFinal ().
12747
12748         * ecore.cs (Expression.MemberLookup): Added `int
12749         num_type_arguments' argument; only return members with the correct
12750         number of type arguments.
12751         (Expression.MemberLookupFailed): Check whether the MemberLookup
12752         failed because we did not have the correct number of type
12753         arguments; report CS0305 in this case.
12754
12755         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
12756         `e.ResolveAsTypeTerminal()' already did so.
12757
12758 2004-03-15  Martin Baulig  <martin@ximian.com>
12759
12760         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
12761         we're a ConstructedType; in this case, the caller must report an
12762         error (for instance CS0131).
12763
12764         * generic.cs (TypeArguments): Added Location argument to the .ctor.
12765         (TypeArguments.Resolve): Actually report errors here.
12766
12767 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12768
12769         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12770         `set_indexer_name' to the pending bits (one per type).
12771
12772         We fixed a bug today that was picking the wrong method to
12773         override, since for properties the existing InterfaceMethod code
12774         basically ignored the method name.  Now we make sure that the
12775         method name is one of the valid indexer names.
12776
12777 2004-03-15  Martin Baulig  <martin@ximian.com>
12778
12779         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
12780         for generic instances.
12781
12782 2004-03-13  Martin Baulig  <martin@ximian.com>
12783
12784         * class.cs (TypeContainer.DefineType): Call
12785         TypeManager.AddUserType() immediately after creating the
12786         TypeBuilder; pass all type parameters when creating the
12787         CurrentType.
12788
12789         * decl.cs (DeclSpace.FindNestedType): New public method.
12790         (DeclSpace.FindType): Added `int num_type_args' argument; only
12791         return types with the correct number of type parameters.
12792         (DeclSpace.CountTypeParams): New public property.
12793
12794         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
12795         the number of type parameters; defaults to zero.
12796
12797         * generic.cs (TypeArguments.Count): New public property.
12798         (ConstructedType.DoResolveAsTypeStep): First call
12799         ds.FindNestedType() to find out whether we're nested in the
12800         current generic type; in this case, we inherit all type parameters
12801         from the current class.
12802
12803         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
12804         num_type_args' argument.
12805         (RootContext.LookupType): Added overloaded version which takes the
12806         number of type arguments; only return types with the correct
12807         number of type arguments.
12808
12809         * typemanager.cs (TypeManager.CheckGeneric): New public function;
12810         checks whether `Type t' has `int num_type_args'.
12811
12812 2004-03-13  Martin Baulig  <martin@ximian.com>
12813
12814         * generic.cs (GenericMethod.DefineType): New method; calls
12815         DefineType() on all the type parameters.
12816
12817         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
12818         (MethodData.Define): If we're a generic method, call
12819         GenericMethod.DefineType() to define the type parameters.       
12820
12821 2004-03-10  Martin Baulig  <martin@ximian.com>
12822
12823         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
12824         instead of IsAssignableFrom.    
12825
12826 2004-03-10  Martin Baulig  <martin@ximian.com>
12827
12828         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
12829
12830         * support.cs (ParameterData.HasArrayParameter): New property.
12831         (ReflectionParameters.ctor): Take a MethodBase instead of a
12832         ParameterInfo[].  If we have any type parameters, get the generic
12833         method definition and ask it whether we have variable arguments.
12834
12835 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
12836
12837         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12838         routines to check if a type is an enumerable/enumerator allow
12839         classes that implement the IEnumerable or IEnumerator interfaces.
12840
12841         * class.cs (Property, Operator): Implement IIteratorContainer, and
12842         implement SetYields.
12843
12844         (Property.Define): Do the block swapping for get_methods in the
12845         context of iterators.   We need to check if Properties also
12846         include indexers or not.
12847
12848         (Operator): Assign the Block before invoking the
12849         OperatorMethod.Define, so we can trigger the Iterator code
12850         replacement. 
12851
12852         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
12853         Property and Operator classes are not created when we parse the
12854         declarator but until we have the block completed, so we use a
12855         singleton SimpleIteratorContainer.Simple to flag whether the
12856         SetYields has been invoked.
12857
12858         We propagate this setting then to the Property or the Operator to
12859         allow the `yield' to function.
12860
12861 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
12862
12863         * codegen.cs: Implemented attribute support for modules.
12864         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12865         Assembly/Module functionality.
12866
12867         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12868         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12869         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12870
12871 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
12872
12873         * interface.cs (FindMembers): The operation is performed on all base
12874         interfaces and not only on the first. It is required for future CLS Compliance patch.
12875
12876 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12877
12878         * statement.cs, codegen.cs:
12879         This patch deals with patterns such as:
12880
12881         public class List : IEnumerable {
12882
12883                 public MyEnumerator GetEnumerator () {
12884                         return new MyEnumerator(this);
12885                 }
12886
12887                 IEnumerator IEnumerable.GetEnumerator () {
12888                         ...
12889                 }
12890                 
12891                 public struct MyEnumerator : IEnumerator {
12892                         ...
12893                 }
12894         }
12895
12896         Before, there were a few things we did wrong:
12897         1) we would emit callvirt on a struct, which is illegal
12898         2) we emited ldarg when we needed to emit ldarga
12899         3) we would mistakenly call the interface methods on an enumerator
12900         type that derived from IEnumerator and was in another assembly. For example:
12901
12902         public class MyEnumerator : IEnumerator
12903
12904         Would have the interface methods called, even if there were public impls of the
12905         method. In a struct, this lead to invalid IL code.
12906
12907 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
12908
12909         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12910           renamed to Emit.
12911
12912         * delegate.cs (Define): Fixed crash when delegate type is undefined.
12913
12914 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
12915
12916         * cs-parser.jay: Fix small regression: we were not testing V2
12917         compiler features correctly.
12918
12919         * interface.cs: If the emit context is null, then create one
12920
12921 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
12922
12923         * decl.cs (GetSignatureForError): New virtual method to get full name
12924           for error messages.
12925
12926         * attribute.cs (IAttributeSupport): New interface for attribute setting.
12927           Now it is possible to rewrite ApplyAttributes method to be less if/else.
12928
12929         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12930           Duplicated members and code in these classes has been removed.
12931           Better encapsulation in these classes.
12932
12933 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
12934
12935         * assign.cs (Assign.DoResolve): When dealing with compound
12936         assignments, there is a new rule in ECMA C# 2.4 (might have been
12937         there before, but it is documented here) that states that in:
12938
12939         a op= b;
12940
12941         If b is of type int, and the `op' is a shift-operator, then the
12942         above is evaluated as:
12943
12944         a = (int) a op b 
12945
12946         * expression.cs (Binary.ResolveOperator): Instead of testing for
12947         int/uint/long/ulong, try to implicitly convert to any of those
12948         types and use that in pointer arithmetic.
12949
12950         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12951         method to print information for from the type, not from the
12952         null-method we were given.
12953
12954 2004-02-01  Duncan Mak  <duncan@ximian.com>
12955
12956         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12957         parsing for cmd, fixes bug #53694.
12958
12959 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
12960
12961         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12962         in the member name duplication tests. Property and operator name duplication
12963         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12964
12965 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
12966
12967         * interface.cs (PopulateMethod): Fixed crash when interface method
12968         returns not existing type (error test cs0246-3.cs).
12969
12970 2004-02-02  Ravi Pratap M <ravi@ximian.com>
12971
12972         * cs-parser.jay (interface_accessors): Re-write actions to also
12973         store attributes attached to get and set methods. Fix spelling
12974         while at it.
12975
12976         (inteface_property_declaration): Modify accordingly.
12977
12978         (InterfaceAccessorInfo): New helper class to store information to pass
12979         around between rules that use interface_accessors.
12980
12981         * interface.cs (Emit): Apply attributes on the get and set
12982         accessors of properties and indexers too.
12983
12984         * attribute.cs (ApplyAttributes): Modify accordingly to use the
12985         right MethodBuilder when applying attributes to the get and set accessors.
12986
12987 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
12988
12989         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12990
12991 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
12992
12993         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12994
12995 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
12996
12997         * cs-parser.jay: Remove YIELD token, instead use the new grammar
12998         changes that treat `yield' specially when present before `break'
12999         or `return' tokens.
13000
13001         * cs-tokenizer.cs: yield is no longer a keyword.
13002
13003 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
13004
13005         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
13006         setting for default constructors.
13007         For default constructors are almost every time set wrong Modifier. The
13008         generated IL code has been alright. But inside mcs this values was
13009         wrong and this was reason why several of my CLS Compliance tests
13010         failed.
13011
13012 2004-02-27  Martin Baulig  <martin@ximian.com>
13013
13014         * generics.cs (ConstructedType.ResolveType): Make the nested type
13015         stuff actually work.
13016
13017 2004-02-25  Martin Baulig  <martin@ximian.com>
13018
13019         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
13020         property; returns the type parameters just from the current type,
13021         ie. with the ones from outer classes.
13022         (DeclSpace.LookupGeneric): First search in the current class, then
13023         in outer classes.
13024         (DeclSpace.initialize_type_params): When hiding a type parameter
13025         from an outer class, put it into the `type_param_list' anyways.
13026
13027         * expression.cs (MemberAccess.expr): Made this field protected.
13028
13029         * class.cs (TypeContainer.Define): The `CurrentType' just contains
13030         the type parameters from the current class.
13031
13032         * generic.cs (ConstructedType.ResolveType): Support nested generic
13033         types by taking the type parameters which we inherit from outer
13034         classes into account.
13035         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
13036         support for nested generic types.
13037
13038 2004-02-23  Martin Baulig  <martin@ximian.com>
13039
13040         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
13041         field and check whether we're nested inside a generic type.
13042         (DeclSpace.ResolveType): If we're resolving to a generic type
13043         definition, create a ConstructedType and return its resolved type.
13044         (DeclSpace.initialize_type_params): New private method;
13045         initializes the `type_param_list' field from the type parameters
13046         from this and all enclosing classes.
13047         (DeclSpace.TypeParameters): Call initialize_type_params() unless
13048         we're already initialized.
13049
13050 2004-02-23  Martin Baulig  <martin@ximian.com>
13051
13052         * class.cs (Method.Define): Create the generic method before
13053         calling DoDefine().
13054         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
13055         the TypeContainer one); we use this for generic methods.
13056
13057         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
13058         parent's TypeBuilder.
13059
13060 2004-02-18  Martin Baulig  <martin@ximian.com>
13061
13062         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
13063         to check for equality.
13064
13065 2004-02-05  Martin Baulig  <martin@ximian.com>
13066
13067         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
13068         `ec.TypeContainer.CurrentType', use it instead of
13069         `ec.ContainerType' to check whether we're in the type's ctor.
13070
13071 2004-01-29  Martin Baulig  <martin@ximian.com>
13072
13073         * expression.cs (Invocation.DoResolve): If we're a
13074         `ConstructedType', then we're actually a generic method, so
13075         rewrite the expr as a GenericMemberAccess.
13076
13077         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
13078         here; manually parse it into a string.
13079
13080 2004-01-28  Martin Baulig  <martin@ximian.com>
13081
13082         * typemanager.cs (TypeManager.IsEqual): New static method.
13083         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
13084         check for equality instead of using `=='.
13085
13086 2004-01-26  Martin Baulig  <martin@ximian.com>
13087
13088         * decl.cs (DeclSpace.CurrentType): New public field.
13089
13090         * expression.cs (This.ResolveBase): If we have an
13091         `ec.TypeContainer.CurrentType', use it instead of
13092         `ec.ContainerType'.
13093
13094         * class.cs (TypeContainer.DefineType): If we're a generic type,
13095         create the `CurrentType' (unresolved).
13096         (TypeContainer.GenericType): New private field.
13097         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
13098         it and store it in `GenericType' before creating the MemberCache.
13099         (TypeContainer.GetMembers): If we have a `GenericType', call
13100         TypeManager.FindMembers() on it.
13101
13102         * interface.cs (Interface.GenericType): New private field.
13103         (Interface.DefineType): If we're a generic type, create the
13104         `CurrentType' (unresolved).
13105         (Interface.DefineMembers): If we have a `CurrentType', resolve it
13106         and store it in `GenericType' before creating the MemberCache.
13107         (Interface.GetMembers): If we have a `GenericType', call
13108         TypeManager.FindMembers() on it.
13109
13110 2004-01-22  Martin Baulig  <martin@ximian.com>
13111
13112         * cs-parser.jay (namespace_or_type_name): Return an Expression,
13113         not a QualifiedIdentifier.  This is what `type_name_expression'
13114         was previously doing.
13115         (type_name_expression): Removed; the code is now in
13116         `namespace_or_type_name'.
13117         (qualified_identifier): Removed, use `namespace_or_type_name'
13118         instead.
13119         (QualifiedIdentifier): Removed this class.      
13120
13121 2004-01-22  Martin Baulig  <martin@ximian.com>
13122
13123         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
13124         not a string as alias name.
13125
13126 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
13127
13128         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
13129         #52730 bug, and instead compute correctly the need to use a
13130         temporary variable when requesting an address based on the
13131         static/instace modified of the field and the constructor.
13132  
13133 2004-01-21  Martin Baulig  <martin@ximian.com>
13134
13135         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
13136         class and namespace before looking up aliases.  Fixes #52517.
13137
13138 2004-01-21  Martin Baulig  <martin@ximian.com>
13139
13140         * flowanalysis.cs (UsageVector.Merge): Allow variables being
13141         assinged in a 'try'; fixes exception4.cs.
13142
13143 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13144         * class.cs : Implemented parameter-less constructor for TypeContainer
13145
13146         * decl.cs: Attributes are now stored here. New property OptAttributes
13147
13148         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
13149
13150         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
13151
13152 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13153
13154         * typemanager.cs (CSharpSignature): Now reports also inner class name.
13155           (CSharpSignature): New method for indexer and property signature.
13156
13157 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13158
13159         * pending.cs (IsVirtualFilter): Faster implementation.
13160
13161 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13162
13163         * typemanager.cs: Avoid inclusion of same assembly more than once.
13164
13165 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13166
13167         * cs-parser.jay: Fixed problem where the last assembly attribute
13168           has been applied also to following declaration (class, struct, etc.)
13169           
13170 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13171
13172         * class.cs: Added error CS0538, CS0539 reporting.
13173         Fixed crash on Microsoft runtime when field type is void.
13174
13175         * cs-parser.jay: Added error CS0537 reporting.
13176
13177         * pending.cs: Added error CS0535 reporting.
13178         Improved error report for errors CS0536, CS0534.
13179
13180 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
13181
13182         Merge a few bits from the Anonymous Method MCS tree.
13183
13184         * statement.cs (ToplevelBlock): New class for toplevel methods,
13185         will hold anonymous methods, lifted variables.
13186
13187         * cs-parser.jay: Create toplevel blocks for delegates and for
13188         regular blocks of code. 
13189
13190 2004-01-20  Martin Baulig  <martin@ximian.com>
13191
13192         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
13193         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
13194         and `NeedExplicitReturn'; added `IsLastStatement'.
13195         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
13196         have a `ReturnLabel' or we're not unreachable.
13197
13198         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
13199         child's reachability; don't just override ours with it.  Fixes
13200         #58058 (lluis's example).
13201         (FlowBranching): Added public InTryOrCatch(), InCatch(),
13202         InFinally(), InLoop(), InSwitch() and
13203         BreakCrossesTryCatchBoundary() methods.
13204
13205         * statement.cs (Return): Do all error checking in Resolve().
13206         Unless we are the last statement in a top-level block, always
13207         create a return label and jump to it.
13208         (Break, Continue): Do all error checking in Resolve(); also make
13209         sure we aren't leaving a `finally'.
13210         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
13211         statement in a top-level block.
13212         (Block.Flags): Added `IsDestructor'.
13213         (Block.IsDestructor): New public property.
13214
13215 2004-01-20  Martin Baulig  <martin@ximian.com>
13216
13217         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
13218
13219 2004-01-20  Martin Baulig  <martin@ximian.com>
13220
13221         * statement.cs (Statement.ResolveUnreachable): New public method.
13222         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
13223         (Block.Resolve): Resolve unreachable statements.
13224
13225 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13226
13227         * expression.cs: We need to fix the case where we do
13228         not have a temp variable here.
13229
13230         * assign.cs: Only expression compound assignments need
13231         temporary variables.
13232
13233 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13234
13235         * flowanalysis.cs: Reduce memory allocation in a few ways:
13236           - A block with no variables should not allocate a bit
13237             vector for itself.
13238           - A method with no out parameters does not need any tracking
13239             for assignment of the parameters, so we need not allocate
13240             any data for it.
13241           - The arrays:
13242                 public readonly Type[] VariableTypes;
13243                 public readonly string[] VariableNames;
13244             Are redundant. The data is already stored in the variable
13245             map, so we need not allocate another array for it.
13246           - We need to add alot of checks for if (params | locals) == null
13247             due to the first two changes.
13248
13249 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
13250
13251         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
13252         implement IMemoryLocation, we store a copy on a local variable and
13253         take the address of it.  Patch from Benjamin Jemlich
13254
13255         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
13256         to use a special "type_name_expression" rule which reduces the
13257         number of "QualifiedIdentifier" classes created, and instead
13258         directly creates MemberAccess expressions.
13259
13260 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
13261
13262         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
13263         that fixes #52853.  Null literal assignment to ValueType
13264
13265         * class.cs (MethodData.Emit): Instead of checking the name of the
13266         method to determine if its a destructor, create a new derived
13267         class from Method called Destructor, and test for that.  
13268
13269         * cs-parser.jay: Create a Destructor object instead of a Method.  
13270
13271         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
13272
13273         Fixes: 52933
13274
13275 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
13276
13277         * expression.cs (Binary.ResolveOperator): Perform an implicit
13278         conversion from MethodGroups to their delegate types on the
13279         Addition operation.
13280
13281         * delegate.cs: Introduce a new class DelegateCreation that is the
13282         base class for `NewDelegate' and `ImplicitDelegateCreation',
13283         factor some code in here.
13284
13285         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
13286         conversion from MethodGroups to compatible delegate types. 
13287
13288         * ecore.cs (Expression.Resolve): Do not flag error 654
13289         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
13290         we allow conversions from MethodGroups to delegate types now.
13291
13292         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
13293         assignments in v2 either.
13294
13295 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
13296
13297         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
13298         static read-only fields in ctors.
13299
13300         Applied patch from Benjamin Jemlich 
13301
13302         * expression.cs (UnaryMutator): Avoid leaking local variables. 
13303
13304 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
13305
13306         * cs-tokenizer.cs (IsCastToken): Allow the various native types
13307         here to return true, as they can be used like this:
13308
13309                 (XXX) int.MEMBER ()
13310
13311         Fixed 49836 and all the other dups
13312
13313 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
13314
13315         * driver.cs: Implement /win32res and /win32icon.
13316
13317 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
13318
13319         * cs-parser.jay: Add a rule to improve error handling for the
13320         common mistake of placing modifiers after the type.
13321
13322 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
13323
13324         * cs-parser.jay (interface_event_declaration): Catch
13325         initialization of events on interfaces, and report cs0068
13326
13327         * cs-parser.jay (interface_event_declaration): Catch
13328         initialization of events. 
13329
13330         * ecore.cs: Better report missing constructors.
13331
13332         * expression.cs (Binary.ResolveOperator): My previous bug fix had
13333         the error reporting done in the wrong place.  Fix.
13334
13335         * expression.cs (Binary.ResolveOperator): Catch the 
13336         operator + (E x, E y) error earlier, and later allow for implicit
13337         conversions in operator +/- (E e, U x) from U to the underlying
13338         type of E.
13339
13340         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
13341         52596, if the container class is abstract, the default constructor
13342         is protected otherwise its public (before, we were always public).
13343
13344         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
13345         fixed statement.
13346
13347         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
13348         Jemlich that fixes bug #52597, MCS was generating invalid code for
13349         idisposable structs.   Thanks to Ben for following up with this
13350         bug as well.
13351
13352 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
13353
13354         * driver.cs: Allow assemblies without code to be generated, fixes
13355         52230.
13356
13357 2004-01-07  Nick Drochak <ndrochak@gol.com>
13358
13359         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
13360
13361 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
13362
13363         * cs-parser.jay: Add rules to improve error reporting if fields or
13364         methods are declared at the namespace level (error 116)
13365
13366         * Add rules to catch event add/remove
13367
13368 2004-01-04  David Sheldon <dave-mono@earth.li>
13369
13370   * expression.cs: Added matching ")" to error message for 
13371   CS0077
13372
13373 2004-01-03 Todd Berman <tberman@gentoo.org>
13374
13375         * ecore.cs, attribute.cs:
13376         Applying fix from #52429.
13377
13378 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13379
13380         * ecore.cs, expression.cs, statement.cs:
13381         Total rewrite of how we handle branching. We
13382         now handle complex boolean expressions with fewer
13383         jumps. As well if (x == 0) no longer emits a ceq.
13384
13385         if (x is Foo) is much faster now, because we generate
13386         better code.
13387
13388         Overall, we get a pretty big improvement on our benchmark
13389         tests. The code we generate is smaller and more readable.
13390
13391         I did a full two-stage bootstrap. The patch was reviewed
13392         by Martin and Miguel.
13393
13394 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13395
13396         * cs-parser.jay: Make primary_expression not take a QI.
13397         we dont need this because the member_access rule covers
13398         us here. So we replace the rule with just IDENTIFIER.
13399
13400         This has two good effects. First, we remove a s/r conflict.
13401         Second, we allocate many fewer QualifiedIdentifier objects.
13402
13403 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13404
13405         * attribute.cs: Handle MarshalAs attributes as pseudo, and
13406         set the correct information via SRE. This prevents
13407         hanging on the MS runtime. Fixes #29374.
13408
13409 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13410
13411         * convert.cs: correctly handle conversions to value types
13412         from Enum and ValueType as unboxing conversions.
13413
13414         Fixes bug #52569. Patch by Benjamin Jemlich.
13415
13416 2004-01-02  Ravi Pratap  <ravi@ximian.com>
13417
13418         * expression.cs (BetterConversion): Prefer int -> uint
13419         over int -> ulong (csc's behaviour). This fixed bug #52046.
13420
13421 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13422
13423         * decl.cs (MemberCache.FindMembers): now returns a
13424         MemberInfo [].
13425
13426         * typemanager.cs: In general, go with with ^^.
13427         (CopyNewMethods): take an IList.
13428         (RealMemberLookup): Only allocate an arraylist
13429         if we copy from two sets of methods.
13430
13431         This change basically does two things:
13432         1) Fewer array lists allocated due to CopyNewMethods.
13433         2) the explicit cast in MemberList costed ALOT.
13434
13435 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
13436
13437         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
13438         a hashtable to avoid needless string allocations when an identifier is
13439         used more than once (the common case).
13440
13441 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13442
13443         * pending.cs: MS's TypeBuilder.GetInterfaces ()
13444         is broken, it will not return anything. So, we
13445         have to use the information we have in mcs to
13446         do the task.
13447
13448         * typemanager.cs: Add a cache for GetInterfaces,
13449         since this will now be used more often (due to ^^)
13450
13451         (GetExplicitInterfaces) New method that gets the
13452         declared, not effective, interfaces on a type
13453         builder (eg, if you have interface IFoo, interface
13454         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
13455         { IBar }.
13456
13457         This patch makes MCS able to bootstrap itself on
13458         Windows again.
13459
13460 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13461
13462         * expression.cs: Remove the Nop's that Miguel put
13463         in by mistake.
13464
13465 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13466
13467         * report.cs, codegen.cs: Give the real stack trace to
13468         the error when an exception is thrown.
13469
13470 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13471
13472         * decl.cs: only allocate hashtables for ifaces if 
13473         it is an iface!
13474
13475 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13476
13477         * expression.cs: fix the error from cs0121-2.cs
13478         (a parent interface has two child interfaces that
13479         have a function with the same name and 0 params
13480         and the function is called through the parent).
13481
13482 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13483
13484         * class.cs, rootcontext.cs, typmanager.cs: do not
13485         leak pointers.
13486
13487 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
13488
13489         * codegen.cs: remove stack for the ec flow branching.
13490         It is already a linked list, so no need.
13491
13492 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
13493
13494         * Makefile: Allow custom profiler here.
13495
13496 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13497
13498         * typemanager.cs (LookupType):
13499           - Use a static char [], because split takes
13500             a param array for args, so it was allocating
13501             every time.
13502           - Do not store true in a hashtable, it boxes.
13503
13504 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13505
13506         * flowanalysis.cs: bytify common enums.
13507
13508 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13509
13510         * modifiers.cs: Add a new set of flags for the
13511         flags allowed on explicit interface impls.
13512         * cs-parser.jay: catch the use of modifiers in
13513         interfaces correctly.
13514         * class.cs: catch private void IFoo.Blah ().
13515
13516         All related to bug #50572.
13517
13518 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13519
13520         * decl.cs: Rewrite the consistant accessability checking.
13521         Accessability is not linear, it must be implemented in
13522         a tableish way. Fixes #49704.
13523
13524 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13525
13526         * expression.cs: Handle negation in a checked context.
13527         We must use subtraction from zero. Fixes #38674.
13528
13529 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13530
13531         * class.cs: Ignore static void main in DLLs.
13532         * rootcontext.cs: Handle the target type here,
13533         since we are have to access it from class.cs
13534         * driver.cs: account for the above.
13535
13536 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13537
13538         * report.cs: Give line numbers and files if available.
13539
13540 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
13541
13542         * driver.cs: Implement /addmodule.
13543
13544         * typemanager.cs:  Change 'modules' field so it now contains Modules not
13545         ModuleBuilders.
13546
13547 2003-12-20  Martin Baulig  <martin@ximian.com>
13548
13549         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13550         (FieldBase.IsAssigned): Removed this field.
13551         (FieldBase.SetAssigned): New public method.
13552         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13553
13554 2003-12-20  Martin Baulig  <martin@ximian.com>
13555
13556         * expression.cs (LocalVariableReference.DoResolve): Don't set
13557         `vi.Used' if we're called from DoResolveLValue().
13558
13559         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13560         returns the usage vector it just merged into the current one -
13561         pass this one to UsageWarning().
13562         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13563         of the `EmitContext', don't call this recursively on our children.
13564
13565 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
13566
13567         * driver.cs: Implement /target:module.
13568
13569 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
13570
13571         * support.cs (CharArrayHashtable): New helper class.
13572
13573         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
13574         char arrays, not strings, so we can avoid creating a string in
13575         consume_identifier if the identifier is a keyword.
13576
13577 2003-12-16  Martin Baulig  <martin@ximian.com>
13578
13579         * statement.cs (LocalInfo.Assigned): Removed this property.
13580         (LocalInfo.Flags): Removed `Assigned'.
13581         (LocalInfo.IsAssigned): New public method; takes the EmitContext
13582         and uses flow analysis.
13583         (Block.UsageWarning): Made this method private.
13584         (Block.Resolve): Call UsageWarning() if appropriate.
13585
13586         * expression.cs (LocalVariableReference.DoResolve): Always set
13587         LocalInfo.Used here.
13588
13589 2003-12-13  Martin Baulig  <martin@ximian.com>
13590
13591         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13592         any value here; we're now using flow analysis to figure out
13593         whether a statement/block returns a value.
13594
13595 2003-12-13  Martin Baulig  <martin@ximian.com>
13596
13597         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13598         working again.
13599         (FlowBranching.MergeFinally): Don't call
13600         `branching.CheckOutParameters()' here, this is called in
13601         MergeTopBlock().
13602         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13603         when adding the `finally' vector.       
13604
13605 2003-12-13  Martin Baulig  <martin@ximian.com>
13606
13607         * flowanalysis.cs
13608         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13609         actually work and also fix #48962.
13610
13611 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
13612
13613         * decl.cs: Do not check System.Object for nested types,
13614         since we know it does not have any. Big bang for buck:
13615
13616         BEFORE:
13617            Run 1:   8.35 seconds
13618            Run 2:   8.32 seconds
13619            corlib:  17.99 seconds
13620         AFTER:
13621            Run 1:   8.17 seconds
13622            Run 2:   8.17 seconds
13623            corlib:  17.39 seconds
13624
13625 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
13626
13627         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13628         time we are returning 0 members, so we save alot here.
13629
13630 2003-12-11  Martin Baulig  <martin@ximian.com>
13631
13632         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13633         `MergeChild()', also just take the `FlowBranching' as argument;
13634         call Merge() on it and return the result.
13635         (FlowBranching.Merge): We don't need to do anything if we just
13636         have one sibling.
13637
13638 2003-12-11  Martin Baulig  <martin@ximian.com>
13639
13640         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13641         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
13642         Maurer for this idea.
13643
13644 2003-12-11  Martin Baulig  <martin@ximian.com>
13645
13646         * flowanalysis.cs (MergeResult): This class is now gone; we now
13647         use the `UsageVector' for this.  The reason for this is that if a
13648         branching just has one sibling, we don't need to "merge" them at
13649         all - that's the next step to do.
13650         (FlowBranching.Merge): We now return a `UsageVector' instead of a
13651         `MergeResult'.
13652
13653 2003-12-11  Martin Baulig  <martin@ximian.com>
13654
13655         Reworked flow analyis and made it more precise and bug-free.  The
13656         most important change is that we're now using a special `Reachability'
13657         class instead of having "magic" meanings of `FlowReturns'.  I'll
13658         do some more cleanups and optimizations and also add some more
13659         documentation this week.
13660
13661         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13662         largely reworked this class.
13663         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13664         the new `Reachability' class instead of having "magic" values here.
13665         (FlowBranching): We're now using an instance of `Reachability'
13666         instead of having separate `Returns', `Breaks' etc. fields.
13667
13668         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13669         based on flow analysis; ignore the return value of block.Emit ().
13670
13671 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
13672
13673         * driver.cs typemanager.cs: Find the mono extensions to corlib even
13674         if they are private.
13675
13676 2003-12-09  Martin Baulig  <martin@ximian.com>
13677
13678         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13679         call them directly on the UsageVector.
13680
13681 2003-12-09  Martin Baulig  <martin@ximian.com>
13682
13683         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13684         Changed return type from `FlowReturns' to `Reachability'.
13685
13686 2003-12-09  Martin Baulig  <martin@ximian.com>
13687
13688         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13689         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13690         `Reachable' fields with a single `Reachability' one.
13691
13692 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13693
13694         * class.cs (FindMembers): Remove foreach's.
13695
13696         Bootstrap times:
13697
13698         BEFORE
13699                 Run 1:   8.74 seconds
13700                 Run 2:   8.71 seconds
13701
13702         AFTER
13703                 Run 1:   8.64 seconds
13704                 Run 2:   8.58 seconds
13705
13706
13707 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13708
13709         * cs-parser.jay:
13710         * gen-treedump.cs:
13711         * statement.cs:
13712         This patch does a few things:
13713                 1. EmptyStatement is now a singleton, so it is never reallocated.
13714                 2. All blah is EmptyStatement constructs have been changed to
13715                    blah == EmptyStatement.Value, which is much faster and valid
13716                    now that EmptyStatement is a singleton.
13717                 3. When resolving a block, rather than allocating a new array for
13718                    the non-empty statements, empty statements are replaced with
13719                    EmptyStatement.Value
13720                 4. Some recursive functions have been made non-recursive.
13721         Mainly the performance impact is from (3), however (1) and (2) are needed for
13722         this to work. (4) does not make a big difference in normal situations, however
13723         it makes the profile look saner.
13724
13725         Bootstrap times:
13726
13727         BEFORE
13728         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13729         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13730         Total memory allocated: 56397 KB
13731
13732         AFTER
13733         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13734         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13735         Total memory allocated: 55666 KB
13736
13737 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13738
13739         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13740         than the hashtable in a hashtable version
13741
13742         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13743         we always end up concating a string. This results in a huge perf
13744         loss, because many strings have to be tracked by the GC. In this
13745         patch, we first use a hashtable that works with two keys, so that
13746         the strings do not need to be concat'ed.
13747
13748         Bootstrap times:
13749         BEFORE
13750                 Run 1:   8.74 seconds
13751                 Run 2:   8.71 seconds
13752
13753         AFTER
13754                 Run 1:   8.65 seconds
13755                 Run 2:   8.56 seconds
13756
13757 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13758
13759         * Makefile: Add a new target `do-time' that does a quick and simple
13760         profile, leaving easy to parse output.
13761
13762 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
13763
13764         * codegen.cs (Init): Create the dynamic assembly with 
13765         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13766
13767 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13768
13769         * support.cs: Make the PtrHashtable use only one
13770         instance of its comparer.
13771
13772 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
13773
13774         * typemanager.cs: Fix lookup of GetNamespaces.
13775
13776 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
13777
13778         * expression.cs: Removed redundant line.
13779
13780         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13781         ArrayLists, use for loops with bounds.  
13782
13783         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13784         arraylist.
13785
13786         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13787         arraylists, use for loop with bounds.
13788
13789         The above three changes give us a 0.071 second performance
13790         improvement out of 3.294 seconds down to 3.223.  On my machine
13791         the above changes reduced the memory usage by 1,387 KB during
13792         compiler bootstrap.
13793
13794         * cs-parser.jay (QualifiedIdentifier): New class used to represent
13795         QualifiedIdentifiers.  Before we created a new string through
13796         concatenation, and mostly later on, the result would be
13797         manipulated by DecomposeQI through string manipulation.
13798
13799         This reduced the compiler memory usage for bootstrapping from
13800         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13801         compile times in 0.05 seconds.
13802
13803 2003-11-28  Dick Porter  <dick@ximian.com>
13804
13805         * support.cs: Do string compares with the Invariant culture.
13806
13807         * rootcontext.cs: 
13808         * gen-treedump.cs: 
13809         * expression.cs: 
13810         * driver.cs: 
13811         * decl.cs: 
13812         * codegen.cs: 
13813         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13814         the comparison is done with the Invariant culture.
13815
13816 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
13817
13818         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13819         GetEnumerator method.
13820
13821         (ProbeCollectionType): Iterate starting at the most specific type
13822         upwards looking for a GetEnumerator
13823
13824         * expression.cs: Shift count can be up to 31 for int/uint and 63
13825         for long/ulong.
13826
13827 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
13828
13829         * statement.cs (Block.LookupLabel): Also look for the label on the
13830         children blocks.  Use a hash table to keep track of visited
13831         nodes. 
13832
13833         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13834         we actually did transform the other operand, otherwise fall back
13835         to the common codepath that casts to long.
13836
13837         * cs-tokenizer.cs: Use the same code pattern as the int case.
13838         Maybe I should do the parsing myself, and avoid depending on the
13839         Parse routines to get this done.
13840
13841 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
13842
13843         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13844         which fixes bug 51347.  This time test it.
13845
13846         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13847         attributes for example can not tell the difference between these.
13848         The difference was only a syntax feature of the language. 
13849
13850         * attribute.cs: Apply attributes to delegates.
13851
13852         * delegate.cs: Call the apply attributes method.
13853
13854 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
13855
13856         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13857         comparing 0 vs Byte.MinValue, not the value
13858
13859         (ImplicitConversionRequired): When reporting a conversion error,
13860         use error 31 to print out the constant error instead of the
13861         simpler 29.
13862
13863         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13864         which fixes bug 51347.
13865
13866 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
13867
13868         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
13869         which fixes the -warnaserror command line option.
13870
13871 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
13872
13873         * cfold.cs (DoNumericPromotions): During constant folding of
13874         additions on UIntConstant, special case intconstants with
13875         IntConstants like we do on the expression binary operator. 
13876
13877 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
13878
13879         * convert.cs (ImplicitReferenceConversion): We were missing a case
13880         (System.Enum are not value types or class types, so we need to
13881         classify them separatedly).
13882
13883         * driver.cs: We do not support error 2007.
13884
13885 2003-11-12 Jackson Harper <jackson@ximian.com>
13886
13887         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13888         system directory. Also use the full file name so users can
13889         libraries names mscorlib-o-tron.dll in a non system dir.
13890         
13891 2004-01-04  David Sheldon <dave-mono@earth.li>
13892
13893         * expression.cs: Added matching ")" to error message for CS0077.
13894
13895 2003-12-19  Martin Baulig  <martin@ximian.com>
13896
13897         * typemanager.cs (TypeManager.IsEqualGenericType): New public
13898         static method; see documentation in the method.
13899         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
13900
13901         * convert.cs (Convert.ImplicitReferenceConversion,
13902         Convert.ImplicitReferenceConversionExists): Add support for
13903         generic type declarations; see gen-36.cs.
13904
13905 2003-12-19  Martin Baulig  <martin@ximian.com>
13906
13907         * pending.cs (Pending.InterfaceMethod): Use
13908         `Type.IsAssignableFrom()' instead of `=='.
13909
13910 2003-12-18  Martin Baulig  <martin@ximian.com>
13911
13912         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
13913         byref types first.
13914
13915         * convert.cs (Convert.ImplicitStandardConversionExists): Use
13916         `expr_type.Equals (target_type)' instead of `=='.
13917
13918 2003-12-08  Martin Baulig  <martin@ximian.com>
13919
13920         * generics.cs (Constraints.Types): Removed.
13921         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
13922         to Type's.
13923         (Constraints.ResolveTypes): New public method; resolves the
13924         TypeExpr's to Type's.
13925         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
13926         longer takes the constraints.
13927         (TypeParameter.DefineMethod): Likewise.
13928         (TypeParameter.DefineType): New public method.  Calls
13929         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
13930         the constraints.
13931
13932 2003-12-08  Martin Baulig  <martin@ximian.com>
13933
13934         * convert.cs (Convert.ImplicitConversionStandard): Use
13935         `expr_type.Equals (target_type)' instead of `=='.
13936
13937 2003-12-08  Martin Baulig  <martin@ximian.com>
13938
13939         * typemanager.cs (TypeManager.GetReferenceType): Call
13940         `Type.MakeByRefType ()'.
13941
13942 2003-12-08  Martin Baulig  <martin@ximian.com>
13943
13944         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
13945         just has some special meaning in some situations.  For instance,
13946         it is allowed to use `where' as the name of a variable etc.
13947
13948 2003-12-04  Martin Baulig  <martin@ximian.com>
13949
13950         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13951         `Type.MakeArrayType()' for array types.
13952
13953 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
13954
13955         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
13956         debugging message.
13957
13958         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
13959         corlib to compile.
13960
13961 2003-11-16  Martin Baulig  <martin@ximian.com>
13962
13963         * codegen.cs (EmitContext.IsGeneric): Removed.
13964
13965         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
13966         ResolveGeneric() on the DeclSpace.
13967
13968 2003-11-16  Martin Baulig  <martin@ximian.com>
13969
13970         * generic.cs (TypeArguments.Resolve):
13971         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
13972         `ResolveType()' on it to get the Type.
13973
13974 2003-11-15  Martin Baulig  <martin@ximian.com>
13975
13976         * generic.cs (ConstructedType.GetInterfaces): Override this.
13977
13978 2003-11-14  Martin Baulig  <martin@ximian.com>
13979
13980         * interface.cs (Interface.DefineType): Define all type parameters
13981         before adding the interfaces we inherit.
13982
13983 2003-11-11  Martin Baulig  <martin@ximian.com>
13984
13985         * generic.cs (ConstructedType.ResolveType): Always call
13986         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
13987
13988 2003-11-10  Martin Baulig  <martin@ximian.com>
13989
13990         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13991         (TypeManager.InitCoreTypes): Initialize them here, but instead of
13992         calling `ResolveType()' on them, directly assign their `Type'.
13993
13994 2003-11-08  Martin Baulig  <martin@ximian.com>
13995
13996         * generic.cs (ConstructedType): Override `IsClass' etc.
13997
13998 2003-11-08  Martin Baulig  <martin@ximian.com>
13999
14000         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
14001         return value and the `out parent' parameter.
14002         (TypeContainer.DefineType): Moved the CS0644 check into
14003         GetClassBases().  Don't pass the interface types to the
14004         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
14005         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
14006
14007         * ecore.cs (TypeExpr.IsAttribute): New property.
14008         (TypeExpr.GetInterfaces): New method.
14009
14010         * interface.cs (Interface.GetInterfaceTypeByName): Return a
14011         TypeExpr instead of a Type.
14012         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
14013         (Interface.DefineType): Don't pass the interface types to the
14014         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
14015         them later and then call `TypeBulider.AddInterfaceImplementation()'.
14016
14017         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
14018         instead of a `Type[]'.
14019         (TypeManager.RegisterBuilder): Likewise.
14020         (TypeManager.AddUserInterface): Likewise.
14021         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
14022         `Type[]' and also return a `TypeExpr[]'.
14023         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
14024
14025 2003-11-08  Martin Baulig  <martin@ximian.com>
14026
14027         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
14028         Expression.     
14029
14030 2003-11-08  Martin Baulig  <martin@ximian.com>
14031
14032         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
14033         TypeManager.ResolveExpressionTypes().
14034
14035         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
14036         instead of an Expression.
14037         (TypeExpr): This is now an abstract base class for `TypeExpression'.
14038         (TypeExpression): New public class; formerly known as `TypeExpr'.
14039
14040         * expression.cs (ComposedCast): Derive from TypeExpr.
14041
14042         * typemanager.cs (TypeManager.system_*_expr): These are now
14043         TypExpr's instead of Expression's.
14044         (TypeManager.ResolveExpressionTypes): New public static function;
14045         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
14046         of them.        
14047
14048 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
14049
14050         * expression.cs (New.DoResolve): Do not dereference value that
14051         might be a null return.
14052
14053         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
14054         sure that the constant value has the right type.  Fixes an
14055         unreported bug, similar to 50425.
14056
14057         * const.cs (Const.LookupConstantValue): Call
14058         ImplicitStandardConversionExists before doing a conversion to
14059         avoid havng the TypeManager.ChangeType do conversions.
14060
14061         Reduced the number of casts used
14062
14063         (Const.ChangeType): New routine to enable reuse of the constant
14064         type changing code from statement.
14065
14066         * typemanager.cs (ChangeType): Move common initialization to
14067         static global variables.
14068
14069         Fixes #50425.
14070
14071         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
14072         every value type to go through, even if it was void.  Fix that. 
14073
14074         * cs-tokenizer.cs: Use is_identifier_start_character on the start
14075         character of the define, and the is_identifier_part_character for
14076         the rest of the string.
14077
14078 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
14079
14080         * expression.cs (UnaryMutator.EmitCode): When I updated
14081         LocalVariableReference.DoResolve, I overdid it, and dropped an
14082         optimization done on local variable references.
14083
14084 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
14085
14086         * ecore.cs: Convert the return from Ldlen into an int.
14087
14088 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
14089
14090         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
14091         the accessibility, this is a special case for toplevel non-public
14092         classes (internal for instance).
14093
14094 2003-10-20  Nick Drochak <ndrochak@gol.com>
14095
14096         * ecore.cs: Fix typo and build.  Needed another right paren.
14097
14098 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
14099
14100         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
14101         `internal' case regular and protected, but not allowing protected
14102         to be evaluated later.  Bug 49840
14103
14104 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
14105
14106         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
14107         to kb.Nlast, and not the kb.nFirst to isolate the switch
14108         statement.
14109
14110         Extract the underlying type, so enumerations of long/ulong are
14111         treated like long/ulong.
14112
14113 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
14114
14115         * expression.cs (New): Overload the meaning of RequestedType to
14116         track the possible creation of the NewDelegate type, since
14117         DoResolve is invoked more than once for new constructors on field
14118         initialization.
14119
14120         See bugs: #48800 and #37014
14121
14122         * cs-parser.jay (declare_local_constants): Take an arraylist
14123         instead of a single constant.
14124
14125         (local_constant_declaration): It should take a
14126         constant_declarators, not a constant_declarator.  Fixes 49487
14127
14128         * convert.cs: Fix error report.
14129
14130 2003-10-13 Jackson Harper <jackson@ximian.com>
14131
14132         * typemanager.cs (TypeToCoreType): Add float and double this fixes
14133         bug #49611
14134         
14135 2003-11-03  Martin Baulig  <martin@ximian.com>
14136
14137         * expression.cs (ArrayAccess.GetStoreOpcode): Added
14138         `out bool has_type_arg'; if set, we need to pass the type to
14139         ig.Emit().
14140         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
14141         Stelem_Any/Ldelem_Any for generic parameters.   
14142
14143 2003-11-02  Martin Baulig  <martin@ximian.com>
14144
14145         * expression.cs (Invocation.EmitCall): Use
14146         `TypeManager.IsValueType()' to check whether it's a value type.
14147         Don't set `struct_call' when calling a method on a type parameter.
14148
14149 2003-11-02  Martin Baulig  <martin@ximian.com>
14150
14151         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
14152         and removed the TypeBuilder argument.
14153
14154         * typemanager.cs (TypeManager.IsValueType): Return
14155         `t.IsGenericParameter || t.IsValueType'.
14156
14157 2003-10-25  Martin Baulig  <martin@ximian.com>
14158
14159         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
14160         call ConstructedType.Resolve() on it.
14161
14162         * generic.cs (ConstructedType.Resolve): Set `type' on success.
14163
14164 2003-10-25  Martin Baulig  <martin@ximian.com>
14165
14166         * class.cs (TypeContainer.GetClassBases): Changed
14167         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
14168         CS8214 reporting here.
14169         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
14170         instead of a `Type' for our parent.  In case of a recursive
14171         declaration (see tests/gen-23.cs for an example), our parent is a
14172         ConstructedType and it doesn't have its type set.  So, first
14173         create our own TypeBuilder, then call constructed.Resolve() to get
14174         the parent's type and finally TypeBuilder.SetParent() it.
14175
14176         * ecore.cs (TypeExpr.Name): New public virtual property.
14177
14178         * generic.cs
14179         (ConstructedType): We're now a TypeExpr and not just an Expression.
14180         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
14181         arguments here; this is done later.
14182         (ConstructedType.Resolve): New public method to resolve the type
14183         arguments and bind them.
14184
14185 2003-10-21  Martin Baulig  <martin@ximian.com>
14186
14187         * convert.cs: Use `TypeManager.IsValueType' instead of
14188         'type.IsValueType' everywhere.
14189
14190         * typemanager.cs (TypeManager.IsValueType): Return true for type
14191         parameters.  The reason for this is that we need to box a type
14192         parameter when converting it to a reference type.
14193
14194         * cs-parser.jay: Added support for default value expressions.
14195
14196         * generics.cs (DefaultValueExpression): New public class.       
14197
14198 2003-10-17  Martin Baulig  <martin@ximian.com>
14199
14200         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
14201         TypeContainer so we can also use this for Interfaces.
14202         (TypeParameter.Resolve): Likewise.
14203
14204         * interface.cs (Interface.DefineType): Added support for generic
14205         interfaces.
14206
14207         * cs-parser.jay: Added support for generic structs and interfaces.
14208
14209 2003-10-17  Martin Baulig  <martin@ximian.com>
14210
14211         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
14212         call generic methods :-)
14213
14214 2003-10-16  Martin Baulig  <martin@ximian.com>
14215
14216         * cs-parser.jay (namespace_or_type_name): Only create a
14217         GenericMemberAccess if we actually have type arguments.
14218
14219 2003-10-13  Martin Baulig  <martin@ximian.com>
14220
14221         * class.cs (Method.Define): If we're a generic method, call
14222         TypeBuilder.DefineGenericMethod () before resolving
14223         the parameters.
14224         (MethodData): Added .ctor which takes an additional MethodBuilder
14225         argument; this is used for generic methods.
14226         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
14227         we already have a MethodBuilder.
14228
14229 2003-10-10  Martin Baulig  <martin@ximian.com>
14230
14231         * class.cs (Method): Added .ctor which takes a `GenericMethod'
14232         instead of a `DeclSpace'.  This is used for generic methods.
14233
14234         * cs-parser.jay (method_header): Added support for generic
14235         methods; create a `GenericMethod' instance and pass it to the
14236         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
14237         parameters and locals.
14238
14239         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
14240         since we already have the location.  Check whether we're a generic
14241         type declaration or a generic method and create the correct type
14242         parameter.
14243
14244         * generic.cs (TypeParameter.DefineMethod): New public method.
14245         (GenericMethod): New public class; derives from DeclSpace and is
14246         used for generic methods.       
14247
14248 2003-10-09  Martin Baulig  <martin@ximian.com>
14249
14250         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
14251         to the .ctor.
14252         (MethodCore.DoDefineParameters): Removed the TypeContainer
14253         argument; use the DeclSpace which was passed to the .ctor instead.
14254         (MethodCore.CheckParameter): Take a DeclSpace instead of a
14255         TypeContainer; we only need a DeclSpace here.
14256
14257 2003-10-09  Martin Baulig  <martin@ximian.com>
14258
14259         * class.cs (MethodData): Added additional `DeclSpace ds' argument
14260         to the .ctor.
14261         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
14262         EmitContext's .ctor.    
14263
14264 2003-10-09  Martin Baulig  <martin@ximian.com>
14265
14266         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
14267         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
14268         AsAccessible(), moved them as well.
14269
14270         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
14271
14272 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
14273
14274         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
14275         generation for >=, as spotted by Paolo, bug 48679.  
14276         Patch from David Waite.
14277
14278         * cs-tokenizer.cs: Add handling for #pragma.
14279
14280         * cs-parser.jay: Allow for both yield and yield return in the
14281         syntax.  The anti-cobolization of C# fight will go on!
14282
14283         * class.cs (TypeBuilder.DefineType): Catch error condition here
14284         (Parent.DefineType erroring out and returning null).
14285
14286         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14287         coping with enumerations variables, we were mistakenly processing
14288         them as a regular value type instead of built-in types.  Fixes the
14289         bug #48063
14290
14291         * typemanager.cs (IsBuiltinOrEnum): New method.
14292
14293 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
14294
14295         * cs-parser.jay: Upgrade: yield now needs the return clause.
14296
14297 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
14298
14299         * cs-parser.jay : Renamed yyName to yyNames related to jay.
14300
14301 2003-09-29  Martin Baulig  <martin@ximian.com>
14302
14303         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
14304         inflated generic methods.
14305
14306         * generics.cs (ConstructedType): Distinguish between open and
14307         closed constructed types; correctly resolve the arguments.
14308
14309 2003-09-22  Martin Baulig  <martin@ximian.com>
14310
14311         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
14312         all type arguments meet their constraints.
14313
14314 2003-09-19  Martin Baulig  <martin@ximian.com>
14315
14316         * decl.cs (MemberCache.SetupCacheForInterface): Take a
14317         `MemberCache parent' argument.  Normally, an interface doesn't
14318         have a parent type except System.Object, but we use this in gmcs
14319         for generic type parameters.
14320
14321 2003-09-18  Martin Baulig  <martin@ximian.com>
14322
14323         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
14324         on `type.IsInterface'; don't check whether the type has a parent
14325         to determine whether it's an interface.
14326
14327 2003-09-17  Martin Baulig  <martin@ximian.com>
14328
14329         * generic.cs (ConstructedType.ToString): Always use `name' as the
14330         type name.
14331
14332 2003-09-15  Martin Baulig  <martin@ximian.com>
14333
14334         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
14335
14336         * generic.cs (Constraints.Resolve): New public method; this is
14337         called to resolve the constraint types and to check whether all
14338         the constraints are correct.
14339         (Constraints.Types): New public property.
14340         (TypeParameter.Resolve): New public method; resolves all the
14341         type's constraints.
14342
14343         * class.cs (TypeContainer.DefineType): Call
14344         TypeParameter.Resolve() before actually defining the type.
14345
14346 2003-09-15  Martin Baulig  <martin@ximian.com>
14347
14348         * class.cs (TypeContainer.DefineType): Added an error flag to
14349         avoid reporting duplicate CS0146's ("class definition is
14350         circular.").
14351
14352         * driver.cs (Driver.MainDriver): Abort if
14353         RootContext.ResolveTree() reported any errors.
14354
14355 2003-09-07  Martin Baulig  <martin@ximian.com>
14356
14357         * report.cs (Error, Warning): Added overloaded versions which take
14358         a `params object[] args' and call String.Format().
14359
14360 2003-09-07  Martin Baulig  <martin@ximian.com>
14361
14362         * decl.cs (DeclSpace..ctor): Don't call
14363         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
14364         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
14365         (DeclSpace.RecordDecl): New method.
14366
14367         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
14368
14369 2003-09-02  Ravi Pratap  <ravi@ximian.com>
14370
14371         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
14372         value attributes to be applied to ParameterBuilders.
14373
14374         * class.cs (MethodCore.LabelParameters): Make static and more
14375         generic so that it can be used from other places - like interface
14376         methods, for instance.
14377
14378         * interface.cs (Interface.Emit): Call LabelParameters before
14379         emitting attributes on the InterfaceMethod.
14380
14381 2003-09-07  Martin Baulig  <martin@ximian.com>
14382
14383         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
14384         if the number of type parameters doesn't match.
14385
14386 2003-09-04  Martin Baulig  <martin@ximian.com>
14387
14388         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
14389         for arrays of generic type params (ie. `!0[]').
14390
14391 2003-09-04  Martin Baulig  <martin@ximian.com>
14392
14393         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
14394         for the moment.
14395
14396 2003-09-04  Martin Baulig  <martin@ximian.com>
14397
14398         * decl.cs (DeclSpace.LookupGeneric): New method.
14399         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
14400         moment.
14401
14402         * generic.cs (TypeParameterExpr): Take a TypeParameter as
14403         argument, not just a string.
14404         (TypeParameter.Define): New public method; this is called to
14405         actually define the generic parameter; after this, you can use the
14406         new `Type' property to get the type.
14407
14408 2003-09-04  Martin Baulig  <martin@ximian.com>
14409
14410         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
14411         is now an ArrayList; initialize the result of the `TypeParameters'
14412         property here.
14413         (DeclSpace.GetGenericData): Removed.
14414         (DeclSpace.LookupGeneric): Temporarily removed; we need to
14415         implement this in a different way.
14416         (DeclSpace.GetTypeParameters): Removed; there's now a
14417         `TypeParameters' property.
14418         (DeclSpace.TypeParameters): New public property.
14419
14420         * generic.cs (Constraints): Make this class public.
14421         (TypeParameter): New public class.
14422
14423 2003-09-04  Martin Baulig  <martin@ximian.com>
14424
14425         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
14426         generic parameters.
14427
14428         * class.cs (TypeContainer.DefineType): Call
14429         TypeBuilder.DefineGenericParameter () on all generic parameters if
14430         this is a generic type.
14431
14432 2003-08-28  Martin Baulig  <martin@ximian.com>
14433
14434         * sample-stack.il: Compile this with ilasm: "ilasm /dll
14435         sample-stack.il".
14436
14437         * sample-hello.cs: Compile this with gmcs: "gmcs
14438         /r:sample-stack.dll sample-hello.cs".
14439
14440 2003-08-28  Martin Baulig  <martin@ximian.com>
14441
14442         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
14443         the parameters to the generic type.
14444
14445 2003-08-28  Martin Baulig  <martin@ximian.com>
14446
14447         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
14448
14449 2003-08-28  Martin Baulig  <martin@ximian.com>
14450
14451         * cs-parser.jay (opt_type_argument_list): Use
14452         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
14453         (primary_expression): Replace `qualified_identifier' with `type_name'.
14454         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
14455
14456         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
14457         parser to check whether it is syntactically a type parameter list;
14458         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
14459         this case.
14460
14461 2003-08-26  Martin Baulig  <martin@ximian.com>
14462
14463         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
14464         resolving aliases; fixes #47927.
14465
14466 2003-08-26  Martin Baulig  <martin@ximian.com>
14467
14468         * statement.cs (Using.DoResolve): This is internally emitting a
14469         try/finally clause, so we need to set ec.NeedExplicitReturn if we
14470         do not always return.  Fixes #47681.
14471
14472 2003-08-26  Martin Baulig  <martin@ximian.com>
14473
14474         * decl.cs (MemberCore): Moved WarningNotHiding(),
14475         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
14476         into MemberBase.
14477         (AdditionResult): Make this nested in DeclSpace.
14478         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
14479         argument; call NamespaceEntry.Define() unless we're nested in a
14480         class or struct.
14481
14482         * namespace.cs (Namespace.DefineName): New public function.  This
14483         is called from DeclSpace's .ctor to add 
14484         (Namespace.Lookup): Include DeclSpaces in the lookup.
14485
14486         * class.cs (Operator): Derive from MemberBase, not MemberCore.
14487
14488         * const.cs (Const): Derive from MemberBase, not MemberCore.     
14489
14490 2003-08-25  Martin Baulig  <martin@ximian.com>
14491
14492         * convert.cs (Convert.ExplicitReferenceConversion): When
14493         converting from an interface type to a class, unbox if the target
14494         type is a struct type.  Fixes #47822.
14495
14496 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14497
14498         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
14499         #47854.
14500
14501 2003-08-22  Martin Baulig  <martin@ximian.com>
14502
14503         * class.cs (TypeManager.DefineType): When defining a nested type,
14504         call DefineType() on our parent; fixes #47801.
14505
14506 2003-08-22  Martin Baulig  <martin@ximian.com>
14507
14508         * class.cs (MethodData.Define): While checking if a method is an
14509         interface implementation, improve the test a bit more to fix #47654.
14510
14511 2003-08-22  Martin Baulig  <martin@ximian.com>
14512
14513         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
14514         correctly; fixes #47722.
14515
14516 2003-08-22  Martin Baulig  <martin@ximian.com>
14517
14518         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
14519         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
14520
14521         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
14522
14523 2003-08-22  Martin Baulig  <martin@ximian.com>
14524
14525         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
14526         can only be assigned in static constructors.  Fixes #47161.
14527
14528 2003-08-22  Martin Baulig  <martin@ximian.com>
14529
14530         Rewrote and improved the flow analysis code.
14531
14532         * flowbranching.cs (FlowBranching): Make this class abstract.
14533         (FlowBranching.CreateBranching): New static function to create a
14534         new flow branching.
14535         (FlowBranchingBlock, FlowBranchingException): New classes.
14536         (FlowBranching.UsageVector.Type): New public readonly field.
14537         (FlowBranching.UsageVector.Breaks): Removed the setter.
14538         (FlowBranching.UsageVector.Returns): Removed the setter.
14539         (FlowBranching.UsageVector): Added Break(), Return(),
14540         NeverReachable() and Throw() methods to modify the reachability.
14541         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
14542         done by FlowBranching.Merge().
14543         (FlowBranching.UsageVector.MergeChild): New method; merges the
14544         merge result into the current vector.
14545         (FlowBranching.Merge): New abstract method to merge a branching.
14546
14547 2003-08-12  Martin Baulig  <martin@ximian.com>
14548
14549         * expression.cs (Indirection.CacheTemporaries): Create the
14550         LocalTemporary with the pointer type, not its element type.
14551
14552 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
14553
14554         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
14555         token was a keyword or not.
14556
14557         Add `error' options where an IDENTIFIER was expected;  Provide
14558         CheckToken and CheckIdentifierToken convenience error reporting
14559         functions. 
14560
14561         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
14562
14563         * decl.cs: Rename `NamespaceEntry Namespace' public field into
14564         NameSpaceEntry NameSpaceEntry.
14565
14566         (LookupInterfaceOrClass): Avoid creating a full qualified name
14567         from namespace and name: avoid doing lookups when we know the
14568         namespace is non-existant.   Use new Tree.LookupByNamespace which
14569         looks up DeclSpaces based on their namespace, name pair.
14570
14571         * driver.cs: Provide a new `parser verbose' to display the
14572         exception thrown during parsing.  This is turned off by default
14573         now, so the output of a failure from mcs is more graceful.
14574
14575         * namespace.cs: Track all the namespaces defined in a hashtable
14576         for quick lookup.
14577
14578         (IsNamespace): New method
14579
14580 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
14581
14582         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
14583         we know that we need to concatenate (full typename can never be
14584         null). 
14585
14586         * class.cs: ditto.
14587
14588         * statement.cs: Use a bitfield;  Do not initialize to null things
14589         which are done by the constructor by default.
14590
14591         * cs-parser.jay: bug fix, parameter was 4, not 3.
14592
14593         * expression.cs: Just use the property;
14594
14595         * statement.cs: No need for GetVariableInfo method.
14596
14597 2003-08-08  Martin Baulig  <martin@ximian.com>
14598
14599         * flowanalysis.cs (FlowReturns): This is now nested in the
14600         `FlowBranching' class.
14601         (MyBitVector): Moved this here from statement.cs.
14602         (FlowBranching.SiblingType): New enum type.
14603         (FlowBranching.CreateSibling): Added `SiblingType' argument.
14604
14605 2003-08-07  Martin Baulig  <martin@ximian.com>
14606
14607         * flowanalysis.cs (FlowBranchingType): This is now nested in the
14608         `FlowBranching' class and called `BranchingType'.
14609
14610 2003-08-07  Martin Baulig  <martin@ximian.com>
14611
14612         * flowanalysis.cs: Moved all the control flow analysis code into
14613         its own file.
14614
14615 2003-08-07  Martin Baulig  <martin@ximian.com>
14616
14617         * assign.cs (Assign.DoResolve): `target' must either be an
14618         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
14619         #37319.
14620
14621 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
14622
14623         * expression.cs (BinaryMethod): This kind of expression is created by the
14624         Binary class if it determines that the operator has to be handled
14625         by a method.
14626
14627         (BinaryDelegate): This kind of expression is created if we are
14628         dealing with a + or - operator on delegates.
14629
14630         (Binary): remove method, argumetns, and DelegateOperator: when
14631         dealing with methods, 
14632
14633         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14634
14635         * statement.cs (Block): use bitfields for the three extra booleans
14636         we had in use.   Remove unused topblock parameter.
14637
14638         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14639
14640         * assign.cs: Drop extra unneeded tests.
14641
14642 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
14643
14644         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14645
14646         * statement.cs (Foreach): Use VariableStorage instead of
14647         LocalBuilders.   
14648
14649         * codegen.cs (VariableStorage): New class used by clients that
14650         require a variable stored: locals or fields for variables that
14651         need to live across yield.
14652
14653         Maybe provide a convenience api for EmitThis+EmitLoad?
14654
14655         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14656         these bad boys.
14657
14658 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
14659
14660         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14661         RemapParameterLValue): New methods that are used to turn a
14662         precomputed FieldInfo into an expression like this:
14663
14664                 instance.FieldInfo
14665
14666         The idea is to use this instead of making LocalVariableReference
14667         have more than one meaning.
14668
14669         * cs-parser.jay: Add error production to BASE.
14670
14671         * ecore.cs: Deal with TypeManager.GetField returning null, which
14672         is now a valid return value.
14673
14674         (FieldExprNoAddress): New expression for Fields whose address can
14675         not be taken.
14676
14677         * expression.cs (LocalVariableReference): During the resolve
14678         phases, create new expressions if we are in a remapping context.
14679         Remove code that dealt with remapping here.
14680
14681         (ParameterReference): same.
14682
14683         (ProxyInstance): New expression, like the `This' expression, but
14684         it is born fully resolved.  We know what we are doing, so remove
14685         the errors that are targeted to user-provided uses of `this'.
14686
14687         * statement.cs (Foreach): our variable is now stored as an
14688         Expression;  During resolution, follow the protocol, dont just
14689         assume it will return this.
14690
14691 2003-08-06  Martin Baulig  <martin@ximian.com>
14692
14693         * support.cs (SeekableStreamReader.cs): New public class.
14694
14695         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14696         SeekableStreamReader instead of the normal StreamReader.
14697
14698 2003-08-04  Martin Baulig  <martin@ximian.com>
14699
14700         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14701         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14702         deambiguate casts and delegate invocations.
14703         (parenthesized_expression): Use the new tokens to ensure this is
14704         not a cast of method invocation.
14705
14706         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14707         when reading a `)' and Deambiguate_CloseParens () was previously
14708         called.
14709
14710         * expression.cs (ParenthesizedExpression): New class.  This is
14711         just used for the CS0075 test.
14712         (Binary.DoResolve): Check for CS0075.   
14713
14714 2003-07-29  Ravi Pratap  <ravi@ximian.com>
14715
14716         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14717         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14718         reference comparison.
14719
14720         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14721         examine the ReturnType for equality - this is necessary in the
14722         cases of implicit and explicit operators whose signature also
14723         includes the return type.
14724
14725 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
14726
14727         * namespace.cs: Cache the result of the namespace computation,
14728         instead of computing it every time.
14729
14730 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14731
14732         * decl.cs: Use a global arraylist that we reuse over invocations
14733         to avoid excesive memory consumption.  Reduces memory usage on an
14734         mcs compile by one meg (45 average).
14735
14736         * typemanager.cs (LookupTypeReflection): In .NET pointers are
14737         private, work around that.
14738
14739 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
14740
14741         * literal.cs (IntLiteral): Define Zero and One static literals. 
14742
14743         * cs-parser.jay (integer_literal): use static literals to reduce
14744         memory usage for the most used literals (0, 1 and -1).  211kb
14745         reduced in memory usage.
14746
14747         Replace all calls to `new ArrayList' with `new
14748         ArrayList(4)' which is a good average number for most allocations,
14749         and also requires only 16 bytes of memory for its buffer by
14750         default. 
14751
14752         This reduced MCS memory usage in seven megabytes for the RSS after
14753         bootstrapping.
14754
14755 2003-07-28  Ravi Pratap  <ravi@ximian.com>
14756
14757         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14758         handle params methods the correct way by forming only one
14759         applicable set with params and normal methods in them. Earlier we
14760         were looking at params methods only if we found no normal methods
14761         which was not the correct thing to do.
14762
14763         (Invocation.BetterFunction): Take separate arguments indicating
14764         when candidate and the best method are params methods in their
14765         expanded form.
14766
14767         This fixes bugs #43367 and #46199.
14768
14769         * attribute.cs: Documentation updates.
14770
14771         (CheckAttribute): Rename to CheckAttributeTarget.
14772         (GetValidPlaces): Rename to GetValidTargets.
14773
14774         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14775         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14776
14777         Fixes bug #44468.
14778
14779 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
14780
14781         * codegen.cs: Compute IsGeneric correctly.
14782
14783         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
14784         resolution. 
14785
14786         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
14787         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
14788         regressions, and I was chasing more bugs than I required.
14789
14790         * interface.cs: Use expressions for base type names (like classes
14791         and structs have been doing for a while now), and resolve that.
14792         This patch should probably go into head as well.
14793
14794         This makes it one less user of FindType.
14795
14796 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14797
14798         This compiler can not self host currently.  Need to fix that.
14799         
14800         * Makefile: compile to `gmcs.exe'
14801
14802         * driver.cs: Turn on v2 by default on gmcs.
14803
14804         * generic.cs (ConstructedType): Does no longer take a container
14805         type argument;  That will be taken care of later.
14806
14807         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
14808         Use SimpleName to resolve for now, so we can continue the work on
14809         the parser, until we get Type.GetType that understands generics.
14810
14811         (ConstructedType.ToString): Implement
14812
14813         (TypeArguments.Resolve): Resolve the child expressions as types. 
14814         
14815         * cs-parser.jay: Rename interface_constraints to
14816         type_parameter_constraints
14817
14818         (namespace_or_type_name): Only use constructed types for the basic
14819         construction, we will deal with identifier<...> later.
14820
14821         (type/type_name): No longer call DecomposeQI, as
14822         namespace_or_type_name is always decoded now.
14823         
14824 2003-07-22  Ravi Pratap  <ravi@ximian.com>
14825
14826         * expression.cs (Invocation.OverloadResolve): Follow the spec more
14827         closely: we eliminate methods in base types when we have an
14828         applicable method in a top-level type.
14829
14830         Please see section 14.5.5.1 for an exact description of what goes
14831         on. 
14832
14833         This fixes bug #45127 and a host of other related to corlib compilation.
14834
14835         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14836         array is the method corresponding to the top-level type (this is
14837         because of the changes made to icall.c) so we change this
14838         accordingly.
14839
14840         (MethodGroupExpr.Name): This too.
14841
14842         * typemanager.cs (GetElementType): New method which does the right
14843         thing when compiling corlib. 
14844
14845         * everywhere: Make use of the above in the relevant places.
14846
14847 2003-07-22  Martin Baulig  <martin@ximian.com>
14848
14849         * cs-parser.jay (invocation_expression): Moved
14850         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14851         `cast_expression', but create a InvocationOrCast which later
14852         resolves to either an Invocation or a Cast.
14853
14854         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14855         method; call this before EmitStatement() to make sure that this
14856         expression can be used as a statement.
14857
14858         * expression.cs (InvocationOrCast): New class; resolves to either
14859         an Invocation or a Cast.
14860
14861         * statement.cs (StatementExpression): Call ResolveStatement() on
14862         the ExpressionStatement before emitting it.
14863
14864 2003-07-21  Martin Baulig  <martin@ximian.com>
14865
14866         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14867         `ref' and `out' attributes match; fixes #46220.
14868         (MemberAccess.ResolveMemberAccess): You can't reference a type
14869         through an expression; fixes #33180.
14870         (Indexers.GetIndexersForType): Don't return the indexers from
14871         interfaces the class implements; fixes #46502.
14872
14873 2003-07-21  Martin Baulig  <martin@ximian.com>
14874
14875         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14876         CS0661 checks; fixes bug #30442.
14877
14878 2003-07-21  Martin Baulig  <martin@ximian.com>
14879
14880         * decl.cs (AdditionResult): Added `Error'.
14881
14882         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14883
14884         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
14885         cs0031.cs actually work.
14886
14887  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14888  
14889         * cs-parser.jay (namespace_name): do not use
14890         namespace_or_type_name, use qualified_identifier, because
14891         namespace_or_type_name will soon return a composed expression
14892         instead of a string.
14893  
14894         (namespace_or_type_name): Instead of returning a string, now this
14895         production returns an expression.
14896  
14897         * codegen.cs (EmitContext): Setup IsGeneric property based on
14898         whether our DeclSpace is generic, our the method is generic.
14899  
14900         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
14901         the method is generic.
14902  
14903         * cs-parser.jay (type_arguments, opt_type_argument_list,
14904         type_parameters, type_parameter_list, opt_type_parameter_list,
14905         type_parameter,, opt_type_parameter_constraints_clauses,
14906         type_parameter_constraints_clauses,
14907         type_parameter_constraint_clause, type_parameter_constraint,
14908         interface_constraints): Add new production
14909  
14910         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
14911         DeclSpace is generic or not.
14912  
14913         (DeclSpace.SetParameterInfo): New routine, used to set the
14914         parameter info for a type.
14915  
14916         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
14917         returns a GenericTypeExpr
14918  
14919         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
14920         generic, lookup the generic argument.
14921  
14922         * attribute.cs: Do not allow TypeParameterExpressions in
14923         Attributes.
14924  
14925         * class.cs: Do not allow the Main method to be defined in a
14926         Generic container.
14927  
14928         * expression.cs (SizeOf): Do not allow generic types to be used as
14929         arguments to sizeof.
14930  
14931         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
14932         it: whether a type is generic or not.  Only works for types we are
14933         currently building for now.
14934         
14935 2003-07-20  Martin Baulig  <martin@ximian.com>
14936
14937         * namespace.cs: Fixed that bug which caused a crash when compiling
14938         the debugger's GUI.
14939
14940 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14941
14942         * typemanager.cs (LookupTypeReflection): Never expose types which
14943         are NotPublic, NestedPrivate, NestedAssembly, or
14944         NestedFamANDAssem.  We used to return these, and later do a check
14945         that would report a meaningful error, but the problem is that we
14946         would not get the real match, if there was a name override.
14947
14948 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
14949
14950         * namespace.cs (Namespace, Name): Do not compute the namespace
14951         name dynamically, compute it in the constructor.  This reduced
14952         memory usage by 1697 KB.
14953
14954         * driver.cs: Use --pause to pause at the end.
14955
14956 2003-07-17  Peter Williams  <peter@newton.cx>
14957
14958         * Makefile: Change the name of the test target so that it doesn't
14959         conflict with the recursive test target.
14960
14961 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
14962
14963         * expression.cs (LocalVariableReference.Emit, EmitAssign,
14964         AddressOf): Do not use EmitThis, that was wrong, use the actual
14965         this pointer.
14966
14967 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
14968
14969         * class.cs (MethodData.Define): While checking if a method is an
14970         interface implementation, improve the test: If we are not public
14971         (use new test here: use the computed MethodAttributes directly,
14972         instead of the parsed modifier flags) check if the `implementing'
14973         method comes from an interface or not.
14974
14975         * pending.cs (VerifyPendingMethods): Slightly better error
14976         message.
14977
14978         * makefile: add test target that does the mcs bootstrap.
14979
14980 2003-07-16  Ravi Pratap  <ravi@ximian.com>
14981
14982         * interface.cs (Define): Do nothing here since there are no
14983         members to populate etc. Move the attribute emission out of here
14984         since this was just totally the wrong place to put it. Attribute
14985         application happens during the 'Emit' phase, not in the 'Define'
14986         phase.
14987
14988         (Emit): Add this method and move the attribute emission here
14989
14990         * rootcontext.cs (EmitCode): Call the Emit method on interface
14991         types too.
14992
14993 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14994
14995         * expression.cs (OverloadResolve): Report error only if Location
14996         is not 'Null' which means that there was a probe going on.
14997
14998 2003-07-14  Martin Baulig  <martin@ximian.com>
14999
15000         * expression.cs (ConditionalLogicalOperator): New public class to
15001         implement user defined conditional logical operators.
15002         This is section 14.11.2 in the spec and bug #40505.
15003
15004 2003-07-14  Martin Baulig  <martin@ximian.com>
15005
15006         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
15007
15008 2003-07-14  Martin Baulig  <martin@ximian.com>
15009
15010         * codegen.cs (EmitContext.InFixedInitializer): New public field.
15011
15012         * ecore.cs (IVariable.VerifyFixed): New interface method.
15013
15014         * expression.cs (Unary.ResolveOperator): When resolving the `&'
15015         operator, check whether the variable is actually fixed.  Fixes bug
15016         #36055.  Set a variable definitely assigned when taking its
15017         address as required by the spec.
15018
15019         * statement.cs (LocalInfo.IsFixed): New field.
15020         (LocalInfo.MakePinned): Set `IsFixed' to true.
15021
15022 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
15023
15024         * attribute.cs (Attribute.Resolve): While doing a Member lookup
15025         for .ctors, ensure that we only ask for members declared in the
15026         attribute type (BindingFlags.DeclaredOnly).
15027
15028         Fixes bug #43632.
15029
15030         * expression.cs (Error_WrongNumArguments): Report error 1501
15031         correctly the way CSC does.
15032
15033 2003-07-13  Martin Baulig  <martin@ximian.com>
15034
15035         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
15036         lookup on the fully qualified name, to make things like "X.X" work
15037         where "X.X" is a fully qualified type name, but we also have a
15038         namespace "X" in the using list.  Fixes #41975.
15039
15040 2003-07-13  Martin Baulig  <martin@ximian.com>
15041
15042         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
15043         function. If we're a CompoundAssign, we need to create an embedded
15044         CompoundAssign, not an embedded Assign.
15045         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
15046         Fixes #45854.
15047
15048 2003-07-13  Martin Baulig  <martin@ximian.com>
15049
15050         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
15051         work to fix bug #46088.
15052
15053 2003-07-13  Ravi Pratap <ravi@ximian.com>
15054
15055         * class.cs (Operator.Emit): Do not emit attributes here - it is
15056         taken care of by the Method class that we delegate too. This takes
15057         care of bug #45876.
15058
15059 2003-07-10  Martin Baulig  <martin@ximian.com>
15060
15061         * expression.cs (TypeOfVoid): New class.
15062         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
15063
15064 2003-07-10  Martin Baulig  <martin@ximian.com>
15065
15066         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
15067         bug #35957.
15068
15069 2003-07-10  Martin Baulig  <martin@ximian.com>
15070
15071         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
15072         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
15073
15074         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
15075
15076         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
15077
15078 2003-07-10  Martin Baulig  <martin@ximian.com>
15079
15080         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
15081         of decimal.  Fixes #42850.
15082
15083         NOTE: I also fixed the created byte blob, but this doesn't work on
15084         the MS runtime and csc never produces any byte blobs for decimal
15085         arrays.
15086
15087 2003-07-10  Martin Baulig  <martin@ximian.com>
15088
15089         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
15090         structs; fixes #32068.
15091         (Block.AddChildVariableNames): Fixed #44302.
15092
15093 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15094
15095         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
15096
15097 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
15098
15099         * attribute.cs: And this test is onger needed.
15100
15101 2003-07-08  Martin Baulig  <martin@ximian.com>
15102
15103         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
15104         inaccessible types.  Fixes #36313.
15105
15106         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
15107
15108         * namespace.cs (NamespaceEntry): Create implicit entries for all
15109         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
15110         implicit entries for N1.N2 and N1.
15111
15112 2003-07-08  Martin Baulig  <martin@ximian.com>
15113
15114         Rewrote the handling of namespaces to fix a lot of the issues
15115         wrt. `using' aliases etc.
15116
15117         * namespace.cs (Namespace): Splitted this class into a
15118         per-assembly `Namespace' and a per-file `NamespaceEntry'.
15119
15120         * typemanager.cs (TypeManager.IsNamespace): Removed.
15121         (TypeManager.ComputeNamespaces): Only compute namespaces from
15122         loaded assemblies here, not the namespaces from the assembly we're
15123         currently compiling.
15124
15125 2003-07-08  Martin Baulig  <martin@ximian.com>
15126
15127         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
15128
15129 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
15130
15131         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
15132         already fixed it.  
15133
15134         I thought about the memory savings here, but LookupTypeReflection
15135         is used under already very constrained scenarios.  Compiling
15136         corlib or mcs only exposes one hit, so it would not really reduce
15137         any memory consumption.
15138
15139 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15140
15141         * typemanager.cs: fixes bug #45889 by only adding public types from
15142         other assemblies to the list of known types.
15143
15144 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
15145
15146         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
15147         on the type we resolved.
15148
15149 2003-07-05  Martin Baulig  <martin@ximian.com>
15150
15151         * pending.cs (PendingImplementation.ParentImplements): Don't
15152         create the proxy if the parent is abstract.
15153
15154         * class.cs (TypeContainer.DefineIndexers): Process explicit
15155         interface implementations first.  Fixes #37714.
15156
15157 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
15158
15159         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
15160         defined recursively;  but since we modify the input parameters
15161         (left is set to `this' temporarily), we reset this value if the
15162         left_is_explicit is false, which gives the original semantics to
15163         the code.  
15164
15165         * literal.cs (NullPointer): new class used to represent a null
15166         literal in a pointer context.
15167
15168         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
15169         type is a pointer, use a NullPointer object instead of a
15170         NullLiteral.   Closes 43687
15171
15172         (ExplicitConversion): Convert pointer values using
15173         the conv opcode to the proper type.
15174
15175         * ecore.cs (New): change ValueTypeVariable property into a method,
15176         that returns whether the valuetype is suitable for being used.
15177
15178         * expression.cs (Binary.DoNumericPromotions): Only return if we
15179         the int constant was a valid uint, and we can return both left and
15180         right as uints.  If not, we continue processing, to trigger the
15181         type conversion.  This fixes 39018.
15182
15183         * statement.cs (Block.EmitMeta): During constant resolution, set
15184         the CurrentBlock property on the emitcontext, so that we resolve
15185         constants propertly.
15186
15187 2003-07-02  Martin Baulig  <martin@ximian.com>
15188
15189         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
15190         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
15191
15192         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
15193         than emitting it here.
15194
15195         * statement.cs: Fixed some more flow analysis bugs.
15196
15197 2003-07-02  Martin Baulig  <martin@ximian.com>
15198
15199         * class.cs (MethodData.Define): When implementing interface
15200         methods, set Final unless we're Virtual.
15201
15202         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
15203         check work for interface methods.
15204
15205 2003-07-01  Martin Baulig  <martin@ximian.com>
15206
15207         * ecore.cs (EmitContext.This): Replaced this property with a
15208         GetThis() method which takes a Location argument.  This ensures
15209         that we get the correct error location for a CS0188.
15210
15211 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
15212
15213         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
15214         ImplicitStandardConversion.
15215
15216         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
15217
15218 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
15219
15220         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
15221         optimization.
15222
15223 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
15224
15225         * class.cs (Constructor.Define): Turn off initlocals for unsafe
15226         constructors.
15227
15228         (MethodData.Define): Turn off initlocals for unsafe methods.
15229
15230 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
15231
15232         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
15233         complete;  Fixes #37521.
15234
15235         * delegate.cs: Use Modifiers.TypeAttr to compute the
15236         TypeAttributes, instead of rolling our own.  This makes the flags
15237         correct for the delegates.
15238
15239 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
15240
15241         * class.cs (Constructor.Define): Set the private flag for static
15242         constructors as well.
15243
15244         * cs-parser.jay (statement_expression): Set the return value to
15245         null, to avoid a crash when we catch an error.
15246
15247 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
15248
15249         * cs-parser.jay: Applied patch from Jackson that adds support for
15250         extern and unsafe modifiers to destructor declarations.
15251
15252         * expression.cs: Report error 21 if the user is trying to index a
15253         System.Array.
15254
15255         * driver.cs: Add an error message, suggested by the bug report.
15256
15257         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
15258         if we do not have a ": this ()" constructor initializer.  Fixes 45149
15259
15260 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
15261
15262         * namespace.cs: Add some information to reduce FAQs.
15263
15264 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
15265
15266         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
15267         underlying enumeration types.  Fixes #43915.
15268
15269         * expression.cs: Treat ushort/short as legal values to be used in
15270         bitwise operations.
15271
15272 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
15273
15274         * delegate.cs: transfer custom attributes for paramenters from
15275         the delegate declaration to Invoke and BeginInvoke.
15276
15277 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
15278
15279         * attribute.cs: handle custom marshalers and emit marshal info
15280         for fields, too.
15281
15282 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
15283
15284         * makefile.gnu: Added anonymous.cs to the compiler sources.
15285
15286 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
15287
15288         * iterators.cs: Change the name of the proxy class to include two
15289         underscores.
15290
15291         * cs-parser.jay: Update grammar to include anonymous methods.
15292
15293         * anonymous.cs: new file.
15294
15295 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
15296
15297         * class.cs (Field.Define): Add missing test for pointers and
15298         safety. 
15299
15300 2003-05-27  Ravi Pratap  <ravi@ximian.com>
15301
15302         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
15303         we use the stobj opcode.
15304
15305         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
15306         since it wasn't the correct fix. 
15307
15308         It still is puzzling that we are required to use stobj for IntPtr
15309         which seems to be a ValueType.
15310
15311 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
15312
15313         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
15314         during regular simple name resolution.   Now, the trick is that
15315         instead of returning for processing the simplename, we do a
15316         TypeManager.LookupType (ie, a rooted lookup as opposed to a
15317         contextual lookup type).   If a match is found, return that, if
15318         not, return for further composition.
15319
15320         This fixes long-standing 30485.
15321
15322         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15323         using the address to initialize an object, do an Stobj instead of
15324         using the regular Stelem.
15325
15326         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
15327         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
15328         Because if we are a BaseIndexerAccess that value will be true.
15329         Fixes 43643.
15330
15331         * statement.cs (GotoCase.Resolve): Return after reporting an
15332         error, do not attempt to continue. 
15333
15334         * expression.cs (PointerArithmetic.Emit): If our operand is a
15335         long, convert our constants to match the operand before
15336         multiplying.  Convert to I type before adding.   Fixes 43670.
15337
15338 2003-05-14  Ravi Pratap  <ravi@ximian.com>
15339
15340         * enum.cs (ImplicitConversionExists) : Rename to
15341         ImplicitEnumConversionExists to remove ambiguity. 
15342
15343         * ecore.cs (NullCast): New type of cast expression class which
15344         basically is very similar to EmptyCast with the difference being
15345         it still is a constant since it is used only to cast a null to
15346         something else
15347         (eg. (string) null)
15348
15349         * convert.cs (ImplicitReferenceConversion): When casting a null
15350         literal, we return a NullCast.
15351
15352         * literal.cs (NullLiteralTyped): Remove - I don't see why this
15353         should be around anymore.
15354
15355         The renaming (reported was slightly wrong). Corrections:
15356
15357         ConvertImplicitStandard -> ImplicitConversionStandard
15358         ConvertExplicitStandard -> ExplicitConversionStandard
15359
15360         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
15361         before passing them in !
15362
15363         * convert.cs (ImplicitConversionStandard): When comparing for
15364         equal expr and target types, ensure that expr is not a
15365         NullLiteral.
15366
15367         In general, we must not be checking (expr_type ==
15368         target_type) in the top level conversion methods
15369         (ImplicitConversion, ExplicitConversion etc). This checking is
15370         done in the methods that they delegate to.
15371
15372 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
15373
15374         * convert.cs: Move Error_CannotConvertType,
15375         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
15376         ImplicitNumericConversion, ImplicitConversionExists,
15377         ImplicitUserConversionExists, StandardConversionExists,
15378         FindMostEncompassedType, FindMostSpecificSource,
15379         FindMostSpecificTarget, ImplicitUserConversion,
15380         ExplicitUserConversion, GetConversionOperators,
15381         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
15382         TryImplicitIntConversion, Error_CannotConvertImplicit,
15383         ConvertImplicitRequired, ConvertNumericExplicit,
15384         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
15385         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
15386         its own file.
15387
15388         Perform the following renames:
15389
15390         StandardConversionExists -> ImplicitStandardConversionExists
15391         ConvertImplicit -> ImplicitConversion
15392         ConvertImplicitStandard -> ImplicitStandardConversion
15393         TryImplicitIntConversion -> ImplicitIntConversion
15394         ConvertImplicitRequired -> ImplicitConversionRequired
15395         ConvertNumericExplicit -> ExplicitNumericConversion
15396         ConvertReferenceExplicit -> ExplicitReferenceConversion
15397         ConvertExplicit -> ExplicitConversion
15398         ConvertExplicitStandard -> ExplicitStandardConversion
15399
15400 2003-05-19  Martin Baulig  <martin@ximian.com>
15401
15402         * statement.cs (TypeInfo.StructInfo): Made this type protected.
15403         (TypeInfo): Added support for structs having structs as fields.
15404
15405         * ecore.cs (FieldExpr): Implement IVariable.
15406         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
15407         VariableInfo for the field.
15408
15409 2003-05-18  Martin Baulig  <martin@ximian.com>
15410
15411         * expression.cs (This.DoResolve): Report a CS0027 if we're
15412         emitting a field initializer.
15413
15414 2003-05-18  Martin Baulig  <martin@ximian.com>
15415
15416         * expression.cs (This.ResolveBase): New public function.
15417         (This.DoResolve): Check for CS0188.
15418
15419         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
15420         This.Resolve().
15421
15422         * ecore.cs (MethodGroupExpr.DoResolve): Set the
15423         `instance_expression' to null if we don't have any non-static
15424         methods.
15425
15426 2003-05-18  Martin Baulig  <martin@ximian.com>
15427
15428         Reworked the way how local variables and parameters are handled by
15429         the flow analysis code.
15430
15431         * statement.cs (TypeInfo, VariableMap): New public classes.
15432         (VariableInfo): New public class.  This is now responsible for
15433         checking whether a variable has been assigned.  It is used for
15434         parameters and local variables.
15435         (Block.EmitMeta): Take the InternalParameters as argument; compute
15436         the layout of the flow vectors here.
15437         (Block.LocalMap, Block.ParameterMap): New public properties.
15438         (FlowBranching): The .ctor doesn't get the InternalParameters
15439         anymore since Block.EmitMeta() now computes the layout of the flow
15440         vector.
15441         (MyStructInfo): This class is now known as `StructInfo' and nested
15442         in `TypeInfo'; we don't access this directly anymore.
15443
15444         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
15445         property and removed IsAssigned(), IsFieldAssigned(),
15446         SetAssigned() and SetFieldAssigned(); we now call them on the
15447         VariableInfo so we don't need to duplicate this code everywhere.
15448
15449         * expression.cs (ParameterReference): Added `Block block' argument
15450         to the .ctor.
15451         (LocalVariableReference, ParameterReference, This): The new
15452         VariableInfo class is now responsible for all the definite
15453         assignment stuff.
15454
15455         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
15456         IsParameterAssigned, SetParameterAssigned): Removed.
15457
15458 2003-05-18  Martin Baulig  <martin@ximian.com>
15459
15460         * typemanager.cs (InitCoreTypes): Try calling
15461         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
15462         the 3-args-version.  Corlib now also needs our `void_type'.
15463         (GetMethod): Added overloaded version which takes an optional
15464         `bool report_errors' to allow lookups of optional methods.
15465
15466 2003-05-12  Martin Baulig  <martin@ximian.com>
15467
15468         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
15469         only used for locals and not for parameters.
15470
15471 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
15472
15473         * support.cs (InternalParameters.ParameterType): Return the
15474         ExternalType of the parameter.
15475
15476         * parameter.cs (Parameter.ExternalType): drop the two arguments,
15477         they were unused.
15478
15479 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
15480
15481         * class.cs (MethodData.Define): Do not set the `newslot' on
15482         interface members, if they are also flagged as "override".
15483
15484         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
15485         better code for ++i and i++.  This only works for static fields
15486         and local variables.
15487
15488         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
15489         want to pull the DeclSpace out of the builder_to_declspace instead
15490         of the TypeBuilder (like in TypeContainer.FindMembers).
15491
15492         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
15493         instead of LookupTypeContainer.  Fixes the crash on .NET for
15494         looking up interface members.
15495
15496         * const.cs: Create our own emit context during the Definition
15497         stage, so that constants are evaluated in the proper context, when
15498         a recursive definition happens.
15499
15500 2003-05-11  Martin Baulig  <martin@ximian.com>
15501
15502         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
15503         new block for a switch section.
15504         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
15505         the adding/lookup in the switch block.  Fixes #39828.
15506
15507 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
15508
15509         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
15510         functionality: I needed to convert the data after I had performed
15511         the add/sub operation into the operands type size.
15512
15513         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
15514         pass the type for the box operation, otherwise the resulting
15515         object would have been of type object.
15516
15517         (BoxedCast): Add constructor to specify the type to box as.
15518
15519 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
15520
15521         * iterators.cs: I was reusing the `count' variable inadvertently,
15522         take steps to not allow this to happen.
15523
15524 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
15525
15526         * attribute.cs (Attribute.Resolve): Params attributes are encoded
15527         by creating an array at the point where the params starts and
15528         putting all those arguments there, then adjusting the size of the
15529         array.
15530
15531 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
15532
15533         * expression.cs (New.AddressOf): Implement interface
15534         IMemoryLocation.  This is used when the `new' operator is used in
15535         the context of an invocation to a method on a value type.
15536
15537         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
15538         example. 
15539
15540         * namespace.cs: Also check the using aliases here.
15541
15542         * driver.cs: Move the test for using validity after the types have
15543         been entered, so we do a single pass that also includes the using
15544         aliases. 
15545
15546         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
15547         in the regular case.   CreateSiblingForFinally is doing extra
15548         error checking.
15549
15550         * attribute.cs (GetAttributeArgumentExpression): Store the result
15551         on an out value, and use the return value to indicate failure
15552         instead of using null (which is a valid return for Constant.GetValue).
15553
15554         * statement.cs: Perform the analysis flow for the increment
15555         portion after the statement, because this will be the real flow of
15556         execution.  Fixes #42385
15557
15558         * codegen.cs (EmitContext.EmitArgument,
15559         EmitContext.EmitStoreArgument): New helper functions when the
15560         RemapToProxy flag is set.
15561
15562         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
15563         function.
15564
15565         Add support for remapping parameters. 
15566
15567         * iterators.cs: Propagate parameter values;  Store parameter
15568         values in the proxy classes.
15569
15570 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
15571
15572         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
15573         need a proxy reference;  I do not know what I was thinking
15574
15575         * cs-parser.jay (constructor_initializer): catch another error,
15576         and display nice message.
15577
15578         (field_declaration): catch void field declaration
15579         to flag a better error. 
15580
15581         * class.cs (MemberBase.CheckBase): Report an error instead of a
15582         warning if a new protected member is declared in a struct. 
15583         (Field.Define): catch the error of readonly/volatile.
15584
15585         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
15586
15587         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
15588         volatile variable is taken
15589
15590 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
15591
15592         * statement.cs (Fixed.Resolve): Report an error if we are not in
15593         an unsafe context.
15594
15595 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
15596
15597         * typemanager.cs: reuse the code that handles type clashes for
15598         delegates and enumerations.
15599
15600         * class.cs (Report28): Always report.
15601
15602         * expression.cs (EncodeAsAttribute): Allow nulls here.
15603
15604 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
15605
15606         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
15607         the functionality for testing whether an expression is valid for
15608         an attribute here.  Also handle the case of arrays of elements
15609         being stored. 
15610
15611         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
15612         encoding a linear array into an array of objects that are suitable
15613         to be passed to an CustomAttributeBuilder.
15614
15615         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15616
15617         * ecore.cs: (FieldExpr): Handle field remapping here.
15618
15619         * iteratators.cs: Pass the instance variable (if the method is an
15620         instance method) to the constructors, so we can access the field
15621         variables on the class.
15622
15623         TODO: Test this with structs.  I think the THIS variable on
15624         structs might have to be a pointer, and not a refenrece
15625
15626 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
15627
15628         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15629         local variables to fields in a proxy class.
15630
15631         * iterators.cs (PopulateProxy): Rename our internal fields to
15632         <XXX>.  
15633         Create a <THIS> field if we are an instance method, so we can
15634         reference our parent container variables.
15635         (MapVariable): Called back from the EmitContext code to enter a
15636         new variable to field mapping into the proxy class (we just create
15637         a FieldBuilder).
15638
15639         * expression.cs
15640         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15641         for using the remapped locals to fields.
15642
15643         I placed the code here, because that gives the same semantics to
15644         local variables, and only changes the Emit code.
15645
15646         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15647         statements inside iterators.
15648         (VariableInfo): Add a FieldBuilder for the cases when we are
15649         remapping local variables to fields in a proxy class
15650
15651         * ecore.cs (SimpleNameResolve): Avoid testing two times for
15652         current_block != null.
15653
15654         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15655         not cope with strings, as it has been moved to the
15656         TableSwitchEmit.  Fixed bug in switch generation.
15657
15658         * expression.cs (New.DoResolve): Provide more context for the user
15659         when reporting an error.
15660
15661         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15662         pointers. 
15663
15664         * expression.cs (MemberAccess.DoResolve): When we get a type back,
15665         check the permissions for it.  Note than in a type-resolution
15666         context the check was already present in DeclSpace.ResolveType,
15667         but was missing from the MemberAccess.
15668
15669         (ArrayCreation.CheckIndices): warn if the user has
15670         more nested levels of expressions, but there are no more
15671         dimensions specified.  Avoids crash on bug 41906.
15672
15673 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
15674
15675         * statement.cs (Block): replace Implicit bool, for a generic
15676         flags.   
15677         New flag: `Unchecked'.  This is used during the EmitMeta phase
15678         (which is out-of-line with the regular Resolve/Emit process for a
15679         statement, as this is done ahead of time, but still gets a chance
15680         to call constant resolve).
15681
15682         (Block.Flags): new enum for adding a new flag.
15683
15684         (Block.EmitMeta): track the state of unchecked.
15685
15686         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15687         to enable constant resolution to work there as well.
15688
15689 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
15690
15691         * typemanager.cs (ienumerable_type): Also look up
15692         System.Collections.IEnumerable. 
15693
15694 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
15695
15696         TODO: Test more than one conditional per method.
15697
15698         * class.cs (Indexer.Define): Report the location where the user is
15699         referencing the unsupported feature.
15700
15701         (MethodData): Overload the use of `conditionals' to
15702         minimize the creation of needless ArrayLists.   This saves roughly
15703         212kb on my machine.
15704
15705         (Method): Implement the new IIteratorContainer interface.
15706         (Method.SetYields): Implement the method by setting the ModFlags
15707         to contain METHOD_YIELDS.
15708
15709         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15710         which just got set to null.
15711
15712         * iterators.cs: New file.
15713
15714         (Yield, YieldBreak): New statements.
15715
15716         * statement.cs (Return.Resolve): Flag an error if we are used in
15717         an iterator method.
15718
15719         * codegen.cs (InIterator): New flag set if the code is being
15720         compiled in an iterator method.
15721
15722         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
15723         internal modifier, and we just use it to avoid adding extra
15724         fields, as this is seldom used.  
15725
15726         * cs-parser.jay: Add yield_statement (yield and yield break).
15727
15728         * driver.cs: New flag -v2 to turn on version 2 features. 
15729
15730         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15731         hashtable when v2 is enabled.
15732
15733 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
15734
15735         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15736         there is already a namespace defined with this name.
15737
15738         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15739         people upgraded their corlibs.
15740
15741         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15742         always use fully qualified types, no need to use the compiler
15743         front end.
15744
15745         (TypeManager.IsNamespace): Use binarysearch.
15746
15747         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15748         AddDelegate): I did not quite use the new IsValid API properly: I
15749         have to pass the short-name and the fullname.  I was passing only
15750         the basename instead of the fullname sometimes. 
15751
15752         (TypeContainer.DefineType): call NamespaceClash.
15753
15754         * interface.cs (Interface.DefineType): use NamespaceClash before
15755         defining the type.
15756
15757         * delegate.cs (Delegate.DefineType): use NamespaceClash before
15758         defining the type.
15759
15760         * enum.cs: (Enum.DefineType): use NamespaceClash before
15761         defining the type.
15762
15763         * typemanager.cs (: 3-line patch that gives us some tasty 11%
15764         speed increase.  First, use the negative_hits cache when we get a
15765         negative.  Second, add the type with its full original name
15766         instead of the new . and + encoded name (reflection uses + to
15767         separate type from a nested type).  Use LookupTypeReflection
15768         directly which bypasses the type->name hashtable (that we already
15769         know does not contain the type.
15770
15771         * decl.cs (DeclSpace.ResolveTypeExpr): track the
15772         location/container type. 
15773
15774         * driver.cs: When passing utf8, use directly the UTF8Encoding.
15775
15776 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
15777
15778         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15779
15780         * delegate.cs (NewDelegate.Resolve): Test whether an instance
15781         method is being referenced in the method group from a static
15782         context, and report error 120 if so.
15783
15784         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15785         Error118. 
15786
15787         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15788         is created, we create the A namespace).
15789
15790         * cs-parser.jay: A namespace also introduces a DeclarationFound.
15791         Fixes #41591
15792
15793 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
15794
15795         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15796         invocation to ModuleBuilder.GetType with the same values will
15797         return a new type instance, so we need to cache its return
15798         values. 
15799
15800         * expression.cs (Binary.ResolveOperator): Only allow the compare
15801         operators on enums if they are of the same type.
15802
15803         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15804         types of ValueType on their own case.  Before we were giving them
15805         the same treatment as objects.
15806
15807         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15808         fullname.  Short name is used to compare against container name.
15809         Fullname is used to check against defined namespace names.
15810
15811         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15812         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15813
15814         (Method.CheckBase): Call parent.
15815         (MemberBase.CheckBase): Check for protected members on sealed
15816         classes.
15817         (PropertyBase.CheckBase): Call parent.
15818         (Field.Define): Call parent.
15819
15820         * report.cs: Negative error codes are now mapped to 8000 - code,
15821         so that the display is render more nicely.
15822
15823         * typemanager.cs: Do not use try/catch, instead report a regular
15824         error. 
15825
15826         (GetPointerType, GetReferenceType): These methods provide
15827         mechanisms to obtain the T* and T& from a T.  We had the code
15828         previously scattered around the code base, and it also used
15829         TypeManager.LookupType that would go through plenty of caches.
15830         This one goes directly to the type source.
15831
15832         In some places we did the Type.GetType followed by
15833         ModuleBuilder.GetType, but not in others, so this unifies the
15834         processing as well.
15835
15836         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15837         statements now that we have namespace information.
15838
15839         * typemanager.cs (IsNamespace): New method, returns whether the
15840         string presented is a namespace or not.
15841
15842         (ComputeNamespaces): New public entry point, computes the list of
15843         available namespaces, using the GetNamespaces API call in Mono, or
15844         the slower version in MS.NET.   
15845
15846         Now before we start the semantic analysis phase, we have a
15847         complete list of namespaces including everything that the user has
15848         provided.
15849
15850         Deleted old code to cache namespaces in .nsc files.
15851
15852 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
15853
15854         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15855         class/struct location definition Location for the implicit
15856         constructor location.
15857
15858         (Operator.Define): Use the location of the operator for the
15859         implicit Method definition.
15860
15861         (Constructor.Emit): use the constructor location for the implicit
15862         base initializer constructor.
15863
15864         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
15865         and the Expression class now contains two new methods:
15866
15867         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
15868         isolate type lookup from the rest of the resolution process.
15869
15870         Since we use Expressions to hold type definitions due to the way
15871         we parse the input we have historically overloaded Resolve to
15872         perform the Type lookups if a special flag is passed.  Now this is
15873         eliminated and two methods take their place. 
15874
15875         The differences in the two methods between xStep and xTerminal is
15876         that xStep is involved in our current lookup system that uses
15877         SimpleNames to compose a name, while xTerminal is used just to
15878         catch the case where the simplename lookup failed.
15879
15880 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
15881
15882         * expression.cs (ResolveMemberAccess): Remove redundant code.
15883         TypeExpr expressions are always born fully resolved.
15884
15885         * interface.cs (PopulateMethod): Do not lookup the types twice.
15886         We were doing it once during SemanticAnalysis and once during
15887         PopulateMethod.
15888
15889         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15890         in local variable type definitions, were being returned as a
15891         SimpleName (we decomposed everything into a string), that is
15892         because primary_expression was being used instead of a type in the
15893         grammar (reduce/reduce conflicts).
15894
15895         The part that was wrong is that we converted the expression into a
15896         string (an oversimplification in one hand, compounded with primary
15897         expressions doing string concatenation).
15898
15899         So things like:
15900
15901         A.B.C [] x;
15902
15903         Would return "A.B.C[]" as a SimpleName.  This stopped things like
15904         using clauses from working on this particular context.  And a type
15905         was being matched directly against "A.B.C[]".
15906
15907         We now use the correct approach, and allow for ComposedCast to be
15908         part of the unary expression.  So the "A.B.C []" become a composed
15909         cast of "A.B.C" (as a nested group of MemberAccess with a
15910         SimpleName at the end) plus the rank composition "[]". 
15911
15912         Also fixes 35567
15913
15914 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
15915
15916         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15917         for the access level checking.
15918
15919         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
15920         `TypeContainer container', because I kept getting confused when I
15921         was debugging this code.
15922
15923         * expression.cs (Indexers): Instead of tracking getters/setters,
15924         we now track them in parallel.  We create one arraylist less, but
15925         most importantly it is possible now for the LValue code to find a
15926         matching get for a set.
15927
15928         (IndexerAccess.DoResolveLValue): Update the code.
15929         GetIndexersForType has been modified already to extract all the
15930         indexers from a type.  The code assumed it did not.
15931
15932         Also make the code set the correct return type for the indexer.
15933         This was fixed a long time ago for properties, but was missing for
15934         indexers.  It used to be void_type.
15935
15936         (Binary.Emit): Test first for doubles instead of
15937         floats, as they are more common.
15938
15939         (Binary.EmitBranchable): Use the .un version of the branch opcodes
15940         when dealing with floats and the <=, >= operators.  This fixes bug
15941         #39314 
15942
15943         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15944         to load the array value by emitting a load on the foreach variable
15945         type.  This was incorrect.  
15946
15947         We now emit the code to load an element using the the array
15948         variable type, and then we emit the conversion operator.
15949
15950         Fixed #40176
15951
15952 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
15953
15954         * attribute.cs: Avoid allocation of ArrayLists in the common case.
15955
15956 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
15957
15958         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15959         test for protection before we test for signatures. 
15960
15961         (MethodSignature.ToString): implement.
15962
15963         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15964         to the case where we reduced into a LongConstant.
15965
15966         * decl.cs (CheckAccessLevel): If the type is an array, we can not
15967         depend on whether the information is acurrate, because the
15968         Microsoft runtime will always claim that the array type is public,
15969         regardless of the real state.
15970
15971         If the type is a pointer, another problem happens: the type is
15972         reported as non-public in Microsoft.  
15973
15974         In both cases we have to call CheckAccessLevel recursively with
15975         the underlying type as the argument to be tested.
15976
15977 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
15978
15979         * assign.cs (Assign.Emit): If we are dealing with a compound
15980         assignment expression, we should use the code path that stores the
15981         intermediate result in a temporary value.  This fixes #40903.
15982
15983         *expression.cs (Indirection.ToString): Provide ToString method for
15984         debugging. 
15985
15986 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
15987
15988         * class.cs: Null out fields holding references to Block objects so
15989         they can be garbage collected.
15990
15991         * expression.cs (OverloadResolve): Remove unused local.
15992
15993 2003-04-07  Martin Baulig  <martin@ximian.com>
15994
15995         * codegen.cs (EmitContext.CurrentFile): New public field.
15996         (EmitContext.Mark): Use the CurrentFile to check whether the
15997         location is in the correct file.
15998         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15999
16000 2003-04-07  Martin Baulig  <martin@ximian.com>
16001
16002         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
16003
16004         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
16005         location.  [FIXME: The location argument which gets passed to this
16006         method is sometimes wrong!]
16007
16008 2003-04-07  Nick Drochak <ndrochak@gol.com>
16009
16010         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
16011
16012 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
16013
16014         * expression.cs (Indirection.EmitAssign): We were using the
16015         temporary, but returning immediately instead of continuing the
16016         EmitAssing flow.
16017
16018 2003-04-06  Martin Baulig  <martin@ximian.com>
16019
16020         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
16021         if it's a nested child, but also deriving from the outer class.
16022         See test 190.cs.
16023
16024         * typemanager.cs (IsNestedChildOf): Make this work if it's a
16025         nested child, but also deriving from the outer class.  See
16026         test-190.cs.
16027         (FilterWithClosure): We may access private members of the outer
16028         class if we're a nested child and deriving from the outer class.
16029         (RealMemberLookup): Only set `closure_private_ok' if the
16030         `original_bf' contained BindingFlags.NonPublic.
16031
16032 2003-04-05  Martin Baulig  <martin@ximian.com>
16033
16034         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
16035         probe if its a type parameter, and if so, flag an error.
16036
16037         * decl.cs: Move here the SetParameterInfo code from class.cs.
16038         Handle IsGeneric here.
16039
16040         Handle a variety of errors in the parameter info definition.
16041
16042         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
16043         type parameters here.
16044
16045         * cs-parser.jay (class_declaration): report errors for parameters
16046         here as well.
16047
16048 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
16049
16050         * generic.cs: New file, contains support code for generics.
16051
16052         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
16053         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
16054
16055         Update parser for the above removals.
16056
16057         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
16058         now taken care of in the parser.
16059
16060 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
16061
16062         * class.cs (Event.Define): Do not allow abstract events to have
16063         initializers. 
16064
16065 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
16066
16067         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
16068         block in event declarations.
16069
16070         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
16071         value type, get its address.
16072
16073         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
16074         leaving a class on the stack instead of a boolean value (int
16075         0/1).  Change the code so we compare against null, and then the
16076         result against zero.
16077
16078         * class.cs (TypeContainer.GetClassBases): We were checking for the
16079         parent class being sealed too late.
16080
16081         * expression.cs (Binary.Emit): For <= and >= when dealing with
16082         floating point values, use cgt.un and clt.un instead of cgt and
16083         clt alone.
16084
16085 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
16086
16087         * statement.cs: Apply the same optimization as MS: skip the 
16088         GetEnumerator returning an IEnumerator, and use the one returning a 
16089         CharEnumerator instead. This allows us to avoid the try-finally block 
16090         and the boxing.
16091
16092 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
16093
16094         * cs-parser.jay: Attributes cannot be applied to
16095                          namespaces. Fixes #40473
16096
16097 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16098
16099         * class.cs:
16100         (Add*): check if the name is valid using the full name for constants,
16101         fields, properties and events.
16102
16103 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
16104
16105         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
16106         char constants to be part of the enumeration.
16107
16108         * expression.cs (Conditional.DoResolve): Add support for operator
16109         true. Implements the missing functionality from 14.12
16110
16111         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
16112         operator true/false as required by the spec.
16113
16114         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
16115         implicit conversion to boolean.
16116
16117         * statement.cs (Statement.ResolveBoolean): A boolean expression is
16118         also one where the type implements `operator true'. 
16119
16120         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
16121         get an expression that will invoke operator true based on an
16122         expression.  
16123
16124         (GetConversionOperators): Removed the hack that called op_True
16125         here.  
16126
16127         (Expression.ResolveBoolean): Move this from Statement.
16128
16129 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
16130
16131         * ecore.cs (FieldExpr): do not allow initialization of initonly
16132         fields on derived classes
16133
16134 2003-03-13  Martin Baulig  <martin@ximian.com>
16135
16136         * statement.cs (Block.Emit): Call ig.BeginScope() and
16137         ig.EndScope() when compiling with debugging info; call
16138         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
16139
16140 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
16141
16142         * expression.cs (Indexers): Do not construct immediately, allow
16143         for new members to be appended as we go.  Fixes 38143
16144
16145 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16146
16147         * expression.cs: save/restore context when resolving an unchecked
16148         expression.
16149
16150 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
16151
16152         * cfold.cs: Catch division by zero in modulus operator during
16153         constant folding.
16154
16155 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
16156
16157         * interface.cs (Interface.DefineMembers): Avoid defining members
16158         twice. 
16159
16160 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
16161
16162         * driver.cs: handle the +/- options for -noconfig
16163
16164         * statement.cs (Unckeched.Resolve): Also track the state of
16165         unchecked in the Resolve phase.
16166
16167 2003-02-27  Martin Baulig  <martin@ximian.com>
16168
16169         * ecore.cs (Expression.MemberLookup): Don't create a
16170         MethodGroupExpr for something which is not a method.  Fixes #38291.
16171
16172 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
16173
16174         * class.cs (MemberBase.CheckParameters): Also check that the type
16175         is unmanaged if it is a pointer.
16176
16177         * expression.cs (SizeOf.Resolve): Add location information.
16178
16179         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
16180         a managed type is declared.
16181
16182         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
16183         parameter modifiers as well.  Fixes bug 38606
16184
16185         * class.cs: Very sad.  Am backing out the speed up changes
16186         introduced by the ArrayList -> Array in the TypeContainer, as they
16187         were not actually that much faster, and introduced a bug (no error
16188         reports on duplicated methods).
16189
16190         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
16191         source first, this will guarantee that we have a valid expression
16192         before calling in lower levels functions that will require a
16193         resolved object.  Then use this original_source in the
16194         target.ResolveLValue instead of the original source that was
16195         passed to us.
16196
16197         Another change.  Use target.Resolve instead of LValueResolve.
16198         Although we are resolving for LValues, we will let the Assign code
16199         take care of that (it will be called again from Resolve).  This
16200         basically allows code like this:
16201
16202         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
16203         class Y { void A (X x) { x [0] += o; }
16204
16205         The problem was that the indexer was trying to resolve for
16206         set_Item (idx, object o) and never finding one.  The real set_Item
16207         was set_Item (idx, X).  By delaying the process we get the right
16208         semantics. 
16209
16210         Fixes bug 36505
16211
16212 2003-02-23  Martin Baulig  <martin@ximian.com>
16213
16214         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
16215         while calling DoEmit ().
16216
16217         * codegen.cs (EmitContext.Mark): Don't mark locations in other
16218         source files; if you use the #line directive inside a method, the
16219         compiler stops emitting line numbers for the debugger until it
16220         reaches the end of the method or another #line directive which
16221         restores the original file.
16222
16223 2003-02-23  Martin Baulig  <martin@ximian.com>
16224
16225         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
16226
16227 2003-02-23  Martin Baulig  <martin@ximian.com>
16228
16229         * statement.cs (Block.AddChildVariableNames): We need to call this
16230         recursively, not just for our immediate children.
16231
16232 2003-02-23  Martin Baulig  <martin@ximian.com>
16233
16234         * class.cs (Event.Define): Always make the field private, like csc does.
16235
16236         * typemanager.cs (TypeManager.RealMemberLookup): Make events
16237         actually work, fixes bug #37521.
16238
16239 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
16240
16241         * delegate.cs: When creating the various temporary "Parameters"
16242         classes, make sure that we call the ComputeAndDefineParameterTypes
16243         on those new parameters (just like we do with the formal ones), to
16244         allow them to be resolved in the context of the DeclSpace.
16245
16246         This fixes the bug that Dick observed in Bugzilla #38530.
16247
16248 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
16249
16250         * expression.cs (ResolveMemberAccess): When resolving a constant,
16251         do not attempt to pull a constant if the value was not able to
16252         generate a valid constant.
16253
16254         * const.cs (LookupConstantValue): Do not report more errors than required.
16255
16256 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16257
16258         * expression.cs: fixes bug #38328.
16259
16260 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
16261
16262         * class.cs: Changed all the various members that can be part of a
16263         class from being an ArrayList to be an Array of the right type.
16264         During the DefineType type_list, interface_list, delegate_list and
16265         enum_list are turned into types, interfaces, delegates and enums
16266         arrays.  
16267
16268         And during the member population, indexer_list, event_list,
16269         constant_list, field_list, instance_constructor_list, method_list,
16270         operator_list and property_list are turned into their real arrays.
16271
16272         Although we could probably perform this operation earlier, for
16273         good error reporting we need to keep the lists and remove the
16274         lists for longer than required.
16275
16276         This optimization was triggered by Paolo profiling the compiler
16277         speed on the output of `gen-sample-program.pl' perl script. 
16278
16279         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
16280         not crash in methods like MemberLookupFailed that use this field.  
16281
16282         This problem arises when the compiler fails to resolve a type
16283         during interface type definition for example.
16284
16285 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
16286
16287         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
16288         inherit from System.Object, so we have to stop at null, not only
16289         when reaching System.Object.
16290
16291 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
16292
16293         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
16294         DeclaredOnly because the parent indexer might have had a different
16295         name, but did not loop until the top of the hierarchy was reached.
16296
16297         The problem this one fixes is 35492: when a class implemented an
16298         indexer from an interface, we were getting the interface method
16299         (which was abstract) and we were flagging an error (can not invoke
16300         abstract method).
16301
16302         This also keeps bug 33089 functioning, and test-148 functioning.
16303
16304         * typemanager.cs (IsSpecialMethod): The correct way of figuring
16305         out if a method is special is to see if it is declared in a
16306         property or event, or whether it is one of the predefined operator
16307         names.   This should fix correctly #36804.
16308
16309 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
16310
16311         The goal here is to remove the dependency on EmptyCast.Peel ().
16312         Killing it completely.
16313
16314         The problem is that currently in a number of places where
16315         constants are expected, we have to "probe" for an EmptyCast, and
16316         Peel, which is not the correct thing to do, as this will be
16317         repetitive and will likely lead to errors. 
16318
16319         The idea is to remove any EmptyCasts that are used in casts that
16320         can be reduced to constants, so we only have to cope with
16321         constants. 
16322
16323         This bug hunt was triggered by Bug 37363 and the desire to remove
16324         the duplicate pattern where we were "peeling" emptycasts to check
16325         whether they were constants.  Now constants will always be
16326         constants.
16327
16328         * ecore.cs: Use an enumconstant here instead of wrapping with
16329         EmptyCast.  
16330
16331         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
16332         throwing me off.  By handling this we can get rid of a few hacks.
16333
16334         * statement.cs (Switch): Removed Peel() code.
16335
16336 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
16337
16338         * class.cs: Location information for error 508
16339
16340         * expression.cs (New.DoResolve): Add a guard against double
16341         resolution of an expression.  
16342
16343         The New DoResolve might be called twice when initializing field
16344         expressions (see EmitFieldInitializers, the call to
16345         GetInitializerExpression will perform a resolve on the expression,
16346         and later the assign will trigger another resolution
16347
16348         This leads to bugs (#37014)
16349
16350         * delegate.cs: The signature for EndInvoke should contain any ref
16351         or out parameters as well.  We were not doing this in the past. 
16352
16353         * class.cs (Field.Define): Do not overwrite the type definition
16354         inside the `volatile' group.  Turns out that volatile enumerations
16355         were changing the type here to perform a validity test, which
16356         broke conversions. 
16357
16358 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
16359
16360         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
16361         and structs, we do not want to load the instance variable
16362
16363         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
16364         enum_type has to be handled like an object reference (implicit
16365         conversions exists from this to object), but the regular IsClass
16366         and IsValueType tests will never return true for this one.
16367
16368         Also we use TypeManager.IsValueType instead of type.IsValueType,
16369         just for consistency with the rest of the code (this is only
16370         needed if we ever use the construct exposed by test-180.cs inside
16371         corlib, which we dont today).
16372
16373 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
16374
16375         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
16376         just InternalCall.
16377
16378 2003-02-09  Martin Baulig  <martin@ximian.com>
16379
16380         * namespace.cs (Namespace..ctor): Added SourceFile argument.
16381         (Namespace.DefineNamespaces): New static public method; this is
16382         called when we're compiling with debugging to add all namespaces
16383         to the symbol file.
16384
16385         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
16386         pass it to the Namespace's .ctor.
16387
16388         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
16389         and MethodBase arguments; pass the namespace ID to the symwriter;
16390         pass the MethodBase instead of the token to the symwriter.
16391         (SymbolWriter.DefineNamespace): New method to add a namespace to
16392         the symbol file.
16393
16394 2003-02-09  Martin Baulig  <martin@ximian.com>
16395
16396         * symbolwriter.cs: New file.  This is a wrapper around
16397         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
16398         methods here in near future.
16399
16400 2003-02-09  Martin Baulig  <martin@ximian.com>
16401
16402         * codegen.cs (EmitContext.Mark): Just pass the arguments to
16403         ILGenerator.MarkSequencePoint() which are actually used by the
16404         symbol writer.
16405
16406 2003-02-09  Martin Baulig  <martin@ximian.com>
16407
16408         * location.cs (SourceFile): New public sealed class.  This
16409         contains the name and an index which is used in the location's token.
16410         (Location): Reserve an appropriate number of bits in the token for
16411         the source file instead of walking over that list, this gives us a
16412         really huge performance improvement when compiling with debugging.
16413
16414         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
16415         `SourceFile' argument instead of a string.
16416         (Driver.ProcessFile): Add all the files via Location.AddFile(),
16417         but don't parse/tokenize here, we need to generate the list of all
16418         source files before we do that.
16419         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
16420         the files.
16421
16422         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
16423         instead of a string.
16424
16425         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
16426         of a string.
16427
16428 2003-02-09  Martin Baulig  <martin@ximian.com>
16429
16430         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
16431         filename on `#line default'.
16432
16433 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
16434
16435         * statement.cs: don't clear the pinned var when the fixed statement
16436         returns from the method (fixes bug#37752).
16437
16438 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
16439
16440         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
16441         to IsValueType.
16442
16443 2003-02-07  Martin Baulig  <martin@ximian.com>
16444
16445         * driver.cs: Removed the `--debug-args' command line argument.
16446
16447         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
16448         automatically by the AsssemblyBuilder.
16449         (CodeGen.InitializeSymbolWriter): We don't need to call any
16450         initialization function on the symbol writer anymore.  This method
16451         doesn't take any arguments.
16452
16453 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
16454
16455         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
16456         from referenced assemblies as well.
16457
16458 2003-02-02  Martin Baulig  <martin@ximian.com>
16459
16460         * class.cs (MethodData.Emit): Generate debugging info for external methods.
16461
16462 2003-02-02  Martin Baulig  <martin@ximian.com>
16463
16464         * class.cs (Constructor.Emit): Open the symbol writer before
16465         emitting the constructor initializer.
16466         (ConstructorInitializer.Emit): Call ec.Mark() to allow
16467         single-stepping through constructor initializers.
16468
16469 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
16470
16471         * class.cs: Handle error 549: do not allow virtual methods in
16472         sealed classes. 
16473
16474 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
16475
16476         * decl.cs: Check access levels when resolving types
16477
16478 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
16479
16480         * statement.cs: Add parameters and locals set in catch blocks that might 
16481         return to set vector
16482
16483 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
16484
16485         * class.cs (Operator): Set the SpecialName flags for operators.
16486
16487         * expression.cs (Invocation.DoResolve): Only block calls to
16488         accessors and operators on SpecialName methods.
16489
16490         (Cast.TryReduce): Handle conversions from char constants.
16491
16492
16493 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
16494
16495         * statement.cs: small memory and time optimization in FlowBranching.
16496
16497 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
16498
16499         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
16500         problem that the last fix but in the other sid (Set).
16501
16502         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
16503         access when there is no indexer in the hierarchy.
16504
16505 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
16506
16507         * class.cs: Combine some if statements.
16508
16509 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16510
16511         * driver.cs: fixed bug #37187.
16512
16513 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
16514
16515         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
16516         any indexer, it's needed to build a list with all the indexers in the
16517         hierarchy (AllGetters), else we have problems. Fixes #35653.
16518
16519 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
16520
16521         * class.cs (MethodData.Define): It is wrong for an interface
16522         implementation to be static in both cases: explicit and implicit.
16523         We were only handling this in one case.
16524
16525         Improve the if situation there to not have negations.
16526
16527         * class.cs (Field.Define): Turns out that we do not need to check
16528         the unsafe bit on field definition, only on usage.  Remove the test.
16529
16530 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16531
16532         * driver.cs: use assembly.Location instead of Codebase (the latest
16533         patch made mcs fail when using MS assemblies).
16534
16535 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
16536
16537         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
16538         get the path to *corlib.dll.
16539
16540 2003-01-21  Nick Drochak <ndrochak@gol.com>
16541
16542         * cs-tokenizer.cs:
16543         * pending.cs:
16544         * typemanager.cs: Remove compiler warnings
16545
16546 2003-01-20  Duncan Mak  <duncan@ximian.com>
16547
16548         * AssemblyInfo.cs: Bump the version number to 0.19.
16549
16550 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16551
16552         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
16553
16554 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
16555
16556         * class.cs (Constructor::Emit): Emit debugging info for constructors.
16557
16558 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
16559
16560         * cs-parser.jay: Small fix: we were not comparing the constructor
16561         name correctly.   Thanks to Zoltan for the initial pointer.
16562
16563 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
16564
16565         * cs-tokenizer.cs: Set file name when specified with #line
16566
16567 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
16568
16569         * cs-parser.jay: Only perform the constructor checks here if we
16570         are named like the class;  This will help provider a better
16571         error.  The constructor path is taken when a type definition is
16572         not found, but most likely the user forgot to add the type, so
16573         report that rather than the constructor error.
16574
16575 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
16576
16577         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
16578         allocations.
16579
16580 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16581
16582         * cs-parser.jay: Add cleanup call.
16583
16584 2003-01-13  Duncan Mak  <duncan@ximian.com>
16585
16586         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
16587         consistent with other methods.
16588
16589 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16590
16591         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
16592
16593 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
16594
16595         * attribute.cs: only set GuidAttr to true when we have a
16596         GuidAttribute.
16597
16598 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16599
16600         * ecore.cs:
16601         * expression.cs:
16602         * typemanager.cs: fixes to allow mcs compile corlib with the new
16603         Type.IsSubclassOf fix.
16604
16605 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
16606
16607         * expression.cs (LocalVariableReference.DoResolve): Classify a
16608         constant as a value, not as a variable.   Also, set the type for
16609         the variable.
16610
16611         * cs-parser.jay (fixed_statement): take a type instead of a
16612         pointer_type, so we can produce a better error message later.
16613
16614         * statement.cs (Fixed.Resolve): Flag types that are not pointers
16615         as an error.  
16616
16617         (For.DoEmit): Make inifinite loops have a
16618         non-conditional branch back.
16619
16620         (Fixed.DoEmit): First populate the pinned variables, then emit the
16621         statement, then clear the variables.  Before I was emitting the
16622         code once for each fixed piece.
16623
16624
16625 2003-01-08  Martin Baulig  <martin@ximian.com>
16626
16627         * statement.cs (FlowBranching.MergeChild): A break in a
16628         SWITCH_SECTION does not leave a loop.  Fixes #36155.
16629
16630 2003-01-08  Martin Baulig  <martin@ximian.com>
16631
16632         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16633         lives in the same number space than `param_map'.  Fixes #36154.
16634
16635 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
16636
16637         * cs-parser.jay (constructor_declaration): Set the
16638         Constructor.ModFlags before probing for it.  This makes the
16639         compiler report 514, 515 and 132 (the code was there, but got
16640         broken). 
16641
16642         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16643         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16644         (GotoCase.Resolve): Set `Returns' to ALWAYS.
16645
16646 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16647
16648         * enum.cs: create the enum static fields using the enum type.
16649
16650 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16651
16652         * class.cs: don't try to create the ParamBuilder for the return
16653         type if it's not needed (and handle it breaking for the ms runtime
16654         anyway).
16655
16656 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16657
16658         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16659
16660 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
16661
16662         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16663         the command.   This showed up while compiling the JANET source
16664         code, which used \r as its only newline separator.
16665
16666 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
16667
16668         * class.cs (Method.Define): If we are an operator (because it
16669         reuses our code), then set the SpecialName and HideBySig.  #36128
16670
16671 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
16672
16673         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16674         exception, report error 120 `object reference required'.
16675
16676         * driver.cs: Add --pause option, used during to measure the size
16677         of the process as it goes with --timestamp.
16678
16679         * expression.cs (Invocation.DoResolve): Do not allow methods with
16680         SpecialName to be invoked.
16681
16682 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
16683
16684         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16685         number before adding it.
16686
16687 2002-12-21  Ravi Pratap  <ravi@ximian.com>
16688
16689         * ecore.cs (StandardImplicitConversion): When in an unsafe
16690         context, we allow conversion between void * to any other pointer
16691         type. This fixes bug #35973.
16692
16693 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16694
16695         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16696         is not thrown when extensionless outputs are used 
16697
16698 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16699
16700         * rootcontext.cs: fixed compilation of corlib.
16701
16702 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
16703
16704         * attribute.cs (Attributes.Contains): Add new method.
16705
16706         * class.cs (MethodCore.LabelParameters): if the parameter is an
16707         `out' parameter, check that no attribute `[In]' has been passed.
16708
16709         * enum.cs: Handle the `value__' name in an enumeration.
16710
16711 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
16712
16713         * decl.cs: Added special case to allow overrides on "protected
16714         internal" methods
16715
16716 2002-12-18  Ravi Pratap  <ravi@ximian.com>
16717
16718         * attribute.cs (Attributes.AddAttributeSection): Rename to this
16719         since it makes much more sense.
16720
16721         (Attributes.ctor): Don't require a Location parameter.
16722
16723         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16724
16725         * attribute.cs (ApplyAttributes): Remove extra Location parameters
16726         since we already have that information per attribute.
16727
16728         * everywhere : make appropriate changes.
16729
16730         * class.cs (LabelParameters): Write the code which actually
16731         applies attributes to the return type. We can't do this on the MS
16732         .NET runtime so we flag a warning in the case an exception is
16733         thrown.
16734
16735 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
16736
16737         * const.cs: Handle implicit null conversions here too.
16738
16739 2002-12-17  Ravi Pratap  <ravi@ximian.com>
16740
16741         * class.cs (MethodCore.LabelParameters): Remove the extra
16742         Type [] parameter since it is completely unnecessary. Instead
16743         pass in the method's attributes so that we can extract
16744         the "return" attribute.
16745
16746 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
16747
16748         * cs-parser.jay (parse): Use Report.Error to flag errors instead
16749         of ignoring it and letting the compile continue.
16750
16751         * typemanager.cs (ChangeType): use an extra argument to return an
16752         error condition instead of throwing an exception.
16753
16754 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
16755
16756         * expression.cs (Unary.TryReduce): mimic the code for the regular
16757         code path.  Perform an implicit cast in the cases where we can
16758         implicitly convert to one of the integral types, and then reduce
16759         based on that constant.   This fixes bug #35483.
16760
16761 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16762
16763         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16764
16765 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16766
16767         * namespace.cs: fixed bug #35489.
16768
16769 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
16770
16771         * class.cs: Remove some dead code.
16772
16773         * cs-parser.jay: Estimate the number of methods needed
16774         (RootContext.MethodCount);
16775
16776         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16777         numbers instead of StringBuilders.
16778
16779         * support.cs (PtrHashtable): Add constructor with initial size;
16780         We can now reduce reallocations of the method table.
16781
16782 2002-12-10  Ravi Pratap  <ravi@ximian.com>
16783
16784         * attribute.cs (ApplyAttributes): Keep track of the emitted
16785         attributes on a per-target basis. This fixes bug #35413.
16786
16787 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
16788
16789         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16790         default to the Windows 1252 encoding.
16791
16792         (UnixParseOption): Support version, thanks to Alp for the missing
16793         pointer. 
16794
16795         * AssemblyInfo.cs: Add nice assembly information.
16796
16797         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16798         (bug 35169).
16799
16800         * cs-parser.jay: Allow a trailing comma before the close bracked
16801         in the attribute_section production.
16802
16803         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16804         address of the instance was being taken, I will take this out,
16805         because we take the address of the object immediately here.
16806
16807 2002-12-09  Ravi Pratap  <ravi@ximian.com>
16808
16809         * typemanager.cs (AreMultipleAllowed): Take care of the most
16810         obvious case where attribute type is not in the current assembly -
16811         stupid me ;-)
16812
16813 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
16814
16815         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16816         definitions, instead of doing that afterwards.  
16817
16818         Also we use a nice little hack, depending on the constructor, we
16819         know if we are a "composed" name or a simple name.  Hence, we
16820         avoid the IndexOf test, and we avoid 
16821
16822         * codegen.cs: Add code to assist in a bug reporter to track down
16823         the source of a compiler crash. 
16824
16825 2002-12-07  Ravi Pratap  <ravi@ximian.com>
16826
16827         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16828         types have been emitted for a given element and flag an error
16829         if something which does not have AllowMultiple set is used more
16830         than once.
16831
16832         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16833         attribute types and their corresponding AllowMultiple properties
16834
16835         (AreMultipleAllowed): Check the property for a given type.
16836
16837         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16838         property in the case we have a TypeContainer.
16839
16840         (Attributes.AddAttribute): Detect duplicates and just skip on
16841         adding them. This trivial fix catches a pretty gross error in our
16842         attribute emission - global attributes were being emitted twice!
16843
16844         Bugzilla bug #33187 is now fixed.
16845
16846 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
16847
16848         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16849         instead of pp_and).
16850
16851         * expression.cs (Binary.ResolveOperator): I can only use the
16852         Concat (string, string, string) and Concat (string, string,
16853         string, string) if the child is actually a concatenation of
16854         strings. 
16855
16856 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
16857
16858         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16859         context where we need a 2-character lookahead.
16860
16861         * pending.cs (PendingImplementation): Rework so we can keep track
16862         of interface types all the time, and flag those which were
16863         implemented by parents as optional.
16864
16865 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
16866
16867         * expression.cs (Binary.ResolveOperator): Use
16868         String.Concat(string,string,string) or
16869         String.Concat(string,string,string,string) when possible. 
16870
16871         * typemanager: More helper methods.
16872
16873
16874 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16875
16876         * pending.cs: remove the bogus return from GetMissingInterfaces()
16877         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16878
16879 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16880
16881         * namespace.cs: avoid duplicated 'using xxx' being added to
16882         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16883         when we get more than one 'using' statement for the same namespace.
16884         Report a CS0105 warning for it.
16885
16886 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
16887
16888         * cs-tokenizer.cs (consume_identifier): use read directly, instead
16889         of calling getChar/putback, uses internal knowledge of it.    
16890
16891         (xtoken): Reorder tokenizer so most common patterns are checked
16892         first.  This reduces the compilation time in another 5% (from 8.11s
16893         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16894
16895         The parsing time is 22% of the compilation in mcs, and from that
16896         64% is spent on the tokenization process.  
16897
16898         I tried using a binary search for keywords, but this is slower
16899         than the hashtable.  Another option would be to do a couple of
16900         things:
16901
16902                 * Not use a StringBuilder, instead use an array of chars,
16903                   with a set value.  Notice that this way we could catch
16904                   the 645 error without having to do it *afterwards*.
16905
16906                 * We could write a hand-parser to avoid the hashtable
16907                   compares altogether.
16908
16909         The identifier consumption process takes 37% of the tokenization
16910         time.  Another 15% is spent on is_number.  56% of the time spent
16911         on is_number is spent on Int64.Parse:
16912
16913                 * We could probably choose based on the string length to
16914                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
16915                   computations. 
16916
16917         Another 3% is spend on wrapping `xtoken' in the `token' function.
16918
16919         Handle 0xa0 as whitespace (#34752)
16920
16921 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
16922
16923         * typemanager.cs (IsCLRType): New routine to tell whether a type
16924         is one of the builtin types.  
16925
16926         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
16927         typecode in more places instead of doing pointer comparissions.
16928         We could leverage some knowledge about the way the typecodes are
16929         laid out.
16930
16931         New code to cache namespaces in assemblies, it is currently not
16932         invoked, to be used soon.
16933
16934         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16935
16936         * expression.cs (Binary.ResolveOperator): specially handle
16937         strings, and do not perform user-defined operator overloading for
16938         built-in types.
16939
16940 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
16941
16942         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16943         internalcall as it is a pretty simple operation;  Avoid whenever
16944         possible to call Char.IsLetter.
16945
16946         (consume_identifier): Cut by half the number of
16947         hashtable calls by merging the is_keyword and GetKeyword behavior.
16948
16949         Do not short-circuit, because if we do, we
16950         report errors (ie, #if false && true would produce an invalid
16951         directive error);
16952
16953
16954 2002-11-24  Martin Baulig  <martin@ximian.com>
16955
16956         * expression.cs (Cast.TryReduce): If we're in checked syntax,
16957         check constant ranges and report a CS0221.  Fixes #33186.
16958
16959 2002-11-24  Martin Baulig  <martin@ximian.com>
16960
16961         * cs-parser.jay: Make this work for uninitialized variable
16962         declarations in the `for' initializer.  Fixes #32416.
16963
16964 2002-11-24  Martin Baulig  <martin@ximian.com>
16965
16966         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16967         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
16968
16969 2002-11-24  Martin Baulig  <martin@ximian.com>
16970
16971         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16972         argument; if true, we also check for user-defined conversions.
16973         This is only needed if both arguments are of a user-defined type.
16974         Fixes #30443, added test-175.cs.
16975         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16976
16977         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16978
16979 2002-11-24  Martin Baulig  <martin@ximian.com>
16980
16981         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16982         function to get the store opcode.
16983         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16984         only emit the Ldelema if the store opcode is Stobj.  You must run
16985         both test-34 and test-167 to test this.  Fixes #34529.
16986
16987 2002-11-23  Martin Baulig  <martin@ximian.com>
16988
16989         * ecore.cs (Expression.MemberLookup): Added additional
16990         `qualifier_type' argument which is used when we're being called
16991         from MemberAccess.DoResolve() and null if we're called from a
16992         SimpleName lookup.
16993         (Expression.MemberLookupFailed): New method to report errors; this
16994         does the CS1540 check and reports the correct error message.
16995
16996         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16997         argument for the CS1540 check and redone the way how we're dealing
16998         with private members.  See the comment in the source code for details.
16999         (FilterWithClosure): Reverted this back to revision 1.197; renamed
17000         `closure_start_type' to `closure_qualifier_type' and check whether
17001         it's not null.  It was not this filter being broken, it was just
17002         being called with the wrong arguments.
17003
17004         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
17005         and pass it the correct `qualifier_type'; this also does the error
17006         handling for us.
17007
17008 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
17009
17010         * expression.cs (Invocation.EmitParams): If the we are dealing
17011         with a non-built-in value type, load its address as well.
17012
17013         (ArrayCreation): Use a a pretty constant instead
17014         of the hardcoded value 2.   Use 6 instead of 2 for the number of
17015         static initializers.  
17016
17017         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
17018         because they are not really value types, just glorified integers. 
17019
17020         * driver.cs: Do not append .exe, the CSC compiler does not do it.
17021
17022         * ecore.cs: Remove redundant code for enumerations, make them use
17023         the same code path as everything else, fixes the casting issue
17024         with enumerations in Windows.Forms.
17025
17026         * attribute.cs: Do only cast to string if it is a string, the
17027         validation happens later.
17028
17029         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
17030         people upgrade their corlibs.
17031
17032         * ecore.cs: Oops, enumerations were not following the entire code path
17033
17034 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
17035
17036         * typemanager.cs (FilterWithClosure): Commented out the test for
17037         1540 in typemanager.cs, as it has problems when accessing
17038         protected methods from a parent class (see test-174.cs). 
17039
17040         * attribute.cs (Attribute.ValidateGuid): new method.
17041         (Attribute.Resolve): Use above.
17042
17043 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
17044
17045         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
17046
17047         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
17048         handling for enumerations, as we only needed the TypeContainer
17049         functionality to begin with (this is required for the fix below to
17050         work for enums that reference constants in a container class for
17051         example). 
17052
17053         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
17054
17055         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
17056         a valid TypeBuilder to perform lookups on.o
17057
17058         * class.cs (InheritableMemberSignatureCompare): Use true in the
17059         call to GetGetMethod and GetSetMethod, because we are comparing
17060         the signature, and we need to get the methods *even* if they are
17061         private. 
17062
17063         (PropertyBase.CheckBase): ditto.
17064
17065         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
17066         GotoCase.Resolve): Use Peel on EmpytCasts.
17067
17068         * ecore.cs (EmptyCast): drop child, add Peel method.
17069
17070 2002-11-17  Martin Baulig  <martin@ximian.com>
17071
17072         * ecore.cs (EmptyCast.Child): New public property.
17073
17074         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
17075         label resolved to an EmptyCast.  Fixes #34162.
17076         (GotoCase.Resolve): Likewise.
17077         (Block.EmitMeta): Likewise.
17078
17079 2002-11-17  Martin Baulig  <martin@ximian.com>
17080
17081         * expression.cs (Invocation.BetterConversion): Prefer int over
17082         uint; short over ushort; long over ulong for integer literals.
17083         Use ImplicitConversionExists instead of StandardConversionExists
17084         since we also need to check for user-defined implicit conversions.
17085         Fixes #34165.  Added test-173.cs.
17086
17087 2002-11-16  Martin Baulig  <martin@ximian.com>
17088
17089         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
17090         with the `true' and `false' literals.  Fixes #33151.
17091
17092 2002-11-16  Martin Baulig  <martin@ximian.com>
17093
17094         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
17095         October 22nd; don't do the cs1540 check for static members.
17096
17097         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
17098         now using our own filter here and doing the cs1540 check again.
17099
17100 2002-11-16  Martin Baulig  <martin@ximian.com>
17101
17102         * support.cs (InternalParameters): Don't crash if we don't have
17103         any fixed parameters.  Fixes #33532.
17104
17105 2002-11-16  Martin Baulig  <martin@ximian.com>
17106
17107         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
17108         when looking up static methods to make this work on Windows.
17109         Fixes #33773.
17110
17111 2002-11-16  Martin Baulig  <martin@ximian.com>
17112
17113         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
17114         a setter rather than using PropertyInfo.CanWrite.
17115
17116 2002-11-15  Nick Drochak  <ndrochak@gol.com>
17117
17118         * class.cs: Allow acces to block member by subclasses. Fixes build
17119         breaker.
17120
17121 2002-11-14  Martin Baulig  <martin@ximian.com>
17122
17123         * class.cs (Constructor.Emit): Added the extern/block check.
17124         Fixes bug #33678.
17125
17126 2002-11-14  Martin Baulig  <martin@ximian.com>
17127
17128         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
17129         iteration while looking for indexers, this is needed because the
17130         indexer may have a different name in our base classes.  Fixed the
17131         error reporting (no indexers at all, not get accessor, no
17132         overloaded match).  Fixes bug #33089.
17133         (IndexerAccess.DoResolveLValue): Likewise.
17134
17135 2002-11-14  Martin Baulig  <martin@ximian.com>
17136
17137         * class.cs (PropertyBase.CheckBase): Make this work for multiple
17138         indexers.  Fixes the first part of bug #33089.
17139         (MethodSignature.InheritableMemberSignatureCompare): Added support
17140         for properties.
17141
17142 2002-11-13  Ravi Pratap  <ravi@ximian.com>
17143
17144         * attribute.cs (Attribute.Resolve): Catch the
17145         NullReferenceException and report it since it isn't supposed to
17146         happen. 
17147
17148 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
17149
17150         * expression.cs (Binary.EmitBranchable): Also handle the cases for
17151         LogicalOr and LogicalAnd that can benefit from recursively
17152         handling EmitBranchable.  The code now should be nice for Paolo.
17153
17154 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
17155
17156         * typemanager.cs (LookupType): Added a negative-hit hashtable for
17157         the Type lookups, as we perform quite a number of lookups on
17158         non-Types.  This can be removed once we can deterministically tell
17159         whether we have a type or a namespace in advance.
17160
17161         But this might require special hacks from our corlib.
17162
17163         * TODO: updated.
17164
17165         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
17166         and double which avoids a conversion from an integer to a double.
17167
17168         * expression.cs: tiny optimization, avoid calling IsConstant,
17169         because it effectively performs the lookup twice.
17170
17171 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
17172
17173         But a bogus return here to keep the semantics of the old code
17174         until the Mono runtime is fixed.
17175
17176         * pending.cs (GetMissingInterfaces): New method used to remove all
17177         the interfaces that are already implemented by our parent
17178         classes from the list of pending methods. 
17179
17180         * interface.cs: Add checks for calls after ResolveTypeExpr.
17181
17182 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
17183
17184         * class.cs (Class.Emit): Report warning 67: event not used if the
17185         warning level is beyond 3.
17186
17187         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
17188         being a NullLiteral.
17189
17190         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
17191         specifiers. 
17192
17193         * class.cs (TypeContainer.GetClassBases): Cover a missing code
17194         path that might fail if a type can not be resolved.
17195
17196         * expression.cs (Binary.Emit): Emit unsigned versions of the
17197         operators. 
17198
17199         * driver.cs: use error 5.
17200
17201 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
17202
17203         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
17204
17205 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
17206
17207         * cs-parser.jay (switch_section): A beautiful patch from Martin
17208         Baulig that fixed 33094.
17209
17210 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
17211
17212         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
17213         Check whether the base is abstract and report an error if so.
17214
17215         * expression.cs (IndexerAccess.DoResolveLValue,
17216         IndexerAccess.DoResolve): ditto. 
17217
17218         (Invocation.DoResolve): ditto.
17219
17220         (Invocation.FullMethodDesc): Improve the report string.
17221
17222         * statement.cs (Block): Eliminate IsVariableDefined as it is
17223         basically just a wrapper for GetVariableInfo.
17224
17225         * ecore.cs (SimpleName): Use new 
17226
17227         * support.cs (ReflectionParamter.ParameterType): We unwrap the
17228         type, as we return the actual parameter ref/unref state on a
17229         different call.
17230
17231 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
17232
17233         * support.cs: Return proper flags REF/OUT fixing the previous
17234         commit.  
17235
17236         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
17237         not used to mean `ref' but `ref or out' in ParameterReference
17238
17239         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
17240         full type signature instead of calling TypeManger.CSharpName
17241         ourselves. 
17242
17243         * support.cs (InternalParameters.ParameterDesc): Do not compare
17244         directly to the modflags, because REF/OUT will actually be bitsets
17245         if set. 
17246
17247         * delegate.cs (VerifyMethod): Check also the modifiers.
17248
17249         * cs-tokenizer.cs: Fix bug where floating point values with an
17250         exponent where a sign was missing was ignored.
17251
17252         * driver.cs: Allow multiple assemblies to be specified in a single
17253         /r: argument
17254
17255 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
17256
17257         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
17258         because identifiers after a parenthesis would end up in this kind
17259         of production, and we needed to desamiguate it for having casts
17260         like:
17261
17262                 (UserDefinedType *) xxx
17263
17264 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
17265
17266         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
17267         we should set on the Bindingflags.NonPublic, but not turn on
17268         private_ok.  private_ok controls whether a Private member is
17269         returned (this is chekced on the filter routine), while the
17270         BindingFlags.NonPublic just controls whether private/protected
17271         will be allowed.   This fixes the problem part of the problem of
17272         private properties being allowed to be used in derived classes.
17273
17274         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
17275         so we can call the children DoResolveLValue method (this will
17276         properly signal errors on lvalue assignments to base properties)
17277
17278         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
17279         getter are null, and we have a property info, we know that this
17280         happened because the lookup failed, so we report an error 122 for
17281         protection level violation.
17282
17283         We also silently return if setter and getter are null in the
17284         resolve functions, this condition only happens if we have flagged
17285         the error before.  This is the other half of the problem. 
17286
17287         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
17288         not have accessibility information, that is why we were returning
17289         true in the filter function in typemanager.cs.
17290
17291         To properly report 122 (property is inaccessible because of its
17292         protection level) correctly, we report this error in ResolveAccess
17293         by failing if both the setter and the getter are lacking (ie, the
17294         lookup failed). 
17295
17296         DoResolve and DoLResolve have been modified to check for both
17297         setter/getter being null and returning silently, the reason being
17298         that I did not want to put the knowledge about this error in upper
17299         layers, like:
17300
17301         int old = Report.Errors;
17302         x = new PropertyExpr (...);
17303         if (old != Report.Errors)
17304                 return null;
17305         else
17306                 return x;
17307
17308         So the property expr is returned, but it is invalid, so the error
17309         will be flagged during the resolve process. 
17310
17311         * class.cs: Remove InheritablePropertySignatureCompare from the
17312         class, as we no longer depend on the property signature to compute
17313         whether it is possible to implement a method or not.
17314
17315         The reason is that calling PropertyInfo.GetGetMethod will return
17316         null (in .NET, in Mono it works, and we should change this), in
17317         cases where the Get Method does not exist in that particular
17318         class.
17319
17320         So this code:
17321
17322         class X { public virtual int A { get { return 1; } } }
17323         class Y : X { }
17324         class Z : Y { public override int A { get { return 2; } } }
17325
17326         Would fail in Z because the parent (Y) would not have the property
17327         defined.  So we avoid this completely now (because the alternative
17328         fix was ugly and slow), and we now depend exclusively on the
17329         method names.
17330
17331         (PropertyBase.CheckBase): Use a method-base mechanism to find our
17332         reference method, instead of using the property.
17333
17334         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
17335         routines are gone now.
17336
17337         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
17338         names, they were incorrectly named.
17339
17340         * cs-tokenizer.cs: Return are more gentle token on failure. 
17341
17342         * pending.cs (PendingImplementation.InterfaceMethod): This routine
17343         had an out-of-sync index variable, which caused it to remove from
17344         the list of pending methods the wrong method sometimes.
17345
17346 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
17347
17348         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
17349         CanWrite, because those refer to this particular instance of the
17350         property, and do not take into account the fact that we can
17351         override single members of a property.
17352
17353         Constructor requires an EmitContext.  The resolution process does
17354         not happen here, but we need to compute the accessors before,
17355         because the resolution does not always happen for properties.
17356
17357         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
17358         subclass, before we did not update this flag, but we did update
17359         bindingflags. 
17360
17361         (GetAccessors): Drop this routine, as it did not work in the
17362         presence of partially overwritten set/get methods. 
17363
17364         Notice that this broke the cs1540 detection, but that will require
17365         more thinking. 
17366
17367 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17368
17369         * class.cs:
17370         * codegen.cs:
17371         * driver.cs: issue a warning instead of an error if we don't support
17372         debugging for the platform. Also ignore a couple of errors that may
17373         arise when trying to write the symbols. Undo my previous patch.
17374
17375 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17376
17377         * driver.cs: ignore /debug switch except for Unix platforms.
17378
17379 2002-10-23  Nick Drochak  <ndrochak@gol.com>
17380
17381         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
17382
17383 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
17384
17385         * driver.cs: Do not make mcs-debug conditional, so we do not break
17386         builds that use it.
17387
17388         * statement.cs (UsageVector.MergeChildren): I would like Martin to
17389         review this patch.  But basically after all the children variables
17390         have been merged, the value of "Breaks" was not being set to
17391         new_breaks for Switch blocks.  I think that it should be set after
17392         it has executed.  Currently I set this to the value of new_breaks,
17393         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
17394         conservative, but I do not understand this code very well.
17395
17396         I did not break anything in the build, so that is good ;-)
17397
17398         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
17399
17400 2002-10-20  Mark Crichton  <crichton@gimp.org>
17401
17402         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
17403
17404 2002-10-20  Nick Drochak  <ndrochak@gol.com>
17405
17406         * cfold.cs: Fixed compile blocker.
17407
17408 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
17409
17410         * driver.cs: I was chekcing the key, not the file.
17411
17412 2002-10-19  Ravi Pratap  <ravi@ximian.com>
17413
17414         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
17415         message that we were generating - we just need to silently return
17416         a null.
17417
17418 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
17419
17420         * class.cs (Event.Define): Change my previous commit, as this
17421         breaks the debugger.  This is a temporary hack, as it seems like
17422         the compiler is generating events incorrectly to begin with.
17423
17424         * expression.cs (Binary.ResolveOperator): Added support for 
17425         "U operator - (E x, E y)"
17426
17427         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
17428         y)".
17429
17430         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
17431         init-only variables, but this path did not take into account that
17432         there might be also instance readonly variables.  Correct this
17433         problem. 
17434
17435         This fixes bug 32253
17436
17437         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
17438         delegates as well.
17439
17440         * driver.cs: Change the extension for modules to `netmodule'
17441
17442         * cs-parser.jay: Improved slightly the location tracking for
17443         the debugger symbols.
17444
17445         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
17446         modifiers that were specified instead of the hardcoded value
17447         (FamAndAssem).  This was basically ignoring the static modifier,
17448         and others.  Fixes 32429.
17449
17450         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
17451         fixed a bug in the process (32476)
17452
17453         * expression.cs (ArrayAccess.EmitAssign): Patch from
17454         hwang_rob@yahoo.ca that fixes bug 31834.3
17455
17456 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
17457
17458         * driver.cs: Make the module extension .netmodule.
17459
17460 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
17461
17462         * driver.cs: Report an error if the resource file is not found
17463         instead of crashing.
17464
17465         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
17466         false, like Emit does.
17467
17468 2002-10-16  Nick Drochak  <ndrochak@gol.com>
17469
17470         * typemanager.cs: Remove unused private member.  Also reported mcs
17471         bug to report this as a warning like csc.
17472
17473 2002-10-15  Martin Baulig  <martin@gnome.org>
17474
17475         * statement.cs (Statement.Emit): Made this a virtual method; emits
17476         the line number info and calls DoEmit().
17477         (Statement.DoEmit): New protected abstract method, formerly knows
17478         as Statement.Emit().
17479
17480         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
17481
17482 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
17483
17484         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
17485         have fixed a remaining problem: not every AddXXXX was adding a
17486         fully qualified name.  
17487
17488         Now everyone registers a fully qualified name in the DeclSpace as
17489         being defined instead of the partial name.  
17490
17491         Downsides: we are slower than we need to be due to the excess
17492         copies and the names being registered this way.  
17493
17494         The reason for this is that we currently depend (on the corlib
17495         bootstrap for instance) that types are fully qualified, because
17496         we dump all the types in the namespace, and we should really have
17497         types inserted into the proper namespace, so we can only store the
17498         basenames in the defined_names array.
17499
17500 2002-10-10  Martin Baulig  <martin@gnome.org>
17501
17502         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
17503         from bug #31834, see the bug report for a testcase which is
17504         miscompiled.
17505
17506 2002-10-10  Martin Baulig  <martin@gnome.org>
17507
17508         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
17509         flow analysis code for this.
17510
17511         * statement.cs (Do, While, For): Tell the flow analysis code about
17512         infinite loops.
17513         (FlowBranching.UsageVector): Added support for infinite loops.
17514         (Block.Resolve): Moved the dead code elimination here and use flow
17515         analysis to do it.
17516
17517 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
17518
17519         * class.cs (Field.Define): Catch cycles on struct type
17520         definitions. 
17521
17522         * typemanager.cs (IsUnmanagedtype): Do not recursively check
17523         fields if the fields are static.  We only need to check instance
17524         fields. 
17525
17526         * expression.cs (As.DoResolve): Test for reference type.
17527
17528         * statement.cs (Using.ResolveExpression): Use
17529         ConvertImplicitRequired, not ConvertImplicit which reports an
17530         error on failture
17531         (Using.ResolveLocalVariableDecls): ditto.
17532
17533         * expression.cs (Binary.ResolveOperator): Report errors in a few
17534         places where we had to.
17535
17536         * typemanager.cs (IsUnmanagedtype): Finish implementation.
17537
17538 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
17539
17540         * expression.cs: Use StoreFromPtr instead of extracting the type
17541         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
17542
17543         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
17544         an enumeration value to a System.Enum, but System.Enum is not a
17545         value type, but an class type, so we need to box.
17546
17547         (Expression.ConvertExplicit): One codepath could return
17548         errors but not flag them.  Fix this.  Fixes #31853
17549
17550         * parameter.cs (Resolve): Do not allow void as a parameter type.
17551
17552 2002-10-06  Martin Baulig  <martin@gnome.org>
17553
17554         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
17555         if it's a class type and not a struct.  Fixes #31815.
17556
17557 2002-10-06  Martin Baulig  <martin@gnome.org>
17558
17559         * statement.cs: Reworked the flow analysis code a bit to make it
17560         usable for dead code elimination.
17561
17562 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17563
17564         * cs-parser.jay: allow empty source files. Fixes bug #31781.
17565
17566 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17567
17568         * expression.cs (ComposedCast.DoResolveType): A quick workaround
17569         to fix the test 165, will investigate deeper.
17570
17571 2002-10-04  Martin Baulig  <martin@gnome.org>
17572
17573         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
17574         finally blocks actually work.
17575         (Try.Resolve): We don't need to create a sibling for `finally' if
17576         there is no finally block.
17577
17578 2002-10-04  Martin Baulig  <martin@gnome.org>
17579
17580         * class.cs (Constructor.Define): The default accessibility for a
17581         non-default constructor is private, not public.
17582
17583 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17584
17585         * class.cs (Constructor): Make AllowedModifiers public, add
17586         EXTERN.
17587
17588         * cs-parser.jay: Perform the modifiers test here, as the
17589         constructor for the Constructor class usually receives a zero
17590         because of the way we create it (first we create, later we
17591         customize, and we were never checking the modifiers).
17592
17593         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
17594         is a version of LookupTypeReflection that includes the type-name
17595         cache.  This can be used as a fast path for functions that know
17596         the fully qualified name and are only calling into *.GetType() to
17597         obtain a composed type.
17598
17599         This is also used by TypeManager.LookupType during its type
17600         composition.
17601
17602         (LookupType): We now also track the real type name, as sometimes
17603         we can get a quey for the real type name from things like
17604         ComposedCast.  This fixes bug 31422.
17605
17606         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
17607         complete type fullname, it does not have to go through the type
17608         resolution system to obtain the composed version of the type (for
17609         obtaining arrays or pointers).
17610
17611         (Conditional.Emit): Use the EmitBoolExpression to
17612         generate nicer code, as requested by Paolo.
17613
17614         (ArrayCreation.CheckIndices): Use the patch from
17615         hwang_rob@yahoo.ca to validate the array initializers. 
17616
17617 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
17618
17619         * class.cs (ConstructorInitializer.Emit): simplify code by using
17620         Invocation.EmitCall, and at the same time, fix the bugs in calling
17621         parent constructors that took variable arguments. 
17622
17623         * ecore.cs (Expression.ConvertNumericExplicit,
17624         Expression.ImplicitNumericConversion): Remove the code that
17625         manually wrapped decimal (InternalTypeConstructor call is now gone
17626         as well).
17627
17628         * expression.cs (Cast.TryReduce): Also handle decimal types when
17629         trying to perform a constant fold on the type.
17630
17631         * typemanager.cs (IsUnmanagedtype): Partially implemented.
17632
17633         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17634         that only turned off an error report, and did nothing else. 
17635
17636 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
17637
17638         * driver.cs: Handle and ignore /fullpaths
17639
17640 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
17641
17642         * expression.cs (Binary.ResolveOperator): Catch the case where
17643         DoNumericPromotions returns true, 
17644
17645         (Binary.DoNumericPromotions): Simplify the code, and the tests.
17646
17647 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
17648
17649         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17650         report error 70.
17651
17652 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
17653
17654         * ecore.cs (ConvertNumericExplicit): It is not enough that the
17655         conversion exists, but it is also required that the conversion be
17656         performed.  This manifested in "(Type64Enum) 2".  
17657
17658         * class.cs (TypeManager.AddMethod): The fix is not to change
17659         AddEnum, because that one was using a fully qualified name (every
17660         DeclSpace derivative does), but to change the AddMethod routine
17661         that was using an un-namespaced name.  This now correctly reports
17662         the duplicated name.
17663
17664         Revert patch until I can properly fix it.  The issue
17665         is that we have a shared Type space across all namespaces
17666         currently, which is wrong.
17667
17668         Options include making the Namespace a DeclSpace, and merge
17669         current_namespace/current_container in the parser.
17670
17671 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
17672
17673         * cs-parser.jay: Improve error reporting when we get a different
17674         kind of expression in local_variable_type and
17675         local_variable_pointer_type. 
17676
17677         Propagate this to avoid missleading errors being reported.
17678
17679         * ecore.cs (ImplicitReferenceConversion): treat
17680         TypeManager.value_type as a target just like object_type.   As
17681         code like this:
17682
17683         ValueType v = 1;
17684
17685         Is valid, and needs to result in the int 1 being boxed before it
17686         is assigned to the value type v.
17687
17688         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17689         to validate the enumeration name.
17690
17691         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17692         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
17693         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17694
17695         * ecore.cs (TryImplicitIntConversion): When doing an
17696         implicit-enumeration-conversion, check if the type is 64-bits and
17697         perform a conversion before passing to EnumConstant.
17698
17699 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
17700
17701         * decl.cs (Error_AmbiguousTypeReference); New routine used to
17702         report ambiguous type references.  Unlike the MS version, we
17703         report what the ambiguity is.   Innovation at work ;-)
17704
17705         (DeclSpace.FindType): Require a location argument to
17706         display when we display an ambiguous error.
17707
17708         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17709
17710         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17711
17712         * expression.cs (EmitDynamicInitializers): Apply patch from
17713         hwang_rob@yahoo.ca that fixes the order in which we emit our
17714         initializers. 
17715
17716 2002-09-21  Martin Baulig  <martin@gnome.org>
17717
17718         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17719         delegate takes no arguments.
17720
17721 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
17722
17723         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17724         from integers.
17725
17726         * expression.cs: Extract the underlying type.
17727
17728         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17729
17730         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17731
17732 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
17733
17734         * class.cs (TypeContainer.DefineType): We can not use the nice
17735         PackingSize with the size set to 1 DefineType method, because it
17736         will not allow us to define the interfaces that the struct
17737         implements.
17738
17739         This completes the fixing of bug 27287
17740
17741         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17742         means also structs.  This fixes part of the problem. 
17743         (Expresion.ImplicitReferenceConversionExists): ditto.
17744
17745         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17746         error if there were no errors reported during the type lookup
17747         process, to avoid duplicates or redundant errors.  Without this
17748         you would get an ambiguous errors plus a type not found.  We have
17749         beaten the user enough with the first error.  
17750
17751         (DeclSparce.FindType): Emit a warning if we have an ambiguous
17752         reference. 
17753
17754         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17755         during the resolution process, stop the lookup, this avoids
17756         repeated error reports (same error twice).
17757
17758         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17759
17760         * typemanager.cs (LookupType): Redo the type lookup code to match
17761         the needs of System.Reflection.  
17762
17763         The issue is that System.Reflection requires references to nested
17764         types to begin with a "+" sign instead of a dot.  So toplevel
17765         types look like: "NameSpace.TopLevelClass", and nested ones look
17766         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17767         levels. 
17768
17769 2002-09-19  Martin Baulig  <martin@gnome.org>
17770
17771         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17772         says that a method always returns or always throws an exception,
17773         don't report the CS0161.
17774
17775         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17776         set `Returns = new_returns'.
17777
17778 2002-09-19  Martin Baulig  <martin@gnome.org>
17779
17780         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17781         to an enum constant, check for a CS0176.
17782
17783 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
17784
17785         * class.cs (TypeContainer.CheckPairedOperators): Now we check
17786         for operators that must be in pairs and report errors.
17787
17788         * ecore.cs (SimpleName.DoResolveType): During the initial type
17789         resolution process, when we define types recursively, we must
17790         check first for types in our current scope before we perform
17791         lookups in the enclosing scopes.
17792
17793         * expression.cs (MakeByteBlob): Handle Decimal blobs.
17794
17795         (Invocation.VerifyArgumentsCompat): Call
17796         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17797         I thought we were supposed to always call this, but there are a
17798         few places in the code where we dont do it.
17799
17800 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
17801
17802         * driver.cs: Add support in -linkres and -resource to specify the
17803         name of the identifier.
17804
17805 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17806
17807         * ecore.cs (StandardConversionExists): Sync with the conversion
17808         code: allow anything-* to void* conversions.
17809
17810         (FindMostSpecificSource): Use an Expression argument
17811         instead of a Type, because we might be handed over a Literal which
17812         gets a few more implicit conversions that plain types do not.  So
17813         this information was being lost.
17814
17815         Also, we drop the temporary type-holder expression when not
17816         required.
17817
17818 2002-09-17  Martin Baulig  <martin@gnome.org>
17819
17820         * class.cs (PropertyBase.CheckBase): Don't check the base class if
17821         this is an explicit interface implementation.
17822
17823 2002-09-17  Martin Baulig  <martin@gnome.org>
17824
17825         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17826         different `IndexerName' attributes.
17827
17828         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17829         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17830         virtual CommonResolve().
17831
17832 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17833
17834         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17835         and convert that to the UnderlyingType.
17836
17837         * statement.cs (Foreach.Resolve): Indexers are just like variables
17838         or PropertyAccesses.
17839
17840         * cs-tokenizer.cs (consume_string): Track line numbers and columns
17841         inside quoted strings, we were not doing this before.
17842
17843 2002-09-16  Martin Baulig  <martin@gnome.org>
17844
17845         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17846         resolve it.  This is needed for the definite assignment check of the
17847         instance expression, fixes bug #29846.
17848         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17849
17850 2002-09-16  Nick Drochak  <ndrochak@gol.com>
17851
17852         * parameter.cs: Fix compile error.  Cannot reference static member
17853         from an instance object.  Is this an mcs bug?
17854
17855 2002-09-14  Martin Baulig  <martin@gnome.org>
17856
17857         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17858         multiple times.  Fixes bug #30295, added test-166.cs.
17859
17860 2002-09-14  Martin Baulig  <martin@gnome.org>
17861
17862         * statement.cs (Block.Emit): Don't emit unreachable code.
17863         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17864         `break' statements.
17865         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17866
17867 2002-09-14  Martin Baulig  <martin@gnome.org>
17868
17869         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17870         is set.
17871
17872 2002-09-14  Martin Baulig  <martin@gnome.org>
17873
17874         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17875         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17876         be false on the ms runtime.
17877
17878 2002-09-13  Martin Baulig  <martin@gnome.org>
17879
17880         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17881         the CS0038 error message.
17882
17883 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
17884
17885         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17886         constant inside, return it.
17887
17888 2002-09-12  Martin Baulig  <martin@gnome.org>
17889
17890         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17891         implicit conversion can be done between enum types.
17892
17893         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17894         check whether an implicit conversion to the current enum's UnderlyingType
17895         exists and report an error if not.
17896
17897         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17898         without debugging support.
17899
17900         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17901         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
17902
17903 2002-09-12  Martin Baulig  <martin@gnome.org>
17904
17905         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17906
17907         * ecore.cs (IMemberExpr.DeclaringType): New property.
17908         (SimpleName.SimpleNameResolve): Check whether we're accessing a
17909         nonstatic member of an outer type (CS0038).
17910
17911 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
17912
17913         * driver.cs: Activate the using-error detector at warning level
17914         4 (at least for MS-compatible APIs).
17915
17916         * namespace.cs (VerifyUsing): Small buglett fix.
17917
17918         * pending.cs (PendingImplementation): pass the container pointer. 
17919
17920         * interface.cs (GetMethods): Allow for recursive definition.  Long
17921         term, I would like to move every type to support recursive
17922         definitions, not the current ordering mechanism that we have right
17923         now.
17924
17925         The situation is this: Attributes are handled before interfaces,
17926         so we can apply attributes to interfaces.  But some attributes
17927         implement interfaces, we will now handle the simple cases
17928         (recursive definitions will just get an error).  
17929
17930         * parameter.cs: Only invalidate types at the end if we fail to
17931         lookup all types.  
17932
17933 2002-09-09  Martin Baulig  <martin@gnome.org>
17934
17935         * ecore.cs (PropertyExpr.Emit): Also check for
17936         TypeManager.system_int_array_get_length so this'll also work when
17937         compiling corlib.  Fixes #30003.
17938
17939 2002-09-09  Martin Baulig  <martin@gnome.org>
17940
17941         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17942         and throw an exception if we can't get the type's size.  Fixed #30040,
17943         added test-165.cs.
17944
17945 2002-09-09  Martin Baulig  <martin@gnome.org>
17946
17947         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17948
17949         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17950         context.  Fixes bug #30027.
17951
17952         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17953         virtual functions.  Fixes bug #30043, added test-164.cs.
17954
17955 2002-09-08  Ravi Pratap  <ravi@ximian.com>
17956
17957         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17958
17959 2002-09-08  Nick Drochak  <ndrochak@gol.com>
17960
17961         * driver.cs: Use an object to get the windows codepage since it's not a
17962         static property.
17963
17964 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
17965
17966         * statement.cs (For.Emit): for infinite loops (test == null)
17967         return whether there is a break inside, not always "true".
17968
17969         * namespace.cs (UsingEntry): New struct to hold the name of the
17970         using definition, the location where it is defined, and whether it
17971         has been used in a successful type lookup.
17972
17973         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17974         strings.
17975
17976         * decl.cs: ditto.
17977
17978 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17979
17980         * attribute.cs : Fix incorrect code which relied on catching
17981         a NullReferenceException to detect a null being passed in
17982         where an object was expected.
17983
17984 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
17985
17986         * statement.cs (Try): flag the catch variable as assigned
17987
17988         * expression.cs (Cast): Simplified by using ResolveType instead of
17989         manually resolving.
17990
17991         * statement.cs (Catch): Fix bug by using ResolveType.
17992
17993 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17994
17995         * expression.cs (BetterConversion): Special case for when we have
17996         a NullLiteral as the argument and we have to choose between string
17997         and object types - we choose string the way csc does.
17998
17999         * attribute.cs (Attribute.Resolve): Catch the
18000         NullReferenceException and report error #182 since the Mono
18001         runtime no more has the bug and having this exception raised means
18002         we tried to select a constructor which takes an object and is
18003         passed a null.
18004
18005 2002-09-05  Ravi Pratap  <ravi@ximian.com>
18006
18007         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
18008         message (1502, 1503) when we can't locate a method after overload
18009         resolution. This is much more informative and closes the bug
18010         Miguel reported.
18011
18012         * interface.cs (PopulateMethod): Return if there are no argument
18013         types. Fixes a NullReferenceException bug.
18014
18015         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
18016         expressions too. Previously we were checking only in one place for
18017         positional arguments leaving out named arguments.
18018
18019         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
18020         type to the enum type is not allowed. Remove code corresponding to
18021         that.
18022
18023         (ConvertNumericExplicit): Allow explicit conversions from
18024         the underlying type to enum type. This precisely follows the spec
18025         and closes a bug filed by Gonzalo.
18026
18027 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18028
18029         * compiler.csproj:
18030         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
18031
18032 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
18033
18034         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
18035         it was important that we stored the right value after the
18036         reduction in `converted'.
18037
18038 2002-09-04  Martin Baulig  <martin@gnome.org>
18039
18040         * location.cs (Location.SymbolDocument): Use full pathnames for the
18041         source files.
18042
18043 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
18044
18045         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
18046         of the expression resolve mechanism, because that will catch the
18047         SimpleName error failures.
18048
18049         (Conditional): If we can not resolve the
18050         expression, return, do not crash.
18051
18052 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18053
18054         * cs-tokenizer.cs:
18055         (location): display token name instead of its number.
18056
18057 2002-08-28  Martin Baulig  <martin@gnome.org>
18058
18059         * expression.cs (Binary.ResolveOperator): Don't silently return
18060         but return an error if an operator cannot be applied between two
18061         enum types.
18062
18063 2002-08-28  Martin Baulig  <martin@gnome.org>
18064
18065         * class.cs (Constructor.Define): Set the permission attributes
18066         correctly instead of making all constructors public.
18067
18068 2002-08-28  Martin Baulig  <martin@gnome.org>
18069
18070         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
18071         for private members before reporting a CS0103; if we find anything,
18072         it's a CS0122.
18073
18074 2002-08-28  Martin Baulig  <martin@gnome.org>
18075
18076         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
18077         to check whether `closure_start_type == closure_invocation_type',
18078         we also need to check whether `m.DeclaringType == closure_invocation_type'
18079         before bypassing the permission checks.  We might be accessing
18080         protected/private members from the base class.
18081         (TypeManager.RealMemberLookup): Only set private_ok if private
18082         members were requested via BindingFlags.NonPublic.
18083
18084         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
18085
18086         * expression.cs (MemberAccess.ResolveMemberAccess): Set
18087         MethodGroupExpr.IsExplicitImpl if appropriate.
18088         (Invocation.DoResolve): Don't report the CS0120 for explicit
18089         interface implementations.
18090
18091 2002-08-27  Martin Baulig  <martin@gnome.org>
18092
18093         * expression.cs (Invocation.DoResolve): If this is a static
18094         method and we don't have an InstanceExpression, we must report
18095         a CS0120.
18096
18097 2002-08-25  Martin Baulig  <martin@gnome.org>
18098
18099         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
18100         `==' between a valuetype and an object.
18101
18102 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
18103
18104         * ecore.cs (TypeExpr): Provide a ToString method.
18105
18106 2002-08-24  Martin Baulig  <martin@gnome.org>
18107
18108         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
18109         now called proggie.dbg and it's a binary file.
18110
18111 2002-08-23  Martin Baulig  <martin@gnome.org>
18112
18113         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
18114
18115 2002-08-23  Martin Baulig  <martin@gnome.org>
18116
18117         * struct.cs (MyStructInfo.ctor): Make this work with empty
18118         structs; it's not allowed to use foreach() on null.
18119
18120 2002-08-23  Martin Baulig  <martin@gnome.org>
18121
18122         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
18123         writer the full pathname of the generated assembly.
18124
18125 2002-08-23  Martin Baulig  <martin@gnome.org>
18126
18127         * statements.cs (FlowBranching.UsageVector.MergeChildren):
18128         A `finally' block never returns or breaks; improved handling of
18129         unreachable code.
18130
18131 2002-08-23  Martin Baulig  <martin@gnome.org>
18132
18133         * statement.cs (Throw.Resolve): Allow `throw null'.
18134
18135 2002-08-23  Martin Baulig  <martin@gnome.org>
18136
18137         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
18138         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
18139         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
18140         MemberLookup would return a wrong event if this is an explicit
18141         interface implementation and the class has an event with the same
18142         name.
18143
18144 2002-08-23  Martin Baulig  <martin@gnome.org>
18145
18146         * statement.cs (Block.AddChildVariableNames): New public method.
18147         (Block.AddChildVariableName): Likewise.
18148         (Block.IsVariableNameUsedInChildBlock): Likewise.
18149         (Block.AddVariable): Check whether a variable name has already
18150         been used in a child block.
18151
18152         * cs-parser.jay (declare_local_variables): Mark all variable names
18153         from the current block as being used in a child block in the
18154         implicit block.
18155
18156 2002-08-23  Martin Baulig  <martin@gnome.org>
18157
18158         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
18159         find the symbol writer.
18160
18161         * driver.cs: csc also allows the arguments to /define being
18162         separated by commas, not only by semicolons.
18163
18164 2002-08-23  Martin Baulig  <martin@gnome.org>
18165
18166         * interface.cs (Interface.GetMembers): Added static check for events.
18167
18168 2002-08-15  Martin Baulig  <martin@gnome.org>
18169
18170         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
18171         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
18172
18173         * ecore.cs (Expression.MemberLookup): Added documentation and explained
18174         why the MethodData.EmitDestructor() change was necessary.
18175
18176 2002-08-20  Martin Baulig  <martin@gnome.org>
18177
18178         * class.cs (TypeContainer.FindMembers): Added static check for events.
18179
18180         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
18181
18182         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
18183         use Type.GetEvents(), not Type.FindMembers().
18184
18185 2002-08-20  Martin Baulig  <martin@gnome.org>
18186
18187         * decl.cs (MemberCache): Added a special method cache which will
18188         be used for method-only searched.  This ensures that a method
18189         search will return a MethodInfo with the correct ReflectedType for
18190         inherited methods.      
18191
18192 2002-08-20  Martin Baulig  <martin@gnome.org>
18193
18194         * decl.cs (DeclSpace.FindMembers): Made this public.
18195
18196 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18197
18198         * delegate.cs: fixed build on windows.
18199         [FIXME:  Filed as bug #29150: MCS must report these errors.]
18200
18201 2002-08-19  Ravi Pratap  <ravi@ximian.com>
18202
18203         * ecore.cs (StandardConversionExists): Return a false
18204         if we are trying to convert the void type to anything else
18205         since that is not allowed.
18206
18207         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
18208         we flag error 70 in the event an event is trying to be accessed
18209         directly from outside the declaring type.
18210
18211 2002-08-20  Martin Baulig  <martin@gnome.org>
18212
18213         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
18214         MemberCache from typemanager.cs to decl.cs.
18215
18216 2002-08-19  Martin Baulig  <martin@gnome.org>
18217
18218         * class.cs (TypeContainer): Implement IMemberContainer.
18219         (TypeContainer.DefineMembers): Create the MemberCache.
18220         (TypeContainer.FindMembers): Do better BindingFlags checking; only
18221         return public members if BindingFlags.Public was given, check
18222         whether members are static.
18223
18224 2002-08-16  Martin Baulig  <martin@gnome.org>
18225
18226         * decl.cs (DeclSpace.Define): Splitted this in Define and
18227         DefineMembers.  DefineMembers is called first and initializes the
18228         MemberCache.
18229
18230         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
18231         DefineMembers() on all our DeclSpaces.
18232
18233         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
18234         but call DefineMembers() on all nested interfaces.  We call their
18235         Define() in our new Define() function.
18236
18237         * interface.cs (Interface): Implement IMemberContainer.
18238         (Interface.Define): Moved all code except the attribute stuf to
18239         DefineMembers().
18240         (Interface.DefineMembers): Initialize the member cache.
18241
18242         * typemanager.cs (IMemberFinder): Removed this interface, we don't
18243         need this anymore since we can use MemberCache.FindMembers directly.
18244
18245 2002-08-19  Martin Baulig  <martin@gnome.org>
18246
18247         * typemanager.cs (MemberCache): When creating the cache for an
18248         interface type, add all inherited members.
18249         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
18250         to `out bool used_cache' and documented it.
18251         (TypeManager.MemberLookup): If we already used the cache in the first
18252         iteration, we don't need to do the interfaces check.
18253
18254 2002-08-19  Martin Baulig  <martin@gnome.org>
18255
18256         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
18257         here from IMemberFinder and don't implement this interface anymore.
18258         (DeclSpace.MemberCache): Moved here from IMemberFinder.
18259
18260         * typemanager.cs (IMemberFinder): This interface is now only used by
18261         classes which actually support the member cache.
18262         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
18263         since we only put DeclSpaces into this Hashtable.
18264         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
18265         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
18266
18267 2002-08-16  Martin Baulig  <martin@gnome.org>
18268
18269         * typemanager.cs (ICachingMemberFinder): Removed.
18270         (IMemberFinder.MemberCache): New property.
18271         (TypeManager.FindMembers): Merged this with RealFindMembers().
18272         This function will never be called from TypeManager.MemberLookup()
18273         so we can't use the cache here, just the IMemberFinder.
18274         (TypeManager.MemberLookup_FindMembers): Check whether the
18275         IMemberFinder has a MemberCache and call the cache's FindMembers
18276         function.
18277         (MemberCache): Rewrote larger parts of this yet another time and
18278         cleaned it up a bit.
18279
18280 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
18281
18282         * driver.cs (LoadArgs): Support quoting.
18283
18284         (Usage): Show the CSC-like command line arguments.
18285
18286         Improved a few error messages.
18287
18288 2002-08-15  Martin Baulig  <martin@gnome.org>
18289
18290         * typemanager.cs (IMemberContainer.Type): New property.
18291         (IMemberContainer.IsInterface): New property.
18292
18293         The following changes are conditional to BROKEN_RUNTIME, which is
18294         defined at the top of the file.
18295
18296         * typemanager.cs (MemberCache.MemberCache): Don't add the base
18297         class'es members, but add all members from TypeHandle.ObjectType
18298         if we're an interface.
18299         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
18300         is the current type.
18301         (MemberCache.CacheEntry.Container): Removed this field.
18302         (TypeHandle.GetMembers): Include inherited members.
18303
18304 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18305
18306         * typemanager.cs: fixed compilation and added a comment on a field that
18307         is never used.
18308
18309 2002-08-15  Martin Baulig  <martin@gnome.org>
18310
18311         * class.cs (ConstructorInitializer.Resolve): In the
18312         Expression.MemberLookup call, use the queried_type as
18313         invocation_type.
18314
18315         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
18316         declared' attribute, it's always true.
18317         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
18318         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
18319         temporary wrapper for FindMembers which tells MemberLookup whether
18320         members from the base classes are included in the return value.
18321         This will go away soon.
18322         (TypeManager.MemberLookup): Use this temporary hack here; once the
18323         new MemberCache is completed, we don't need to do the DeclaredOnly
18324         looping here anymore since the MemberCache will take care of this.
18325         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
18326         (MemberCache): When creating the MemberCache for a class, get
18327         members from the current class and all its base classes.
18328         (MemberCache.CacheEntry.Container): New field.  This is a
18329         temporary hack until the Mono runtime is fixed to distinguish
18330         between ReflectedType and DeclaringType.  It allows us to use MCS
18331         with both the MS runtime and the unfixed Mono runtime without
18332         problems and without accecting performance.
18333         (MemberCache.SearchMembers): The DeclaredOnly looping from
18334         TypeManager.MemberLookup is now done here.      
18335
18336 2002-08-14  Martin Baulig  <martin@gnome.org>
18337
18338         * statement.cs (MyStructInfo.MyStructInfo): Don't call
18339         Type.GetFields on dynamic types but get the fields from the
18340         corresponding TypeContainer.
18341         (MyStructInfo.GetStructInfo): Added check for enum types.
18342
18343         * typemanager.cs (MemberList.IsSynchronized): Implemented.
18344         (MemberList.SyncRoot): Implemented.
18345         (TypeManager.FilterWithClosure): No need to check permissions if
18346         closure_start_type == closure_invocation_type, don't crash if
18347         closure_invocation_type is null.
18348
18349 2002-08-13  Martin Baulig  <martin@gnome.org>
18350
18351         Rewrote TypeContainer.FindMembers to use a member cache.  This
18352         gives us a speed increase of about 35% for the self-hosting MCS
18353         build and of about 15-20% for the class libs (both on GNU/Linux).
18354
18355         * report.cs (Timer): New class to get enhanced profiling.  This
18356         whole class is "TIMER" conditional since it remarkably slows down
18357         compilation speed.
18358
18359         * class.cs (MemberList): New class.  This is an IList wrapper
18360         which we're now using instead of passing MemberInfo[]'s around to
18361         avoid copying this array unnecessarily.
18362         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
18363         (ICachingMemberFinder, IMemberContainer): New interface.
18364         (TypeManager.FilterWithClosure): If `criteria' is null, the name
18365         has already been checked, otherwise use it for the name comparision.
18366         (TypeManager.FindMembers): Renamed to RealMemberFinder and
18367         provided wrapper which tries to use ICachingMemberFinder.FindMembers
18368         if possible.  Returns a MemberList, not a MemberInfo [].
18369         (TypeHandle): New class, implements IMemberContainer.  We create
18370         one instance of this class per type, it contains a MemberCache
18371         which is used to do the member lookups.
18372         (MemberCache): New class.  Each instance of this class contains
18373         all members of a type and a name-based hash table.
18374         (MemberCache.FindMembers): This is our new member lookup
18375         function.  First, it looks up all members of the requested name in
18376         the hash table.  Then, it walks this list and sorts out all
18377         applicable members and returns them.
18378
18379 2002-08-13  Martin Baulig  <martin@gnome.org>
18380
18381         In addition to a nice code cleanup, this gives us a performance
18382         increase of about 1.4% on GNU/Linux - not much, but it's already
18383         half a second for the self-hosting MCS compilation.
18384
18385         * typemanager.cs (IMemberFinder): New interface.  It is used by
18386         TypeManager.FindMembers to call FindMembers on a TypeContainer,
18387         Enum, Delegate or Interface.
18388         (TypeManager.finder_to_member_finder): New PtrHashtable.
18389         (TypeManager.finder_to_container): Removed.
18390         (TypeManager.finder_to_delegate): Removed.
18391         (TypeManager.finder_to_interface): Removed.
18392         (TypeManager.finder_to_enum): Removed.
18393
18394         * interface.cs (Interface): Implement IMemberFinder.
18395
18396         * delegate.cs (Delegate): Implement IMemberFinder.
18397
18398         * enum.cs (Enum): Implement IMemberFinder.
18399
18400         * class.cs (TypeContainer): Implement IMemberFinder.
18401
18402 2002-08-12  Martin Baulig  <martin@gnome.org>
18403
18404         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
18405
18406 2002-08-12  Martin Baulig  <martin@gnome.org>
18407
18408         * ecore.cs (ITypeExpression): New interface for expressions which
18409         resolve to a type.
18410         (TypeExpression): Renamed to TypeLookupExpression.
18411         (Expression.DoResolve): If we're doing a types-only lookup, the
18412         expression must implement the ITypeExpression interface and we
18413         call DoResolveType() on it.
18414         (SimpleName): Implement the new ITypeExpression interface.
18415         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
18416         hack, the situation that we're only looking up types can't happen
18417         anymore when this method is called.  Moved the type lookup code to
18418         DoResolveType() and call it.
18419         (SimpleName.DoResolveType): This ITypeExpression interface method
18420         is now doing the types-only lookup.
18421         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
18422         (ResolveFlags): Added MaskExprClass.
18423
18424         * expression.cs (MemberAccess): Implement the ITypeExpression
18425         interface.
18426         (MemberAccess.DoResolve): Added support for a types-only lookup
18427         when we're called via ITypeExpression.DoResolveType().
18428         (ComposedCast): Implement the ITypeExpression interface.
18429
18430         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
18431         Expression.Resolve() with ResolveFlags.Type instead.
18432
18433 2002-08-12  Martin Baulig  <martin@gnome.org>
18434
18435         * interface.cs (Interface.Define): Apply attributes.
18436
18437         * attribute.cs (Attribute.ApplyAttributes): Added support for
18438         interface attributes.
18439
18440 2002-08-11  Martin Baulig  <martin@gnome.org>
18441
18442         * statement.cs (Block.Emit): Only check the "this" variable if we
18443         do not always throw an exception.
18444
18445         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
18446         whether the property has a set accessor.
18447
18448 2002-08-11  Martin Baulig  <martin@gnome.org>
18449
18450         Added control flow analysis support for structs.
18451
18452         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
18453         with control flow analysis turned off.
18454         (IVariable): New interface.
18455         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
18456         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
18457         (FieldExpr.DoResolve): Resolve the instance expression with flow
18458         analysis turned off and do the definite assignment check after the
18459         resolving when we know what the expression will resolve to.
18460
18461         * expression.cs (LocalVariableReference, ParameterReference):
18462         Implement the new IVariable interface, only call the flow analysis
18463         code if ec.DoFlowAnalysis is true.
18464         (This): Added constructor which takes a Block argument.  Implement
18465         the new IVariable interface.
18466         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
18467         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
18468         This does the definite assignment checks for struct members.
18469
18470         * class.cs (Constructor.Emit): If this is a non-static `struct'
18471         constructor which doesn't have any initializer, call
18472         Block.AddThisVariable() to tell the flow analysis code that all
18473         struct elements must be initialized before control returns from
18474         the constructor.
18475
18476         * statement.cs (MyStructInfo): New public class.
18477         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
18478         argument to this indexer.  If non-zero, check an individual struct
18479         member, not the whole struct.
18480         (FlowBranching.CheckOutParameters): Check struct members.
18481         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
18482         overloaded versions of these methods which take an additional
18483         `int field_idx' argument to check struct members.
18484         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
18485         overloaded versions of these methods which take an additional
18486         `string field_name' argument to check struct member.s
18487         (VariableInfo): Implement the IVariable interface.
18488         (VariableInfo.StructInfo): New public property.  Returns the
18489         MyStructInfo instance of the variable if it's a struct or null.
18490         (Block.AddThisVariable): New public method.  This is called from
18491         Constructor.Emit() for non-static `struct' constructor which do
18492         not have any initializer.  It creates a special variable for the
18493         "this" instance variable which will be checked by the flow
18494         analysis code to ensure that all of the struct's fields are
18495         initialized before control returns from the constructor.
18496         (UsageVector): Added support for struct members.  If a
18497         variable/parameter is a struct with N members, we reserve a slot
18498         in the usage vector for each member.  A struct is considered fully
18499         initialized if either the struct itself (slot 0) or all its
18500         members are initialized.
18501
18502 2002-08-08  Martin Baulig  <martin@gnome.org>
18503
18504         * driver.cs (Driver.MainDriver): Only report an error CS5001
18505         if there were no compilation errors.
18506
18507         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
18508         `UnsafeContext' property to determine whether the parent is in
18509         unsafe context rather than checking the parent's ModFlags:
18510         classes nested in an unsafe class are unsafe as well.
18511
18512 2002-08-08  Martin Baulig  <martin@gnome.org>
18513
18514         * statement.cs (UsageVector.MergeChildren): Distinguish between
18515         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
18516         we return.  Added test17() and test18() to test-154.cs.
18517
18518 2002-08-08  Martin Baulig  <martin@gnome.org>
18519
18520         * typemanager.cs (TypeManager.FilterWithClosure): If we have
18521         Family access, make sure the invoking type isn't a subclass of the
18522         queried type (that'd be a CS1540).
18523
18524         * ecore.cs (Expression.MemberLookup): Added overloaded version of
18525         this method which takes an additional `Type invocation_type'.
18526
18527         * expression.cs (BaseAccess.DoResolve): Use the base type as
18528         invocation and query type.
18529         (MemberAccess.DoResolve): If the lookup failed and we're about to
18530         report a CS0122, try a lookup with the ec.ContainerType - if this
18531         succeeds, we must report a CS1540.
18532
18533 2002-08-08  Martin Baulig  <martin@gnome.org>
18534
18535         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
18536         (MethodGroupExpr): Implement the IMemberExpr interface.
18537
18538         * expression (MemberAccess.ResolveMemberAccess): No need to have
18539         any special code for MethodGroupExprs anymore, they're now
18540         IMemberExprs.   
18541
18542 2002-08-08  Martin Baulig  <martin@gnome.org>
18543
18544         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
18545         Family, FamANDAssem and FamORAssem permissions.
18546         (TypeManager.IsSubclassOrNestedChildOf): New public method.
18547
18548 2002-08-08  Martin Baulig  <martin@gnome.org>
18549
18550         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
18551         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
18552         or loop block.
18553
18554 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
18555
18556         * driver.cs: implemented /resource option to embed managed resources.
18557
18558 2002-08-07  Martin Baulig  <martin@gnome.org>
18559
18560         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
18561         (FieldBase.HasFieldInitializer): New public property.
18562         (FieldBase.GetInitializerExpression): New public method.  Resolves and
18563         returns the field initializer and makes sure it is only resolved once.
18564         (TypeContainer.EmitFieldInitializers): Call
18565         FieldBase.GetInitializerExpression to get the initializer, this ensures
18566         that it isn't resolved multiple times.
18567
18568         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
18569         the resolving process (SimpleName/MemberLookup) that we're currently
18570         emitting a field initializer (which must not access any instance members,
18571         this is an error CS0236).
18572
18573         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
18574         argument, if the `IsFieldInitializer' flag is set, we must report and
18575         error CS0236 and not an error CS0120.   
18576
18577 2002-08-07  Martin Baulig  <martin@gnome.org>
18578
18579         * ecore.cs (IMemberExpr): New public interface.
18580         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
18581         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
18582         if the expression is an IMemberExpr.
18583
18584         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
18585         to be null, implicitly default to `this' if we're non-static in
18586         this case.  Simplified the code a lot by using the new IMemberExpr
18587         interface.  Also fixed bug #28176 here.
18588
18589 2002-08-06  Martin Baulig  <martin@gnome.org>
18590
18591         * cs-parser.jay (SimpleLookup): Removed.  We need to create
18592         ParameterReferences during semantic analysis so that we can do a
18593         type-only search when resolving Cast, TypeOf and SizeOf.
18594         (block): Pass the `current_local_parameters' to the Block's
18595         constructor.
18596
18597         * class.cs (ConstructorInitializer): Added `Parameters parameters'
18598         argument to the constructor.
18599         (ConstructorInitializer.Resolve): Create a temporary implicit
18600         block with the parameters.
18601
18602         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
18603         references here if we aren't doing a type-only search.
18604
18605         * statement.cs (Block): Added constructor which takes a
18606         `Parameters parameters' argument.
18607         (Block.Parameters): New public property.
18608
18609         * support.cs (InternalParameters.Parameters): Renamed `parameters'
18610         to `Parameters' and made it public readonly.
18611
18612 2002-08-06  Martin Baulig  <martin@gnome.org>
18613
18614         * ecore.cs (Expression.Warning): Made this public as well.
18615
18616         * report.cs (Report.Debug): Print the contents of collections.
18617
18618 2002-08-06  Martin Baulig  <martin@gnome.org>
18619
18620         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
18621         used to tell Resolve() which kinds of expressions it may return.
18622         (Expression.Resolve): Added overloaded version of this method which
18623         takes a `ResolveFlags flags' argument.  This can be used to tell
18624         Resolve() which kinds of expressions it may return.  Reports a
18625         CS0118 on error.
18626         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18627         ResolveFlags.SimpleName.
18628         (Expression.Error118): Added overloaded version of this method which
18629         takes a `ResolveFlags flags' argument.  It uses the flags to determine
18630         which kinds of expressions are allowed.
18631
18632         * expression.cs (Argument.ResolveMethodGroup): New public method.
18633         Resolves an argument, but allows a MethodGroup to be returned.
18634         This is used when invoking a delegate.
18635
18636         * TODO: Updated a bit.
18637
18638 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18639
18640         Fixed compilation with csc.
18641
18642         * ecore.cs: Expression.Error made public. Is this correct? Should
18643         Warning be made public too?
18644
18645         * expression.cs: use ea.Location instead of ea.loc.
18646         [FIXME:  Filed as bug #28607: MCS must report these errors.]
18647
18648 2002-08-06  Martin Baulig  <martin@gnome.org>
18649
18650         * ecore.cs (Expression.loc): Moved the location here instead of
18651         duplicating it in all derived classes.
18652         (Expression.Location): New public property.
18653         (Expression.Error, Expression.Warning): Made them non-static and
18654         removed the location argument.
18655         (Expression.Warning): Added overloaded version which takes an
18656         `int level' argument.
18657         (Expression.Error118): Make this non-static and removed the
18658         expression and location arguments.
18659         (TypeExpr): Added location argument to the constructor.
18660
18661         * expression.cs (StaticCallExpr): Added location argument to
18662         the constructor.
18663         (Indirection, PointerArithmetic): Likewise.
18664         (CheckedExpr, UnCheckedExpr): Likewise.
18665         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18666         (StringPtr): Likewise.
18667
18668
18669 2002-08-05  Martin Baulig  <martin@gnome.org>
18670
18671         * expression.cs (BaseAccess.DoResolve): Actually report errors.
18672
18673         * assign.cs (Assign.DoResolve): Check whether the source
18674         expression is a value or variable.
18675
18676         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18677         while resolving the corresponding blocks.
18678
18679         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18680         an error, don't silently return null.
18681
18682         * statement.cs (Block.AddVariable): Do the error reporting here
18683         and distinguish between CS0128 and CS0136.
18684         (Block.DoResolve): Report all unused labels (warning CS0164).
18685         (LabeledStatement): Pass the location to the constructor.
18686         (LabeledStatement.HasBeenReferenced): New property.
18687         (LabeledStatement.Resolve): Set it to true here.
18688
18689         * statement.cs (Return.Emit): Return success even after reporting
18690         a type mismatch error (CS0126 or CS0127), this is what csc does and
18691         it avoids confusing the users with any consecutive errors.
18692
18693 2002-08-05  Martin Baulig  <martin@gnome.org>
18694
18695         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18696
18697         * const.cs (Const.LookupConstantValue): Catch circular definitions.
18698
18699         * expression.cs (MemberAccess.DoResolve): Silently return if an
18700         error has already been reported.
18701
18702         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18703         error has already been reported.
18704
18705 2002-08-05  Martin Baulig  <martin@gnome.org>
18706
18707         * statement.cs (UsageVector): Only initialize the `parameters'
18708         vector if we actually have any "out" parameters.
18709
18710 2002-08-05  Martin Baulig  <martin@gnome.org>
18711
18712         * expression.cs (Binary.ResolveOperator): When combining delegates,
18713         they must have the same type.
18714
18715 2002-08-05  Martin Baulig  <martin@gnome.org>
18716
18717         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18718         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18719         work with the ms runtime and we also don't need it: if we're a
18720         PropertyBuilder and not in the `indexer_arguments' hash, then we
18721         are a property and not an indexer.
18722
18723         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18724         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18725         since the latter one doesn't work with the ms runtime.
18726
18727 2002-08-03  Martin Baulig  <martin@gnome.org>
18728
18729         Fixed bugs #27998 and #22735.
18730
18731         * class.cs (Method.IsOperator): New public field.
18732         (Method.CheckBase): Report CS0111 if there's already a method
18733         with the same parameters in the current class.  Report CS0508 when
18734         attempting to change the return type of an inherited method.
18735         (MethodData.Emit): Report CS0179 if a method doesn't have a body
18736         and it's not marked abstract or extern.
18737         (PropertyBase): New abstract base class for Property and Indexer.
18738         (PropertyBase.CheckBase): Moved here from Property and made it work
18739         for indexers.
18740         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18741         the same so we can reuse it there.
18742         (Property, Indexer): Derive from PropertyBase.
18743         (MethodSignature.inheritable_property_signature_filter): New delegate
18744         to find properties and indexers.
18745
18746         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18747         argument and improved error reporting.
18748
18749         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18750         EmptyReadOnlyParameters and made it a property.
18751
18752         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18753         version of this method which takes a `PropertyInfo indexer'.
18754         (TypeManager.RegisterIndexer): New method.
18755
18756         * class.cs: Added myself as author of this file :-)
18757
18758 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18759
18760         * class.cs: fixed compilation on windoze.
18761
18762 2002-08-03  Martin Baulig  <martin@gnome.org>
18763
18764         * interface.cs (Interface.GetInterfaceBases): Check whether all
18765         base interfaces are at least as accessible than the current one.
18766
18767         * class.cs (TypeContainer.GetClassBases): Check whether base types
18768         are at least as accessible than the current type.
18769         (TypeContainer.AsAccessible): Implemented and made non-static.
18770         (MemberBase.CheckParameters): Report errors if the accessibility
18771         checks fail.
18772
18773         * delegate.cs (Delegate.Delegate): The default visibility is
18774         internal for top-level types and private for nested types.
18775         (Delegate.Define): Report errors if the accessibility checks fail.
18776
18777         * enum.cs (Enum.Enum): The default visibility is internal for
18778         top-level types and private for nested types.
18779         (Enum.DefineType): Compute the correct visibility.
18780
18781         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18782         function which takes a `bool is_toplevel' instead of a TypeContainer.
18783
18784         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18785         builtin type.
18786
18787 2002-08-02  Martin Baulig  <martin@gnome.org>
18788
18789         * expression.cs (LocalVariableReferenc): Added constructor which
18790         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18791         (LocalVariableReference.IsReadOnly): New property.
18792         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18793         variable is readonly, use our own readonly flag to do this; you can
18794         use the new constructor to get a writable reference to a read-only
18795         variable.
18796
18797         * cs-parser.jay (foreach_statement, using_statement): Get a writable
18798         reference to the local variable.
18799
18800 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
18801
18802         * rootcontext.cs (ResolveCore): Also include System.Exception
18803
18804         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18805         we reach an EmptyStatement.
18806
18807         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18808         is also fine.
18809
18810         * expression.cs (Binary.ResolveOperator): Check error result in
18811         two places.
18812
18813         use brtrue/brfalse directly and avoid compares to null.
18814
18815 2002-08-02  Martin Baulig  <martin@gnome.org>
18816
18817         * class.cs (TypeContainer.Define): Define all nested interfaces here.
18818         Fixes bug #28407, added test-155.cs.
18819
18820 2002-08-01  Martin Baulig  <martin@gnome.org>
18821
18822         * class.cs (Event.EmitDefaultMethod): Make this work with static
18823         events.  Fixes #28311, added verify-3.cs.
18824
18825 2002-08-01  Martin Baulig  <martin@gnome.org>
18826
18827         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18828         `is_disposable' fields.
18829         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18830         `hm.is_disposable' if we're using the collection pattern.
18831         (Foreach.EmitCollectionForeach): Use the correct type for the
18832         enumerator's local variable, only emit the try/finally block if
18833         necessary (fixes #27713).
18834
18835 2002-08-01  Martin Baulig  <martin@gnome.org>
18836
18837         * ecore.cs (Expression.report118): Renamed to Error118 and made
18838         it public static.
18839
18840         * statement.cs (Throw.Resolve): Check whether the expression is of
18841         the correct type (CS0118) and whether the type derives from
18842         System.Exception (CS0155).
18843         (Catch.Resolve): New method.  Do the type lookup here and check
18844         whether it derives from System.Exception (CS0155).
18845         (Catch.CatchType, Catch.IsGeneral): New public properties.
18846
18847         * typemanager.cs (TypeManager.exception_type): Added.
18848
18849 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
18850
18851         * driver.cs: Updated About function.
18852
18853 2002-07-31  Martin Baulig  <martin@gnome.org>
18854
18855         Implemented Control Flow Analysis.
18856
18857         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18858         (EmitContext.CurrentBranching): Added.
18859         (EmitContext.StartFlowBranching): Added.
18860         (EmitContext.EndFlowBranching): Added.
18861         (EmitContext.KillFlowBranching): Added.
18862         (EmitContext.IsVariableAssigned): Added.
18863         (EmitContext.SetVariableAssigned): Added.
18864         (EmitContext.IsParameterAssigned): Added.
18865         (EmitContext.SetParameterAssigned): Added.
18866         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18867         Added control flow analysis stuff here.
18868
18869         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18870         resolve the expression as lvalue.
18871         (LocalVariableReference.DoResolve): Check whether the variable has
18872         already been assigned.
18873         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18874         the parameter as assigned here.
18875         (ParameterReference.DoResolve): Check whether the parameter has already
18876         been assigned.
18877         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18878         expression as lvalue.
18879
18880         * statement.cs (FlowBranching): New class for the flow analysis code.
18881         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18882         (LabeledStatement.IsDefined): New public property.
18883         (LabeledStatement.AddUsageVector): New public method to tell flow
18884         analyis that the label may be reached via a forward jump.
18885         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18886         flow analysis.
18887         (VariableInfo.Number): New public field.  This is used by flow analysis
18888         to number all locals of a block.
18889         (Block.CountVariables): New public property.  This is the number of
18890         local variables in this block (including the locals from all parent
18891         blocks).
18892         (Block.EmitMeta): Number all the variables.
18893
18894         * statement.cs: Added flow analysis support to all classes.
18895
18896 2002-07-31  Martin Baulig  <martin@gnome.org>
18897
18898         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18899         To get debugging messages, compile mcs with /define:MCS_DEBUG and
18900         then use this argument.
18901
18902         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18903
18904         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18905         use this to specify /define options.
18906
18907 2002-07-29  Martin Baulig  <martin@gnome.org>
18908
18909         * statement.cs (Fixed): Moved all code that does variable lookups
18910         and resolvings from Emit to Resolve.
18911
18912         * statement.cs (For): Moved all code that does variable lookups
18913         and resolvings from Emit to Resolve.
18914
18915         * statement.cs (Using): Moved all code that does variable lookups
18916         and resolvings from Emit to Resolve.
18917
18918 2002-07-29  Martin Baulig  <martin@gnome.org>
18919
18920         * attribute.cs (Attribute.Resolve): Explicitly catch a
18921         System.NullReferenceException when creating the
18922         CustromAttributeBuilder and report a different warning message.
18923
18924 2002-07-29  Martin Baulig  <martin@gnome.org>
18925
18926         * support.cs (ParameterData.ParameterName): Added method to
18927         get the name of a parameter.
18928
18929         * typemanager.cs (TypeManager.IsValueType): New public method.
18930
18931 2002-07-29  Martin Baulig  <martin@gnome.org>
18932
18933         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
18934         is a flag which specifies that it's either ref or out.
18935         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18936         the out parameter to `out Parameter.Modifier mod', also set the
18937         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18938
18939         * support.cs (InternalParameters.ParameterModifier): Distinguish
18940         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18941         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18942
18943         * expression.cs (Argument.GetParameterModifier): Distinguish
18944         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18945         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18946
18947 2002-07-29  Martin Baulig  <martin@gnome.org>
18948
18949         * expression.cs (ParameterReference.ParameterReference): Added
18950         `Location loc' argument to the constructor.
18951
18952         * cs-parser.jay: Pass location to ParameterReference.
18953
18954 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
18955
18956         * statement.cs (Try): Initialize the location.
18957
18958         * cs-parser.jay: pass location to Try.
18959
18960         * expression.cs (Unary.Reduce): Change the prototype to return
18961         whether a constant fold could be performed or not.  The result is
18962         returned in an out parameters.  In the case of Indirection and
18963         AddressOf, we want to perform the full tests.
18964
18965 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
18966
18967         * statement.cs (Statement.Emit): Flag dead code.
18968
18969 2002-07-27  Andrew Birkett  <andy@nobugs.org>
18970
18971         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18972
18973 2002-07-27  Martin Baulig  <martin@gnome.org>
18974
18975         * class.cs (MethodData.Define): Put back call to
18976         TypeManager.AddMethod(), accidentally commented this out.
18977
18978         * report.cs (Debug): New public method to print debugging information,
18979         this is `[Conditional ("DEBUG")]'.
18980
18981 2002-07-26  Martin Baulig  <martin@gnome.org>
18982
18983         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18984         (switch_statement): Push the current_block to the switch_stack and
18985         pop it again when we're done with the switch.
18986         (switch_section): The new block is a child of the current_block.
18987         Fixes bug #24007, added test-152.cs.
18988
18989 2002-07-27  Martin Baulig  <martin@gnome.org>
18990
18991         * expression.cs (Invocation.EmitArguments): When calling a varargs
18992         function with only its fixed arguments, we need to pass an empty
18993         array.
18994
18995 2002-07-27  Martin Baulig  <martin@gnome.org>
18996
18997         Mono 0.13 has been released.
18998
18999 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
19000
19001         * driver.cs: Rename --resource to --linkres, because that is what
19002         we do currently, we dont support --resource yet.
19003
19004         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
19005
19006 2002-07-25  Martin Baulig  <martin@gnome.org>
19007
19008         * class.cs (MethodData): New public class.  This is a `method builder'
19009         class for a method or one accessor of a Property/Indexer/Event.
19010         (MethodData.GetMethodFlags): Moved here from MemberBase.
19011         (MethodData.ApplyAttributes): Likewise.
19012         (MethodData.ApplyObsoleteAttribute): Likewise.
19013         (MethodData.ApplyConditionalAttribute): Likewise.
19014         (MethodData.ApplyDllImportAttribute): Likewise.
19015         (MethodData.CheckAbstractAndExternal): Likewise.
19016         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
19017         (MethodData.Emit): Formerly known as Method.Emit().
19018         (MemberBase): Moved everything which was specific to a single
19019         accessor/method to MethodData.
19020         (Method): Create a new MethodData and call Define() and Emit() on it.
19021         (Property, Indexer, Event): Create a new MethodData objects for each
19022         accessor and call Define() and Emit() on them.
19023
19024 2002-07-25  Martin Baulig  <martin@gnome.org>
19025
19026         Made MethodCore derive from MemberBase to reuse the code from there.
19027         MemberBase now also checks for attributes.
19028
19029         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
19030         (MemberBase.GetMethodFlags): Moved here from class Method and marked
19031         as virtual.
19032         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
19033         `CallingConventions cc' and `Attributes opt_attrs' arguments.
19034         (MemberBase.ApplyAttributes): New virtual method; applies the
19035         attributes to a method or accessor.
19036         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
19037         (MemberBase.ApplyConditionalAttribute): Likewise.
19038         (MemberBase.ApplyDllImportAttribute): Likewise.
19039         (MemberBase.CheckAbstractAndExternal): Likewise.
19040         (MethodCore.ParameterTypes): This is now a property instead of a
19041         method, it's initialized from DoDefineParameters().
19042         (MethodCore.ParameterInfo): Removed the set accessor.
19043         (MethodCore.DoDefineParameters): New protected virtual method to
19044         initialize ParameterTypes and ParameterInfo.
19045         (Method.GetReturnType): We can now simply return the MemberType.
19046         (Method.GetMethodFlags): Override the MemberBase version and add
19047         the conditional flags.
19048         (Method.CheckBase): Moved some code from Define() here, call
19049         DoDefineParameters() here.
19050         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
19051         here to avoid some larger code duplication.
19052         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
19053         ensure that abstract and external accessors don't declare a body.
19054
19055         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
19056         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
19057         lookup in the attribute's parent classes, so we need to abort as soon
19058         as we found the first match.
19059         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
19060         the attribute has no arguments.
19061
19062         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
19063         of a Method.
19064
19065 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19066
19067         * cs-parser.jay: reverted previous patch.
19068
19069 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19070
19071         * cs-parser.jay: fixed bug #22119.
19072
19073 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19074
19075         * attribute.cs: fixed compilation. The error was:
19076         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
19077         be assigned to before control leaves the current method."
19078         [FIXME:  Filed as bug #28186: MCS must report this error.]
19079
19080 2002-07-25  Martin Baulig  <martin@gnome.org>
19081
19082         * attribute.cs (Attribute.Conditional_GetConditionName): New static
19083         method to pull the condition name ouf of a Conditional attribute.
19084         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
19085         the obsolete message and error flag out of an Obsolete attribute.
19086
19087         * class.cs (Method.GetMethodFlags): New public method to get the
19088         TypeManager.MethodFlags for this method.
19089         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
19090         private methods.
19091         (Method.Define): Get and apply the Obsolete and Conditional attributes;
19092         if we're overriding a virtual function, set the new private variable
19093         `parent_method'; call the new TypeManager.AddMethod().
19094
19095         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
19096         the MethodBuilder and the Method in a PtrHashtable.
19097         (TypeManager.builder_to_method): Added for this purpose.
19098         (TypeManager.MethodFlags): Added IsObsoleteError.
19099         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
19100         Obsolete and Conditional arguments in MethodBuilders.  If we discover
19101         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
19102         the message from the attribute.
19103
19104 2002-07-24  Martin Baulig  <martin@gnome.org>
19105
19106         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
19107         preprocessor directives, ensure that the argument to #define/#undef is
19108         exactly one identifier and that it's actually an identifier.
19109
19110         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
19111         did not work ....
19112
19113 2002-07-24  Martin Baulig  <martin@gnome.org>
19114
19115         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
19116         initialize it to TypeManager.object_type in the constructor.
19117         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
19118         of the `hm.get_current' method if we're using the collection pattern.
19119         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
19120         for the explicit conversion to make it work when we're using the collection
19121         pattern and the `Current' property has a different return type than `object'.
19122         Fixes #27713.
19123
19124 2002-07-24  Martin Baulig  <martin@gnome.org>
19125
19126         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
19127         does not match, but don't report any errors.  This method is called in
19128         order for all methods in a MethodGroupExpr until a matching method is
19129         found, so we don't want to bail out if the first method doesn't match.
19130         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
19131         matches, report the 123.  Fixes #28070.
19132
19133 2002-07-24  Martin Baulig  <martin@gnome.org>
19134
19135         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
19136         TypeManager.TypeToCoreType() to the top of the method so the
19137         following equality checks will work.  Fixes #28107.
19138
19139 2002-07-24  Martin Baulig  <martin@gnome.org>
19140
19141         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
19142         operand is of type uint, and the other operand is of type sbyte,
19143         short or int, the operands are converted to type long." -
19144         Actually do what this comment already told us.  Fixes bug #28106,
19145         added test-150.cs.
19146
19147 2002-07-24  Martin Baulig  <martin@gnome.org>
19148
19149         * class.cs (MethodBase): New abstract class.  This is now a base
19150         class for Property, Indexer and Event to avoid some code duplication
19151         in their Define() and DefineMethods() methods.
19152         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
19153         generic methods for Define() and DefineMethods().
19154         (FieldBase): Derive from MemberBase, not MemberCore.
19155         (Property): Derive from MemberBase, not MemberCore.
19156         (Property.DefineMethod): Moved all the code from this method to the
19157         new MethodBase.DefineAccessor(), just call it with appropriate
19158         argumetnts.
19159         (Property.Define): Call the new Property.DoDefine(), this does some
19160         sanity checks and we don't need to duplicate the code everywhere.
19161         (Event): Derive from MemberBase, not MemberCore.
19162         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
19163         accessors, this will also make them work with interface events.
19164         (Indexer): Derive from MemberBase, not MemberCore.
19165         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
19166         (Indexer.Define): Use the new MethodBase functions.
19167
19168         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
19169         argument to the constructor.
19170         (Interface.FindMembers): Added support for interface events.
19171         (Interface.PopluateEvent): Implemented.
19172
19173         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
19174
19175 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
19176
19177         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
19178         but this is required to check for a method name being the same as
19179         the containing class.  
19180
19181         Handle this now.
19182
19183 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19184
19185         * interface.cs: initialize variable.
19186
19187 2002-07-23  Martin Baulig  <martin@gnome.org>
19188
19189         Implemented the IndexerName attribute in interfaces.
19190
19191         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
19192         name if this is an explicit interface implementation.
19193         (Indexer.InterfaceIndexerName): New public variable.  If we're
19194         implementing an interface indexer, this is the IndexerName in that
19195         interface.  Otherwise, it's the IndexerName.
19196         (Indexer.DefineMethod): If we're implementing interface indexer,
19197         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
19198         and Pending.ImplementIndexer methods.
19199         (Indexer.Define): Also define the PropertyBuilder if we're
19200         implementing an interface indexer and this is neither an explicit
19201         interface implementation nor do the IndexerName match the one in
19202         the interface.
19203
19204         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
19205         If a method is defined here, then we always need to create a proxy
19206         for it.  This is used when implementing interface indexers.
19207         (Pending.IsInterfaceIndexer): New public method.
19208         (Pending.ImplementIndexer): New public method.
19209         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
19210         This is used when implementing interface indexers to define a proxy
19211         if necessary.
19212         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
19213         define a proxy if necessary.
19214
19215         * interface.cs (Interface.IndexerName): New public variable.
19216         (Interface.PopulateIndexer): Set the IndexerName.
19217         (Interface.DefineIndexers): New private method.  Populate all the
19218         indexers and make sure their IndexerNames match.
19219
19220         * typemanager.cs (IndexerPropertyName): Added support for interface
19221         indexers.
19222
19223 2002-07-22  Martin Baulig  <martin@gnome.org>
19224
19225         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
19226         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
19227         ret if HasReturnLabel.
19228         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
19229         variables.
19230
19231         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
19232         and set the ec.LoopBeginTryCatchLevel.
19233         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
19234         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
19235         the current ec.TryCatchLevel, the branch goes out of an exception
19236         block.  In this case, we need to use Leave and not Br.
19237
19238 2002-07-22  Martin Baulig  <martin@gnome.org>
19239
19240         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
19241         block unless the block does not always return or it is contained in
19242         another try { ... } catch { ... } block.  Fixes bug #26506.
19243         Added verify-1.cs to the test suite.
19244
19245 2002-07-22  Martin Baulig  <martin@gnome.org>
19246
19247         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
19248         then we do not always return.  Fixes bug #24985.
19249
19250 2002-07-22  Martin Baulig  <martin@gnome.org>
19251
19252         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
19253         lookup on a per-class level; ie. walk up the class hierarchy until we
19254         found at least one applicable method, then choose the best among them.
19255         Fixes bug #24463 and test-29.cs.
19256
19257 2002-07-22  Martin Baulig  <martin@gnome.org>
19258
19259         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
19260         return types of the methods.  The return type is not part of the
19261         signature and we must not check it to make the `new' modifier work.
19262         Fixes bug #27999, also added test-147.cs.
19263         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
19264
19265         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
19266         on the method's return type.
19267
19268 2002-07-21  Martin Baulig  <martin@gnome.org>
19269
19270         * assign.cs: Make this work if the rightmost source is a constant and
19271         we need to do an implicit type conversion.  Also adding a few more tests
19272         to test-38.cs which should have caught this.
19273
19274         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
19275         target in the makefile for this.  The makefile.gnu is primarily intended
19276         for end-users who don't want to debug the compiler.
19277
19278 2002-07-21  Martin Baulig  <martin@gnome.org>
19279
19280         * assign.cs: Improved the Assign class so it can now handle embedded
19281         assignments (X = Y = Z = something).  As a side-effect this'll now also
19282         consume less local variables.  test-38.cs now passes with MCS, added
19283         a few new test cases to that test.
19284
19285 2002-07-20  Martin Baulig  <martin@gnome.org>
19286
19287         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
19288         instructions.  Fixes bug #27977, also added test-146.cs.
19289
19290 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19291
19292         * cs-tokenizer.cs: fixed getHex ().
19293
19294 2002-07-19  Martin Baulig  <martin@gnome.org>
19295
19296         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
19297         not Type.GetType() to lookup the array type.  This is needed when
19298         we're constructing an array of a user-defined type.
19299         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
19300         single-dimensional arrays, but also for single-dimensial arrays of
19301         type decimal.
19302
19303 2002-07-19  Martin Baulig  <martin@gnome.org>
19304
19305         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
19306         this function is called, it's not allowed to share LocalBuilders
19307         among ILGenerators.
19308
19309 2002-07-19  Martin Baulig  <martin@gnome.org>
19310
19311         * expression.cs (Argument.Resolve): Report an error 118 when trying
19312         to pass a type as argument.
19313
19314 2002-07-18  Martin Baulig  <martin@gnome.org>
19315
19316         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
19317         Conv_R_Un for the signed `long' type.
19318
19319 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
19320
19321         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
19322         `expr' for the temporary result, as that will fail if we do
19323         multiple resolves on the same expression.
19324
19325 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
19326
19327         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
19328         ec.TypeContainer for looking up aliases. 
19329
19330         * class.cs (TypeContainer): Remove LookupAlias from here.
19331
19332         * decl.cs (DeclSpace); Move here.
19333
19334 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
19335
19336         * class.cs (FindMembers): Only call filter if the constructor
19337         bulider is not null.
19338
19339         Also handle delegates in `NestedTypes' now.  Now we will perform
19340         type lookups using the standard resolution process.  This also
19341         fixes a bug.
19342
19343         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
19344         This uses Expressions (the limited kind that can be parsed by the
19345         tree) instead of strings.
19346
19347         * expression.cs (ComposedCast.ToString): Implement, used to flag
19348         errors since now we have to render expressions.
19349
19350         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
19351         FormArrayType. 
19352
19353         * ecore.cs (SimpleName.ToString): ditto.
19354
19355         * cs-parser.jay: Instead of using strings to assemble types, use
19356         Expressions to assemble the type (using SimpleName, ComposedCast,
19357         MemberAccess).  This should fix the type lookups in declarations,
19358         because we were using a different code path for this.
19359
19360         * statement.cs (Block.Resolve): Continue processing statements
19361         even when there is an error.
19362
19363 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
19364
19365         * class.cs (Event.Define): Also remove the `remove' method from
19366         the list of pending items.
19367
19368         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
19369         generate more compact code. 
19370
19371 2002-07-17  Martin Baulig  <martin@gnome.org>
19372
19373         * const.cs (Const.LookupConstantValue): Add support for constant
19374         `unchecked' and `checked' expressions.
19375         Also adding test case test-140.cs for this.
19376
19377 2002-07-17  Martin Baulig  <martin@gnome.org>
19378
19379         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
19380         check whether mi.ReturnType implements the IEnumerator interface; the
19381         `==' and the IsAssignableFrom() will fail in this situation.
19382
19383 2002-07-16  Ravi Pratap  <ravi@ximian.com>
19384
19385         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
19386         here too.
19387
19388 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19389
19390         * expression.cs: fixed bug #27811.
19391
19392 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
19393
19394         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
19395         Molaro: when we are a ref, the value already contains a pointer
19396         value, do not take the address of it.
19397
19398 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19399         * removed mb-parser.jay and mb-tokenizer.cs
19400
19401 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19402
19403         * expression.cs: check against the building corlib void type.
19404
19405 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
19406
19407         * ecore.cs: fix for valuetype static readonly fields: when 
19408         initializing them, we need their address, not the address of a copy.
19409
19410 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
19411
19412         * typemanager.cs: register also enum_type in corlib.
19413
19414 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19415
19416         * class.cs: allow calling this (but not base) initializers in structs.
19417
19418 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
19419
19420         * ecore.cs: make sure we compare against the building base types
19421         in GetTypeSize ().
19422
19423 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
19424
19425         * typemanager.cs: fix TypeToCoreType() to handle void and object
19426         (corlib gets no more typerefs after this change).
19427
19428 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
19429
19430         * expression.cs (ArrayCreation.EmitArrayArguments): use
19431         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
19432
19433         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
19434         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
19435         array indexes, the runtime actually forbids them.
19436
19437         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
19438         for array arguments here.
19439
19440         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
19441         instead of the default for ValueTypes.
19442
19443         (New.DoEmit): Use IsValueType instead of
19444         IsSubclassOf (value_type)
19445         (New.DoResolve): ditto.
19446         (Invocation.EmitCall): ditto.
19447
19448         * assign.cs (Assign): ditto.
19449
19450         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
19451         Statements *are* currently doing part of their resolution during
19452         Emit.  
19453
19454         Expressions do always resolve during resolve, but statements are
19455         only required to propagate resolution to their children.
19456
19457 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
19458
19459         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
19460
19461         (LoadAssembly): Do not add the dll if it is already specified
19462
19463         (MainDriver): Add the System directory to the link path at the end,
19464         after all the other -L arguments. 
19465
19466         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
19467         wrong opcode for loading bytes and bools (ldelem.i1 instead of
19468         ldelem.u1) and using the opposite for sbytes.
19469
19470         This fixes Digger, and we can finally run it.
19471
19472         * driver.cs (UnixParseOption): Move the option parsing here.  
19473         (CSCParseOption): Implement CSC-like parsing of options.
19474
19475         We now support both modes of operation, the old Unix way, and the
19476         new CSC-like way.  This should help those who wanted to make cross
19477         platform makefiles.
19478
19479         The only thing broken is that /r:, /reference: and /lib: are not
19480         implemented, because I want to make those have the same semantics
19481         as the CSC compiler has, and kill once and for all the confussion
19482         around this.   Will be doing this tomorrow.
19483
19484         * statement.cs (Unsafe.Resolve): The state is checked during
19485         resolve, not emit, so we have to set the flags for IsUnsfe here.
19486
19487 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
19488
19489         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
19490         not catch the Error_ObjectRefRequired in SimpleName (as it is
19491         possible to have a class/instance variable name that later gets
19492         deambiguated), we have to check this here.      
19493
19494 2002-07-10  Ravi Pratap  <ravi@ximian.com>
19495
19496         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
19497         make static and put into Expression.
19498
19499         (Event.Define): Register the private field of the event with the 
19500         TypeManager so that GetFieldFromEvent can get at it.
19501
19502         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
19503         keep track of the private field associated with an event which
19504         has no accessors.
19505
19506         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
19507         private field.
19508
19509         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
19510
19511 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
19512
19513         * expression.cs (Binary.EmitBranchable): this routine emits the
19514         Binary expression in a branchable context.  This basically means:
19515         we need to branch somewhere, not just get the value on the stack.
19516
19517         This works together with Statement.EmitBoolExpression.
19518
19519         * statement.cs (Statement.EmitBoolExpression): Use
19520         EmitBranchable. 
19521
19522 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
19523
19524         * statement.cs (For): Reduce the number of jumps in loops.
19525
19526         (For): Implement loop inversion for the For statement.
19527
19528         (Break): We can be breaking out of a Try/Catch controlled section
19529         (foreach might have an implicit try/catch clause), so we need to
19530         use Leave instead of Br.
19531
19532         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
19533         now).  If the instace expression supports IMemoryLocation, we use
19534         the AddressOf method from the IMemoryLocation to extract the
19535         address instead of emitting the instance.
19536
19537         This showed up with `This', as we were emitting the instance
19538         always (Emit) instead of the Address of This.  Particularly
19539         interesting when This is a value type, as we dont want the Emit
19540         effect (which was to load the object).
19541
19542 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
19543
19544         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
19545
19546         * statement.cs (Checked): Set the CheckedState during the resolve
19547         process too, as the ConvCast operations track the checked state on
19548         the resolve process, and not emit.
19549
19550         * cs-parser.jay (namespace_member_declaration): Flag that we have
19551         found a declaration when we do.  This is used to flag error 1529
19552
19553         * driver.cs: Report ok when we display the help only.
19554
19555 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
19556
19557         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
19558
19559 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
19560
19561         * cs-tokenizer.cs (define): We also have to track locally the
19562         defines.  AllDefines is just used for the Conditional Attribute,
19563         but we also need the local defines for the current source code. 
19564
19565 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
19566
19567         * statement.cs (While, For, Do): These loops can exit through a
19568         Break statement, use this information to tell whether the
19569         statement is the last piece of code.
19570
19571         (Break): Flag that we break.
19572
19573         * codegen.cs (EmitContexts): New `Breaks' state variable.
19574
19575 2002-07-03  Martin Baulig  <martin@gnome.org>
19576
19577         * class.cs (TypeContainer.MethodModifiersValid): Allow override
19578         modifiers in method declarations in structs.  Otherwise, you won't
19579         be able to override things like Object.Equals().
19580
19581 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19582
19583         * class.cs (Method, Property, Indexer): Do not allow the public
19584         modifier to be used in explicit interface implementations.
19585
19586         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
19587         override modifiers in method declarations in structs
19588
19589 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
19590
19591         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
19592         integer or real overflow, report an error
19593
19594 2002-07-02  Martin Baulig  <martin@gnome.org>
19595
19596         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
19597         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
19598         to tell the runtime about our newly created System.Object and
19599         System.ValueType types.
19600
19601 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19602
19603         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
19604         struct instead of Ldarg/Starg.
19605
19606 2002-07-02  Martin Baulig  <martin@gnome.org>
19607
19608         * expression.cs (Indirection.Indirection): Call
19609         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
19610
19611 2002-07-02  Martin Baulig  <martin@gnome.org>
19612
19613         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
19614         ValueType, call TypeManager.TypeToCoreType() on it.
19615         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19616         the OpCodes.Newarr argument.
19617
19618 2002-07-02  Martin Baulig  <martin@gnome.org>
19619
19620         * expression.cs (Invocation.EmitCall): When compiling corlib,
19621         replace all calls to the system's System.Array type to calls to
19622         the newly created one.
19623
19624         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19625         System.Array methods.
19626         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19627         from the system's System.Array type which must be replaced.
19628
19629 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19630
19631         * typemanager.cs: load unverifiable_code_ctor so we can build
19632         corlib using the correct type. Avoid using GetTypeCode() with
19633         TypeBuilders.
19634         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19635         TypeManager.object_type to allow building corlib.
19636
19637 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19638
19639         * ecore.cs: handle System.Enum separately in LoadFromPtr().
19640
19641 2002-07-01  Martin Baulig  <martin@gnome.org>
19642
19643         * class.cs: Make the last change actually work, we need to check
19644         whether `ifaces != null' to avoid a crash.
19645
19646 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19647
19648         * class.cs: when we build structs without fields that implement
19649         interfaces, we need to add the interfaces separately, since there is
19650         no API to both set the size and add the interfaces at type creation
19651         time.
19652
19653 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19654
19655         * expression.cs: the dimension arguments to the array constructors
19656         need to be converted if they are a long.
19657
19658 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19659
19660         * class.cs: don't emit ldarg.0 if there is no parent constructor
19661         (fixes showstopper for corlib).
19662
19663 2002-06-29  Martin Baulig  <martin@gnome.org>
19664
19665         MCS now compiles corlib on GNU/Linux :-)
19666
19667         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19668         ie. check for MethodImplOptions.InternalCall.
19669
19670         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19671         and TypeManager.attribute_type are null, so we must explicitly check
19672         whether parent is not null to find out whether it's an attribute type.
19673         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19674         and SetBuilder, not only if the property is neither abstract nor external.
19675         This is necessary to set the MethodImplOptions on the accessor methods.
19676         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19677         SetBuilder, see Property.Emit().
19678
19679         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19680         populate "System.Object", "System.ValueType" and "System.Attribute" since
19681         they've already been populated from BootCorlib_PopulateCoreTypes().
19682
19683 2002-06-29  Martin Baulig  <martin@gnome.org>
19684
19685         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19686         is the NullLiteral, we also need to make sure that target_type is not
19687         an enum type.   
19688
19689 2002-06-29  Martin Baulig  <martin@gnome.org>
19690
19691         * rootcontext.cs (RootContext.ResolveCore): We must initialize
19692         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19693         before calling BootstrapCorlib_ResolveDelegate ().
19694
19695 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19696
19697         * statement.cs: fixed build-breaker. All tests passed ok.
19698
19699 2002-06-27  Martin Baulig  <martin@gnome.org>
19700
19701         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19702         for System.Decimal when compiling corlib.
19703
19704 2002-06-27  Martin Baulig  <martin@gnome.org>
19705
19706         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19707         switch blocks which contain nothing but a default clause.
19708
19709 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
19710
19711        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19712
19713 2002-06-27  Martin Baulig  <martin@gnome.org>
19714
19715         * ecore.cs (PropertyExpr.PropertyExpr): Call
19716         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19717
19718         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19719         is already a TypeBuilder.
19720
19721 2002-06-27  Martin Baulig  <martin@gnome.org>
19722
19723         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19724         `target_type == TypeManager.array_type', not IsAssignableFrom() in
19725         the "from an array-type to System.Array" case.  This makes it work
19726         when compiling corlib.
19727
19728 2002-06-27  Martin Baulig  <martin@gnome.org>
19729
19730         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19731         non-static PropertyExpr, set its InstanceExpression.  This makes
19732         the `ICollection.Count' property work in System/Array.cs.
19733
19734 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
19735
19736         * driver.cs: Made error handling more consistent.  Errors now
19737         tracked by Report class, so many methods which used to return int
19738         now return void.  Main() now prints success/failure and 
19739         errors/warnings message.
19740
19741         Renamed '--probe' compiler argument to '--expect-error'.  Removed
19742         the magic number return values (123 and 124).  Now, if the
19743         expected error occurs, the compiler exits with success (exit value
19744         0).  If the compilation completes without seeing that particular
19745         error, the compiler exits with failure (exit value 1).  The
19746         makefile in mcs/errors has been changed to handle the new behaviour.
19747
19748         * report.cs: Made 'expected error' number a property and renamed
19749         it from 'Probe' to 'ExpectedError'.
19750
19751         * genericparser.cs: Removed error handling support, since it is
19752         now all done by Report class.
19753
19754         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19755         class, so parse() no longer returns an int.
19756
19757         * namespace.cs: Use Report.Error instead of GenericParser.error
19758
19759 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
19760
19761         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19762         TypeContainer.AddOperator): At the front of the list put the
19763         explicit implementations, so they get resolved/defined first. 
19764
19765 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
19766
19767         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19768         interface type is implemented by this TypeContainer.  Used during
19769         explicit interface implementation.
19770
19771         (Property.Define, Indexer.Define, Method.Define): Validate that
19772         the given interface in the explicit implementation is one of the
19773         base classes for the containing type.
19774
19775         Also if we are explicitly implementing an interface, but there is
19776         no match in the pending implementation table, report an error.
19777
19778         (Property.Define): Only define the property if we are
19779         not explicitly implementing a property from an interface.  Use the
19780         correct name also for those properties (the same CSC uses,
19781         although that is really not needed).
19782
19783         (Property.Emit): Do not emit attributes for explicitly implemented
19784         properties, as there is no TypeBuilder.
19785
19786         (Indexer.Emit): ditto.
19787
19788         Hiding then means that we do not really *implement* a pending
19789         implementation, which makes code fail.
19790
19791 2002-06-22  Martin Baulig  <martin@gnome.org>
19792
19793         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19794         the return value of Object.GetType().  [FIXME: we need to do this whenever
19795         we get a type back from the reflection library].
19796
19797 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19798
19799         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19800
19801 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
19802
19803         * attribute.cs: Return null if we can not look up the type.
19804
19805         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19806         the interface types found.
19807
19808         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19809         interface types found.
19810
19811         * typemanager.cs (GetInterfaces): Make this routine returns alll
19812         the interfaces and work around the lame differences between
19813         System.Type and System.Reflection.Emit.TypeBuilder in the results
19814         result for GetInterfaces.
19815
19816         (ExpandInterfaces): Given an array of interface types, expand and
19817         eliminate repeated ocurrences of an interface.  This expands in
19818         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19819         be IA, IB, IC.
19820
19821 2002-06-21  Martin Baulig  <martin@gnome.org>
19822
19823         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19824         on System.Enum.
19825
19826 2002-06-21  Martin Baulig  <martin@gnome.org>
19827
19828         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
19829         and called with one of the core types, return the corresponding typebuilder for
19830         that type.
19831
19832         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19833         element type.
19834
19835 2002-06-21  Martin Baulig  <martin@gnome.org>
19836
19837         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19838         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19839         (Expression.ConvertReferenceExplicit): Likewise.
19840
19841         * expression.cs (ElementAccess.DoResolve): Likewise.
19842         (ElementAccess.DoResolveLValue): Likewise.
19843
19844 2002-06-10  Martin Baulig  <martin@gnome.org>
19845
19846         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19847         add the "value" parameter to the parameter list.
19848
19849         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19850         to our caller.
19851
19852 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
19853
19854         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19855         the argument to an int, uint, long or ulong, per the spec.  Also
19856         catch negative constants in array creation.
19857
19858 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19859
19860         * class.cs: do not allow the same interface to appear twice in
19861         the definition list.
19862
19863 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19864
19865         * ecore.cs: don't use ldlen with System.Array.
19866
19867 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19868
19869         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19870
19871 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19872
19873         * modifiers.cs: produce correct field attributes for protected
19874         internal. Easy fix so miguel can work on ther harder stuff:-)
19875
19876 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
19877
19878         * pending.cs: New file.  Move the code from class.cs here.
19879         Support clearning the pending flag for all methods (when not doing
19880         explicit interface implementation).
19881
19882 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19883
19884         * rootcontext.cs: added a couple more types needed to bootstrap.
19885
19886 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
19887
19888         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19889         constructor in the type, instead of any constructor in the type
19890         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
19891         a bug in the Mono runtime when applying the params attribute). 
19892
19893 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
19894         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19895
19896 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
19897
19898         * expression.cs (Unary.ResolveOperator): Use TypeManager
19899         to resolve the type.
19900
19901 2002-06-13  Ravi Pratap  <ravi@ximian.com>
19902
19903         * cs-parser.jay (enum_member_declaration): Pass in the attributes
19904         attached.
19905
19906         * enum.cs (AddEnumMember): Add support to store the attributes associated 
19907         with each member too.
19908
19909         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19910         field builders too - this takes care of the enum member case.
19911
19912 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
19913
19914         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19915         address-of operator on both value types and pointers.
19916
19917 2002-06-10  Martin Baulig  <martin@gnome.org>
19918
19919         * interface.cs (Interface.PopulateIndexer): Add the indexer's
19920         PropertyBuilder to the `property_builders' list.
19921
19922         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19923         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19924         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
19925         find any indexers which are inherited from an interface.
19926
19927 2002-06-09  Martin Baulig  <martin@gnome.org>
19928
19929         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19930         the same type as the constant if necessary.  There's also a test-130.cs
19931         for this.
19932
19933         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19934
19935         * typemanager.cs (TypeManager.ChangeType): Previously known as
19936         Enum.ChangeEnumType().
19937
19938 2002-06-09  Martin Baulig  <martin@gnome.org>
19939
19940         * expression.cs (Cast.TryReduce): Added support for consts.
19941
19942 2002-06-08  Ravi Pratap  <ravi@ximian.com>
19943
19944         * class.cs (Accessor): Hold attributes information so we can pass
19945         it along.
19946
19947         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19948         Modify to pass in attributes attached to the methods.
19949
19950         (add_accessor_declaration, remove_accessor_declaration): Ditto.
19951
19952         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19953         to handle the Accessor kind :-)
19954
19955         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19956
19957 2002-06-08  Martin Baulig  <martin@gnome.org>
19958
19959         * expression.cs (Unary.TryReduceNegative): Added support for
19960         ULongConstants.
19961
19962 2002-06-08  Martin Baulig  <martin@gnome.org>
19963
19964         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19965         name can't be found in the `defined_names' - the caller will do a
19966         MemberLookup in this case and thus find methods in System.Enum
19967         such as Enum.IsDefined().
19968
19969 2002-06-08  Martin Baulig  <martin@gnome.org>
19970
19971         * enum.cs (Enum.ChangeEnumType): This is a custom version of
19972         Convert.ChangeType() which works with TypeBuilder created types.
19973         (Enum.LookupEnumValue, Enum.Define): Use it here.
19974
19975         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19976         `TypeBuilder.BaseType != null' check.
19977         (TypeContainer.FindMembers): Only lookup parent members if we
19978         actually have a parent.
19979         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19980         (ConstructorInitializer.Resolve): Likewise.
19981
19982         * interface.cs (Interface.FindMembers): Added
19983         `TypeBuilder.BaseType != null' check.
19984
19985         * rootcontext.cs (RootContext.ResolveCore): Added
19986         "System.Runtime.CompilerServices.IndexerNameAttribute" to
19987         classes_second_stage.
19988
19989         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19990         debug_type and trace_type when compiling with --nostdlib.       
19991
19992 2002-06-07  Martin Baulig  <martin@gnome.org>
19993
19994         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19995         (AddField): Set it to true when adding a non-static field.
19996         (DefineType): Use `have_nonstatic_fields' to find out whether we
19997         have non-static fields, not `Fields != null'.
19998
19999 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
20000
20001         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
20002         dereferencing a null on the static-field code path)
20003
20004 2002-05-30  Martin Baulig  <martin@gnome.org>
20005
20006         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
20007         to take command line arguments.  Use reflection to call the new
20008         custom `Initialize' function on the symbol writer and pass it the
20009         command line arguments.
20010
20011         * driver.cs (--debug-args): New command line argument to pass command
20012         line arguments to the symbol writer.
20013
20014 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
20015
20016         * assign.cs (DoResolve): Forgot to do the implicit conversion to
20017         the target type for indexers and properties.  Thanks to Joe for
20018         catching this.
20019
20020 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
20021
20022         * typemanager.cs (MethodFlags): returns the method flags
20023         (Obsolete/ShouldIgnore) that control warning emission and whether
20024         the invocation should be made, or ignored. 
20025
20026         * expression.cs (Invocation.Emit): Remove previous hack, we should
20027         not do this on matching a base type, we should do this based on an attribute
20028
20029         Only emit calls to System.Diagnostics.Debug and
20030         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
20031         on the command line.
20032
20033         * rootcontext.cs: Global settings for tracing and debugging.
20034
20035         * cs-tokenizer.cs (define): New utility function to track
20036         defines.   Set the global settings for TRACE and DEBUG if found.
20037
20038 2002-05-25  Ravi Pratap  <ravi@ximian.com>
20039
20040         * interface.cs (Populate*): Pass in the TypeContainer as well as
20041         the DeclSpace as parameters so that we can create EmitContexts and
20042         then use that to apply attributes etc.
20043
20044         (PopulateMethod, PopulateEvent, PopulateProperty)
20045         (PopulateIndexer): Apply attributes everywhere.
20046
20047         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
20048         etc.
20049
20050         (ApplyAttributes): Update accordingly.
20051
20052         We now apply interface attributes for all members too.
20053
20054 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
20055
20056         * class.cs (Indexer.Define); Correctly check if we are explicit
20057         implementation (instead of checking the Name for a ".", we
20058         directly look up if the InterfaceType was specified).
20059
20060         Delay the creation of the PropertyBuilder.
20061
20062         Only create the PropertyBuilder if we are not an explicit
20063         interface implementation.   This means that explicit interface
20064         implementation members do not participate in regular function
20065         lookups, and hence fixes another major ambiguity problem in
20066         overload resolution (that was the visible effect).
20067
20068         (DefineMethod): Return whether we are doing an interface
20069         implementation. 
20070
20071         * typemanager.cs: Temporary hack until we get attributes in
20072         interfaces (Ravi is working on that) and we get IndexerName
20073         support in interfaces.
20074
20075         * interface.cs: Register the indexers as properties.
20076
20077         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
20078         warning, I have verified that this is a bug in the .NET runtime
20079         (JavaScript suffers of the same problem).
20080
20081         * typemanager.cs (MemberLookup): When looking up members for
20082         interfaces, the parent of an interface is the implicit
20083         System.Object (so we succeed in searches of Object methods in an
20084         interface method invocation.  Example:  IEnumerable x;  x.ToString
20085         ()) 
20086
20087 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
20088
20089         * class.cs (Event): Events should also register if they do
20090         implement the methods that an interface requires.
20091
20092         * typemanager.cs (MemberLookup); use the new GetInterfaces
20093         method. 
20094
20095         (GetInterfaces): The code used to lookup interfaces for a type is
20096         used in more than one place, factor it here. 
20097
20098         * driver.cs: Track the errors at the bottom of the file, we kept
20099         on going.
20100
20101         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
20102         instance if the method we are calling is static!
20103
20104 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
20105
20106         * attribute.cs (ApplyAttributes): Make this function filter out
20107         the IndexerName attribute (as that attribute in reality is never
20108         applied) and return the string constant for the IndexerName
20109         attribute. 
20110
20111         * class.cs (TypeContainer.Emit): Validate that all the indexers
20112         have the same IndexerName attribute, and if so, set the
20113         DefaultName attribute on the class. 
20114
20115         * typemanager.cs: The return value might contain other stuff (not
20116         only methods).  For instance, consider a method with an "Item"
20117         property and an Item method.
20118
20119         * class.cs: If there is a problem with the parameter types,
20120         return. 
20121
20122 2002-05-24  Ravi Pratap  <ravi@ximian.com>
20123
20124         * ecore.cs (ImplicitConversionExists): Wrapper function which also
20125         looks at user defined conversion after making a call to 
20126         StandardConversionExists - we need this for overload resolution.
20127
20128         * expression.cs : Update accordingly the various method calls.
20129
20130         This fixes 2 bugs filed against implicit user defined conversions 
20131
20132 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
20133
20134         * statement.cs: Track the result of the assignment.
20135
20136 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
20137
20138         * expression.cs (MemberAccess): Improved error reporting for
20139         inaccessible members.
20140
20141 2002-05-22  Martin Baulig  <martin@gnome.org>
20142
20143         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
20144         itself with debugging support.
20145
20146 2002-05-22  Martin Baulig  <martin@gnome.org>
20147
20148         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
20149         Removed, this isn't needed anymore.
20150
20151 2002-05-20  Martin Baulig  <martin@gnome.org>
20152
20153         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
20154         be underlying type for an enum.
20155
20156 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
20157
20158         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
20159         that splits out the loading of just the core types.
20160
20161         * rootcontext.cs (ResolveCore): Split the struct resolution in
20162         two, so we can load the enumeration underlying types before any
20163         enums are used.
20164
20165         * expression.cs (Is): Bandaid until we fix properly Switch (see
20166         bug #24985 for details).
20167
20168         * typemanager.cs (ImplementsInterface): The hashtable will contain
20169         a null if there are no interfaces implemented.
20170
20171 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
20172
20173         * cs-parser.jay (indexer_declarator): It is fine to have array
20174         parameters
20175
20176 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
20177
20178         * typemanager.cs: (RegisterBuilder): New function used to register
20179         TypeBuilders that implement interfaces.  Since
20180         TypeBuilder.GetInterfaces (as usual) does not work with lame
20181         Reflection.Emit. 
20182         (AddUserType): register interfaces.
20183
20184         (ImplementsInterface): Use the builder_to_ifaces hash if we are
20185         dealing with TypeBuilder.  Also, arrays are showing up as
20186         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
20187         methods can not be invoked on them!
20188
20189         * ecore.cs (ExplicitReferenceConversionExists): Made public.
20190         (ImplicitReferenceConversionExists): Split out from
20191         StandardConversionExists. 
20192
20193         * expression.cs (As): We were only implementing one of the three
20194         cases for the as operator.  We now implement them all.
20195         (Is): Implement the various other cases for Is as well.
20196
20197         * typemanager.cs (CACHE): New define used to control if we want or
20198         not the FindMembers cache.  Seems to have a negative impact on
20199         performance currently
20200
20201         (MemberLookup): Nested types have full acess to
20202         enclosing type members
20203
20204         Remove code that coped with instance/static returns for events, we
20205         now catch this in RealFindMembers.
20206
20207         (RealFindMembers): only perform static lookup if the instance
20208         lookup did not return a type or an event.  
20209
20210 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
20211
20212         * assign.cs (CompoundAssign): We pass more semantic information
20213         now to Compound Assignments than we did before: now we have all
20214         the information at hand, and now we resolve the target *before* we
20215         do the expression expansion, which allows the "CacheValue" method
20216         to have the effect we intended (before, a [x] += 1 would generate
20217         two differen ArrayAccess expressions from the ElementAccess,
20218         during the resolution process).
20219
20220         (CompoundAssign.DoResolve): Resolve target and original_source here.
20221
20222 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
20223
20224         * expression.cs (ArrayAccess): dropped debugging information. 
20225
20226         * typemanager.cs: Small bug fix: I was always returning i_members,
20227         instead of one of i_members or s_members (depending on which had
20228         the content).
20229
20230         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
20231         method is invoked before any code generation takes place, and it
20232         is a mechanism to inform that the expression will be invoked more
20233         than once, and that the method should use temporary values to
20234         avoid having side effects
20235
20236         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
20237
20238         * ecore.cs (Expression.CacheTemporaries): Provide empty default
20239         implementation.
20240
20241         * expression.cs (Indirection, ArrayAccess): Add support for
20242         CacheTemporaries in these two bad boys. 
20243
20244         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
20245         ldobj or ldind_ref.  
20246         (StoreFromPtr): Handle stobj as well.
20247
20248         * expression.cs (UnaryMutator): Share more code.
20249
20250         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
20251         down: I was not tracking the Filter function as well, which
20252         was affecting the results of the cache.
20253
20254 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
20255
20256         * attribute.cs: Remove the hack to handle the CharSet property on
20257         StructLayouts. 
20258
20259 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
20260
20261         * attribute.cs (DoResolve): More uglyness, we now only try to
20262         resolve the attribute partially, to extract the CharSet
20263         information (only if we are a StructLayout attribute).  Otherwise 
20264
20265         (GetExtraTypeInfo): Add some code to conditionally kill in the
20266         future this.   I am more and more convinced that the .NET
20267         framework has special code to handle the attribute setting on
20268         certain elements.
20269
20270         * expression.cs (IsParamsMethodApplicable): Revert my previous
20271         foreach change here, it was wrong.
20272
20273 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
20274
20275         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
20276         (pp_expr): do not abort on unknown input, just return.
20277         (eval): abort if there are pending chars.
20278
20279         * attribute.cs (Attribute.Resolve): Positional parameters are
20280         optional.  Deal with that case.
20281
20282         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
20283         the Ansi/Unicode/Auto information for the type.
20284
20285         (TypeContainer.DefineType): instantiate the EmitContext here, as
20286         we will be using it during the type definition (to resolve
20287         attributes) and during the emit phase.
20288
20289         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
20290         to pull type information out of the attributes
20291
20292         (Attribute.Resolve): track the constructor builder, and allow for
20293         multiple invocations (structs and classes will use this).
20294
20295         * ecore.cs (MemberLookupFinal): new version with all the
20296         parameters customizable.
20297
20298         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
20299         constructors.  Return if the result value is null (as the error
20300         would have been flagged already by MemberLookupFinal)
20301
20302         Do not allow instances of abstract classes or interfaces to be
20303         created.
20304
20305         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
20306         We have to compare the assembly property here when dealing with
20307         FamANDAssem and Assembly access modifiers, because we might be
20308         creating an assembly from *modules* (that means that we are not
20309         getting TypeBuilders for types defined in other modules that are
20310         part of this assembly).
20311
20312         (Method.Emit): If the method is marked abstract and has a body,
20313         emit an error. 
20314
20315         (TypeContainer.DefineMembers): If both the defined member and the
20316         parent name match are methods, then do not emit any warnings: let
20317         the Method.Define routine take care of flagging warnings.  But if
20318         there is a mismatch (method overrides something else, or method is
20319         overriwritten by something, then emit warning).
20320
20321         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
20322         set to null, this means `do not check for the return type on the
20323         signature'. 
20324
20325         (Method.Define): set the return type for the method signature to
20326         null, so that we get methods with the same name and parameters and
20327         different return types.  This is used to flag warning 114 (you are
20328         hiding a method, and you probably want to use the new/override
20329         keywords instead).
20330
20331         * typemanager.cs (MemberLookup): Implemented proper access
20332         control, closing a long standing set of bug reports.  The problem
20333         was that the Framework only has two bits: Public and NonPublic,
20334         and NonPublic includes private and protected methods, but we need
20335         to enforce the FamANDAssem, FamOrAssem and Family. 
20336
20337 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
20338
20339         * statement.cs (GotoCase): Return true: Ammounts to giving up
20340         knowledge on whether we return or not, and letting the other case
20341         be responsible for it.
20342
20343 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
20344
20345         * driver.cs: Do not load directories for each file processed, only
20346         do it if there is a pattern.
20347
20348         * ecore.cs: Report readonly assigns here as well, as we might have
20349         been resolved only by MemberAccess.
20350
20351         (SimpleName.SimpleNameResolve): Also be useful for LValue
20352         resolution.   We need this to propagate assign to local readonly variables
20353
20354         * typemanager.cs: Use a ptrhashtable for the criteria, because we
20355         do not want to reuse potential criteria memory.
20356
20357         * class.cs (MyEventBuilder): Set reflected_type;
20358
20359         * ecore.cs (Constantify): Added support for constifying bools.
20360
20361         (RootContext.LookupType): Added a cache for values looked up in
20362         the declaration space.
20363
20364         * typemanager.cs (FindMembers): Now is a front-end to
20365         RealFindMembers, and provides a two-level hashtable-based cache to
20366         the request.  
20367
20368         15% performance improvement: from 22.5 to 19.2 seconds.
20369
20370         * expression.cs (IsParamsMethodApplicable): use foreach.
20371         (Invocation.DoResolve): ditto.
20372         (New.DoResolve): ditto.
20373         (ArrayCreation.DoResolve): ditto.
20374
20375         * ecore.cs (FindMostEncompassingType): use foreach.
20376
20377         * delegate.cs (NewDelegate.DoResolve): Use foreach
20378
20379         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
20380         (RemoveMethods): use foreach.
20381
20382         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
20383         nested foreach statements instead of for, and also break out of
20384         the inner loop once a match is found.
20385
20386         (Invocation.OverloadResolve): Use foreach, simplify the code. 
20387
20388 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
20389
20390         * cfold.cs (BinaryFold): During an enumeration evaluation context,
20391         we actually unwrap the expression to allow for extra information
20392         to be extracted. 
20393
20394         * expression.cs: Use Shr_Un on unsigned operations. 
20395
20396 2002-05-08  Ravi Pratap  <ravi@ximian.com>
20397
20398         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
20399         applicable operators was not being considered correctly. This closes
20400         the bug Miguel reported.
20401
20402 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
20403
20404         * attribute.cs: check that the type derives from System.Attribute
20405         and report the correct error in that case (moved the duplicate code to
20406         its own method, too).
20407
20408 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
20409
20410         * attribute.cs: lookup attribute type name as the spec says: first the
20411         bare attribute name and then name + "Attribute" (nant compiles with
20412         mcs after this fix).
20413
20414 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
20415
20416         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
20417         Because of the way we parse things, we should try to see if a
20418         UIntConstant can fit in an integer.
20419
20420 2002-05-07  Ravi Pratap  <ravi@ximian.com>
20421
20422         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
20423         when we are in an explicit context.
20424
20425         (ConvertReferenceExplicit): When converting from Iface type S to Class
20426         T make sure the rules are implemented as an OR.
20427
20428         * parameter.cs (ParameterType): Make it a property for now although the
20429         purpose really isn't anything immediate.
20430
20431         * expression.cs (Is*Applicable): Do better checking on the parameter type
20432         of a ref/out parameter. The ones from the system assemblies are already 
20433         marked with the correct type so we don't need to do any correction.
20434
20435         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
20436         the object type is standard too so include that.
20437
20438 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20439
20440         * ecore.cs (StandardConversionExists): Augment with missing code:
20441         deal with IntConstant, LongConstants and Enumerations.
20442
20443         * assign.cs: Report the error, instead of failing silently
20444
20445         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
20446         typecontainer that they are declared, because the
20447         typecontainer/namespace will have the list of using clauses that
20448         need to be applied.
20449
20450         Assembly Attributes were escaping the normal registration
20451         mechanism. 
20452
20453         (EmitCode): Apply attributes within an EmitContext that represents
20454         the container they were declared on.
20455
20456         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
20457
20458 2002-05-06  Ravi Pratap  <ravi@ximian.com>
20459
20460         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
20461         Revamp completely - make much cleaner as we now operate only
20462         on a set of Types.
20463
20464         (FindMostSpecificSource, FindMostSpecificTarget): New methods
20465         to implement the logic detailed in the spec more correctly.
20466
20467         (UserDefinedConversion): Update accordingly.
20468
20469 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20470
20471         * statement.cs: Return flow analysis information up.
20472
20473         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
20474         and the default.
20475
20476         (token): Do not consume an extra character before calling
20477         decimal_digits.
20478
20479 2002-05-06  Piers Haken <piersh@friskit.com>
20480
20481         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
20482
20483 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20484
20485         * class.cs (Constructor.Emit): Set the IsStatic flag in the
20486         EmitContext during the instance constructor initializer
20487         resolution, to stop access to instance variables.
20488
20489         This is mandated by the spec, last paragraph of the `constructor
20490         initializers' section. 
20491
20492 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
20493
20494         * cs-parser.jay, class.cs (Accessor): new class used to represent
20495         an accessor (get or set).  In the past we used `null' to represent
20496         a missing accessor.  But this is ambiguous because there was no
20497         way to tell in abstract indexers/properties if one of them was
20498         specified.
20499
20500         Now there is a way of addressing that.
20501
20502         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
20503         instead of FindMembers.
20504
20505         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
20506         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
20507
20508         * attribute.cs: Treat indexers and properties as the same in terms
20509         of applying attributes
20510
20511         * ecore.cs (FindMostEncompassedType): Use statically initialized
20512         EmptyExpressions()s like we do elsewhere to avoid creating useless
20513         objects (and we take this out of the tight loop).
20514
20515         (GetConversionOperators): Move the code to extract the actual
20516         operators to a separate routine to clean things up.
20517
20518 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
20519
20520         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
20521         events are always registered FieldBuilders.
20522
20523         * class.cs (FieldBase): New class shared by Fields 
20524
20525         * delegate.cs: If we are a toplevel delegate, use our full name.
20526         If we are a nested delegate, then only use our tail name.
20527
20528 2002-05-02  Ravi Pratap  <ravi@ximian.com>
20529
20530         * expression.cs (IsApplicable): Ensure that we add the "&" to
20531         ref/out types before comparing it with the type of the argument.
20532
20533         (IsParamsMethodApplicable): Ditto.
20534
20535         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
20536         silly me ;-)
20537
20538         * delegate.cs : Handle the case when we have more than one applicable
20539         method. Flag an error only when we finish checking all.
20540
20541 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
20542
20543         * expression.cs: Add support for boolean static initializers.
20544
20545 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
20546
20547         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
20548
20549         * parameter.cs (ComputeParameterTypes,
20550         ComputeAndDefineParameterTypes): Better error handling: now we
20551         clear the `types' cache if we fail during any of the type lookups.
20552         We also return the status code correctly to our caller
20553
20554         * delegate.cs: If we fail to define a delegate, abort the extra
20555         steps. 
20556
20557         * expression.cs (Binary.ResolveOperator): for
20558         operator==(object,object) and operator !=(object, object) we also
20559         have to verify that there is an implicit conversion from one to
20560         the other.
20561
20562         (ArrayAccess.DoResolve): Array Access can operate on
20563         non-variables. 
20564
20565 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
20566
20567         * assign.cs (CompoundAssign): A new class used as a "flag" that
20568         the assignment actually is happening as part of a compound
20569         assignment operator.
20570
20571         During compound assignment, a few new rules exist to enable things
20572         like:
20573
20574         byte b |= 1 + 2
20575
20576         From the spec:
20577
20578         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
20579         to the type of x) if y is implicitly convertible to the type of x,
20580         and the operator is a builtin operator and the return type of the
20581         operator is explicitly convertible to the type of x. 
20582
20583         * rootcontext.cs: Reset warning level to 2.  4 catches various
20584         "interesting" features in mcs, we must clean this up at some
20585         point, but currently am trying to kill other bugs ;-)
20586
20587         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
20588         in container classes as well.  
20589
20590         * expression.cs (Binary.ResolveOperator): Handle string case
20591         before anything else (as operator overloading does emit an error
20592         before doing anything else).
20593
20594         This code could go away when we move to a table driven model, but
20595         i could not come up with a good plan last night.
20596
20597 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
20598
20599         * typemanager.cs (CSharpName): reimplementation using regex.
20600         * class.cs: added null check for fields in Emit
20601         * rootcontext.cs: set warninglevel to 4
20602
20603 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
20604
20605         * typemanager.cs (CSharpName): reimplemented with Lupus
20606         suggestion.
20607
20608 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
20609
20610         * statement.cs (If): correclty implement Resolve, because we were
20611         not catching sem errors in there.  The same process is needed
20612         everywhere else. 
20613         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
20614
20615
20616         (Statement.Warning_DeadCodeFound): Factorize code.
20617         (While): Report dead code here too.
20618
20619         (Statement): Added Resolve virtual method to allow
20620         for resolution split from the emit code.
20621
20622 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20623
20624         * statement.cs (EmitBoolExpression): No longer try to resolve the
20625         expression here.    
20626         (MakeBoolean): New utility function that resolve, implicitly
20627         converts to boolean and tags the expression. 
20628
20629
20630         (If, Do): Implement dead code elimination.
20631         (While): Implement loop inversion
20632
20633         (Do, While, For, If): Resolve the expression prior to calling our
20634         code generation.
20635
20636 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
20637
20638         * class.cs:
20639           - added method Report28 (warning: program has more than one entry point)
20640           - added method IsEntryPoint, implements paragraph 10.1 of the spec
20641           - modified method Method.Define, the part at the end of the method
20642
20643         * rootcontext.cs: added static public Location EntryPointLocation;
20644           
20645         * ../errors/cs0028.cs : Add test case for the above warning.              
20646
20647         * typemanager.cs:
20648           - modified method CSharpName to allow arrays of primitive type to
20649             be printed nicely (e.g. instead of System.Int32[][] it now prints
20650             int[][])
20651           - added method CSharpSignature: returns the signature of a method
20652             in string format to be used in reporting errors, warnings, etc.
20653
20654         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20655         with String.Empty.
20656
20657 2002-04-26  Ravi Pratap  <ravi@ximian.com>
20658
20659         * delegate.cs (Define): Fix extremely silly bug where I was
20660         setting the type of the 'object' parameter of the BeginInvoke
20661         method to System.IAsyncResult instead of System.Object ;-)
20662
20663 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20664
20665         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20666         here. 
20667
20668         (Constructor.Emit): return if we fail to initialize the
20669         constructor.  Another door closed!  
20670
20671         * expression.cs (New.DoResolve): Improve error message (from -6 to
20672         1501).  Use DeclaredOnly lookup to find the exact constructor.
20673
20674         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20675         loop.  This is useful.
20676
20677         * cs-parser.jay: Adjust the default parameters so that destructors
20678         have the proper signature.
20679
20680 2002-04-26  Martin Baulig  <martin@gnome.org>
20681
20682         * driver.cs (LoadAssembly): If `assembly' contains any characters
20683         which are only valid in path names and not in assembly names
20684         (currently slash, backslash and point), use Assembly.LoadFrom ()
20685         instead of Assembly.Load () on the `assembly' (before iteration
20686         over the link_paths).
20687
20688 2002-04-26  Martin Baulig  <martin@gnome.org>
20689
20690         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20691
20692 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
20693
20694         * class.cs (Property): use the new typemanager.MemberLookup
20695
20696         (TypeContainer.MemberLookup): Implement using the
20697         TypeManager.MemberLookup now. 
20698
20699         * typemanager.cs: Make MemberLookup a function of the TypeManager,
20700         and return MemberInfos, so that these can be used without an
20701         EmitContext (what we had before).
20702
20703 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
20704
20705         * expression.cs: Fix the case where the argument to params if the
20706         type of the params.  I omitted handling this before.   Fixed
20707
20708 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20709
20710         * driver.cs: Call BootCorlib_PopulateCoreType
20711
20712         * class.cs (Property.CheckBase): Check for properties only, not
20713         for all members. 
20714
20715         * interface.cs: Temporary hack: try/catch around the
20716         CustomAttributeBuilder, because I am getting an exception that I
20717         do not understand.
20718
20719         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20720         types whose definitions are required to be there (attributes are
20721         defined before standard types).
20722
20723         Compute definitions as we boot the various types, as they are used
20724         immediately (value_type class will need object_type, but if we do
20725         not initialize object_type, we will pass a null, which will let
20726         the runtime pick the System.Object from the existing corlib, which
20727         is not what we want).
20728
20729 2002-04-22  Patrik Torstensson <totte@labs2.com>
20730
20731         * cs-tokenizer.cs: fixed a number of trim() issues.
20732
20733 2002-04-22  Ravi Pratap  <ravi@ximian.com>
20734
20735         * expression.cs (Argument.Type): Ensure that we return the correct
20736         type when we have out or ref parameters [in which case we 
20737         append a "&"].
20738
20739 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20740
20741         * class.cs (Property, Indexer): Allow extern modifier in there. 
20742
20743         * typemanager.cs (InitBaseTypes): Initializes object_type and
20744         value_type, since those will be used early on during the bootstrap
20745         process to compile corlib.
20746
20747         (InitCoreTypes): Move code from here to InitBaseTypes.
20748
20749 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
20750
20751         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20752         single-dimension arrays as using the ldlen opcode.  
20753
20754         Daniel Lewis discovered this optimization.  
20755
20756         * typemanager.cs: Add signature for System.Array::get_Length
20757
20758 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20759
20760         * statement.cs: report the error when the foreach does not apply to an
20761         array nor a collection.
20762
20763 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
20764
20765         * expression.cs: Add implicit conversions to the operator ~.
20766
20767         * constant.cs (DecimalConstant.Emit): Emit decimal value.
20768
20769         * typemanager.cs: Locate the decimal constructor.
20770
20771 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20772
20773         * attribute.cs: use the new property of TypeOf.
20774         * expression.cs: added 'get' property around typearg.
20775
20776         These changes fix a build breaker reported by NickD. Is this the
20777         correct way to fix?  If not, please, revert my changes and make it
20778         work :-).
20779
20780 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
20781
20782         * attribute.cs: Add support for typeof in attribute invocations.
20783         I am not sure that this is right though.
20784
20785 2002-04-14  Duncan Mak  <duncan@ximian.com>
20786
20787         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20788         Binary.Operator.Division case.
20789
20790 2002-04-13  Ravi Pratap  <ravi@ximian.com>
20791
20792         * class.cs (DefineType): Ensure that we do a proper check on
20793         attribute types and also register it with the TypeManager.
20794
20795         (TypeContainer.Targets): The default for attribute types is
20796         AttributeTargets.All.
20797
20798         * attribute.cs (ApplyAttributes): Registering the attribute type
20799         is done elsewhere, not when we discover we have a Usage attribute.
20800
20801 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20802
20803         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20804         and get rid of is_delegate parameter.
20805
20806         * everywhere : update.
20807
20808 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20809
20810         * cs-parser.jay (compilation_unit): Revamp completely to use
20811         some new ideas that I got from Rhys' grammar to solve the problems
20812         with assembly level attributes.
20813
20814         (outer_declaration): New grammar production.
20815
20816         (attribute_sections): Add.
20817
20818         (opt_attributes): Base on attribute_sections
20819
20820         (namespace_declaration): Allow opt_attributes to tackle the case
20821         when we have assembly level attributes - we are clever in this
20822         regard now ;-)
20823
20824         * attribute.cs (ApplyAttributes): Do not worry about assembly 
20825         attributes in the non-global context.
20826
20827         * rootcontext.cs (AddGlobalAttributes): Go back to using this
20828         instead of SetGlobalAttributes.
20829
20830         * class.cs, rootcontext.cs : Ensure we define and generate 
20831         attribute types before anything else.
20832
20833         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20834         and flag the new error -20 for the case when the attribute type
20835         does not have valid targets specified. csc does not catch this.
20836
20837         * ../errors/errors.txt : update for error # -20
20838
20839 2002-04-11  Ravi Pratap  <ravi@ximian.com>
20840
20841         * support.cs (InternalParameters.ParameterModifier): Do some null
20842         checking and return sane values.
20843
20844         * class.cs (Method.Define): If we are a PInvoke method, ensure
20845         that we are static and extern. Report error # 601
20846
20847         * ../errors/cs0601.cs : Add test case for the above error.
20848
20849 2002-04-07  Ravi Pratap  <ravi@ximian.com>
20850
20851         * rootcontext.cs (attribute_types): We need to keep type of
20852         all attribute types separately and emit code for them first.
20853
20854         (RegisterAttribute) : Implement.
20855
20856         * class.cs (DefineType): Check if the current Type is a custom
20857         attribute type and register it accordingly.
20858
20859         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20860         adding the first attribute twice and rename to
20861
20862         (SetGlobalAttributes): this.
20863
20864         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20865         lookups.
20866
20867         * attribute.cs (ApplyAttributes): Take an additional argument telling us
20868         if we are processing global arguments. Hmm, I am unsure of this.
20869
20870 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20871
20872         * expression.cs: added static array of strings to avoid calling
20873         Enum.ToString () for Operator in Binary. Significant recover of
20874         performance.
20875
20876 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
20877
20878         * class.cs (FindMembers): Allow the Builders of the various
20879         members to be null.  If they are skip them.  This only happens
20880         during the PInvoke declaration.
20881
20882 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
20883
20884         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20885         failure, so we do not keep going afterwards.
20886
20887         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20888         wanted to pass `false' as the `is_delegate' argument.  If this is
20889         the case, why not use delegate_type == null to mean `is_delegate =
20890         false' and anything else as is_delegate = true.
20891
20892 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
20893
20894         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20895         code for the section, not the beginning of the tests.
20896
20897 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
20898
20899         * cfold.cs: Handle operator + (Enum x, Underlying x) 
20900
20901         * expression.cs (Binary): same.  Warn about errors where we have
20902         Enum/Enum in operator + as well.
20903
20904 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
20905
20906         * statement.cs:
20907                 - added support for switch(bool)
20908                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20909                 - add TableSwitchEmit() to handle table-based switch statements
20910
20911 2002-04-05  Ravi Pratap  <ravi@ximian.com>
20912
20913         * expression.cs (Invocation.OverloadResolve): Factor out code which
20914         does parameter compatibility checking with arguments so that we can 
20915         re-use the code even from Delegate.VerifyApplicability
20916
20917         (VerifyArgumentsCompat): Move above code here.
20918
20919         * delegate.cs (VerifyApplicability): Get rid of duplicate code
20920         and instead make a call to the above method.
20921
20922 2002-03-31  Ravi Pratap  <ravi@ximian.com>
20923
20924         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20925         We use it to keep track of classes which are attribute types.
20926
20927 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
20928
20929         * delegate.cs (Delegate.Define): Correctly define the types in the
20930         presence of fixed and array parameters.
20931
20932         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20933         doing FindMembers.
20934
20935         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20936         include NonPublic after the first iteration.
20937
20938         * class.cs (Indexer.CheckBase): Only check if both parents are
20939         non-null. 
20940
20941         * cs-parser.jay (accessor_body): If empty, set to null.
20942
20943         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20944         same code path here to resolve constants names that we did have in
20945         MemberAccess.DoResolve.  There is too much code duplicated here.
20946
20947 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
20948
20949         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20950
20951         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20952         to MakeUnionSet.
20953
20954         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20955         tokens, numbers and strings.
20956
20957         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20958         parenthesis.
20959
20960         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20961         asyncronous parameters and the regular parameters.  
20962
20963         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20964         specify the target directory.
20965
20966         * expression.cs: (This.DoResolve): Simplify
20967         (As.Emit): Optimize, do not generate IsInst if the expression is
20968         always of the given type.
20969
20970         (Is.DoResolve): Bug fix, we were reporting both always/never for
20971         the is expression.
20972
20973         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20974         creating too many unnecessary arrays.
20975
20976 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
20977
20978         * class.cs (EmitFieldInitializer): Use Assign expression to assign
20979         fields instead of rolling our own initializer.   Takes care of all
20980         implicit conversions, and drops unnecessary static checks/argument.
20981
20982 2002-03-31  Dick Porter  <dick@ximian.com>
20983
20984         * driver.cs: use the GetDirectories() return values properly, and
20985         use "/" as path separator.
20986
20987 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
20988
20989         * expression.cs (Unary): Optimize - - expr into expr.
20990         (Binary): Optimize a + (-b) into a -b.
20991
20992         * codegen.cs (CodeGen): Made all methods static.
20993
20994 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
20995
20996         * rootcontext.cs: 
20997
20998         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20999         TypeBuilder property.
21000
21001         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
21002         instead. 
21003
21004         * tree.cs: Removed the various RecordXXXX, and replaced with a
21005         single RecordDecl.  Removed all the accessor methods, and just
21006         left a single access point Type 
21007
21008         * enum.cs: Rename DefineEnum to DefineType.
21009
21010         * decl.cs: New abstract method `DefineType' used to unify the
21011         Defines for Enumerations, Interfaces, TypeContainers and
21012         Delegates.
21013
21014         (FindType): Moved LookupInterfaceOrClass here.  Moved the
21015         LookupBaseClasses method that used to live in class.cs and
21016         interface.cs here, and renamed to FindType.
21017
21018         * delegate.cs: Implement DefineType.  Take advantage of the
21019         refactored pattern for locating the parent builder without taking
21020         the parent_builder argument (which we know does not work if we are
21021         nested, and triggering a toplevel definition).
21022
21023 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
21024
21025         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
21026         accessibility of a member has changed during override and report
21027         an error if so.
21028
21029         * class.cs (Method.Define, Property.Define): Only complain on
21030         overrides if the method is private, any other accessibility is
21031         fine (and since we just checked the permission is the same, we are
21032         good to go).
21033
21034         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
21035         and elif are processed always.  The other pre-processing
21036         directives are only processed if we are "taking" the path
21037
21038 2002-03-29  Martin Baulig  <martin@gnome.org>
21039
21040         * class.cs (Method.Emit): Only emit symbolic debugging info if the
21041         current location is not Null.
21042
21043         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
21044         a separate method so we can profile it.
21045
21046         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
21047         `span.Seconds' are just seconds, but no minutes or hours.
21048         (MainDriver): Profile the CodeGen.SaveSymbols calls.
21049
21050 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
21051
21052         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
21053         Remove the gratuitous set of Final:
21054
21055                                 // If an interface implementation, then we can set Final.
21056                                 if (((flags & MethodAttributes.Abstract) == 0) &&
21057                                     implementing.DeclaringType.IsInterface)
21058                                         flags |= MethodAttributes.Final;
21059
21060         I do not know what I was smoking when I used that.
21061
21062
21063         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
21064         step into fixing the name resolution issues for delegates and
21065         unifying the toplevel name resolution.
21066
21067 2002-03-28  Martin Baulig  <martin@gnome.org>
21068
21069         * class.cs (Method.Emit): If we have a symbol writer, call its
21070         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
21071         tell it about the current method.
21072
21073         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
21074         writer that we're going to emit the first byte of IL code for a new
21075         statement (a new source line).
21076         (EmitContext.EmitTopBlock): If we have a symbol writer, call
21077         EmitContext.Mark() before emitting any code.
21078
21079         * location.cs (SymbolDocument): Return null when we're Null.
21080
21081         * statement.cs (Statement): Moved the `Location loc' variable here.
21082         (Statement.EmitBoolExpression): If we have a symbol writer, call
21083         ec.Mark() before emitting any code to tell it that we're at the
21084         beginning of a new statement.
21085         (StatementExpression): Added `Location' argument to the constructor.
21086         (Block): Added public readonly variable `StartLocation' and public
21087         variable `EndLocation'.  The latter is to be set using SetEndLocation().
21088         (Block): Added constructor which takes a start and end location.
21089         (Block.SetEndLocation): New method. This sets the end location.
21090         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
21091         local variables we create.
21092         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
21093         each statement and do also mark the begin and end of the block.
21094
21095         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
21096         tell it the current lexer.Location, use Location.Null for the end of the
21097         block.
21098         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
21099         current block, set its end location using SetEndLocation().
21100         (statement_expression): StatementExpression constructor now takes the
21101         lexer.Location as additional argument.
21102         (for_statement, declare_local_variables): Likewise.
21103         (declare_local_variables): When creating a new implicit block, use the
21104         new Block constructor and pass it the lexer.Location.
21105
21106 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
21107
21108         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
21109         members also on the parent interfaces recursively.
21110
21111 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
21112
21113         * report.cs: Use new formats, since Gonzalo finished the missing
21114         bits. 
21115
21116         * expression.cs (Binary.ResolveOperator): added missing operator|
21117         operator& and operator^ for bool/bool.
21118
21119         * cs-parser.jay: CheckDef now takes a Location argument that is
21120         used to report errors more precisly (instead of reporting the end
21121         of a definition, we try to track something which is a lot closer
21122         to the source of the problem).
21123
21124         * cs-tokenizer.cs: Track global token use, so we can properly flag
21125         the use of #define/#undef after the first token has been seen.
21126
21127         Also, rename the reportXXXX to Error_DescriptiveName
21128
21129         * decl.cs (DeclSpace.IsTopLevel): Move property here from
21130         TypeContainer, so that Enum and Interface can use this too.
21131
21132         * class.cs (TypeContainer.LookupInterfaceOrClass,
21133         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
21134         `builder' argument.  Typically this was used to pass the parent
21135         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
21136         the definition).  
21137
21138         The problem is that a nested class could trigger the definition of
21139         a toplevel class, and the builder would be obviously wrong in that
21140         case. 
21141
21142         So we drop this argument, and we compute dynamically the
21143         TypeBuilder/ModuleBuilder (the correct information was available
21144         to us anyways from DeclSpace.Parent)
21145
21146         * interface.cs (Interface.DefineInterface): Drop builder
21147         parameter cleanup like class.cs
21148
21149         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
21150         like class.cs
21151
21152         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
21153         values. 
21154
21155         (Try.Emit): Propagate the returns value from the statement.
21156
21157         (Return.Emit): Even if we are leavning 
21158
21159         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
21160
21161         * modifiers.cs: Fix the computation of MethodAttributes flags.
21162
21163 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
21164
21165         * driver.cs: allow compilation of files that start with '/'.
21166         Add a default case when checking the argument of --target.
21167
21168 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
21169
21170         * interface.cs: Implement the same search algorithm for types in
21171         the interface code.
21172
21173         * delegate.cs: Do not allow multiple definition.
21174
21175         * Recovered ChangeLog that got accidentally amputated
21176
21177         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
21178
21179         * rootcontext.cs: Load manually enum to allow core classes to
21180         contain enumerations.
21181
21182         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
21183         Update to new static methods in TypeManager.
21184
21185         * typemanager.cs (GetMethod, GetConstructor): Use our
21186         implementation of FindMembers to find the members, since during
21187         corlib compilation, the types are TypeBuilders and GetMethod and
21188         GetConstructor do not work.
21189
21190         Make all methods in TypeManager static.
21191
21192         (InitCodeHelpers): Split the functionality from
21193         the InitCodeTypes function.
21194
21195         * driver.cs: Call InitCodeHelpers after we have populated the
21196         types. 
21197
21198         * cs-parser.jay (delegate_declaration): we did not used to compute
21199         the delegate name correctly for void delegates.
21200
21201 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
21202
21203         * rootcontext.cs (RootContext): Init the interface_resolve_order
21204         and type_container_resolve_order always.
21205
21206         (ResolveCore, BootstrapCorlib_ResolveClass,
21207         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
21208         compiler when compiling with --nostdlib
21209
21210         * class.cs (TypeContainer.DefineType): Check that our parent is
21211         not null.  This test is most important when we are bootstraping
21212         the core types.
21213
21214         * codegen.cs: Split out the symbol writing code.
21215
21216 2002-03-25  Martin Baulig  <martin@gnome.org>
21217
21218         * driver.cs (-g): Made -g an alias for --debug.
21219
21220 2002-03-24  Martin Baulig  <martin@gnome.org>
21221
21222         * codegen.cs (SymbolWriter): New public variable. Returns the
21223         current symbol writer.
21224         (CodeGen): Added `bool want_debugging_support' argument to the
21225          constructor. If true, tell the ModuleBuild that we want debugging
21226         support and ask it for the ISymbolWriter.
21227         (Save): If we have a symbol writer, call it's Close() method after
21228         saving the assembly.
21229
21230         * driver.c (--debug): New command line argument to create a
21231         debugger information file.
21232
21233         * location.cs (SymbolDocument): New public property. Returns an
21234         ISymbolDocumentWriter object for the current source file or null
21235         if we don't have a symbol writer.
21236
21237 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
21238
21239         * driver.cs (LoadAssembly): Correctly return when all the paths
21240         have been tried and not before.
21241
21242         * statement.cs (Switch.Emit): return the actual coverage for this
21243         statement (returns/not-returns)
21244
21245         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
21246         switch of the statement if we are the last switch section.  That
21247         kills two problems: try/catch problems (we used to emit an empty
21248         nop at the end) and switch statements where all branches would
21249         return. 
21250
21251 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
21252
21253         * driver.cs: Add default assemblies (the equivalent to the
21254         Microsoft CSC.RSP file)
21255
21256         * cs-tokenizer.cs: When updating `cols and setting it to zero,
21257         also update tokens_seen and set it to false.
21258
21259         * driver.cs: Implement --recurse for Mike.
21260
21261         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
21262         correctly splitting out the paths.
21263
21264 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
21265
21266         * interface.cs (Interface.PopulateProperty): Instead of using
21267         `parent' as the declaration space for the set parameters, use
21268         `this' 
21269
21270         * support.cs (InternalParameters): InternalParameters constructor
21271         takes a DeclSpace instead of a TypeContainer.
21272
21273         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
21274         types are being initialized, load the address of it before calling
21275         the function.  
21276
21277         (New): Provide a mechanism to disable the generation of local
21278         value type temporaries when the caller will be providing us with
21279         an address to store it.
21280
21281         (ArrayCreation.EmitDynamicInitializers): Use it.
21282
21283 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
21284
21285         * expression.cs (Invocation.EmitArguments): Only probe for array
21286         property if there is more than one argument.  Sorry about that.
21287
21288         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
21289         empty param arrays.
21290
21291         * class.cs (Method.LabelParameters): Fix incorrect code path that
21292         prevented the `ParamArrayAttribute' from being applied to the
21293         params attribute.
21294
21295 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
21296
21297         * support.cs (ReflectionParameters): Correctly compute whether the
21298         last argument is a params array.  Fixes the problem with
21299         string.Split ('a')
21300
21301         * typemanager.cs: Make the assemblies array always be non-null
21302         (empty, but non-null)
21303
21304         * tree.cs (RecordDecl): New function that abstracts the recording
21305         of names.  This reports error 101, and provides a pointer to the
21306         previous declaration.  Fixes a crash in the compiler.
21307
21308         * cs-parser.jay (constructor_declaration): Update to new grammar,
21309         and provide a constructor_body that can be empty.
21310
21311 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
21312
21313         * driver.cs: Add support for --resources.
21314
21315         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
21316         Make all types for the various array helper methods be integer.
21317
21318         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
21319         CheckState to ConvCast.
21320
21321         (ConvCast): Now it takes a `checked' state argument, to avoid
21322         depending on the emit context for the conversion, and just using
21323         the resolve time setting.
21324
21325         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
21326         instead of Invocation.EmitArguments.  We do not emit the original
21327         arguments, instead we emit those which have been converted to
21328         unsigned int expressions.
21329
21330         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
21331
21332         * codegen.cs: ditto.
21333
21334         * expression.cs (LocalVariableReference): Drop the use of the
21335         Store function that depended on the variable index.
21336
21337         * statement.cs (VariableInfo): Drop the `Idx' property from this
21338         class, as this is not taking into account the indexes for
21339         temporaries tat we generate during the execution, getting the
21340         indexes wrong.
21341
21342         * class.cs: First emit class initializers, then call the parent
21343         constructor. 
21344
21345         * expression.cs (Binary): Fix opcode emision.
21346         (UnaryMutator.EmitCode): Support checked code generation
21347
21348         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
21349         matches for events for both the Static and Instance scans,
21350         pointing to the same element.   Fix that.
21351
21352 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
21353
21354         * rootcontext.cs (ResolveTree): Always set the
21355         interface_resolve_order, because nested interfaces will be calling
21356         into us.
21357
21358         * class.cs (GetInterfaceOrClass): Track the same resolution
21359         process used by TypeManager.LookupType.  This fixes the nested
21360         type lookups in class declarations (separate path from
21361         LookupType). 
21362
21363         (TypeContainer.DefineType): Also define nested interfaces.
21364         (TypeContainer.RegisterOrder): New public function used to
21365         register the order in which child interfaces need to be closed.
21366
21367         Nested interfaces need to be closed after their parents have been
21368         created. 
21369
21370         * interface.cs (InterfaceAttr): Put all the logic for computing
21371         the interface attribute here. 
21372
21373         (DefineInterface): Register our interface order with the
21374         RootContext or with the TypeContainer depending on the case.
21375
21376 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
21377
21378         * cs-parser.jay: rework foreach statement to work with the new
21379         changes to the policy on SimpleNames.
21380
21381         * report.cs: support Stacktrace on warnings as well.
21382
21383         * makefile: drop --unsafe and /unsafe from the compile.
21384
21385 2002-03-13  Ravi Pratap  <ravi@ximian.com>
21386
21387         * ecore.cs (StandardConversionExists): Modify to take an Expression
21388         as the first parameter. Ensure we do null -> reference type conversion
21389         checking.
21390
21391         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
21392         temporary Expression objects.
21393
21394 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
21395
21396         * interface.cs: workaround bug in method overloading resolution
21397         (there is already a bugzilla bug for it).
21398
21399 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
21400
21401         We could also solve this problem by having a separate path for
21402         performing type lookups, instead of DoResolve, we could have a
21403         ResolveType entry point, and only participating pieces of the
21404         production (simplename, deref, array) would implement this. 
21405
21406         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
21407         signal SimpleName to only resolve type names and not attempt to
21408         resolve anything else.
21409
21410         * expression.cs (Cast): Set the flag.
21411
21412         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
21413
21414         * class.cs: Only report 108 if there is no `new' modifier.
21415
21416         * cs-parser.jay: rework foreach statement to work with the new
21417         changes to the policy on SimpleNames.
21418         
21419         * report.cs: support Stacktrace on warnings as well.
21420
21421         * makefile: drop --unsafe and /unsafe from the compile.
21422
21423 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
21424
21425         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21426         lookups here, instead of doing that at parse time.  This means
21427         that our grammar will not introduce `LocalVariableReferences' as
21428         expressions at this point.  That solves the problem of code like
21429         this:
21430
21431         class X {
21432            static void Main ()
21433            { int X = 1;
21434             { X x = null }}}
21435
21436         This is only half the fix.  The full fix requires parameters to
21437         also be handled in this way.
21438
21439         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
21440         makes the use more obvious of the DeclSpace.  The
21441         ec.TypeContainer.TypeBuilder is now only used to pull the
21442         TypeBuilder for it.
21443
21444         My theory is that I can get rid of the TypeBuilder completely from
21445         the EmitContext, and have typecasts where it is used (from
21446         DeclSpace to where it matters).  
21447
21448         The only pending problem is that the code that implements Aliases
21449         is on TypeContainer, and probably should go in DeclSpace.
21450
21451         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21452         lookups here, instead of doing that at parse time.  This means
21453         that our grammar will not introduce `LocalVariableReferences' as
21454         expressions at this point.  That solves the problem of code like
21455         this:
21456
21457         class X {
21458            static void Main ()
21459            { int X = 1;
21460             { X x = null }}}
21461
21462         This is only half the fix.  The full fix requires parameters to
21463         also be handled in this way.
21464
21465         * class.cs (Property.DefineMethod): When implementing an interface
21466         method, set newslot, when implementing an abstract method, do not
21467         set the flag (before we tried never setting it, or always setting
21468         it, which is the difference).
21469         (Indexer.DefineMethod): same.
21470         (Method.DefineMethod): same.
21471
21472         * ecore.cs: Only set the status used flag if we get back a Field.
21473
21474         * attribute.cs: Temporary hack, so Paolo can keep working.
21475
21476 2002-03-08  Ravi Pratap  <ravi@ximian.com>
21477
21478         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
21479         the unmanaged type in the case we have a MarshalAs attribute.
21480
21481         (Resolve): Handle the case when we are parsing the special MarshalAs
21482         attribute [we need to store the unmanaged type to use later]
21483
21484         * typemanager.cs (marshal_as_attr_type): Built in type for the 
21485         MarshalAs Attribute.
21486
21487         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
21488         on parameters and accordingly set the marshalling info.
21489
21490 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
21491
21492         * class.cs: Optimizing slightly by removing redundant code after
21493         we switched to the `NoTypes' return value.
21494         (Property.DefineMethod): use NoTypes here too.
21495
21496         This fixes the bug I introduced in my last batch of changes.
21497
21498 2002-03-05  Ravi Pratap  <ravi@ximian.com>
21499
21500         * tree.cs (RecordEnum): Add. We now keep track of enums too.
21501
21502         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
21503         Enums since those are types too. 
21504
21505         * cs-parser.jay (enum_declaration): Record enums as we parse them.
21506
21507         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
21508         thanks to a call during the lookup process.
21509
21510 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
21511
21512         * statement.cs (Foreach): Lots of work to accomodate a particular
21513         kind of foreach statement that I had not kept in mind.  It is
21514         possible to have foreachs on classes that provide a GetEnumerator
21515         method that return objects that implement the "pattern" for using
21516         a foreach, there is no need to support GetEnumerator
21517         specifically. 
21518
21519         This is needed to compile nant.
21520
21521         * decl.cs: Only report 114 if the member is not `Finalize' and if
21522         the warning level is at least 2.
21523
21524         * class.cs: Moved the compare function from Method to
21525         MethodSignature. 
21526
21527         (MethodSignature.InheritableMemberSignatureCompare): Add new
21528         filter function that is used to extract inheritable methods from a
21529         class. 
21530
21531         (Method.Define): Use the new `inheritable_method_signature_filter'
21532         delegate
21533
21534         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
21535         command. 
21536
21537 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
21538
21539         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
21540
21541         * cs-parser.jay: Add opt_semicolon to the interface declaration.
21542
21543         * expression.cs: Pass location information to
21544         ConvertImplicitStandard. 
21545
21546         * class.cs: Added debugging code to track return values from
21547         interfaces. 
21548
21549 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
21550
21551         * expression.cs (Is.DoResolve): If either side of the `is' is an
21552         interface, do not flag the warning.
21553
21554         * ecore.cs (ImplicitReferenceConversion): We need a separate test
21555         for interfaces
21556
21557         * report.cs: Allow for --fatal to be used with --probe.
21558
21559         * typemanager.cs (NoTypes): Move the definition for the empty Type
21560         array here. 
21561
21562         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
21563         properties. 
21564         (TypeContainer.DefineProxy): New function used to proxy to parent
21565         implementations when implementing interfaces.
21566         (TypeContainer.ParentImplements): used to lookup if our parent
21567         implements a public function that is required by an interface.
21568         (TypeContainer.VerifyPendingMethods): Hook this up.
21569
21570         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
21571         `modules' and `assemblies' arraylists into arrays.  We only grow
21572         these are the very early start up of the program, so this improves
21573         the speedof LookupType (nicely measured).
21574
21575         * expression.cs (MakeByteBlob): Replaced unsafe code with
21576         BitConverter, as suggested by Paolo.
21577
21578         * cfold.cs (ConstantFold.Binary): Special case: perform constant
21579         folding of string concatenation, but if either side is a string,
21580         and the other is not, then return null, and let the runtime use
21581         the concatenation on the string plus the object (using
21582         `Object.ToString'). 
21583
21584 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
21585
21586         Constant Folding has been implemented now.
21587
21588         * expression.cs (Unary.Reduce): Do not throw an exception, catch
21589         the error instead on types that are not supported in one's
21590         complement. 
21591
21592         * constant.cs (Constant and all children): New set of functions to
21593         perform implict and explicit conversions.
21594
21595         * ecore.cs (EnumConstant): Implement the new functions to perform
21596         conversion by proxying to the child expression.
21597
21598         * codegen.cs: (ConstantCheckState): Constant evaluation has its
21599         own separate setting that can not be turned off from the command
21600         line using --unchecked or --checked and is only controlled using
21601         the checked/unchecked statements and expressions.  This setting is
21602         used by the constant folder to flag errors.
21603
21604         * expression.cs (CheckedExpr, UncheckedExpr): Set the
21605         ConstantCheckState as well.   
21606
21607         During Resolve, they also have to flag the state, because the
21608         constant folder runs completely in the Resolve phase.
21609
21610         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
21611         well.
21612
21613 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21614
21615         * cfold.cs: New file, this file contains the constant folder.
21616
21617         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21618         argument to track whether we are using the resulting address to
21619         load or store a value and provide better error messages. 
21620
21621         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21622         new AddressOf arguments.
21623
21624         * statement.cs (Foreach.EmitCollectionForeach): Update
21625
21626         * expression.cs (Argument.Emit): Call AddressOf with proper
21627         arguments to track usage.
21628
21629         (New.DoEmit): Call AddressOf with new arguments.
21630
21631         (Unary.Emit): Adjust AddressOf call.
21632
21633 2002-03-01  Ravi Pratap  <ravi@ximian.com>
21634
21635         * cs-parser.jay (member_access): Change the case for pre-defined types
21636         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
21637         this suggestion.
21638
21639         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21640         a method body.
21641
21642         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21643         essentially like methods and apply attributes like MethodImplOptions to them too.
21644
21645         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21646         not being null.
21647
21648         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21649         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21650         is the DeclSpace.
21651
21652         * Update code everywhere accordingly.
21653
21654         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21655
21656         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21657
21658 2002-02-28  Ravi Pratap  <ravi@ximian.com>
21659
21660         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21661         try performing lookups against those instead of jumping straight into using
21662         the 'using' clauses.
21663
21664         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21665
21666         (LookupType): Perform lookups in implicit parents too.
21667
21668         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21669         sequence as RootContext.LookupType. 
21670
21671         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
21672         the various cases of namespace lookups into this method.
21673
21674 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21675
21676         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21677         in positional arguments)
21678
21679         * class.cs (Operator): Update the AllowedModifiers to contain
21680         extern. 
21681
21682         * cs-parser.jay: Update operator declaration to allow for the
21683         operator body to be empty.
21684
21685         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21686         values. 
21687
21688 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
21689
21690         * class.cs (Method.Emit): Label parameters.
21691
21692         * driver.cs: Return 1 or 0 as the program exit code.
21693
21694 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
21695
21696         * expression.cs: Special case the `null' object when trying to
21697         auto-compute the type, as anything can be explicitly converted to
21698         that. 
21699
21700         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21701         spotting this Paolo.
21702
21703         (Expression.ImplicitNumericConversion): Perform comparissions of
21704         the type using the underlying type in the case of an enumeration
21705         rather than using the enumeration type for the compare.
21706
21707         Cope with the underlying == type case, which is not possible to
21708         catch before. 
21709
21710         (Expression.ConvertNumericExplicit): Perform comparissions of
21711         the type using the underlying type in the case of an enumeration
21712         rather than using the enumeration type for the compare.
21713
21714         * driver.cs: If the user does not supply an extension, assume .exe
21715
21716         * cs-parser.jay (if_statement): Rewrote so that we can track the
21717         location for the if statement.
21718
21719         * expression.cs (Binary.ConstantFold): Only concat strings when
21720         the operation is "+", not everything ;-)
21721
21722         * statement.cs (Statement.EmitBoolExpression): Take a location
21723         argument. 
21724         (If, While, Do): Track location.
21725
21726         * expression.cs (Binary.ResolveOperator): In the object + string
21727         case, I was missing a call to ConvertImplicit
21728
21729 2002-02-25  Ravi Pratap  <ravi@ximian.com>
21730
21731         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21732         Location arguments. Ensure we use RootContext.LookupType to do our work
21733         and not try to do a direct Type.GetType and ModuleBuilder.GetType
21734
21735         * interface.cs (PopulateMethod): Handle the type of the parameter being
21736         null gracefully.
21737
21738         * expression.cs (Invocation.BetterFunction): Handle the case when we 
21739         have a params method with no fixed arguments and a call is made with no
21740         arguments.
21741
21742 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
21743
21744         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21745         the verbatim-string-literal
21746
21747         * support.cs (InternalParameters.ParameterModifier): handle null
21748         fixed parameters.
21749         (InternalParameters.ParameterType): ditto.
21750
21751         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21752         duplicating the name of the variable parameter.
21753         (GetParameterByName): Fix bug where we were not looking up array
21754         paramters if they were the only present (thanks Paolo!).
21755         (GetParameterInfo): We only have an empty set of types if both
21756         fixed and array are set to null.
21757         (GetParameterInfo-idx): Handle FixedParameter == null
21758
21759         * cs-parser.jay: Handle the case where there is no catch
21760         statements (missing null test).
21761
21762 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
21763
21764         * driver.cs (MainDriver): Be conservative on our command line
21765         handling.
21766
21767         Catch DirectoryNotFoundException when calling GetFiles.
21768
21769         (SplitPathAndPattern): Used to split the input specification into
21770         a path and a pattern that we can feed to Directory.GetFiles.
21771
21772 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
21773
21774         * statement.cs (Fixed): Implement the last case of the Fixed
21775         statement (string handling).
21776
21777         * expression.cs (StringPtr): New class used to return a char * to
21778         a string;  Used by the Fixed statement.
21779
21780         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
21781
21782         * expression.cs (Binary.ResolveOperator): Remove redundant
21783         MemberLookup pn parent type.
21784         Optimize union call, we do not need a union if the types are the same.
21785         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21786         type.
21787
21788         Specialize the use of MemberLookup everywhere, instead of using
21789         the default settings. 
21790
21791         (StackAlloc): Implement stackalloc keyword.
21792
21793         * cs-parser.jay: Add rule to parse stackalloc.
21794
21795         * driver.cs: Handle /h, /help, /?
21796
21797         * expression.cs (MakeByteBlob): Removed the hacks we had in place
21798         before we supported unsafe code.
21799
21800         * makefile: add --unsafe to the self compilation of mcs.
21801
21802 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
21803
21804         * expression.cs (PointerArithmetic): New class that is used to
21805         perform pointer arithmetic.
21806         (Binary.Resolve): Handle pointer arithmetic
21807         Handle pointer comparission.
21808         (ArrayPtr): Utility expression class that is used to take the
21809         address of an array.
21810
21811         (ElementAccess): Implement array access for pointers
21812
21813         * statement.cs (Fixed): Implement fixed statement for arrays, we
21814         are missing one more case before we are done.
21815
21816         * expression.cs (Indirection): Implement EmitAssign and set the
21817         ExprClass to Variable.  This allows pointer dereferences to be
21818         treated as variables, and to have values assigned to them.
21819
21820         * ecore.cs (Expression.StoreFromPtr): New utility function to
21821         store values dereferencing.
21822
21823 2002-02-20  Ravi Pratap  <ravi@ximian.com>
21824
21825         * expression.cs (Binary.ResolveOperator): Ensure that we are
21826         not trying to operate on a void type - this fixes the reported
21827         bug.
21828
21829         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21830         the parent implementation is sealed.
21831
21832         * ../errors/cs0239.cs : Add.
21833
21834         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21835
21836         * typemanager.cs (unverifiable_code_type): Corresponds to 
21837         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21838         which have unsafe code in them.
21839
21840         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
21841         unsafe context.
21842
21843 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
21844
21845         * cs-tokenizer.cs: Add support for @"litreal strings"
21846
21847         Make tokenizer accept pre-processor directives
21848         on any column (remove the old C-like limitation). 
21849
21850         * rootcontext.cs (EmitCode): Emit any global attributes.
21851         (AddGlobalAttributes): Used to keep track of assembly attributes. 
21852
21853         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21854
21855         * cs-parser.jay: Add support for global attributes.  
21856
21857 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
21858
21859         * expression.cs (Indirection): New helper class.  Unary will
21860         create Indirection classes to be able to implement the
21861         IMemoryLocation interface on it.
21862
21863 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
21864
21865         * cs-parser.jay (fixed_statement): reference the right statement.
21866
21867         * statement.cs (Fixed.Emit): Finish implementing the fixed
21868         statement for the &x case.
21869
21870 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
21871
21872         * class.cs (Property.Define, Method.Define): Remove newslot when
21873         `implementing'.  
21874
21875         * modifiers.cs: My use of NewSlot when `Abstract' was set was
21876         wrong.  NewSlot should only be used if the `new' keyword is present.
21877
21878         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21879         locating our system dir.  Sorry about this.
21880
21881 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21882
21883         * driver.cs (GetSystemDir): Compute correctly the location of our
21884         system assemblies.  I was using the compiler directory instead of
21885         the library directory.
21886
21887 2002-02-13  Ravi Pratap  <ravi@ximian.com>
21888
21889         * expression.cs (BetterFunction): Put back in what Miguel commented out
21890         since it is the correct fix. The problem is elsewhere ;-)
21891
21892         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21893         parameters of the parms method are themselves compatible or not !
21894
21895         (StandardConversionExists): Fix very dangerous bug where we were forgetting
21896         to check that a class implements an interface before saying that an implicit
21897         conversion was allowed. Use ImplementsInterface to do the checking.
21898
21899 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21900
21901         * class.cs (Method.Define): Track whether we are an explicit
21902         implementation or not.  And only call DefineMethodOverride if we
21903         are an explicit implementation.
21904
21905         (Property.DefineMethod): Ditto.
21906
21907 2002-02-11  Ravi Pratap  <ravi@ximian.com>
21908
21909         * expression.cs (BetterFunction): Catch hideous bug which was
21910          preventing us from detecting ambiguous calls due to implicit casts i.e
21911         cs0121.
21912
21913 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
21914
21915         * support.cs (Pair): Remove un-needed method.  I figured why I was
21916         getting the error in cs-parser.jay, the variable in a foreach loop
21917         is readonly, and the compiler does not really treat this as a variable.
21918
21919         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
21920         instead of EQUALS in grammar.  
21921
21922         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21923
21924         * expression.cs (Unary.DoResolve): Check whether the argument is
21925         managed or not.
21926
21927 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
21928
21929         * support.cs: Api for Pair to set a value.  Despite the fact that
21930         the variables are public the MS C# compiler refuses to compile
21931         code that accesses the field if the variable is part of a foreach
21932         statement. 
21933
21934         * statement.cs (Fixed): Begin implementation of the fixed
21935         statement.
21936
21937         (Block.AddVariable): Return the VariableInfo on success and null
21938         on failure instead of true/false. 
21939
21940         * cs-parser.jay (foreach): Catch errors on variables already
21941         defined (we were ignoring this value before) and properly unwind
21942         the block hierarchy
21943
21944         (fixed_statement): grammar for the fixed statement.
21945
21946 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
21947
21948         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21949         pointer types to be incretemented.
21950
21951         (SizeOf): Implement.
21952
21953         * cs-parser.jay (pointer_member_access): Implement
21954         expr->IDENTIFIER production.
21955
21956         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21957         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21958         on safe contexts.
21959
21960         (Unary): Implement indirection.
21961
21962         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21963         use in non-unsafe context).
21964
21965         (SimpleName.DoResolve): Check for pointers in field access on safe
21966         contexts. 
21967
21968         (Expression.LoadFromPtr): Factor the load-indirect code in this
21969         function.  This was duplicated in UnboxCast and ParameterReference
21970
21971 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
21972
21973         * expression.cs (ComposedCast): report an error if a pointer cast
21974         is used in a safe region.
21975
21976         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21977         pointer type casts in unsafe context.
21978
21979         * codegen.cs (EmitContext): Set up IsUnsafe.
21980
21981         * cs-parser.jay (non_expression_type): Add productions for pointer
21982         casts. 
21983
21984         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21985         code.  We should not use force into static mode if the method is
21986         not virtual.  Fixes bug in MIS
21987
21988         * statement.cs (Do.Emit, While.Emit, For.Emit,
21989         Statement.EmitBoolExpression): Add support to Do and While to
21990         propagate infinite loop as `I do return' semantics.
21991
21992         Improve the For case to also test for boolean constants.
21993
21994         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21995         to the list of attributes we can add.
21996
21997         Remove `EmitContext' argument.
21998
21999         * class.cs (Method.Define): Apply parameter attributes.
22000         (Constructor.Define): Apply parameter attributes.
22001         (MethodCore.LabelParameters): Move here the core of labeling
22002         parameters. 
22003
22004         * support.cs (ReflectionParameters.ParameterModifier,
22005         InternalParameters.ParameterModifier): Use IsByRef on the type and
22006         only return the OUT bit for these parameters instead of in/out/ref
22007         flags.
22008
22009         This is because I miss-understood things.  The ParameterInfo.IsIn
22010         and IsOut represent whether the parameter has the [In] and [Out]
22011         attributes set.  
22012
22013 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
22014
22015         * ecore.cs (FieldExpr.Emit): Release temporaries.
22016
22017         * assign.cs (LocalTemporary.Release): new function.
22018
22019         * codegen.cs (EmitContext.GetTemporaryStorage,
22020         EmitContext.FreeTemporaryStorage): Rework the way we deal with
22021         temporary storage.  Now we can "put back" localbuilders when we
22022         are done with them
22023
22024 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
22025
22026         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
22027         need to make a copy of the variable to generate verifiable code.
22028
22029 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
22030
22031         * driver.cs: Compute dynamically the system directory.
22032
22033         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
22034         Slower, but more generally useful.  Used by the abstract
22035         registering implementation. 
22036
22037         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
22038         the rules for the special rule on Type/instances.  First check if
22039         we have the same name, and if so, try that special static path
22040         rather than the instance path.
22041
22042 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
22043
22044         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
22045         for, while and if.
22046
22047         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
22048         Enum, ValueType, Delegate or Array for non-corlib compiles.
22049
22050         * cs-tokenizer.cs: Catch long identifiers (645)
22051
22052         * typemanager.cs (IndexerPropetyName): Ravi never tested this
22053         piece of code.
22054
22055         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
22056         fix, we were returning too early, so we were not registering
22057         pending methods from abstract classes.
22058
22059         Do not register pending methods if the class is abstract.
22060
22061         * expression.cs (Conditional.DoResolve): Report circular implicit
22062         conversions when we neecd to compute it for conditional
22063         expressions. 
22064
22065         (Is.DoResolve): If the expression is always of the provided type,
22066         flag warning 183.  If the expression can not ever be of the
22067         provided type flag warning 184.
22068
22069         * class.cs: Catch 169 as well.
22070
22071         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
22072         read. 
22073
22074 2002-01-18  Nick Drochak  <ndrochak@gol.com>
22075
22076         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
22077
22078 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
22079
22080         * interface.cs: (PopulateMethod): Check for pointers being defined
22081         only if the unsafe context is active.
22082         (PopulateProperty): ditto.
22083         (PopulateIndexer): ditto.
22084
22085         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
22086         specified.  If pointers are present, make sure that they are
22087         present in an unsafe context.
22088         (Constructor, Constructor.Define): ditto.
22089         (Field, Field.Define): ditto.
22090         (Property, Property.Define): ditto.
22091         (Event, Event.Define): ditto.
22092
22093         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
22094         hashtable if there are classes or structs defined.
22095
22096         * expression.cs (LocalVariableReference.DoResolve): Simplify this
22097         code, as the constant resolution moved.
22098
22099         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
22100         the metadata, so we can flag error 133. 
22101
22102         * decl.cs (MemberCore.UnsafeOK): New function to test that a
22103         pointer is being declared in an unsafe context.
22104
22105 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
22106
22107         * modifiers.cs (Modifiers.Check): Require a Location argument.
22108         Report error 227 for Unsafe use.
22109
22110         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
22111
22112         * statement.cs (For.Emit): If the test is null, then report that
22113         we do `return', as we wont reach anything afterwards.
22114
22115         (Switch.SwitchGoverningType): Track the expression that matched
22116         the conversion.
22117
22118         * driver.cs: Allow negative numbers as an error code to flag.
22119
22120         * cs-parser.jay: Handle 1551.
22121
22122         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
22123
22124 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
22125
22126         * cs-parser.jay: Report 1518 (type declaration can only contain
22127         class, struct, interface, enum or delegate)
22128
22129         (switch_label): Report 1523 (keywords `case' or `default' must
22130         preced code)
22131
22132         (opt_switch_sections): Report 1522 (empty switch)
22133
22134         * driver.cs: Report 1515 (response file specified multiple times)
22135         Report 1516 (Source file specified multiple times).
22136
22137         * expression.cs (Argument.Resolve): Signal 1510
22138
22139         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
22140         access not allowed in static code)
22141
22142 2002-01-11  Ravi Pratap  <ravi@ximian.com>
22143
22144         * typemanager.cs (IsPointerType): Utility method which we are going
22145         to need a lot.
22146
22147         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
22148         the object type, so we take care of that.
22149
22150         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
22151
22152         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
22153         added to non-params parameters :-)
22154
22155         * typemanager.cs (CSharpName): Include 'void' type too. 
22156
22157         (void_ptr_type): Include in the set of core types.
22158
22159         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
22160         duplicating code.
22161
22162         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
22163         an unsafe context.
22164
22165         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
22166         completely forgotten about it.
22167
22168 2002-01-10  Ravi Pratap  <ravi@ximian.com>
22169
22170         * cs-parser.jay (pointer_type): Add. This begins our implementation
22171         of parsing rules for unsafe code.
22172
22173         (unsafe_statement): Implement.
22174
22175         (embedded_statement): Modify to include the above.
22176
22177         * statement.cs (Unsafe): Implement new class for unsafe blocks.
22178
22179         * codegen.cs (EmitContext.InUnsafe): Add. This determines
22180         if the current context is an unsafe one.
22181
22182         * cs-parser.jay (local_variable_pointer_type): Since local variable types
22183         are handled differently, we need separate rules for them.
22184
22185         (local_variable_declaration): Update to use local_variable_pointer_type
22186         to allow variable declarations of unmanaged pointer types.
22187
22188         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
22189         in unsafe contexts.
22190
22191         * ../errors/cs0214.cs : Add.
22192
22193 2002-01-16  Nick Drochak  <ndrochak@gol.com>
22194
22195         * makefile: remove 'response' file when cleaning.
22196
22197 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
22198
22199         * cs-parser.jay: Report 1524.
22200
22201 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
22202
22203         * typemanager.cs (RegisterMethod): drop checking if we have
22204         registered this from here
22205
22206 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
22207
22208         * class.cs (Method.EmitDestructor): Implement calling our base
22209         destructor. 
22210
22211         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
22212         value of InFinally.
22213
22214         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
22215         this routine and will wrap the call in a try/catch block.  Deal
22216         with the case.
22217
22218 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
22219
22220         * ecore.cs (Expression.MemberLookup): instead of taking a
22221         parameter `same_type' that was used to tell whether we could
22222         access private members we compute our containing type from the
22223         EmitContext.
22224
22225         (FieldExpr): Added partial support for volatile fields.  This does
22226         not work for volatile fields exposed from assemblies, as I can not
22227         figure out how to extract the modreq from it.
22228
22229         Updated all the source files to use this.
22230
22231         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
22232         because it is referenced by MemberLookup very often. 
22233
22234 2002-01-09  Ravi Pratap  <ravi@ximian.com>
22235
22236         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
22237         TypeBuilder.GetCustomAttributes to retrieve what we need.
22238
22239         Get rid of redundant default_member_attr_type as this is the same as
22240         default_member_type which already exists.
22241
22242         * interface.cs, attribute.cs : Update accordingly.
22243
22244 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
22245
22246         * typemanager.cs: Enable IndexerPropertyName again.  It does not
22247         work for TYpeBuilders though.  Ravi, can you please fix this?
22248
22249         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
22250
22251         * expression.cs (Argument.Emit): Handle the case of ref objects
22252         being passed to ref functions;  
22253
22254         (ParameterReference.EmitLoad): Loads the content of the pointer
22255         without dereferencing.
22256
22257 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
22258
22259         * cs-tokenizer.cs: Implemented the pre-processing expressions.
22260
22261 2002-01-08  Ravi Pratap  <ravi@ximian.com>
22262
22263         * class.cs (Indexer.DefineMethod): Incorporate the interface
22264         type in the name of the method if we are doing explicit interface
22265         implementation.
22266
22267         * expression.cs (ConversionExists): Remove as it is completely obsolete.
22268
22269         (BetterConversion): Fix extremely trivial bug where we were referring to
22270         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
22271         again !
22272
22273         * ../errors/bug16.cs : Add although we have fixed it.
22274
22275 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
22276
22277         * expression.cs (BaseIndexer): Begin implementation.
22278
22279         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
22280
22281         * cs-parser.jay (indexer_declarator): Use qualified_identifier
22282         production directly to remove a shift/reduce, and implement
22283         explicit interface implementation.
22284
22285         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
22286         after a floating point suffix.
22287
22288         * expression.cs (DoNumericPromotions): Improved the conversion for
22289         uint/uint.  If we have a constant, we avoid doing a typecast to a
22290         larger type.
22291
22292         * class.cs (Indexer): Implement explicit interface implementation
22293         for indexers.
22294
22295 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
22296
22297         * class.cs: make the default instance constructor public and hidebysig.
22298
22299 2001-01-03  Ravi Pratap  <ravi@ximian.com>
22300
22301         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
22302         so we can call it from elsewhere.
22303
22304         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
22305         we emit it internally if the class has a defined indexer; otherwise the user
22306         emits it by decorating the class definition with the DefaultMemberAttribute.
22307
22308         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
22309         attribute is not used on a type which defines an indexer.
22310
22311         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
22312         character when we skip whitespace.
22313
22314         * ../errors/cs0646.cs : Add.
22315
22316 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
22317
22318         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
22319         again. 
22320
22321         * makefile: Add practical target `mcs3.exe' which builds the third
22322         generation compiler. 
22323
22324         * expression.cs (New): Fix structures constructor calling.
22325
22326         * class.cs (Property, Method, Indexer): Emit Final flag on the
22327         method if we are an interface implementation and we are not
22328         abstract. 
22329
22330         * ecore.cs (PropertyExpr): New public field `IsBase', tells
22331         whether this property is referencing a `base' method.
22332
22333         * expression.cs (Invocation.EmitCall): take an extra argument:
22334         is_base, this is used to determine whether the `call' or
22335         `callvirt' opcode should be used.
22336
22337
22338         * delegate.cs: update EmitCall.
22339
22340         * class.cs (Method.Define): Set NewSlot for the cases where we are
22341         not implementing an interface method.
22342
22343         (Property.Define): ditto.
22344
22345 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
22346
22347         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
22348         'r'.  Allows mcs to parse itself fully.
22349
22350 2002-01-02  Ravi Pratap  <ravi@ximian.com>
22351
22352         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
22353         of the number of initializers that require the InitializeArray method.
22354
22355         (CheckIndices): Store the Expression in all cases - not the plain value. Also
22356         update the above field where necessary.
22357
22358         (MakeByteBlob): Update accordingly.
22359
22360         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
22361         greater than 2.
22362
22363         (EmitDynamicInitializers): Update in accordance with the new optimization.
22364
22365         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
22366         same OpCode applies.
22367
22368         * cs-parser.jay : Fix some glaring errors I introduced.
22369
22370 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
22371
22372         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
22373         so that we can check for name clashes there too.
22374
22375         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
22376         for interface indexers.
22377
22378         * interfaces.cs (Define): Emit the default member attribute.
22379
22380         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
22381         variable was being referred to while setting the value ;-)
22382
22383 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
22384
22385         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
22386         byte-by-byte information when we know the data is zero.
22387
22388         Make the block always a multiple of 4, because
22389         DefineInitializedData has a bug.
22390
22391         * assign.cs: Fix, we should assign from the temporary, not from
22392         the source. 
22393
22394         * expression.cs (MakeByteBlob): Fix my incorrect code.
22395
22396 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
22397
22398         * typemanager.cs (EnumToUnderlying): This function is used to get
22399         the underlying type from an enumeration, because it does not
22400         always work. 
22401
22402         * constant.cs: Use the I4_S form for values between -128 and 127.
22403
22404         * statement.cs (Block.LookupLabel): Looks up a label.
22405         (Block): Drop support for labeled blocks.
22406
22407         (LabeledStatement): New kind of statement that represents a label
22408         only.
22409
22410         (Goto): Finally implement this bad boy.
22411
22412         * cs-parser.jay: Update to reflect new mechanism to implement
22413         labels.
22414
22415 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
22416
22417         * codegen.cs (EmitContext.This): a codegen property that keeps the
22418         a single instance of this instead of creating many different this
22419         instances. 
22420
22421         * delegate.cs (Delegate.DoResolve): Update to use the property;
22422
22423         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
22424
22425         * expression.cs (BaseAccess.DoResolve): Ditto.
22426
22427 2001-12-29  Ravi Pratap  <ravi@ximian.com>
22428
22429         * typemanager.cs (methodimpl_attr_type): Add to hold the type
22430         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
22431
22432         (InitCoreTypes): Update accordingly.
22433
22434         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
22435         so we can quickly store the state.
22436
22437         (ApplyAttributes): Set the correct implementation flags
22438         for InternalCall methods.
22439
22440 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
22441
22442         * expression.cs (EmitCall): if a method is not virtual, then do
22443         not use callvirt on it.
22444
22445         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
22446         user defined stuff) requires the use of stobj, which takes an
22447         address on the stack instead of an array and an index.  So emit
22448         the Ldelema operation for it.
22449
22450         (EmitStoreOpcode): Use stobj for valuetypes.
22451
22452         (UnaryMutator.EmitCode): Use the right 1 value depending on
22453         whether we are dealing with int64/uint64, float or doubles.
22454
22455         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
22456         constructors that I implemented last night.
22457
22458         (Constructor.IsDefault): Fix to work properly for static
22459         constructors.
22460
22461         * cs-parser.jay (CheckDef): report method signature errors.
22462         Update error number 103 to be 132.
22463
22464         * decl.cs: New AdditionResult enumeration value: MethodExists.
22465         Although we do this check for methods later on in the semantic
22466         analysis, catching repeated default constructors is so easy that
22467         we catch these here. 
22468
22469         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
22470         promotions code.
22471
22472         (ParameterReference.EmitAssign, Emit): handle
22473         bools as bytes.
22474
22475         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
22476         (ArrayAccess.EmitStoreOpcode): ditto.
22477
22478         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
22479
22480         * expression.cs (MakeByteBlob): Complete all the missing types
22481         (uint, short, ushort, byte, sbyte)
22482
22483         * class.cs: Only init instance field initializers on instance
22484         constructors. 
22485
22486         Rename `constructors' to instance_constructors. 
22487
22488         (TypeContainer.AddConstructor): Only add constructors to the list
22489         if it is not static.
22490
22491         Make sure that we handle default_static_constructor independently
22492         everywhere where we handle instance_constructors
22493
22494 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
22495
22496         * class.cs: Do not lookup or create a base initializer for a
22497         static constructor.
22498
22499         (ConstructorInitializer.Resolve): use the proper type to lookup
22500         for constructors.
22501
22502         * cs-parser.jay: Report error 1585 (modifiers between type and name).
22503
22504         * enum.cs, interface.cs: Remove CloseType, this is taken care by
22505         in DeclSpace. 
22506
22507         * decl.cs: CloseType is now an virtual method, the default
22508         implementation just closes this type.
22509
22510 2001-12-28  Ravi Pratap  <ravi@ximian.com>
22511
22512         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
22513         to PreserveSig by default. Also emit HideBySig on such methods.
22514
22515         Basically, set the defaults to standard values.
22516
22517         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
22518         argument, if candidate is better, it can't be worse than the best !
22519
22520         (Invocation): Re-write bits to differentiate between methods being
22521         applicable in their expanded form and their normal form - for params
22522         methods of course.
22523
22524         Get rid of use_standard everywhere as only standard conversions are allowed
22525         in overload resolution. 
22526
22527         More spec conformance.
22528
22529 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22530
22531         * driver.cs: Add --timestamp, to see where the compiler spends
22532         most of its time.
22533
22534         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
22535         `this' in static code.
22536
22537         (SimpleName.DoResolve): Implement in terms of a helper function
22538         that allows static-references to be passed upstream to
22539         MemberAccess.
22540
22541         (Expression.ResolveWithSimpleName): Resolve specially simple
22542         names when called by MemberAccess to implement the special
22543         semantics. 
22544
22545         (Expression.ImplicitReferenceConversion): Handle conversions from
22546         Null to reference types before others, as Null's type is
22547         System.Object. 
22548
22549         * expression.cs (Invocation.EmitCall): Handle the special case of
22550         calling methods declared on a reference type from a ValueType
22551         (Base classes System.Object and System.Enum)
22552
22553         (MemberAccess.Resolve): Only perform lookups on Enumerations if
22554         the left hand side is a TypeExpr, not on every enumeration. 
22555
22556         (Binary.Resolve): If types are reference types, then do a cast to
22557         object on operators != and == of both arguments.
22558
22559         * typemanager.cs (FindMembers): Extract instance and static
22560         members if requested.
22561
22562         * interface.cs (PopulateProperty): Use void_type instead of null
22563         as the return type for the setter method.
22564
22565         (PopulateIndexer): ditto.
22566
22567 2001-12-27  Ravi Pratap  <ravi@ximian.com>
22568
22569         * support.cs (ReflectionParameters): Fix minor bug where we
22570         were examining the wrong parameter for the ParamArray attribute.
22571
22572         Cope with requests for the type of the parameter at position
22573         greater than the params parameter's. We now return the element
22574         type of the params array as that makes more sense.
22575
22576         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
22577         accordingly as we no longer have to extract the element type
22578         ourselves.
22579
22580         (Invocation.OverloadResolve): Update.
22581
22582 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22583
22584         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
22585         against IEnumerator, test whether the return value is a descendant
22586         of the IEnumerator interface.
22587
22588         * class.cs (Indexer.Define): Use an auxiliary method to implement
22589         the other bits of the method definition.  Begin support for
22590         explicit interface implementation.
22591
22592         (Property.DefineMethod): Use TypeManager.void_type instead of null
22593         for an empty return value.
22594
22595 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
22596
22597         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
22598         dealing with a FieldExpr which is composed of a FieldBuilder, in
22599         the code path we did extract the constant, but we should have
22600         obtained the underlying value to be able to cast it (otherwise we
22601         end up in an infinite loop, this is what Ravi was running into).
22602
22603         (ArrayCreation.UpdateIndices): Arrays might be empty.
22604
22605         (MemberAccess.ResolveMemberAccess): Add support for section
22606         14.5.4.1 that deals with the special case of E.I when E is a type
22607         and something else, that I can be a reference to a static member.
22608
22609         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
22610         handle a particular array type to create byte blobs, it is just
22611         something we dont generate byteblobs for.
22612
22613         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
22614         arguments. 
22615
22616         * location.cs (Push): remove the key from the hashtable that we
22617         are about to add.   This happens for empty files.
22618
22619         * driver.cs: Dispose files after we have parsed them.
22620
22621         (tokenize): new function that only runs the tokenizer on its
22622         input, for speed testing.
22623
22624 2001-12-26  Ravi Pratap  <ravi@ximian.com>
22625
22626         * class.cs (Event.Define): Define the private field only if there
22627         are no accessors defined.
22628
22629         * expression.cs (ResolveMemberAccess): If there is no associated
22630         field with the event, that means we have an event defined with its
22631         own accessors and we should flag error cs0070 since transforming
22632         ourselves into a field is not valid in that case.
22633
22634         * ecore.cs (SimpleName.DoResolve): Same as above.
22635
22636         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22637         and charset to sane values.
22638
22639 2001-12-25  Ravi Pratap  <ravi@ximian.com>
22640
22641         * assign.cs (DoResolve): Perform check on events only if they 
22642         are being accessed outside the declaring type.
22643
22644         * cs-parser.jay (event_declarations): Update rules to correctly
22645         set the type of the implicit parameter etc.
22646
22647         (add_accessor, remove_accessor): Set current local parameters.
22648
22649         * expression.cs (Binary): For delegate addition and subtraction,
22650         cast the return value from the method into the appropriate delegate
22651         type.
22652
22653 2001-12-24  Ravi Pratap  <ravi@ximian.com>
22654
22655         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22656         of these as the workaround is unnecessary.
22657
22658         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22659         delegate data - none of that is needed at all.
22660
22661         Re-write bits to extract the instance expression and the delegate method
22662         correctly.
22663
22664         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
22665         on delegates too.
22666
22667         * attribute.cs (ApplyAttributes): New method to take care of common tasks
22668         of attaching attributes instead of duplicating code everywhere.
22669
22670         * everywhere : Update code to do attribute emission using the above method.
22671
22672 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22673
22674         * expression.cs (IsParamsMethodApplicable): if there are not
22675         parameters, return immediately.
22676
22677         * ecore.cs: The 0 literal can be implicity converted to an enum
22678         type. 
22679
22680         (SimpleName.DoResolve): First lookup the type, then lookup the
22681         members. 
22682
22683         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22684         want to get its address.  If the InstanceExpression is not
22685         addressable, store the result in a temporary variable, then get
22686         the address of it.
22687
22688         * codegen.cs: Only display 219 errors on warning level or above. 
22689
22690         * expression.cs (ArrayAccess): Make it implement the
22691         IMemoryLocation interface.
22692
22693         (Binary.DoResolve): handle the operator == (object a, object b)
22694         and operator != (object a, object b) without incurring into a
22695         BoxedCast (because 5 != o should never be performed).
22696
22697         Handle binary enumerator operators.
22698
22699         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22700         value type, otherwise use Ldelem_ref.
22701
22702         Use precomputed names;
22703
22704         (AddressOf): Implement address of
22705
22706         * cs-parser.jay (labeled_statement): Fix recursive block
22707         addition by reworking the production.
22708
22709         * expression.cs (New.DoEmit): New has a special case:
22710                 
22711                  If we are dealing with a ValueType, we have a few
22712                  situations to deal with:
22713                 
22714                     * The target of New is a ValueType variable, that is
22715                       easy, we just pass this as the variable reference
22716                 
22717                     * The target of New is being passed as an argument,
22718                       to a boxing operation or a function that takes a
22719                       ValueType.
22720                 
22721                       In this case, we need to create a temporary variable
22722                       that is the argument of New.
22723
22724
22725 2001-12-23  Ravi Pratap  <ravi@ximian.com>
22726
22727         * rootcontext.cs (LookupType): Check that current_type is not null before
22728         going about looking at nested types.
22729
22730         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22731         not implement the IAssignMethod interface any more.
22732
22733         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22734         where we tranform them into FieldExprs if they are being resolved from within
22735         the declaring type.
22736
22737         * ecore.cs (SimpleName.DoResolve): Do the same here.
22738
22739         * assign.cs (DoResolve, Emit): Clean up code considerably. 
22740
22741         * ../errors/bug10.cs : Add.
22742
22743         * ../errors/cs0070.cs : Add.
22744
22745         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22746
22747         * assign.cs : Get rid of EventIsLocal everywhere.
22748
22749 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22750
22751         * ecore.cs (ConvertIntLiteral): finished the implementation.
22752
22753         * statement.cs (SwitchLabel): Convert the value we are using as a
22754         key before looking up the table.
22755
22756 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22757
22758         * codegen.cs (EmitTopBlock): Require a Location argument now.
22759
22760         * cs-parser.jay (constructor_declarator): We need to setup
22761         current_local_parameters before we parse the
22762         opt_constructor_initializer, to allow the variables to be bound
22763         to the constructor arguments.
22764
22765         * rootcontext.cs (LookupType): First lookup nested classes in our
22766         class and our parents before we go looking outside our class.
22767
22768         * expression.cs (ConstantFold): Extract/debox the values at the
22769         beginnning. 
22770
22771         * rootcontext.cs (EmitCode): Resolve the constants first before we
22772         resolve the types.  This is not really needed, but it helps debugging.
22773
22774         * statement.cs: report location.
22775
22776         * cs-parser.jay: pass location to throw statement.
22777
22778         * driver.cs: Small bug fix.
22779
22780         * report.cs: Updated format to be 4-zero filled digits.
22781
22782 2001-12-22  Ravi Pratap  <ravi@ximian.com>
22783
22784         * expression.cs (CheckIndices): Fix minor bug where the wrong
22785         variable was being referred to ;-)
22786
22787         (DoEmit): Do not call EmitStaticInitializers when the 
22788         underlying type is System.Object.
22789
22790 2001-12-21  Ravi Pratap  <ravi@ximian.com>
22791
22792         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22793         and do the usual workaround for SRE.
22794
22795         * class.cs (MyEventBuilder.EventType): New member to get at the type
22796         of the event, quickly.
22797
22798         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22799
22800         * assign.cs (Assign.DoResolve): Handle the case when the target
22801         is an EventExpr and perform the necessary checks.
22802
22803         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22804         interface.
22805
22806         (SimpleName.MemberStaticCheck): Include check for EventExpr.
22807
22808         (EventExpr): Set the type in the constructor itself since we 
22809         are meant to be born fully resolved.
22810
22811         (EventExpr.Define): Revert code I wrote earlier.
22812                 
22813         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22814         instance expression is null. The instance expression is a This in that case
22815         or a null, depending on whether it is a static method or not.
22816
22817         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22818         refers to more than one method.
22819
22820         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22821         and accordingly flag errors.
22822
22823 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22824
22825         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22826
22827 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22828
22829         * location.cs (ToString): Provide useful rutine.
22830
22831 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22832
22833         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22834         objects, return the actual integral boxed.
22835
22836         * statement.cs (SwitchLabel): define an ILLabel for each
22837         SwitchLabel. 
22838
22839         (Switch.CheckSwitch): If the value is a Literal, extract
22840         the underlying literal.
22841
22842         Also in the unused hashtable we had, add the SwitchLabel so we can
22843         quickly look this value up.
22844
22845         * constant.cs: Implement a bunch of new constants.  Rewrite
22846         Literal based on this.  Made changes everywhere to adapt to this.
22847
22848         * expression.cs (Expression.MakeByteBlob): Optimize routine by
22849         dereferencing array only once, and also copes with enumrations.
22850
22851         bytes are two bytes wide, not one.
22852
22853         (Cast): Perform constant conversions.
22854
22855         * ecore.cs (TryImplicitIntConversion): Return literals instead of
22856         wrappers to the literals here.
22857
22858         * expression.cs (DoNumericPromotions): long literals can converted
22859         to ulong implicity (this is taken care of elsewhere, but I was
22860         missing this spot).
22861
22862         * ecore.cs (Expression.Literalize): Make the return type Literal,
22863         to improve type checking.
22864
22865         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22866
22867 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22868
22869         * literal.cs: Revert code from ravi that checked the bounds.  The
22870         bounds are sane by the definition of the type itself. 
22871
22872         * typemanager.cs: Fix implementation of ImplementsInterface.  We
22873         need to actually look up in our parent hierarchy for interfaces
22874         implemented. 
22875
22876         * const.cs: Use the underlying type for enumerations
22877
22878         * delegate.cs: Compute the basename for the delegate creation,
22879         that should fix the delegate test case, and restore the correct
22880         Type Lookup semantics in rootcontext
22881
22882         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
22883         referencing a nested type with the Reflection API is using the "+"
22884         sign. 
22885
22886         * cs-parser.jay: Do not require EOF token at the end.
22887
22888 2001-12-20  Ravi Pratap  <ravi@ximian.com>
22889
22890         * rootcontext.cs (LookupType): Concatenate type names with
22891         a '.' instead of a '+' The test suite passes again.
22892
22893         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22894         field of the enumeration.
22895
22896         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22897         the case when the member is an EventExpr.
22898
22899         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22900         static has an associated instance expression.
22901
22902         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22903
22904         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22905
22906         * class.cs (Event.Define): Register event and perform appropriate checks
22907         for error #111.
22908
22909         We define the Add and Remove methods even if the use provides none because
22910         in that case, we provide default implementations ourselves.
22911
22912         Define a private field of the type of the event. This is done by the CSC compiler
22913         and we should be doing it too ;-)
22914
22915         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22916         More methods we use in code we generate.
22917
22918         (multicast_delegate_type, delegate_type): Two separate types since the distinction
22919         is important.
22920
22921         (InitCoreTypes): Update accordingly for the above.
22922
22923         * class.cs (Event.Emit): Generate code for default accessors that we provide
22924
22925         (EmitDefaultMethod): Do the job in the above.
22926
22927         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
22928         appropriate place.
22929
22930 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22931
22932         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22933         builders even if we were missing one.
22934
22935         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22936         pass the Basename as our class name instead of the Name.  The
22937         basename will be correctly composed for us.
22938
22939         * parameter.cs (Paramters): Now takes a Location argument.
22940
22941         * decl.cs (DeclSpace.LookupType): Removed convenience function and
22942         make all the code call directly LookupType in RootContext and take
22943         this chance to pass the Location information everywhere.
22944
22945         * Everywhere: pass Location information.
22946
22947 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
22948
22949         * class.cs (Constructor.Define): Updated way of detecting the
22950         length of the parameters.
22951
22952         (TypeContainer.DefineType): Use basename as the type name for
22953         nested types.
22954
22955         (TypeContainer.Define): Do not recursively define types here, as
22956         definition is taken care in order by the RootContext.
22957
22958         * tree.cs: Keep track of namespaces in a per-file basis.
22959
22960         * parameter.cs (Parameter.ComputeSignature): Update to use
22961         DeclSpace. 
22962
22963         (Parameters.GetSignature): ditto.
22964
22965         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22966         instead of a TypeContainer.
22967
22968         (Interface.SemanticAnalysis): Use `this' instead of our parent to
22969         resolve names.  Because we need to be resolve in our context, not
22970         our parents.
22971
22972         * driver.cs: Implement response files.
22973
22974         * class.cs (TypeContainer.DefineType): If we are defined, do not
22975         redefine ourselves.
22976
22977         (Event.Emit): Emit the code for add/remove handlers.
22978         (Event.Define): Save the MethodBuilders for add/remove.
22979
22980         * typemanager.cs: Use pair here too.
22981
22982         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22983         DictionaryEntry requires the first argument to be non-null.  
22984
22985         (enum_declaration): Compute full name for registering the
22986         enumeration.
22987
22988         (delegate_declaration): Instead of using
22989         formal_parameter_list, use opt_formal_parameter_list as the list
22990         can be empty.
22991
22992         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22993         (EventParsing): New property that controls whether `add' and
22994         `remove' are returned as tokens or identifiers (for events);
22995
22996 2001-12-19  Ravi Pratap  <ravi@ximian.com>
22997
22998         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22999         use MyEventBuilder only and let it wrap the real builder for us.
23000
23001         (MyEventBuilder): Revamp constructor etc.
23002
23003         Implement all operations that we perform on EventBuilder in precisely the same
23004         way here too.
23005
23006         (FindMembers): Update to use the EventBuilder member.
23007
23008         (Event.Emit): Update accordingly.
23009
23010 2001-12-18  Ravi Pratap  <ravi@ximian.com>
23011
23012         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
23013         by calling the appropriate methods.
23014
23015         (GetCustomAttributes): Make stubs as they cannot possibly do anything
23016         useful.
23017
23018         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
23019
23020 2001-12-17  Ravi Pratap  <ravi@ximian.com>
23021
23022         * delegate.cs (Delegate.Populate): Check that the return type
23023         and various parameters types are indeed accessible.
23024
23025         * class.cs (Constructor.Define): Same here.
23026
23027         (Field.Define): Ditto.
23028
23029         (Event.Define): Ditto.
23030
23031         (Operator.Define): Check that the underlying Method defined itself
23032         correctly - so it's MethodBuilder should not be null.
23033
23034         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
23035         expression happens to be null.
23036
23037         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
23038         members but as of now we don't seem to be able to do anything really useful with it.
23039
23040         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
23041         not the EventBuilder.
23042
23043 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
23044
23045         * cs-tokenizer.cs: Add support for defines.
23046         Add support for #if, #elif, #else, #endif
23047
23048         (eval_var): evaluates a variable.
23049         (eval): stubbed for evaluating functions.
23050
23051         * cs-parser.jay: Pass the defines information
23052
23053         * driver.cs: Add --define command line option.
23054
23055         * decl.cs: Move MemberCore here.
23056
23057         Make it the base class for DeclSpace.  This allows us to catch and
23058         report 108 and 109 for everything now.
23059
23060         * class.cs (TypeContainer.Define): Extract all the members
23061         before populating and emit the warning 108 (new keyword required
23062         to override) instead of having each member implement this.
23063
23064         (MemberCore.Define): New abstract method, we will be using this in
23065         the warning reporting engine in Populate.
23066
23067         (Operator.Define): Adjust to new MemberCore protocol. 
23068
23069         * const.cs (Const): This does not derive from Expression, it is a
23070         temporary object we use to create fields, it is a MemberCore. 
23071
23072         * class.cs (Method.Define): Allow the entry point to be in a
23073         specific class.
23074
23075         * driver.cs: Rewrite the argument handler to clean it up a bit.
23076
23077         * rootcontext.cs: Made it just an auxiliary namespace feature by
23078         making everything static.
23079
23080         * driver.cs: Adapt code to use RootContext type name instead of
23081         instance variable.
23082
23083         * delegate.cs: Remove RootContext argument.
23084
23085         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
23086         argument. 
23087
23088         * class.cs (Event.Define): The lookup can fail.
23089
23090         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
23091
23092         * expression.cs: Resolve the this instance before invoking the code.
23093
23094 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
23095
23096         * cs-parser.jay: Add a production in element_access that allows
23097         the thing to become a "type" reference.  This way we can parse
23098         things like "(string [])" as a type.
23099
23100         Note that this still does not handle the more complex rules of
23101         casts. 
23102
23103
23104         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
23105
23106         * ecore.cs: (CopyNewMethods): new utility function used to
23107         assemble the list of methods from running FindMembers.
23108
23109         (MemberLookup): Rework FindMembers so that 
23110
23111 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
23112
23113         * class.cs (TypeContainer): Remove Delegates who fail to be
23114         defined.
23115
23116         * delegate.cs (Populate): Verify that we dont get null return
23117         values.   TODO: Check for AsAccessible.
23118
23119         * cs-parser.jay: Use basename to emit error 574 (destructor should
23120         have the same name as container class), not the full name.
23121
23122         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
23123         possible representation.  
23124
23125         Also implements integer type suffixes U and L.
23126
23127 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
23128
23129         * expression.cs (ArrayCreation.DoResolve): We need to do the
23130         argument resolution *always*.
23131
23132         * decl.cs: Make this hold the namespace.  Hold the root context as
23133         well.
23134         (LookupType): Move here.
23135
23136         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
23137
23138         * location.cs (Row, Name): Fixed the code, it was always returning
23139         references to the first file.
23140
23141         * interface.cs: Register properties defined through interfaces.
23142
23143         * driver.cs: Add support for globbing on the command line
23144
23145         * class.cs (Field): Make it derive from MemberCore as well.
23146         (Event): ditto.
23147
23148 2001-12-15  Ravi Pratap  <ravi@ximian.com>
23149
23150         * class.cs (Event::Define): Check that the type of the event is a delegate
23151         type else flag error #66.
23152
23153         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
23154         same.
23155
23156         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
23157         values of EntryPoint, CharSet etc etc.
23158
23159         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
23160
23161         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
23162         be null and we should ignore this. I am not sure if this is really clean. Apparently,
23163         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
23164         which needs this to do its work.
23165
23166         * ../errors/cs0066.cs : Add.
23167
23168 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
23169
23170         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
23171         helper functions.
23172
23173         * class.cs: (MethodSignature.MethodSignature): Removed hack that
23174         clears out the parameters field.
23175         (MemberSignatureCompare): Cleanup
23176
23177         (MemberCore): New base class used to share code between MethodCore
23178         and Property.
23179
23180         (RegisterRequiredImplementations) BindingFlags.Public requires
23181         either BindingFlags.Instace or Static.  Use instance here.
23182
23183         (Property): Refactored code to cope better with the full spec.
23184
23185         * parameter.cs (GetParameterInfo): Return an empty array instead
23186         of null on error.
23187
23188         * class.cs (Property): Abstract or extern properties have no bodies.
23189
23190         * parameter.cs (GetParameterInfo): return a zero-sized array.
23191
23192         * class.cs (TypeContainer.MethodModifiersValid): Move all the
23193         method modifier validation to the typecontainer so we can reuse
23194         this on properties.
23195
23196         (MethodCore.ParameterTypes): return an empty sized array of types.
23197
23198         (Property.Define): Test property modifier validity.
23199
23200         Add tests for sealed/override too.
23201
23202         (Method.Emit): abstract or extern methods have no bodies.
23203
23204 2001-12-14  Ravi Pratap  <ravi@ximian.com>
23205
23206         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
23207         thing.
23208
23209         (Method::Define, ::Emit): Modify accordingly.
23210
23211         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
23212
23213         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
23214
23215         * makefile: Pass in /unsafe.
23216
23217 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
23218
23219         * class.cs (MakeKey): Kill routine.
23220
23221         * class.cs (TypeContainer.Define): Correctly define explicit
23222         method implementations (they require the full interface name plus
23223         the method name).
23224
23225         * typemanager.cs: Deply the PtrHashtable here and stop using the
23226         lame keys.  Things work so much better.
23227
23228         This of course broke everyone who depended on `RegisterMethod' to
23229         do the `test for existance' test.  This has to be done elsewhere.
23230
23231         * support.cs (PtrHashtable): A hashtable that avoid comparing with
23232         the object stupid Equals method (because, that like fails all over
23233         the place).  We still do not use it.
23234
23235         * class.cs (TypeContainer.SetRequiredInterface,
23236         TypeContainer.RequireMethods): Killed these two routines and moved
23237         all the functionality to RegisterRequiredImplementations.
23238
23239         (TypeContainer.RegisterRequiredImplementations): This routine now
23240         registers all the implementations required in an array for the
23241         interfaces and abstract methods.  We use an array of structures
23242         which can be computed ahead of time to reduce memory usage and we
23243         also assume that lookups are cheap as most classes will not
23244         implement too many interfaces.
23245
23246         We also avoid creating too many MethodSignatures.
23247
23248         (TypeContainer.IsInterfaceMethod): Update and optionally does not
23249         clear the "pending" bit if we find that there are problems with
23250         the declaration.
23251
23252         (TypeContainer.VerifyPendingMethods): Update to report errors of
23253         methods that look like implementations but are not.
23254
23255         (TypeContainer.Define): Add support for explicit interface method
23256         implementation. 
23257
23258 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
23259
23260         * typemanager.cs: Keep track of the parameters here instead of
23261         being a feature of the TypeContainer.
23262
23263         * class.cs: Drop the registration of parameters here, as
23264         InterfaceMethods are also interface declarations.
23265
23266         * delegate.cs: Register methods with the TypeManager not only with
23267         the TypeContainer.  This code was buggy.
23268
23269         * interface.cs: Full registation here.
23270
23271 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
23272
23273         * expression.cs: Remove reducer for binary expressions, it can not
23274         be done this way.
23275
23276         * const.cs: Put here the code that used to go into constant.cs
23277
23278         * constant.cs: Put here the code for constants, this is a new base
23279         class for Literals.
23280
23281         * literal.cs: Make Literal derive from Constant.
23282
23283 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
23284
23285         * statement.cs (Return.Emit): Report error 157 if the user
23286         attempts to return from a finally block.
23287
23288         (Return.Emit): Instead of emitting a return, jump to the end of
23289         the function.
23290
23291         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
23292         LocalBuilder to store the result of the function.  ReturnLabel is
23293         the target where we jump.
23294
23295
23296 2001-12-09  Radek Doulik  <rodo@ximian.com>
23297
23298         * cs-parser.jay: remember alias in current namespace
23299
23300         * ecore.cs (SimpleName::DoResolve): use aliases for types or
23301         namespaces
23302
23303         * class.cs (LookupAlias): lookup alias in my_namespace
23304
23305         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
23306         aliases hashtable
23307         (LookupAlias): lookup alias in this and if needed in parent
23308         namespaces
23309
23310 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
23311
23312         * support.cs: 
23313
23314         * rootcontext.cs: (ModuleBuilder) Made static, first step into
23315         making things static.  I need this to avoid passing the
23316         TypeContainer when calling ParameterType.
23317
23318         * support.cs (InternalParameters.ParameterType): Remove ugly hack
23319         that did string manipulation to compute the type and then call
23320         GetType.  Use Parameter.ParameterType instead.
23321
23322         * cs-tokenizer.cs: Consume the suffix for floating values.
23323
23324         * expression.cs (ParameterReference): figure out whether this is a
23325         reference parameter or not.  Kill an extra variable by computing
23326         the arg_idx during emission.
23327
23328         * parameter.cs (Parameters.GetParameterInfo): New overloaded
23329         function that returns whether a parameter is an out/ref value or not.
23330
23331         (Parameter.ParameterType): The type of the parameter (base,
23332         without ref/out applied).
23333
23334         (Parameter.Resolve): Perform resolution here.
23335         (Parameter.ExternalType): The full type (with ref/out applied).
23336
23337         * statement.cs (Using.Emit, Using.EmitExpression): Implement
23338         support for expressions on the using statement.
23339
23340 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
23341
23342         * statement.cs (Using.EmitLocalVariableDecls): Split the
23343         localvariable handling of the using statement.
23344
23345         (Block.EmitMeta): Keep track of variable count across blocks.  We
23346         were reusing slots on separate branches of blocks.
23347
23348         (Try.Emit): Emit the general code block, we were not emitting it. 
23349
23350         Check the type of the declaration to be an IDisposable or
23351         something that can be implicity converted to it. 
23352
23353         Emit conversions if required.
23354
23355         * ecore.cs (EmptyExpression): New utility class.
23356         (Expression.ImplicitConversionExists): New utility function.
23357
23358 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
23359
23360         * statement.cs (Using): Implement.
23361
23362         * expression.cs (LocalVariableReference): Support read only variables.
23363
23364         * statement.cs: Remove the explicit emit for the Leave opcode.
23365         (VariableInfo): Add a readonly field.
23366
23367 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
23368
23369         * ecore.cs (ConvCast): new class used to encapsulate the various
23370         explicit integer conversions that works in both checked and
23371         unchecked contexts.
23372
23373         (Expression.ConvertNumericExplicit): Use new ConvCast class to
23374         properly generate the overflow opcodes.
23375
23376 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
23377
23378         * statement.cs: The correct type for the EmptyExpression is the
23379         element_type, not the variable type.  Ravi pointed this out.
23380
23381 2001-12-04  Ravi Pratap  <ravi@ximian.com>
23382
23383         * class.cs (Method::Define): Handle PInvoke methods specially
23384         by using DefinePInvokeMethod instead of the usual one.
23385
23386         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
23387         above to do the task of extracting information and defining the method.
23388
23389 2001-12-04  Ravi Pratap  <ravi@ximian.com>
23390
23391         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
23392         of the condition for string type.
23393
23394         (Emit): Move that here. 
23395
23396         (ArrayCreation::CheckIndices): Keep string literals in their expression
23397         form.
23398
23399         (EmitDynamicInitializers): Handle strings appropriately.
23400
23401 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
23402
23403         * codegen.cs (EmitContext): Replace multiple variables with a
23404         single pointer to the current Switch statement.
23405
23406         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
23407         EmitContext.
23408
23409 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
23410
23411         * statement.cs 
23412
23413         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
23414         default'.
23415
23416         (Foreach.Emit): Foreach on arrays was not setting
23417         up the loop variables (for break/continue).
23418
23419         (GotoCase): Semi-implented.
23420
23421 2001-12-03  Ravi Pratap  <ravi@ximian.com>
23422
23423         * attribute.cs (CheckAttribute): Handle system attributes by using
23424         Attribute.GetAttributes to examine information we need.
23425
23426         (GetValidPlaces): Same here.
23427
23428         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
23429
23430         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
23431
23432         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
23433
23434         (Method::Define): Set appropriate flags if we have a DllImport attribute.
23435
23436         (Method::Emit): Handle the case when we are a PInvoke method.
23437
23438 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
23439
23440         * expression.cs: Use ResolveWithSimpleName on compound names.
23441
23442 2001-12-02  Ravi Pratap  <ravi@ximian.com>
23443
23444         * constant.cs (EmitConstant): Make sure we resolve the associated expression
23445         before trying to reduce it.
23446
23447         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
23448
23449         * constant.cs (LookupConstantValue): Implement.
23450
23451         (EmitConstant): Use the above in emitting the constant.
23452
23453         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
23454         that are user-defined by doing a LookupConstantValue on them.
23455
23456         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
23457         too, like above.
23458
23459 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
23460
23461         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
23462
23463         (BaseAccess.DoResolve): Implement.
23464
23465         (MemberAccess.DoResolve): Split this routine into a
23466         ResolveMemberAccess routine that can be used independently
23467
23468 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
23469
23470         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
23471         As that share bits of the implementation.  Is returns a boolean,
23472         while As returns the Type that is being probed.
23473
23474 2001-12-01  Ravi Pratap  <ravi@ximian.com>
23475
23476         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
23477         instead of a Literal - much easier.
23478
23479         (EnumInTransit): Remove - utterly useless :-)
23480
23481         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
23482
23483         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
23484
23485         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
23486         chain when we have no associated expression.
23487
23488 2001-11-30  Ravi Pratap  <ravi@ximian.com>
23489
23490         * constant.cs (Define): Use Location while reporting the errror.
23491
23492         Also emit a warning when 'new' is used and there is no inherited
23493         member to hide.
23494
23495         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
23496         populated.
23497
23498         (LookupEnumValue): Implement to lookup an enum member's value and define it
23499         if necessary.
23500
23501         (Populate): Re-write accordingly to use the above routine.
23502
23503 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
23504
23505         * expression.cs (This): Fix prototype for DoResolveLValue to
23506         override the base class DoResolveLValue.
23507
23508         * cs-parser.cs: Report errors cs574 and cs575 (destructor
23509         declarations) 
23510
23511         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
23512         (we need to load the address of the field here).  This fixes
23513         test-22. 
23514
23515         (FieldExpr.DoResolveLValue): Call the DoResolve
23516         function to initialize the Instance expression.
23517
23518         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
23519         correctly the GetEnumerator operation on a value type.
23520
23521         * cs-parser.jay: Add more simple parsing error catches.
23522
23523         * statement.cs (Switch): Add support for string switches.
23524         Handle null specially.
23525
23526         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
23527
23528 2001-11-28  Ravi Pratap  <ravi@ximian.com>
23529
23530         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
23531
23532         (declare_local_constant): New helper function.
23533
23534         * statement.cs (AddConstant): Keep a separate record of constants
23535
23536         (IsConstant): Implement to determine if a variable is a constant.
23537
23538         (GetConstantExpression): Implement.
23539
23540         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
23541
23542         * statement.cs (IsVariableDefined): Re-write.
23543
23544 2001-11-27  Ravi Pratap  <ravi@ximian.com>
23545
23546         * class.cs (TypeContainer::FindMembers): Look for constants
23547         in the case when we are looking for MemberTypes.Field
23548
23549         * expression.cs (MemberAccess::DoResolve): Check that in the
23550         case we are a FieldExpr and a Literal, we are not being accessed
23551         by an instance reference.
23552
23553         * cs-parser.jay (local_constant_declaration): Implement.
23554
23555         (declaration_statement): Implement for constant declarations.
23556
23557 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
23558
23559         * statement.cs (Switch): Catch double defaults.
23560
23561         (Switch): More work on the switch() statement
23562         implementation.  It works for integral values now, need to finish
23563         string support.
23564
23565
23566 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23567
23568         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
23569         integer literals into other integer literals.  To be used by
23570         switch. 
23571
23572 2001-11-24  Ravi Pratap  <ravi@ximian.com>
23573
23574         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
23575         some memory.
23576
23577         (EmitDynamicInitializers): Cope with the above since we extract data
23578         directly from ArrayData now.
23579
23580         (ExpectInitializers): Keep track of whether initializers are mandatory
23581         or not.
23582
23583         (Bounds): Make it a hashtable to prevent the same dimension being 
23584         recorded for every element in that dimension.
23585
23586         (EmitDynamicInitializers): Fix bug which prevented the Set array method
23587         from being found.
23588
23589         Also fix bug which was causing the indices to be emitted in the reverse
23590         order.
23591
23592 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23593
23594         * expression.cs (ArrayCreation): Implement the bits that Ravi left
23595         unfinished.  They do not work, because the underlying code is
23596         sloppy.
23597
23598 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23599
23600         * cs-parser.jay: Remove bogus fixme.
23601
23602         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
23603         on Switch statement.
23604
23605 2001-11-23  Ravi Pratap  <ravi@ximian.com>
23606
23607         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
23608         the same. 
23609
23610         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
23611         parameter. Apparently, any expression is allowed. 
23612
23613         (ValidateInitializers): Update accordingly.
23614
23615         (CheckIndices): Fix some tricky bugs thanks to recursion.
23616
23617         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
23618         I was being completely brain-dead.
23619
23620         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23621         and re-write acordingly.
23622
23623         (DelegateInvocation): Re-write accordingly.
23624
23625         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23626
23627         (MakeByteBlob): Handle types more correctly.
23628
23629         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23630         initialization from expressions but it is incomplete because I am a complete
23631         Dodo :-|
23632
23633 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23634
23635         * statement.cs (If.Emit): Fix a bug that generated incorrect code
23636         on If.  Basically, we have to return `true' (ie, we do return to
23637         our caller) only if both branches of the if return.
23638
23639         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23640         short-circuit operators, handle them as short circuit operators. 
23641
23642         (Cast.DoResolve): Resolve type.
23643         (Cast.Cast): Take an expression as the target type.
23644
23645         * cs-parser.jay (cast_expression): Remove old hack that only
23646         allowed a limited set of types to be handled.  Now we take a
23647         unary_expression and we resolve to a type during semantic
23648         analysis.
23649
23650         Use the grammar productions from Rhys to handle casts (this is
23651         not complete like Rhys syntax yet, we fail to handle that corner
23652         case that C# has regarding (-x), but we will get there.
23653
23654 2001-11-22  Ravi Pratap  <ravi@ximian.com>
23655
23656         * class.cs (EmitFieldInitializer): Take care of the case when we have a
23657         field which is an array type.
23658
23659         * cs-parser.jay (declare_local_variables): Support array initialization too.
23660
23661         * typemanager.cs (MakeKey): Implement.
23662
23663         (everywhere): Use the above appropriately.
23664
23665         * cs-parser.jay (for_statement): Update for array initialization while
23666         declaring variables.
23667
23668         * ecore.cs : The error message was correct, it's the variable's names that
23669         were misleading ;-) Make the code more readable.
23670
23671         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23672         the correct type etc.
23673
23674         (ConvertExplicit): Handle Enum types by examining the underlying type.
23675
23676 2001-11-21  Ravi Pratap  <ravi@ximian.com>
23677
23678         * parameter.cs (GetCallingConvention): Always return
23679         CallingConventions.Standard for now.
23680
23681 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23682
23683         * expression.cs (Binary.ResolveOperator): Update the values of `l'
23684         and `r' after calling DoNumericPromotions.
23685
23686         * ecore.cs: Fix error message (the types were in the wrong order).
23687
23688         * statement.cs (Foreach.ProbeCollectionType): Need to pass
23689         BindingFlags.Instance as well 
23690
23691         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23692         implicit int literal conversion in an empty cast so that we
23693         propagate the right type upstream.
23694
23695         (UnboxCast): new class used to unbox value types.
23696         (Expression.ConvertExplicit): Add explicit type conversions done
23697         by unboxing.
23698
23699         (Expression.ImplicitNumericConversion): Oops, forgot to test for
23700         the target type before applying the implicit LongLiterals to ULong
23701         literal cast.
23702
23703 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
23704
23705         * cs-parser.jay (for_statement): Reworked the way For works: now
23706         we declare manually any variables that are introduced in
23707         for_initializer to solve the problem of having out-of-band code
23708         emition (that is what got for broken).
23709
23710         (declaration_statement): Perform the actual variable declaration
23711         that used to be done in local_variable_declaration here.
23712
23713         (local_variable_declaration): Do not declare anything, just pass
23714         the information on a DictionaryEntry
23715
23716 2001-11-20  Ravi Pratap  <ravi@ximian.com>
23717
23718         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23719         re-write of the logic to now make it recursive.
23720
23721         (UpdateIndices): Re-write accordingly.
23722
23723         Store element data in a separate ArrayData list in the above methods.
23724
23725         (MakeByteBlob): Implement to dump the array data into a byte array.
23726
23727 2001-11-19  Ravi Pratap  <ravi@ximian.com>
23728
23729         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23730         into CheckIndices.
23731
23732         * constant.cs (Define): Implement.
23733
23734         (EmitConstant): Re-write fully.
23735
23736         Pass in location info.
23737
23738         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23739         respectively.
23740
23741         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23742         DictionaryEntry since we need location info too.
23743
23744         (constant_declaration): Update accordingly.
23745
23746         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23747         code into another method : UpdateIndices.
23748
23749 2001-11-18  Ravi Pratap  <ravi@ximian.com>
23750
23751         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23752         some type checking etc.
23753
23754 2001-11-17  Ravi Pratap  <ravi@ximian.com>
23755
23756         * expression.cs (ArrayCreation::ValidateInitializers): Implement
23757         bits to provide dimension info if the user skips doing that.
23758
23759         Update second constructor to store the rank correctly.
23760
23761 2001-11-16  Ravi Pratap  <ravi@ximian.com>
23762
23763         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23764         and try to implement.
23765
23766         * ../errors/cs0150.cs : Add.
23767
23768         * ../errors/cs0178.cs : Add.
23769
23770 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
23771
23772         * statement.cs: Implement foreach on multi-dimensional arrays. 
23773
23774         * parameter.cs (Parameters.GetParameterByName): Also lookup the
23775         name of the params argument.
23776
23777         * expression.cs: Use EmitStoreOpcode to get the right opcode while
23778         initializing the array.
23779
23780         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23781         we can use this elsewhere.
23782
23783         * statement.cs: Finish implementation of foreach for single
23784         dimension arrays.
23785
23786         * cs-parser.jay: Use an out-of-band stack to pass information
23787         around, I wonder why I need this.
23788
23789         foreach_block: Make the new foreach_block the current_block.
23790
23791         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23792         function used to return a static Parameters structure.  Used for
23793         empty parameters, as those are created very frequently.
23794
23795         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23796
23797 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23798
23799         * interface.cs : Default modifier is private, not public. The
23800         make verify test passes again.
23801
23802 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23803
23804         * support.cs (ReflectionParameters): Fix logic to determine
23805         whether the last parameter is a params one. Test 9 passes again.
23806
23807         * delegate.cs (Populate): Register the builders we define with
23808         RegisterParameterForBuilder. Test 19 passes again.
23809
23810         * cs-parser.jay (property_declaration): Reference $6 instead
23811         of $$ to get at the location.
23812
23813         (indexer_declaration): Similar stuff.
23814
23815         (attribute): Ditto.
23816
23817         * class.cs (Property): Register parameters for the Get and Set methods
23818         if they exist. Test 23 passes again.
23819
23820         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23821         call to EmitArguments as we are sure there aren't any params arguments. 
23822         Test 32 passes again.
23823
23824         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23825         IndexOutOfRangeException. 
23826
23827         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23828         Test 33 now passes again.
23829
23830 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
23831
23832         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23833         broke a bunch of things.  Will have to come up with a better way
23834         of tracking locations.
23835
23836         * statement.cs: Implemented foreach for single dimension arrays.
23837
23838 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23839
23840         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23841         an error.  This removes the lookup from the critical path.
23842
23843         * cs-parser.jay: Removed use of temporary_loc, which is completely
23844         broken. 
23845
23846 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
23847
23848         * support.cs (ReflectionParameters.ParameterModifier): Report
23849         whether the argument is a PARAMS argument or not.
23850
23851         * class.cs: Set the attribute `ParamArrayAttribute' on the
23852         parameter argument.
23853
23854         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23855         and cons_param_array_attribute (ConstructorInfo for
23856         ParamArrayAttribute)., 
23857
23858         * codegen.cs: Emit the return using the `Return' statement, that
23859         way we can report the error correctly for missing return values. 
23860
23861         * class.cs (Method.Emit): Clean up.
23862
23863         * expression.cs (Argument.Resolve): Take another argument: the
23864         location where this argument is used.  Notice that this is not
23865         part of the "Argument" class as to reduce the size of the
23866         structure (we know the approximate location anyways).
23867
23868         Test if the argument is a variable-reference, if not, then
23869         complain with a 206.
23870
23871         (Argument.Emit): Emit addresses of variables.
23872
23873         (Argument.FullDesc): Simplify.
23874
23875         (Invocation.DoResolve): Update for Argument.Resolve.
23876
23877         (ElementAccess.DoResolve): ditto.
23878
23879         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23880         method should be virtual, as this method is always virtual.
23881
23882         (NewDelegate.DoResolve): Update for Argument.Resolve.
23883
23884         * class.cs (ConstructorInitializer.DoResolve): ditto.
23885
23886         * attribute.cs (Attribute.Resolve): ditto.
23887
23888 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
23889
23890         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23891
23892         * expression.cs (ParameterReference): Drop IStackStorage and implement
23893         IAssignMethod instead. 
23894
23895         (LocalVariableReference): ditto.
23896
23897         * ecore.cs (FieldExpr): Drop IStackStorage and implement
23898         IAssignMethod instead. 
23899
23900 2001-11-13  Miguel de Icaza <miguel@ximian.com>
23901
23902         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23903         enumerations that are used in heavily used structures derive from
23904         byte in a laughable and pathetic attempt to reduce memory usage.
23905         This is the kind of pre-optimzations that you should not do at
23906         home without adult supervision.
23907
23908         * expression.cs (UnaryMutator): New class, used to handle ++ and
23909         -- separatedly from the other unary operators.  Cleans up the
23910         code, and kills the ExpressionStatement dependency in Unary.
23911
23912         (Unary): Removed `method' and `Arguments' from this class, making
23913         it smaller, and moving it all to SimpleCall, so I can reuse this
23914         code in other locations and avoid creating a lot of transient data
23915         strucutres when not required.
23916
23917         * cs-parser.jay: Adjust for new changes.
23918
23919 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
23920
23921         * enum.cs (Enum.Populate): If there is a failure during
23922         definition, return
23923
23924         * cs-parser.jay (opt_enum_base): we used to catch type errors
23925         here, but this is really incorrect.  The type error should be
23926         catched during semantic analysis.
23927
23928 2001-12-11  Ravi Pratap  <ravi@ximian.com>
23929
23930         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23931         current_local_parameters as expected since I, in my stupidity, had forgotten
23932         to do this :-)
23933
23934         * attribute.cs (GetValidPlaces): Fix stupid bug.
23935
23936         * class.cs (Method::Emit): Perform check on applicability of attributes.
23937
23938         (Constructor::Emit): Ditto.
23939
23940         (Field::Emit): Ditto.
23941
23942         (Field.Location): Store location information.
23943
23944         (Property, Event, Indexer, Operator): Ditto.
23945
23946         * cs-parser.jay (field_declaration): Pass in location for each field.
23947
23948         * ../errors/cs0592.cs : Add.
23949
23950 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23951
23952         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23953
23954         (InitCoreTypes): Update accordingly.
23955
23956         (RegisterAttrType, LookupAttr): Implement.
23957
23958         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23959         info about the same.
23960
23961         (Resolve): Update to populate the above as necessary.
23962
23963         (Error592): Helper.
23964
23965         (GetValidPlaces): Helper to the above.
23966
23967         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23968
23969         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23970
23971 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23972
23973         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23974
23975         * ../errors/cs0617.cs : Add.
23976
23977 2001-11-11  Ravi Pratap  <ravi@ximian.com>
23978
23979         * enum.cs (Emit): Rename to Populate to be more consistent with what
23980         we expect it to do and when exactly it is called.
23981
23982         * class.cs, rootcontext.cs : Update accordingly.
23983
23984         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23985         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23986
23987         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23988
23989         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23990         of a fieldinfo using the above, when dealing with a FieldBuilder.
23991
23992 2001-11-10  Ravi Pratap  <ravi@ximian.com>
23993
23994         * ../errors/cs0031.cs : Add.
23995
23996         * ../errors/cs1008.cs : Add.
23997
23998         * ../errrors/cs0543.cs : Add.
23999
24000         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
24001         enum type.
24002
24003         (FindMembers): Implement.
24004
24005         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
24006         enums and delegates too.
24007
24008         (enum_types): Rename to builder_to_enum.
24009
24010         (delegate_types): Rename to builder_to_delegate.
24011
24012         * delegate.cs (FindMembers): Implement.
24013
24014 2001-11-09  Ravi Pratap  <ravi@ximian.com>
24015
24016         * typemanager.cs (IsEnumType): Implement.
24017
24018         * enum.cs (Emit): Re-write parts to account for the underlying type
24019         better and perform checking etc.
24020
24021         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
24022         of the underlying type.
24023
24024         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
24025         value
24026
24027         * enum.cs (error31): Helper to report error #31.
24028
24029         * cs-parser.jay (enum_declaration): Store location of each member too.
24030
24031         * enum.cs (member_to_location): New hashtable. 
24032
24033         (AddEnumMember): Update location hashtable.
24034
24035         (Emit): Use the location of each member while reporting errors.
24036
24037 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
24038
24039         * cs-parser.jay: A for_initializer if is a
24040         local_variable_declaration really ammount to have an implicit
24041         block with the variable declaration and no initializer for for.
24042
24043         * statement.cs (For.Emit): Cope with null initializers.
24044
24045         This fixes the infinite loop on for initializers.
24046
24047 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
24048
24049         * enum.cs: More cleanup.
24050
24051         * ecore.cs: Remove dead code.
24052
24053         * class.cs (Property.Emit): More simplification.
24054         (Event.Emit): ditto.
24055
24056         Reworked to have less levels of indentation.
24057
24058 2001-11-08  Ravi Pratap  <ravi@ximian.com>
24059
24060         * class.cs (Property): Emit attributes.
24061
24062         (Field): Ditto.
24063
24064         (Event): Ditto.
24065
24066         (Indexer): Ditto.
24067
24068         (Operator): Ditto.
24069
24070         * enum.cs (Emit): Ditto.
24071
24072         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
24073         Enums too.
24074
24075         * class.cs (Field, Event, etc.): Move attribute generation into the
24076         Emit method everywhere.
24077
24078         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
24079         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
24080         as we had no way of defining nested enums !
24081
24082         * rootcontext.cs : Adjust code accordingly.
24083
24084         * typemanager.cs (AddEnumType): To keep track of enum types separately.
24085
24086 2001-11-07  Ravi Pratap  <ravi@ximian.com>
24087
24088         * expression.cs (EvalConstantExpression): Move into ecore.cs
24089
24090         * enum.cs (Enum): Rename some members and make them public and readonly
24091         according to our convention.
24092
24093         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
24094         nothing else.
24095
24096         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
24097
24098         (Enum::Emit): Write a simple version for now which doesn't try to compute
24099         expressions. I shall modify this to be more robust in just a while.
24100
24101         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
24102
24103         (TypeContainer::CloseType): Create the Enum types too.
24104
24105         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
24106
24107         * expression.cs (EvalConstantExpression): Get rid of completely.
24108
24109         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
24110         user-defined values and other cases.
24111
24112         (IsValidEnumLiteral): Helper function.
24113
24114         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
24115         out there in the case we had a literal FieldExpr.
24116
24117         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
24118
24119         (Literalize): Revamp a bit to take two arguments.
24120
24121         (EnumLiteral): New class which derives from Literal to wrap enum literals.
24122
24123 2001-11-06  Ravi Pratap  <ravi@ximian.com>
24124
24125         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
24126
24127         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
24128
24129         (Resolve): Use the above to ensure we have proper initializers.
24130
24131 2001-11-05  Ravi Pratap  <ravi@ximian.com>
24132
24133         * expression.cs (Expression::EvalConstantExpression): New method to 
24134         evaluate constant expressions.
24135
24136         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
24137
24138 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
24139
24140         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
24141         in an array.
24142
24143         (Binary.ResolveOperator): Handle operator != (object a, object b)
24144         and operator == (object a, object b);
24145
24146         (Binary.DoNumericPromotions): Indicate whether the numeric
24147         promotion was possible.
24148
24149         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
24150         Implement.  
24151
24152         Made the ArrayAccess implement interface IAssignMethod instead of
24153         IStackStore as the order in which arguments are passed reflects
24154         this.
24155
24156         * assign.cs: Instead of using expr.ExprClass to select the way of
24157         assinging, probe for the IStackStore/IAssignMethod interfaces.
24158
24159         * typemanager.cs: Load InitializeArray definition.
24160
24161         * rootcontext.cs (RootContext.MakeStaticData): Used to define
24162         static data that can be used to initialize arrays. 
24163
24164 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
24165
24166         * expression.cs: Handle operator== and operator!= for booleans.
24167
24168         (Conditioal.Reduce): Implement reducer for the ?: operator.
24169
24170         (Conditional.Resolve): Implement dead code elimination.
24171
24172         (Binary.Resolve): Catch string literals and return a new
24173         concatenated string.
24174
24175         (Unary.Reduce): Implement reduction of unary expressions.
24176
24177         * ecore.cs: Split out the expression core handling here.
24178
24179         (Expression.Reduce): New method used to perform constant folding
24180         and CSE.  This is needed to support constant-expressions. 
24181
24182         * statement.cs (Statement.EmitBoolExpression): Pass true and false
24183         targets, and optimize for !x.
24184
24185 2001-11-04  Ravi Pratap  <ravi@ximian.com>
24186
24187         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
24188         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
24189         set custom atttributes.
24190
24191         * literal.cs (Literal::GetValue): New abstract method to return the actual
24192         value of the literal, cast as an object.
24193
24194         (*Literal): Implement GetValue method.
24195
24196         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
24197         expressions to the arraylist but objects of type Argument.
24198
24199         * class.cs (TypeContainer::Emit): Emit our attributes too.
24200
24201         (Method::Emit, Constructor::Emit): Ditto.
24202
24203         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
24204         to be ignoring earlier.
24205
24206 2001-11-03  Ravi Pratap  <ravi@ximian.com>
24207
24208         * attribute.cs (AttributeSection::Define): Implement to do the business
24209         of constructing a CustomAttributeBuilder.
24210
24211         (Attribute): New trivial class. Increases readability of code.  
24212
24213         * cs-parser.jay : Update accordingly.
24214
24215         (positional_argument_list, named_argument_list, named_argument): New rules
24216
24217         (attribute_arguments): Use the above so that we are more correct.
24218
24219 2001-11-02  Ravi Pratap  <ravi@ximian.com>
24220
24221         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
24222         to perform all checks for a method with a params parameter.
24223
24224         (Invocation::OverloadResolve): Update to use the above method and therefore
24225         cope correctly with params method invocations.
24226
24227         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
24228         params too.
24229
24230         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
24231         constructors in our parent too because we can't afford to miss out on 
24232         protected ones ;-)
24233
24234         * attribute.cs (AttributeSection): New name for the class Attribute
24235
24236         Other trivial changes to improve readability.
24237
24238         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
24239         use the new class names.
24240
24241 2001-11-01  Ravi Pratap  <ravi@ximian.com>
24242
24243         * class.cs (Method::Define): Complete definition for params types too
24244
24245         (Indexer::Define): Ditto.
24246
24247         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
24248         Cope everywhere with a request for info about the array parameter.
24249
24250 2001-11-01  Ravi Pratap  <ravi@ximian.com>
24251
24252         * tree.cs (RecordNamespace): Fix up to check for the correct key.
24253
24254         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
24255         local_variable_type to extract the string corresponding to the type.
24256
24257         (local_variable_type): Fixup the action to use the new helper method.
24258
24259         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
24260         go.
24261
24262         * expression.cs : Clean out code which uses the above.
24263
24264 2001-10-31  Ravi Pratap  <ravi@ximian.com>
24265
24266         * typemanager.cs (RegisterMethod): Check if we already have an existing key
24267         and bale out if necessary by returning a false.
24268
24269         (RegisterProperty): Ditto.
24270
24271         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
24272         and print out appropriate error messages.
24273
24274         * interface.cs (everywhere): Ditto.
24275
24276         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
24277         location to constructor.
24278
24279         * class.cs (Property, Event, Indexer): Update accordingly.
24280
24281         * ../errors/cs111.cs : Added.
24282
24283         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
24284         of a method, as laid down by the spec.
24285
24286         (Invocation::OverloadResolve): Use the above method.
24287
24288 2001-10-31  Ravi Pratap  <ravi@ximian.com>
24289
24290         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
24291         now take a TypeContainer and a Parameters object.
24292
24293         (ParameterData): Modify return type of ParameterModifier method to be 
24294         Parameter.Modifier and not a string.
24295
24296         (ReflectionParameters, InternalParameters): Update accordingly.
24297
24298         * expression.cs (Argument::GetParameterModifier): Same here.
24299
24300         * support.cs (InternalParameters::ParameterType): Find a better way of determining
24301         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
24302         symbol in it at all so maybe this is only for now.
24303
24304 2001-10-30  Ravi Pratap  <ravi@ximian.com>
24305
24306         * support.cs (InternalParameters): Constructor now takes an extra argument 
24307         which is the actual Parameters class.
24308
24309         (ParameterDesc): Update to provide info on ref/out modifiers.
24310
24311         * class.cs (everywhere): Update call to InternalParameters to pass in
24312         the second argument too.
24313
24314         * support.cs (ParameterData): Add ParameterModifier, which is a method 
24315         to return the modifier info [ref/out etc]
24316
24317         (InternalParameters, ReflectionParameters): Implement the above.
24318
24319         * expression.cs (Argument::ParameterModifier): Similar function to return
24320         info about the argument's modifiers.
24321
24322         (Invocation::OverloadResolve): Update to take into account matching modifiers 
24323         too.
24324
24325         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
24326         a new SetFormalParameters object which we pass to InternalParameters.
24327
24328 2001-10-30  Ravi Pratap  <ravi@ximian.com>
24329
24330         * expression.cs (NewArray): Merge into the ArrayCreation class.
24331
24332 2001-10-29  Ravi Pratap  <ravi@ximian.com>
24333
24334         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
24335         NewUserdefinedArray into one as there wasn't much of a use in having
24336         two separate ones.
24337
24338         * expression.cs (Argument): Change field's name to ArgType from Type.
24339
24340         (Type): New readonly property which returns the proper type, taking into 
24341         account ref/out modifiers.
24342
24343         (everywhere): Adjust code accordingly for the above.
24344
24345         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
24346         whether we are emitting for a ref or out parameter.
24347
24348         * expression.cs (Argument::Emit): Use the above field to set the state.
24349
24350         (LocalVariableReference::Emit): Update to honour the flag and emit the
24351         right stuff.
24352
24353         * parameter.cs (Attributes): Set the correct flags for ref parameters.
24354
24355         * expression.cs (Argument::FullDesc): New function to provide a full desc.
24356
24357         * support.cs (ParameterData): Add method ParameterDesc to the interface.
24358
24359         (ReflectionParameters, InternalParameters): Implement the above method.
24360
24361         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
24362         reporting errors.
24363
24364         (Invocation::FullMethodDesc): Ditto. 
24365
24366 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
24367
24368         * cs-parser.jay: Add extra production for the second form of array
24369         creation. 
24370
24371         * expression.cs (ArrayCreation): Update to reflect the above
24372         change. 
24373
24374         * Small changes to prepare for Array initialization.
24375
24376 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
24377
24378         * typemanager.cs (ImplementsInterface): interface might be null;
24379         Deal with this problem;
24380
24381         Also, we do store negative hits on the cache (null values), so use
24382         this instead of calling t.GetInterfaces on the type everytime.
24383
24384 2001-10-28  Ravi Pratap  <ravi@ximian.com>
24385
24386         * typemanager.cs (IsBuiltinType): New method to help determine the same.
24387
24388         * expression.cs (New::DoResolve): Get rid of array creation code and instead
24389         split functionality out into different classes.
24390
24391         (New::FormArrayType): Move into NewBuiltinArray.
24392
24393         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
24394         quite useless.
24395
24396         (NewBuiltinArray): New class to handle creation of built-in arrays.
24397
24398         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
24399         account creation of one-dimensional arrays.
24400
24401         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
24402
24403         (NewUserdefinedArray::DoResolve): Implement.
24404
24405         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
24406
24407         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
24408         we maintain inside the TypeManager. This is necessary to perform lookups on the
24409         module builder.
24410
24411         (LookupType): Update to perform GetType on the module builders too.     
24412
24413         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
24414
24415         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
24416
24417 2001-10-23  Ravi Pratap  <ravi@ximian.com>
24418
24419         * expression.cs (New::DoResolve): Implement guts of array creation.
24420
24421         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
24422
24423 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
24424
24425         * expression.cs: Fix bug I introduced lsat night that broke
24426         Delegates. 
24427
24428         (Expression.Resolve): Report a 246 error (can not resolve name)
24429         if we find a SimpleName in the stream.
24430
24431         (Expression.ResolveLValue): Ditto.
24432
24433         (Expression.ResolveWithSimpleName): This function is a variant of
24434         ResolveName, this one allows SimpleNames to be returned without a
24435         warning.  The only consumer of SimpleNames is MemberAccess
24436
24437 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
24438
24439         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
24440         might arrive here.  I have my doubts that this is correct.
24441
24442         * statement.cs (Lock): Implement lock statement.
24443
24444         * cs-parser.jay: Small fixes to support `lock' and `using'
24445
24446         * cs-tokenizer.cs: Remove extra space
24447
24448         * driver.cs: New flag --checked, allows to turn on integer math
24449         checking. 
24450
24451         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
24452         Threading.Monitor.Exit 
24453
24454 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
24455
24456         * expression.cs (IndexerAccess::DoResolveLValue): Set the
24457         Expression Class to be IndexerAccess.
24458
24459         Notice that Indexer::DoResolve sets the eclass to Value.
24460
24461 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
24462
24463         * class.cs (TypeContainer::Emit): Emit code for indexers.
24464
24465         * assign.cs (IAssignMethod): New interface implemented by Indexers
24466         and Properties for handling assignment.
24467
24468         (Assign::Emit): Simplify and reuse code. 
24469
24470         * expression.cs (IndexerAccess, PropertyExpr): Implement
24471         IAssignMethod, clean up old code. 
24472
24473 2001-10-22  Ravi Pratap  <ravi@ximian.com>
24474
24475         * typemanager.cs (ImplementsInterface): New method to determine if a type
24476         implements a given interface. Provides a nice cache too.
24477
24478         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
24479         method.
24480
24481         (ConvertReferenceExplicit): Ditto.
24482
24483         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
24484         various methods, with correct names etc.
24485
24486         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
24487         Operator.UnaryNegation.
24488
24489         * cs-parser.jay (operator_declarator): Be a little clever in the case where
24490         we have a unary plus or minus operator.
24491
24492         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
24493         UnaryMinus.
24494
24495         * everywhere : update accordingly.
24496
24497         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
24498         respectively.
24499
24500         * class.cs (Method::Define): For the case where we are implementing a method
24501         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
24502         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
24503
24504 2001-10-21  Ravi Pratap  <ravi@ximian.com>
24505
24506         * interface.cs (FindMembers): Implement to work around S.R.E
24507         lameness.
24508
24509         * typemanager.cs (IsInterfaceType): Implement.
24510
24511         (FindMembers): Update to handle interface types too.
24512
24513         * expression.cs (ImplicitReferenceConversion): Re-write bits which
24514         use IsAssignableFrom as that is not correct - it doesn't work.
24515
24516         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
24517         and accordingly override EmitStatement.
24518
24519         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
24520         using the correct logic :-)
24521
24522 2001-10-19  Ravi Pratap  <ravi@ximian.com>
24523
24524         * ../errors/cs-11.cs : Add to demonstrate error -11 
24525
24526 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
24527
24528         * assign.cs (Assign::Resolve): Resolve right hand side first, and
24529         then pass this as a hint to ResolveLValue.
24530
24531         * expression.cs (FieldExpr): Add Location information
24532
24533         (FieldExpr::LValueResolve): Report assignment to readonly
24534         variable. 
24535
24536         (Expression::ExprClassFromMemberInfo): Pass location information.
24537
24538         (Expression::ResolveLValue): Add new method that resolves an
24539         LValue. 
24540
24541         (Expression::DoResolveLValue): Default invocation calls
24542         DoResolve. 
24543
24544         (Indexers): New class used to keep track of indexers in a given
24545         Type. 
24546
24547         (IStackStore): Renamed from LValue, as it did not really describe
24548         what this did.  Also ResolveLValue is gone from this interface and
24549         now is part of Expression.
24550
24551         (ElementAccess): Depending on the element access type
24552
24553         * typemanager.cs: Add `indexer_name_type' as a Core type
24554         (System.Runtime.CompilerServices.IndexerNameAttribute)
24555
24556         * statement.cs (Goto): Take a location.
24557
24558 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24559
24560         * delegate.cs (Delegate::VerifyDelegate): New method to verify
24561         if two delegates are compatible.
24562
24563         (NewDelegate::DoResolve): Update to take care of the case when
24564         we instantiate a delegate from another delegate.
24565
24566         * typemanager.cs (FindMembers): Don't even try to look up members
24567         of Delegate types for now.
24568
24569 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24570
24571         * delegate.cs (NewDelegate): New class to take care of delegate
24572         instantiation.
24573
24574         * expression.cs (New): Split the delegate related code out into 
24575         the NewDelegate class.
24576
24577         * delegate.cs (DelegateInvocation): New class to handle delegate 
24578         invocation.
24579
24580         * expression.cs (Invocation): Split out delegate related code into
24581         the DelegateInvocation class.
24582
24583 2001-10-17  Ravi Pratap  <ravi@ximian.com>
24584
24585         * expression.cs (New::DoResolve): Implement delegate creation fully
24586         and according to the spec.
24587
24588         (New::DoEmit): Update to handle delegates differently.
24589
24590         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
24591         because of which we were printing out arguments in reverse order !
24592
24593         * delegate.cs (VerifyMethod): Implement to check if the given method
24594         matches the delegate.
24595
24596         (FullDelegateDesc): Implement.
24597
24598         (VerifyApplicability): Implement.
24599
24600         * expression.cs (Invocation::DoResolve): Update to accordingly handle
24601         delegate invocations too.
24602
24603         (Invocation::Emit): Ditto.
24604
24605         * ../errors/cs1593.cs : Added.
24606
24607         * ../errors/cs1594.cs : Added.
24608
24609         * delegate.cs (InstanceExpression, TargetMethod): New properties.
24610
24611 2001-10-16  Ravi Pratap  <ravi@ximian.com>
24612
24613         * typemanager.cs (intptr_type): Core type for System.IntPtr
24614
24615         (InitCoreTypes): Update for the same.
24616
24617         (iasyncresult_type, asynccallback_type): Ditto.
24618
24619         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24620         correct.
24621
24622         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24623         too.
24624
24625         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24626         the builders for the 4 members of a delegate type :-)
24627
24628         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24629         type.
24630
24631         * expression.cs (New::DoResolve): Implement guts for delegate creation.
24632
24633         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24634
24635 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
24636
24637         * statement.cs (Break::Emit): Implement.   
24638         (Continue::Emit): Implement.
24639
24640         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24641         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24642         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24643         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
24644         end loop
24645
24646         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24647         properties that track the label for the current loop (begin of the
24648         loop and end of the loop).
24649
24650 2001-10-15  Ravi Pratap  <ravi@ximian.com>
24651
24652         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24653         use of emitting anything at all.
24654
24655         * class.cs, rootcontext.cs : Get rid of calls to the same.
24656
24657         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24658
24659         (Populate): Define the constructor correctly and set the implementation
24660         attributes.
24661
24662         * typemanager.cs (delegate_types): New hashtable to hold delegates that
24663         have been defined.
24664
24665         (AddDelegateType): Implement.
24666
24667         (IsDelegateType): Implement helper method.
24668
24669         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24670
24671         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24672         and accordingly handle it.
24673
24674         * delegate.cs (Populate): Take TypeContainer argument.
24675         Implement bits to define the Invoke method. However, I still haven't figured out
24676         how to take care of the native int bit :-(
24677
24678         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
24679         Qualify the name of the delegate, not its return type !
24680
24681         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24682         conversion.
24683
24684         (StandardConversionExists): Checking for array types turns out to be recursive.
24685
24686         (ConvertReferenceExplicit): Implement array conversion.
24687
24688         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24689
24690 2001-10-12  Ravi Pratap  <ravi@ximian.com>
24691
24692         * cs-parser.jay (delegate_declaration): Store the fully qualified
24693         name as it is a type declaration.
24694
24695         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
24696         readonly.
24697
24698         (DefineDelegate): Renamed from Define. Does the same thing essentially,
24699         as TypeContainer::DefineType.
24700
24701         (Populate): Method in which all the definition of the various methods (Invoke)
24702         etc is done.
24703
24704         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24705         see.
24706
24707         (CloseDelegate): Finally creates the delegate.
24708
24709         * class.cs (TypeContainer::DefineType): Update to define delegates.
24710         (Populate, Emit and CloseType): Do the same thing here too.
24711
24712         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24713         delegates in all these operations.
24714
24715 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
24716
24717         * expression.cs: LocalTemporary: a new expression used to
24718         reference a temporary that has been created.
24719
24720         * assign.cs: Handle PropertyAccess back here, so that we can
24721         provide the proper semantic access to properties.
24722
24723         * expression.cs (Expression::ConvertReferenceExplicit): Implement
24724         a few more explicit conversions. 
24725
24726         * modifiers.cs: `NEW' modifier maps to HideBySig.
24727
24728         * expression.cs (PropertyExpr): Make this into an
24729         ExpressionStatement, and support the EmitStatement code path. 
24730
24731         Perform get/set error checking, clean up the interface.
24732
24733         * assign.cs: recognize PropertyExprs as targets, and if so, turn
24734         them into toplevel access objects.
24735
24736 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
24737
24738         * expression.cs: PropertyExpr::PropertyExpr: use work around the
24739         SRE.
24740
24741         * typemanager.cs: Keep track here of our PropertyBuilders again to
24742         work around lameness in SRE.
24743
24744 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
24745
24746         * expression.cs (LValue::LValueResolve): New method in the
24747         interface, used to perform a second resolution pass for LValues. 
24748
24749         (This::DoResolve): Catch the use of this in static methods.
24750
24751         (This::LValueResolve): Implement.
24752
24753         (This::Store): Remove warning, assigning to `this' in structures
24754         is 
24755
24756         (Invocation::Emit): Deal with invocation of
24757         methods on value types.  We need to pass the address to structure
24758         methods rather than the object itself.  (The equivalent code to
24759         emit "this" for structures leaves the entire structure on the
24760         stack instead of a pointer to it). 
24761
24762         (ParameterReference::DoResolve): Compute the real index for the
24763         argument based on whether the method takes or not a `this' pointer
24764         (ie, the method is static).
24765
24766         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24767         value types returned from functions when we need to invoke a
24768         method on the sturcture.
24769
24770
24771 2001-10-11  Ravi Pratap  <ravi@ximian.com>
24772
24773         * class.cs (TypeContainer::DefineType): Method to actually do the business of
24774         defining the type in the Modulebuilder or Typebuilder. This is to take
24775         care of nested types which need to be defined on the TypeBuilder using
24776         DefineNestedMethod.
24777
24778         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
24779         methods in RootContext, only ported to be part of TypeContainer.
24780
24781         (TypeContainer::GetInterfaceOrClass): Ditto.
24782
24783         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24784
24785         * interface.cs (Interface::DefineInterface): New method. Does exactly
24786         what RootContext.CreateInterface did earlier, only it takes care of nested types 
24787         too.
24788
24789         (Interface::GetInterfaces): Move from RootContext here and port.
24790
24791         (Interface::GetInterfaceByName): Same here.
24792
24793         * rootcontext.cs (ResolveTree): Re-write.
24794
24795         (PopulateTypes): Re-write.
24796
24797         * class.cs (TypeContainer::Populate): Populate nested types too.
24798         (TypeContainer::Emit): Emit nested members too.
24799
24800         * typemanager.cs (AddUserType): Do not make use of the FullName property,
24801         instead just use the name argument passed in as it is already fully
24802         qualified.
24803
24804         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24805         to TypeContainer mapping to see if a type is user-defined.
24806
24807         * class.cs (TypeContainer::CloseType): Implement. 
24808
24809         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24810         the default constructor.
24811
24812         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24813         twice.
24814
24815         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24816
24817         * interface.cs (CloseType): Create the type here.
24818
24819         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24820         the hierarchy.
24821
24822         Remove all the methods which are now in TypeContainer.
24823
24824 2001-10-10  Ravi Pratap  <ravi@ximian.com>
24825
24826         * delegate.cs (Define): Re-write bits to define the delegate
24827         correctly.
24828
24829 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
24830
24831         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24832
24833         * expression.cs (ImplicitReferenceConversion): handle null as well
24834         as a source to convert to any reference type.
24835
24836         * statement.cs (Return): Perform any implicit conversions to
24837         expected return type.  
24838
24839         Validate use of return statement.  
24840
24841         * codegen.cs (EmitContext): Pass the expected return type here.
24842
24843         * class.cs (Method, Constructor, Property): Pass expected return
24844         type to EmitContext.
24845
24846 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
24847
24848         * expression.cs: Make DoResolve take an EmitContext instead of a
24849         TypeContainer.
24850
24851         Replaced `l' and `location' for `loc', for consistency.
24852
24853         (Error, Warning): Remove unneeded Tc argument.
24854
24855         * assign.cs, literal.cs, constant.cs: Update to new calling
24856         convention. 
24857
24858         * codegen.cs: EmitContext now contains a flag indicating whether
24859         code is being generated in a static method or not.
24860
24861         * cs-parser.jay: DecomposeQI, new function that replaces the old
24862         QualifiedIdentifier.  Now we always decompose the assembled
24863         strings from qualified_identifier productions into a group of
24864         memberaccesses.
24865
24866 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
24867
24868         * rootcontext.cs: Deal with field-less struct types correctly now
24869         by passing the size option to Define Type.
24870
24871         * class.cs: Removed hack that created one static field. 
24872
24873 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24874
24875         * statement.cs: Moved most of the code generation here. 
24876
24877 2001-10-09  Ravi Pratap  <ravi@ximian.com>
24878
24879         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24880         seem very right.
24881
24882         (ElementAccess): Remove useless bits for now - keep checks as the spec
24883         says.
24884
24885 2001-10-08  Ravi Pratap  <ravi@ximian.com>
24886
24887         * expression.cs (ElementAccess::DoResolve): Remove my crap code
24888         and start performing checks according to the spec.
24889
24890 2001-10-07  Ravi Pratap  <ravi@ximian.com>
24891
24892         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24893         rank_specifiers instead.
24894
24895         (rank_specifiers): Change the order in which the rank specifiers are stored
24896
24897         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24898
24899         * expression.cs (ElementAccess): Implement the LValue interface too.
24900
24901 2001-10-06  Ravi Pratap  <ravi@ximian.com>
24902
24903         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24904         except that user defined conversions are not included.
24905
24906         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
24907         perform the conversion of the return type, if necessary.
24908
24909         (New::DoResolve): Check whether we are creating an array or an object
24910         and accordingly do the needful.
24911
24912         (New::Emit): Same here.
24913
24914         (New::DoResolve): Implement guts of array creation.
24915
24916         (New::FormLookupType): Helper function.
24917
24918 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24919
24920         * codegen.cs: Removed most of the code generation here, and move the
24921         corresponding code generation bits to the statement classes. 
24922
24923         Added support for try/catch/finalize and throw.
24924
24925         * cs-parser.jay: Added support for try/catch/finalize.
24926
24927         * class.cs: Catch static methods having the flags override,
24928         virtual or abstract.
24929
24930         * expression.cs (UserCast): This user cast was not really doing
24931         what it was supposed to do.  Which is to be born in fully resolved
24932         state.  Parts of the resolution were being performed at Emit time! 
24933
24934         Fixed this code.
24935
24936 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24937
24938         * expression.cs: Implicity convert the result from UserCast.
24939
24940 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24941
24942         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24943         prevented it from working correctly. 
24944
24945         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24946         merely ConvertImplicit.
24947
24948 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24949
24950         * typemanager.cs: Make the LookupTypeContainer function static,
24951         and not per-instance.  
24952
24953         * class.cs: Make static FindMembers (the one that takes a Type
24954         argument). 
24955
24956         * codegen.cs: Add EmitForeach here.
24957
24958         * cs-parser.jay: Make foreach a toplevel object instead of the
24959         inline expansion, as we need to perform semantic analysis on it. 
24960
24961 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24962
24963         * expression.cs (Expression::ImplicitUserConversion): Rename to
24964         UserDefinedConversion.
24965
24966         (Expression::UserDefinedConversion): Take an extra argument specifying 
24967         whether we look for explicit user conversions too.
24968
24969         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24970
24971         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24972
24973         (ExplicitUserConversion): Make it a call to UserDefinedConversion
24974         with the appropriate arguments.
24975
24976         * cs-parser.jay (cast_expression): Record location too.
24977
24978         * expression.cs (Cast): Record location info.
24979
24980         (Expression::ConvertExplicit): Take location argument.
24981
24982         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24983         to determine if we are doing explicit conversions.
24984
24985         (UserCast::Emit): Update accordingly.
24986
24987         (Expression::ConvertExplicit): Report an error if everything fails.
24988
24989         * ../errors/cs0030.cs : Add.
24990
24991 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
24992
24993         * modifiers.cs: If the ABSTRACT keyword is present, also set the
24994         virtual and newslot bits. 
24995
24996         * class.cs (TypeContainer::RegisterRequiredImplementations):
24997         Record methods we need.
24998
24999         (TypeContainer::MakeKey): Helper function to make keys for
25000         MethodBases, since the Methodbase key is useless.
25001
25002         (TypeContainer::Populate): Call RegisterRequiredImplementations
25003         before defining the methods.   
25004
25005         Create a mapping for method_builders_to_methods ahead of time
25006         instead of inside a tight loop.
25007
25008         (::RequireMethods):  Accept an object as the data to set into the
25009         hashtable so we can report interface vs abstract method mismatch.
25010
25011 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
25012
25013         * report.cs: Make all of it static.
25014
25015         * rootcontext.cs: Drop object_type and value_type computations, as
25016         we have those in the TypeManager anyways.
25017
25018         Drop report instance variable too, now it is a global.
25019
25020         * driver.cs: Use try/catch on command line handling.
25021
25022         Add --probe option to debug the error reporting system with a test
25023         suite. 
25024
25025         * report.cs: Add support for exiting program when a probe
25026         condition is reached.
25027
25028 2001-10-03  Ravi Pratap  <ravi@ximian.com>
25029
25030         * expression.cs (Binary::DoNumericPromotions): Fix the case when
25031         we do a forcible conversion regardless of type, to check if 
25032         ForceConversion returns a null.
25033
25034         (Binary::error19): Use location to report error.
25035
25036         (Unary::error23): Use location here too.
25037
25038         * ../errors/cs0019.cs : Check in.
25039
25040         * ../errors/cs0023.cs : Check in.
25041
25042         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
25043         case of a non-null MethodInfo object with a length of 0 !
25044
25045         (Binary::ResolveOperator): Flag error if overload resolution fails to find
25046         an applicable member - according to the spec :-)
25047         Also fix logic to find members in base types.
25048
25049         (Unary::ResolveOperator): Same here.
25050
25051         (Unary::report23): Change name to error23 and make first argument a TypeContainer
25052         as I was getting thoroughly confused between this and error19 :-)
25053
25054         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
25055         (::FindMostEncompassedType): Implement.
25056         (::FindMostEncompassingType): Implement.
25057         (::StandardConversionExists): Implement.
25058
25059         (UserImplicitCast): Re-vamp. We now need info about most specific
25060         source and target types so that we can do the necessary conversions.
25061
25062         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
25063         mathematical union with no duplicates.
25064
25065 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
25066
25067         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
25068         in order from base classes to child classes, so that we can in
25069         child classes look up in our parent for method names and
25070         attributes (required for handling abstract, virtual, new, override
25071         constructs: we need to instrospect our base class, and if we dont
25072         populate the classes in order, the introspection might be
25073         incorrect.  For example, a method could query its parent before
25074         the parent has any methods and would determine that the parent has
25075         no abstract methods (while it could have had them)).
25076
25077         (RootContext::CreateType): Record the order in which we define the
25078         classes.
25079
25080 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
25081
25082         * class.cs (TypeContainer::Populate): Also method definitions can
25083         fail now, keep track of this.
25084
25085         (TypeContainer::FindMembers): Implement support for
25086         DeclaredOnly/noDeclaredOnly flag.
25087
25088         (Constructor::Emit) Return the ConstructorBuilder.
25089
25090         (Method::Emit) Return the MethodBuilder. 
25091         Check for abstract or virtual methods to be public.
25092
25093         * rootcontext.cs (RootContext::CreateType): Register all the
25094         abstract methods required for the class to be complete and the
25095         interface methods that must be implemented. 
25096
25097         * cs-parser.jay: Report error 501 (method requires body if it is
25098         not marked abstract or extern).
25099
25100         * expression.cs (TypeOf::Emit): Implement.
25101
25102         * typemanager.cs: runtime_handle_type, new global type.
25103
25104         * class.cs (Property::Emit): Generate code for properties.
25105
25106 2001-10-02  Ravi Pratap  <ravi@ximian.com>
25107
25108         * expression.cs (Unary::ResolveOperator): Find operators on base type
25109         too - we now conform exactly to the spec.
25110
25111         (Binary::ResolveOperator): Same here.
25112
25113         * class.cs (Operator::Define): Fix minor quirk in the tests.
25114
25115         * ../errors/cs0215.cs : Added.
25116
25117         * ../errors/cs0556.cs : Added.
25118
25119         * ../errors/cs0555.cs : Added.
25120
25121 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
25122
25123         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
25124         single integer which is really efficient
25125
25126 2001-10-01  Ravi Pratap  <ravi@ximian.com>
25127
25128         *  expression.cs (Expression::ImplicitUserConversion): Use location
25129         even in the case when we are examining True operators.
25130  
25131         * class.cs (Operator::Define): Perform extensive checks to conform
25132         with the rules for operator overloading in the spec.
25133
25134         * expression.cs (Expression::ImplicitReferenceConversion): Implement
25135         some of the other conversions mentioned in the spec.
25136
25137         * typemanager.cs (array_type): New static member for the System.Array built-in
25138         type.
25139
25140         (cloneable_interface): For System.ICloneable interface.
25141
25142         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
25143         we start resolving the tree and populating types.
25144
25145         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
25146  
25147 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
25148
25149         * expression.cs (Expression::ExprClassFromMemberInfo,
25150         Expression::Literalize): Create literal expressions from
25151         FieldInfos which are literals.
25152
25153         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
25154         type casts, because they were wrong.  The test suite in tests
25155         caught these ones.
25156
25157         (ImplicitNumericConversion): ushort to ulong requires a widening
25158         cast. 
25159
25160         Int32 constant to long requires widening cast as well.
25161
25162         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
25163         for integers because the type on the stack is not i4.
25164
25165 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
25166
25167         * expression.cs (report118): require location argument. 
25168
25169         * parameter.cs: Do not dereference potential null value.
25170
25171         * class.cs: Catch methods that lack the `new' keyword when
25172         overriding a name.  Report warnings when `new' is used without
25173         anything being there to override.
25174
25175         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
25176
25177         * class.cs: Only add constructor to hashtable if it is non-null
25178         (as now constructors can fail on define).
25179
25180         (TypeManager, Class, Struct): Take location arguments.
25181
25182         Catch field instance initialization in structs as errors.
25183
25184         accepting_filter: a new filter for FindMembers that is static so
25185         that we dont create an instance per invocation.
25186
25187         (Constructor::Define): Catch errors where a struct constructor is
25188         parameterless 
25189
25190         * cs-parser.jay: Pass location information for various new
25191         constructs. 
25192
25193         * delegate.cs (Delegate): take a location argument.
25194
25195         * driver.cs: Do not call EmitCode if there were problesm in the
25196         Definition of the types, as many Builders wont be there. 
25197
25198         * decl.cs (Decl::Decl): Require a location argument.
25199
25200         * cs-tokenizer.cs: Handle properly hex constants that can not fit
25201         into integers, and find the most appropiate integer for it.
25202
25203         * literal.cs: Implement ULongLiteral.
25204
25205         * rootcontext.cs: Provide better information about the location of
25206         failure when CreateType fails.
25207
25208 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
25209
25210         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
25211         as well.
25212
25213         * expression.cs (Binary::CheckShiftArguments): Add missing type
25214         computation.
25215         (Binary::ResolveOperator): Add type to the logical and and logical
25216         or, Bitwise And/Or and Exclusive Or code paths, it was missing
25217         before.
25218
25219         (Binary::DoNumericPromotions): In the case where either argument
25220         is ulong (and most signed types combined with ulong cause an
25221         error) perform implicit integer constant conversions as well.
25222
25223 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
25224
25225         * expression.cs (UserImplicitCast): Method should always be
25226         non-null. 
25227         (Invocation::BetterConversion): Simplified test for IntLiteral.
25228
25229         (Expression::ImplicitNumericConversion): Split this routine out.
25230         Put the code that performs implicit constant integer conversions
25231         here. 
25232
25233         (Expression::Resolve): Become a wrapper around DoResolve so we can
25234         check eclass and type being set after resolve.
25235
25236         (Invocation::Badness): Remove this dead function
25237
25238         (Binary::ResolveOperator): Do not compute the expensive argumnets
25239         unless we have a union for it.
25240
25241         (Probe::Emit): Is needs to do an isinst and then
25242         compare against null.
25243
25244         (::CanConvert): Added Location argument.  If the Location argument
25245         is null (Location.Null), then we do not report errors.  This is
25246         used by the `probe' mechanism of the Explicit conversion.  We do
25247         not want to generate an error for something that the user
25248         explicitly requested to be casted.  But the pipeline for an
25249         explicit cast first tests for potential implicit casts.
25250
25251         So for now, if the Location is null, it means `Probe only' to
25252         avoid adding another argument.   Might have to revise this
25253         strategy later.
25254
25255         (ClassCast): New class used to type cast objects into arbitrary
25256         classes (used in Explicit Reference Conversions).
25257
25258         Implement `as' as well.
25259
25260         Reverted all the patches from Ravi below: they were broken:
25261
25262                 * The use of `level' as a mechanism to stop recursive
25263                   invocations is wrong.  That was there just to catch the
25264                   bug with a strack trace but not as a way of addressing
25265                   the problem.
25266
25267                   To fix the problem we have to *understand* what is going
25268                   on and the interactions and come up with a plan, not
25269                   just get things going.
25270
25271                 * The use of the type conversion cache that I proposed
25272                   last night had an open topic: How does this work across
25273                   protection domains.  A user defined conversion might not
25274                   be public in the location where we are applying the
25275                   conversion, a different conversion might be selected
25276                   (ie, private A->B (better) but public B->A (worse),
25277                   inside A, A->B applies, but outside it, B->A will
25278                   apply).
25279
25280                 * On top of that (ie, even if the above is solved),
25281                   conversions in a cache need to be abstract.  Ie, `To
25282                   convert from an Int to a Short use an OpcodeCast', not
25283                   `To convert from an Int to a Short use the OpcodeCast on
25284                   the variable 5' (which is what this patch was doing).
25285
25286 2001-09-28  Ravi Pratap  <ravi@ximian.com>
25287
25288         * expression.cs (Invocation::ConversionExists): Re-write to use
25289         the conversion cache
25290
25291         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
25292         cache all conversions done, not just user-defined ones.
25293
25294         (Invocation::BetterConversion): The real culprit. Use ConversionExists
25295         to determine if a conversion exists instead of acutually trying to 
25296         perform the conversion. It's faster too.
25297
25298         (Expression::ConvertExplicit): Modify to use ConversionExists to check
25299         and only then attempt the implicit conversion.
25300
25301 2001-09-28  Ravi Pratap  <ravi@ximian.com>
25302
25303         * expression.cs (ConvertImplicit): Use a cache for conversions
25304         already found. Check level of recursion and bail out if necessary.
25305
25306 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
25307
25308         * typemanager.cs (string_concat_string_string, string_concat_object_object):
25309         Export standard methods that we expect for string operations.
25310
25311         * statement.cs (Block::UsageWarning): Track usage of variables and
25312         report the errors for not used variables.
25313
25314         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
25315         operator. 
25316
25317 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
25318
25319         * codegen.cs: remove unnneded code 
25320
25321         * expression.cs: Removed BuiltinTypeAccess class
25322
25323         Fix the order in which implicit conversions are
25324         done.  
25325
25326         The previous fixed dropped support for boxed conversions (adding a
25327         test to the test suite now)
25328
25329         (UserImplicitCast::CanConvert): Remove test for source being null,
25330         that code is broken.  We should not feed a null to begin with, if
25331         we do, then we should track the bug where the problem originates
25332         and not try to cover it up here.
25333
25334         Return a resolved expression of type UserImplicitCast on success
25335         rather than true/false.  Ravi: this is what I was talking about,
25336         the pattern is to use a static method as a "constructor" for
25337         objects. 
25338
25339         Also, do not create arguments until the very last minute,
25340         otherwise we always create the arguments even for lookups that
25341         will never be performed. 
25342
25343         (UserImplicitCast::Resolve): Eliminate, objects of type
25344         UserImplicitCast are born in a fully resolved state. 
25345
25346         * typemanager.cs (InitCoreTypes): Init also value_type
25347         (System.ValueType). 
25348
25349         * expression.cs (Cast::Resolve): First resolve the child expression.
25350
25351         (LValue): Add new method AddressOf to be used by
25352         the `&' operator.  
25353
25354         Change the argument of Store to take an EmitContext instead of an
25355         ILGenerator, because things like FieldExpr need to be able to call
25356         their children expression to generate the instance code. 
25357
25358         (Expression::Error, Expression::Warning): Sugar functions for
25359         reporting errors.
25360
25361         (Expression::MemberLookup): Accept a TypeContainer instead of a
25362         Report as the first argument.
25363
25364         (Expression::ResolvePrimary): Killed.  I still want to improve
25365         this as currently the code is just not right.
25366
25367         (Expression::ResolveMemberAccess): Simplify, but it is still
25368         wrong. 
25369
25370         (Unary::Resolve): Catch errors in AddressOf operators.
25371
25372         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
25373         index to a byte for the short-version, or the compiler will choose
25374         the wrong Emit call, which generates the wrong data.
25375
25376         (ParameterReference::Emit, ::Store): same.
25377
25378         (FieldExpr::AddressOf): Implement.
25379
25380         * typemanager.cs: TypeManager: made public variable instead of
25381         property.
25382
25383         * driver.cs: document --fatal.
25384
25385         * report.cs (ErrorMessage, WarningMessage): new names for the old
25386         Error and Warning classes.
25387
25388         * cs-parser.jay (member_access): Turn built-in access to types
25389         into a normal simplename
25390
25391 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25392
25393         * expression.cs (Invocation::BetterConversion): Fix to cope
25394         with q being null, since this was introducing a bug.
25395
25396         * expression.cs (ConvertImplicit): Do built-in conversions first.
25397
25398 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25399
25400         * expression.cs (UserImplicitCast::Resolve): Fix bug.
25401
25402 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25403
25404         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
25405         I had introduced long ago (what's new ?).
25406
25407         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
25408         the work of all the checking. 
25409         (ConvertImplicit): Call CanConvert and only then create object if necessary.
25410         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
25411
25412         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
25413         that is the right way. 
25414
25415         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
25416         overloading resolution. Use everywhere instead of cutting and pasting code.
25417
25418         (Binary::ResolveOperator): Use MakeUnionSet.
25419
25420         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
25421         we have to convert to bool types. Not complete yet.
25422
25423 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
25424
25425         * typemanager.cs (TypeManager::CSharpName): support ushort.
25426
25427         * expression.cs (Expression::TryImplicitIntConversion): Attempts
25428         to provide an expression that performsn an implicit constant int
25429         conversion (section 6.1.6).
25430         (Expression::ConvertImplicitRequired): Reworked to include
25431         implicit constant expression conversions.
25432
25433         (Expression::ConvertNumericExplicit): Finished.
25434
25435         (Invocation::Emit): If InstanceExpression is null, then it means
25436         that we perform a call on this.
25437
25438 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
25439
25440         * expression.cs (Unary::Emit): Remove some dead code.
25441         (Probe): Implement Resolve and Emit for `is'.
25442         (Expression::ConvertImplicitRequired): Attempt to do constant
25443         expression conversions here.  Maybe should be moved to
25444         ConvertImplicit, but I am not sure.
25445         (Expression::ImplicitLongConstantConversionPossible,
25446         Expression::ImplicitIntConstantConversionPossible): New functions
25447         that tell whether is it possible to apply an implicit constant
25448         expression conversion.
25449
25450         (ConvertNumericExplicit): Started work on explicit numeric
25451         conversions.
25452
25453         * cs-parser.jay: Update operator constants.
25454
25455         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
25456         (Parameters::GetSignature): Hook up VerifyArgs here.
25457         (Parameters::VerifyArgs): Verifies that no two arguments have the
25458         same name. 
25459
25460         * class.cs (Operator): Update the operator names to reflect the
25461         ones that the spec expects (as we are just stringizing the
25462         operator names).
25463
25464         * expression.cs (Unary::ResolveOperator): Fix bug: Use
25465         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
25466         previous usage did only work for our methods.
25467         (Expression::ConvertImplicit): Handle decimal implicit numeric
25468         conversions as well.
25469         (Expression::InternalTypeConstructor): Used to invoke constructors
25470         on internal types for default promotions.
25471
25472         (Unary::Emit): Implement special handling for the pre/post
25473         increment/decrement for overloaded operators, as they need to have
25474         the same semantics as the other operators.
25475
25476         (Binary::ResolveOperator): ditto.
25477         (Invocation::ConversionExists): ditto.
25478         (UserImplicitCast::Resolve): ditto.
25479
25480 2001-09-26  Ravi Pratap  <ravi@ximian.com>
25481
25482         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
25483         operator, return after emitting body. Regression tests pass again !
25484
25485         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
25486         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
25487         (Invocation::OverloadResolve): Ditto.
25488         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
25489
25490         * everywhere : update calls to the above methods accordingly.
25491
25492 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
25493
25494         * assign.cs (Assign): Make it inherit from ExpressionStatement.
25495
25496         * expression.cs (ExpressionStatement): New base class used for
25497         expressions that can appear in statements, so that we can provide
25498         an alternate path to generate expression that do not leave a value
25499         on the stack.
25500
25501         (Expression::Emit, and all the derivatives): We no longer return
25502         whether a value is left on the stack or not.  Every expression
25503         after being emitted leaves a single value on the stack.
25504
25505         * codegen.cs (EmitContext::EmitStatementExpression): Use the
25506         facilties of ExpressionStatement if possible.
25507
25508         * cs-parser.jay: Update statement_expression.
25509
25510 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
25511
25512         * driver.cs: Change the wording of message
25513
25514 2001-09-25  Ravi Pratap  <ravi@ximian.com>
25515
25516         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
25517         the type of the expression to the return type of the method if
25518         we have an overloaded operator match ! The regression tests pass again !
25519         (Unary::ResolveOperator): Ditto.
25520
25521         * expression.cs (Invocation::ConversionExists): Correct the member lookup
25522         to find "op_Implicit", not "implicit" ;-)
25523         (UserImplicitCast): New class to take care of user-defined implicit conversions.
25524         (ConvertImplicit, ForceConversion): Take TypeContainer argument
25525
25526         * everywhere : Correct calls to the above accordingly.
25527
25528         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
25529         (ConvertImplicit): Do user-defined conversion if it exists.
25530
25531 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
25532
25533         * assign.cs: track location.
25534         (Resolve): Use implicit conversions on assignment.
25535
25536         * literal.cs: Oops.  Not good, Emit of short access values should
25537         pass (Bytes) or the wrong argument will be selected.
25538
25539         * expression.cs (Unary::Emit): Emit code for -expr.
25540
25541         (Unary::ResolveOperator): Handle `Substract' for non-constants
25542         (substract from zero from the non-constants).
25543         Deal with Doubles as well. 
25544
25545         (Expression::ConvertImplicitRequired): New routine that reports an
25546         error if no implicit conversion exists. 
25547
25548         (Invocation::OverloadResolve): Store the converted implicit
25549         expressions if we make them
25550
25551 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25552
25553         * class.cs (ConstructorInitializer): Take a Location argument.
25554         (ConstructorBaseInitializer): Same here.
25555         (ConstructorThisInitializer): Same here.
25556
25557         * cs-parser.jay : Update all calls accordingly.
25558
25559         * expression.cs (Unary, Binary, New): Take location argument.
25560         Update accordingly everywhere.
25561
25562         * cs-parser.jay : Update all calls to the above to take a location
25563         argument.
25564
25565         * class.cs : Ditto.
25566
25567 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25568
25569         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
25570         (Invocation::BetterConversion): Same here
25571         (Invocation::ConversionExists): Ditto.
25572
25573         (Invocation::ConversionExists): Implement.
25574
25575 2001-09-22  Ravi Pratap  <ravi@ximian.com>
25576
25577         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
25578         Also take an additional TypeContainer argument.
25579
25580         * All over : Pass in TypeContainer as argument to OverloadResolve.
25581
25582         * typemanager.cs (CSharpName): Update to check for the string type and return
25583         that too.
25584
25585         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
25586         a given method.
25587
25588 2001-09-21  Ravi Pratap  <ravi@ximian.com>
25589
25590         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
25591         (Invocation::BetterFunction): Implement.
25592         (Invocation::BetterConversion): Implement.
25593         (Invocation::ConversionExists): Skeleton, no implementation yet.
25594
25595         Okay, things work fine !
25596
25597 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
25598
25599         * typemanager.cs: declare and load enum_type, delegate_type and
25600         void_type. 
25601
25602         * expression.cs (Expression::Emit): Now emit returns a value that
25603         tells whether a value is left on the stack or not.  This strategy
25604         might be reveted tomorrow with a mechanism that would address
25605         multiple assignments.
25606         (Expression::report118): Utility routine to report mismatches on
25607         the ExprClass.
25608
25609         (Unary::Report23): Report impossible type/operator combination
25610         utility function.
25611
25612         (Unary::IsIncrementableNumber): Whether the type can be
25613         incremented or decremented with add.
25614         (Unary::ResolveOperator): Also allow enumerations to be bitwise
25615         complemented. 
25616         (Unary::ResolveOperator): Implement ++, !, ~,
25617
25618         (Invocation::Emit): Deal with new Emit convetion.
25619
25620         * All Expression derivatives: Updated their Emit method to return
25621         whether they leave values on the stack or not.
25622
25623         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25624         stack for expressions that are statements. 
25625
25626 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25627
25628         * expression.cs (LValue): New interface.  Must be implemented by
25629         LValue objects.
25630         (LocalVariableReference, ParameterReference, FieldExpr): Implement
25631         LValue interface.
25632
25633         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25634         interface for generating code, simplifies the code.
25635
25636 2001-09-20  Ravi Pratap  <ravi@ximian.com>
25637
25638         * expression.cs (everywhere): Comment out return statements in ::Resolve
25639         methods to avoid the warnings.
25640
25641 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25642
25643         * driver.cs (parse): Report error 2001 if we can not open the
25644         source file.
25645
25646         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25647         not resolve it.
25648
25649         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25650         object. 
25651
25652         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25653         otherwise nested blocks end up with the same index.
25654
25655         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25656
25657         * expression.cs:  Instead of having FIXMEs in the Resolve
25658         functions, throw exceptions so it is obvious that we are facing a
25659         bug. 
25660
25661         * cs-parser.jay (invocation_expression): Pass Location information.
25662
25663         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25664         Use a basename for those routines because .NET does not like paths
25665         on them. 
25666
25667         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25668         already defined.
25669
25670 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
25671
25672         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25673         are loading the correct data types (throws an exception if not).
25674         (TypeManager::InitCoreTypes): Use CoreLookupType
25675
25676         * expression.cs (Unary::ResolveOperator): return the child
25677         expression for expressions which are just +expr.
25678         (Unary::ResolveOperator): Return negative literals for -LITERAL
25679         expressions (otherwise they are Unary {Literal}).
25680         (Invocation::Badness): Take into account `Implicit constant
25681         expression conversions'.
25682
25683         * literal.cs (LongLiteral): Implement long literal class.
25684         (IntLiteral): export the `Value' of the intliteral. 
25685
25686 2001-09-19  Ravi Pratap  <ravi@ximian.com>
25687
25688         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25689
25690         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
25691         instead of 'Operator'
25692
25693         * expression.cs (Binary::ResolveOperator): Update accordingly.
25694         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25695         and 'Minus'
25696
25697         * cs-parser.jay (unary_expression): Update to use the new names.
25698
25699         * gen-treedump.cs (GetUnary): Same here.
25700
25701         * expression.cs (Unary::Resolve): Implement.
25702         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
25703         operators are found instead of making noise ;-)
25704         (Unary::ResolveOperator): New method to do precisely the same thing which
25705         Binary::ResolveOperator does for Binary expressions.
25706         (Unary.method, .Arguments): Add.
25707         (Unary::OperName): Implement.   
25708         (Unary::ForceConversion): Copy and Paste !
25709
25710         * class.cs (Operator::Define): Fix a small bug for the case when we have 
25711         a unary operator.
25712
25713         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25714         for the inbuilt operators. Only overloading works for now ;-)
25715
25716 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
25717
25718         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25719         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25720
25721         * expression.cs (This::Emit): Implement. 
25722         (This::Resolve): Implement.
25723         (TypeOf:Resolve): Implement.
25724         (Expression::ResolveSimpleName): Add an implicit this to instance
25725         field references. 
25726         (MemberAccess::Resolve): Deal with Parameters and Fields. 
25727         Bind instance variable to Field expressions.
25728         (FieldExpr::Instance): New field used to track the expression that
25729         represents the object instance.
25730         (FieldExpr::Resolve): Track potential errors from MemberLookup not
25731         binding 
25732         (FieldExpr::Emit): Implement.
25733
25734         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25735         the last instruction contains a return opcode to avoid generating
25736         the last `ret' instruction (this generates correct code, and it is
25737         nice to pass the peverify output).
25738
25739         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25740         initializer for static and instance variables.
25741         (Constructor::Emit): Allow initializer to be null in the case of
25742         static constructors.  Only emit initializer for instance
25743         constructors. 
25744
25745         (TypeContainer::FindMembers): Return a null array if there are no
25746         matches.
25747
25748         Also fix the code for the MemberTypes.Method branch, as it was not
25749         scanning that for operators (or tried to access null variables before).
25750
25751         * assign.cs (Assign::Emit): Handle instance and static fields. 
25752
25753         * TODO: Updated.
25754
25755         * driver.cs: Stop compilation if there are parse errors.
25756
25757         * cs-parser.jay (constructor_declaration): Provide default base
25758         initializer for non-static constructors.
25759         (constructor_declarator): Do not provide a default base
25760         initializers if none was specified.
25761         Catch the fact that constructors should not have parameters.
25762
25763         * class.cs: Do not emit parent class initializers for static
25764         constructors, that should be flagged as an error.
25765
25766 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25767
25768         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25769         Move back code into TypeContainer::Populate.
25770
25771 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25772
25773         * class.cs (TypeContainer::AddConstructor): Fix the check to
25774         compare against Name, not Basename. 
25775         (Operator::OpType): Change Plus and Minus to Add and Subtract.
25776
25777         * cs-parser.jay : Update accordingly.
25778
25779         * class.cs (TypeContainer::FindMembers): For the case where we are searching
25780         for methods, don't forget to look into the operators too.
25781         (RegisterMethodBuilder): Helper method to take care of this for
25782         methods, constructors and operators.
25783         (Operator::Define): Completely revamp.
25784         (Operator.OperatorMethod, MethodName): New fields.
25785         (TypeContainer::Populate): Move the registering of builders into
25786         RegisterMethodBuilder.
25787         (Operator::Emit): Re-write.
25788
25789         * expression.cs (Binary::Emit): Comment out code path to emit method
25790         invocation stuff for the case when we have a user defined operator. I am
25791         just not able to get it right !
25792
25793 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25794
25795         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25796         argument. 
25797
25798         (Expression::MemberLookup): Provide a version that allows to
25799         specify the MemberTypes and BindingFlags. 
25800
25801         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25802         so it was not fetching variable information from outer blocks.
25803
25804         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25805         Beforefieldinit as it was buggy.
25806
25807         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25808         that Ravi put here.  
25809
25810         * class.cs (Constructor::Emit): Only emit if block is not null.
25811         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25812         deal with this by semantically definining it as if the user had
25813         done it.
25814
25815         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25816         constructors as we now "emit" them at a higher level.
25817
25818         (TypeContainer::DefineDefaultConstructor): Used to define the
25819         default constructors if none was provided.
25820
25821         (ConstructorInitializer): Add methods Resolve and Emit. 
25822
25823         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25824
25825 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25826
25827         * class.cs (TypeContainer::EmitDefaultConstructor): Register
25828         the default constructor builder with our hashtable for methodbuilders
25829         to methodcores.
25830
25831         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25832         and argument_count is 0 in which case we have a match.
25833         (Binary::ResolveOperator): More null checking and miscellaneous coding
25834         style cleanup.
25835
25836 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25837
25838         * rootcontext.cs (IsNameSpace): Compare against null.
25839
25840         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25841
25842         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25843         and Unary::Operator.
25844
25845         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25846         accordingly.
25847
25848         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25849         we have overloaded operators.
25850         (Binary::ResolveOperator): Implement the part which does the operator overload
25851         resolution.
25852
25853         * class.cs (Operator::Emit): Implement.
25854         (TypeContainer::Emit): Emit the operators we have too.
25855
25856         * expression.cs (Binary::Emit): Update to emit the appropriate code for
25857         the case when we have a user-defined operator.
25858
25859 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25860
25861         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25862
25863 2001-09-16  Ravi Pratap  <ravi@ximian.com>
25864
25865         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25866         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25867         (Constructor::Emit): Implement.
25868         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25869         if we have no work to do. 
25870         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
25871         Emit method.
25872
25873         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25874         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25875
25876         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25877         of parent.parent.
25878
25879 2001-09-15  Ravi Pratap  <ravi@ximian.com>
25880
25881         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25882         in the source.
25883         (Tree::RecordNamespace): Method to do what the name says ;-)
25884         (Tree::Namespaces): Property to get at the namespaces hashtable.
25885
25886         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
25887         keep track.
25888
25889         * rootcontext.cs (IsNamespace): Fixed it :-)
25890
25891 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25892
25893         * class.cs (TypeContainer::FindMembers): Add support for
25894         constructors. 
25895         (MethodCore): New class that encapsulates both the shared aspects
25896         of a Constructor and a Method.  
25897         (Method, Constructor): Factored pieces into MethodCore.
25898
25899         * driver.cs: Added --fatal which makes errors throw exceptions.
25900         Load System assembly as well as part of the standard library.
25901
25902         * report.cs: Allow throwing exceptions on errors for debugging.
25903
25904         * modifiers.cs: Do not use `parent', instead use the real type
25905         container to evaluate permission settings.
25906
25907         * class.cs: Put Ravi's patch back in.  He is right, and we will
25908         have to cope with the
25909
25910 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25911
25912         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25913         FamORAssem, not FamANDAssem.
25914
25915 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25916
25917         * driver.cs: Added --parse option that only parses its input files
25918         and terminates.
25919
25920         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
25921         incorrect.  IsTopLevel is not used to tell whether an object is
25922         root_types or not (that can be achieved by testing this ==
25923         root_types).  But to see if this is a top-level *class* (not
25924         necessarly our "toplevel" container). 
25925
25926 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25927
25928         * enum.cs (Enum::Define): Modify to call the Lookup method on the
25929         parent instead of a direct call to GetType.
25930
25931 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25932
25933         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25934         Modifiers.TypeAttr. This should just be a call to that method.
25935
25936         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25937         object so that we can determine if we are top-level or not.
25938
25939         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
25940         TypeContainer too.
25941
25942         * enum.cs (Enum::Define): Ditto.
25943
25944         * modifiers.cs (FieldAttr): Re-write.
25945
25946         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25947         (TypeContainer::HaveStaticConstructor): New property to provide access
25948         to precisely that info.
25949
25950         * modifiers.cs (MethodAttr): Re-write.
25951         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25952
25953         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25954         of top-level types as claimed.
25955
25956 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25957
25958         * expression.cs (MemberLookup): Fruitless attempt to lookup
25959         constructors.  Maybe I need to emit default constructors?  That
25960         might be it (currently .NET emits this for me automatically).
25961         (Invocation::OverloadResolve): Cope with Arguments == null.
25962         (Invocation::EmitArguments): new function, shared by the new
25963         constructor and us.
25964         (Invocation::Emit): Handle static and instance methods.  Emit
25965         proper call instruction for virtual or non-virtual invocations.
25966         (New::Emit): Implement.
25967         (New::Resolve): Implement.
25968         (MemberAccess:Resolve): Implement.
25969         (MethodGroupExpr::InstanceExpression): used conforming to the spec
25970         to track instances.
25971         (FieldExpr::Resolve): Set type.
25972
25973         * support.cs: Handle empty arguments.
25974                 
25975         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25976         SimpleLookup): Auxiliary routines to help parse a qualifier
25977         identifier.  
25978
25979         Update qualifier_identifier rule.
25980
25981         * codegen.cs: Removed debugging messages.
25982
25983         * class.cs: Make this a global thing, this acts just as a "key" to
25984         objects that we might have around.
25985
25986         (Populate): Only initialize method_builders_to_methods once.
25987
25988         * expression.cs (PropertyExpr): Initialize type from the
25989         PropertyType. 
25990
25991         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25992         Resolve pattern.  Attempt to implicitly convert value to boolean.
25993         Emit code.
25994
25995         * expression.cs: Set the type for the int32/int32 argument case.
25996         (Binary::ResolveOperator): Set the return type to boolean for
25997         comparission operators
25998
25999         * typemanager.cs: Remove debugging print code.
26000
26001         (Invocation::Resolve): resolve type.
26002
26003         * class.cs: Allocate a MemberInfo of the correct size, as the code
26004         elsewhere depends on the test to reflect the correct contents.
26005
26006         (Method::) Keep track of parameters, due to System.Reflection holes
26007
26008         (TypeContainer::Populate): Keep track of MethodBuilders to Method
26009         mapping here.
26010
26011         (TypeContainer::FindMembers): Use ArrayList and then copy an array
26012         of the exact size and return that.
26013
26014         (Class::LookupMethodByBuilder): New function that maps
26015         MethodBuilders to its methods.  Required to locate the information
26016         on methods because System.Reflection bit us again.
26017
26018         * support.cs: New file, contains an interface ParameterData and
26019         two implementations: ReflectionParameters and InternalParameters
26020         used to access Parameter information.  We will need to grow this
26021         as required.
26022
26023         * expression.cs (Invocation::GetParameterData): implement a cache
26024         and a wrapper around the ParameterData creation for methods. 
26025         (Invocation::OverloadResolve): Use new code.
26026
26027 2001-09-13  Ravi Pratap  <ravi@ximian.com>
26028
26029         * class.cs (TypeContainer::EmitField): Remove and move into 
26030         (Field::Define): here and modify accordingly.
26031         (Field.FieldBuilder): New member.
26032         (TypeContainer::Populate): Update accordingly.
26033         (TypeContainer::FindMembers): Implement.
26034
26035 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
26036
26037         * statement.cs: (VariableInfo::VariableType): New field to be
26038         initialized with the full type once it is resolved. 
26039
26040 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
26041
26042         * parameter.cs (GetParameterInfo): Use a type cache to compute
26043         things only once, and to reuse this information
26044
26045         * expression.cs (LocalVariableReference::Emit): Implement.
26046         (OpcodeCast::Emit): fix.
26047
26048         (ParameterReference::Resolve): Implement.
26049         (ParameterReference::Emit): Implement.
26050
26051         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
26052         that are expressions need to stay as Expressions.
26053
26054         * typemanager.cs (CSharpName): Returns the C# name of a type if
26055         possible. 
26056
26057         * expression.cs (Expression::ConvertImplicit): New function that
26058         implements implicit type conversions.
26059
26060         (Expression::ImplicitReferenceConversion): Implements implicit
26061         reference conversions.
26062
26063         (EmptyCast): New type for transparent casts.
26064
26065         (OpcodeCast): New type for casts of types that are performed with
26066         a sequence of bytecodes.
26067
26068         (BoxedCast): New type used for casting value types into reference
26069         types.  Emits a box opcode.
26070
26071         (Binary::DoNumericPromotions): Implements numeric promotions of
26072         and computation of the Binary::Type.
26073
26074         (Binary::EmitBranchable): Optimization.
26075
26076         (Binary::Emit): Implement code emission for expressions.
26077
26078         * typemanager.cs (TypeManager): Added two new core types: sbyte
26079         and byte.
26080
26081 2001-09-12  Ravi Pratap  <ravi@ximian.com>
26082
26083         * class.cs (TypeContainer::FindMembers): Method which does exactly
26084         what Type.FindMembers does, only we don't have to use reflection. No
26085         implementation yet.
26086
26087         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
26088         typecontainer objects as we need to get at them.
26089         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
26090
26091         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
26092         typecontainer object.
26093
26094         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
26095         of just a Report object.
26096
26097 2001-09-11  Ravi Pratap  <ravi@ximian.com>
26098
26099         * class.cs (Event::Define): Go back to using the prefixes "add_" and
26100         "remove_"
26101         (TypeContainer::Populate): Now define the delegates of the type too.
26102         (TypeContainer.Delegates): Property to access the list of delegates defined
26103         in the type.
26104
26105         * delegates.cs (Delegate::Define): Implement partially.
26106
26107         * modifiers.cs (TypeAttr): Handle more flags.
26108
26109 2001-09-11  Ravi Pratap  <ravi@ximian.com>
26110
26111         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
26112         and not <=
26113         (Operator::Define): Re-write logic to get types by using the LookupType method
26114         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
26115         (Indexer::Define): Ditto.
26116         (Event::Define): Ditto.
26117         (Property::Define): Ditto.
26118
26119 2001-09-10  Ravi Pratap  <ravi@ximian.com>
26120
26121         * class.cs (TypeContainer::Populate): Now define operators too. 
26122         (TypeContainer.Operators): New property to access the list of operators
26123         in a type.
26124         (Operator.OperatorMethodBuilder): New member to hold the method builder
26125         for the operator we are defining.
26126         (Operator::Define): Implement.
26127
26128 2001-09-10  Ravi Pratap  <ravi@ximian.com>
26129
26130         * class.cs (Event::Define): Make the prefixes of the accessor methods
26131         addOn_ and removeOn_ 
26132
26133         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
26134         of the location being passed in too. Ideally, this should go later since all
26135         error reporting should be done through the Report object.
26136
26137         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
26138         (Populate): Iterate thru the indexers we have and define them too.
26139         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
26140         for the get and set accessors.
26141         (Indexer::Define): Implement.
26142
26143 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
26144
26145         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
26146         my previous implementation, did not work.
26147
26148         * typemanager.cs: Add a couple of missing types (the longs).
26149
26150         * literal.cs: Use TypeManager.bool_type instead of getting it.
26151
26152         * expression.cs (EventExpr): New kind of expressions.
26153         (Expressio::ExprClassFromMemberInfo): finish
26154
26155 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
26156
26157         * assign.cs: Emit stores to static fields differently.
26158
26159 2001-09-08  Ravi Pratap  <ravi@ximian.com>
26160
26161         * Merge in changes and adjust code to tackle conflicts. Backed out my
26162         code in Assign::Resolve ;-) 
26163
26164 2001-09-08  Ravi Pratap  <ravi@ximian.com>
26165
26166         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
26167         instead Report.Error and also pass in the location.
26168         (CSharpParser::Lexer): New readonly property to return the reference
26169         to the Tokenizer object.
26170         (declare_local_variables): Use Report.Error with location instead of plain 
26171         old error.
26172         (CheckDef): Ditto.
26173
26174         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
26175         (Operator.CheckBinaryOperator): Ditto.
26176
26177         * cs-parser.jay (operator_declarator): Update accordingly.
26178
26179         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
26180         (CheckBinaryOperator): Same here.
26181
26182         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
26183         on the name without any prefixes of namespace names etc. This is because we
26184         already might have something already fully qualified like 
26185         'System.Console.WriteLine'
26186
26187         * assign.cs (Resolve): Begin implementation. Stuck ;-)
26188
26189 2001-09-07  Ravi Pratap  <ravi@ximian.com>
26190
26191         * cs-tokenizer.cs (location): Return a string which also contains
26192         the file name.
26193
26194         * expression.cs (ElementAccess): New class for expressions of the
26195         type 'element access.'
26196         (BaseAccess): New class for expressions of the type 'base access.'
26197         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
26198         respectively.
26199
26200         * cs-parser.jay (element_access): Implement action.
26201         (base_access): Implement actions.
26202         (checked_expression, unchecked_expression): Implement.
26203
26204         * cs-parser.jay (local_variable_type): Correct and implement.
26205         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
26206
26207         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
26208
26209         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
26210         name and the specifiers.
26211
26212         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
26213
26214         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
26215         making them all public ;-)
26216
26217         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
26218         class anyways.
26219
26220 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
26221
26222         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
26223         PropertyExprs.
26224         (FieldExpr, PropertyExprs): New resolved expressions.
26225         (SimpleName::MemberStaticCheck): Perform static checks for access
26226         to non-static fields on static methods. Maybe this should be
26227         generalized for MemberAccesses. 
26228         (SimpleName::ResolveSimpleName): More work on simple name
26229         resolution. 
26230
26231         * cs-parser.jay (primary_expression/qualified_identifier): track
26232         the parameter index.
26233
26234         * codegen.cs (CodeGen::Save): Catch save exception, report error.
26235         (EmitContext::EmitBoolExpression): Chain to expression generation
26236         instead of temporary hack.
26237         (::EmitStatementExpression): Put generic expression code generation.
26238
26239         * assign.cs (Assign::Emit): Implement variable assignments to
26240         local variables, parameters and fields.
26241
26242 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
26243
26244         * statement.cs (Block::GetVariableInfo): New method, returns the
26245         VariableInfo for a variable name in a block.
26246         (Block::GetVariableType): Implement in terms of GetVariableInfo
26247
26248         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
26249         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
26250
26251 2001-09-06  Ravi Pratap  <ravi@ximian.com>
26252
26253         * cs-parser.jay (operator_declaration): Continue on my quest : update
26254         to take attributes argument.
26255         (event_declaration): Ditto.
26256         (enum_declaration): Ditto.
26257         (indexer_declaration): Ditto.
26258
26259         * class.cs (Operator::Operator): Update constructor accordingly.
26260         (Event::Event): Ditto.
26261
26262         * delegate.cs (Delegate::Delegate): Same here.
26263
26264         * enum.cs (Enum::Enum): Same here.
26265
26266 2001-09-05  Ravi Pratap  <ravi@ximian.com>
26267
26268         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
26269
26270         * ../tests/cs0658.cs : New file to demonstrate error 0658.
26271
26272         * attribute.cs (Attributes): New class to encapsulate all attributes which were
26273         being passed around as an arraylist.
26274         (Attributes::AddAttribute): Method to add attribute sections.
26275
26276         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
26277         (struct_declaration): Update accordingly.
26278         (constant_declaration): Update.
26279         (field_declaration): Update.
26280         (method_header): Update.
26281         (fixed_parameter): Update.
26282         (parameter_array): Ditto.
26283         (property_declaration): Ditto.
26284         (destructor_declaration): Ditto.
26285
26286         * class.cs (Struct::Struct): Update constructors accordingly.
26287         (Class::Class): Ditto.
26288         (Field::Field): Ditto.
26289         (Method::Method): Ditto.
26290         (Property::Property): Ditto.
26291         (TypeContainer::OptAttribute): update property's return type.
26292
26293         * interface.cs (Interface.opt_attributes): New member.
26294         (Interface::Interface): Update to take the extra Attributes argument.
26295
26296         * parameter.cs (Parameter::Parameter): Ditto.
26297
26298         * constant.cs (Constant::Constant): Ditto.
26299
26300         * interface.cs (InterfaceMemberBase): New OptAttributes field.
26301         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
26302         the attributes as a parameter.
26303         (InterfaceProperty): Update constructor call.
26304         (InterfaceEvent): Ditto.
26305         (InterfaceMethod): Ditto.
26306         (InterfaceIndexer): Ditto.
26307
26308         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
26309         pass the attributes too.
26310         (interface_event_declaration): Ditto.
26311         (interface_property_declaration): Ditto.
26312         (interface_method_declaration): Ditto.
26313         (interface_declaration): Ditto.
26314
26315 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
26316
26317         * class.cs (Method::Define): Track the "static Main" definition to
26318         create an entry point. 
26319
26320         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
26321         EntryPoint if we find it. 
26322
26323         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
26324         (EmitContext::ig): Make this variable public.
26325
26326         * driver.cs: Make the default output file be the first file name
26327         with the .exe extension.  
26328
26329         Detect empty compilations
26330
26331         Handle various kinds of output targets.  Handle --target and
26332         rename -t to --dumper.
26333
26334         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
26335         methods inherited from Expression return now an Expression.  This
26336         will is used during the tree rewriting as we resolve them during
26337         semantic analysis.
26338
26339         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
26340         the spec.  Missing entirely is the information about
26341         accessability of elements of it.
26342
26343         (Expression::ExprClassFromMemberInfo): New constructor for
26344         Expressions that creates a fully initialized Expression based on
26345         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
26346         a Type.
26347
26348         (Invocation::Resolve): Begin implementing resolution of invocations.
26349
26350         * literal.cs (StringLiteral):  Implement Emit.
26351
26352 2001-09-05  Ravi Pratap  <ravi@ximian.com>
26353
26354         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
26355         member.
26356
26357 2001-09-04  Ravi Pratap  <ravi@ximian.com>
26358
26359         * cs-parser.jay (attribute_arguments): Implement actions.
26360         (attribute): Fix bug in production. Implement action.
26361         (attribute_list): Implement.
26362         (attribute_target): Implement.
26363         (attribute_target_specifier, opt_target_specifier): Implement
26364         (CheckAttributeTarget): New method to check if the attribute target
26365         is valid.
26366         (attribute_section): Implement.
26367         (opt_attributes): Implement.
26368
26369         * attribute.cs : New file to handle attributes.
26370         (Attribute): Class to hold attribute info.
26371
26372         * cs-parser.jay (opt_attribute_target_specifier): Remove production
26373         (attribute_section): Modify production to use 2 different rules to 
26374         achieve the same thing. 1 s/r conflict down !
26375         Clean out commented, useless, non-reducing dimension_separator rules.
26376
26377         * class.cs (TypeContainer.attributes): New member to hold list
26378         of attributes for a type.
26379         (Struct::Struct): Modify to take one more argument, the attribute list.
26380         (Class::Class): Ditto.
26381         (Field::Field): Ditto.
26382         (Method::Method): Ditto.
26383         (Property::Property): Ditto.
26384
26385         * cs-parser.jay (struct_declaration): Update constructor call to
26386         pass in the attributes too.
26387         (class_declaration): Ditto.
26388         (constant_declaration): Ditto.
26389         (field_declaration): Ditto.
26390         (method_header): Ditto.
26391         (fixed_parameter): Ditto.
26392         (parameter_array): Ditto.
26393         (property_declaration): Ditto.
26394
26395         * constant.cs (Constant::Constant): Update constructor similarly.
26396         Use System.Collections.
26397
26398         * parameter.cs (Parameter::Parameter): Update as above.
26399
26400 2001-09-02  Ravi Pratap  <ravi@ximian.com>
26401
26402         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
26403         (TypeContainer.delegates): New member to hold list of delegates.
26404
26405         * cs-parser.jay (delegate_declaration): Implement the action correctly 
26406         this time as I seem to be on crack ;-)
26407
26408 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
26409
26410         * rootcontext.cs (RootContext::IsNamespace): new function, used to
26411         tell whether an identifier represents a namespace.
26412
26413         * expression.cs (NamespaceExpr): A namespace expression, used only
26414         temporarly during expression resolution.
26415         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
26416         utility functions to resolve names on expressions.
26417
26418 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
26419
26420         * codegen.cs: Add hook for StatementExpressions. 
26421
26422         * class.cs: Fix inverted test for static flag in methods.
26423
26424 2001-09-02  Ravi Pratap  <ravi@ximian.com>
26425
26426         * class.cs (Operator::CheckUnaryOperator): Correct error number used
26427         to make it coincide with MS' number.
26428         (Operator::CheckBinaryOperator): Ditto.
26429
26430         * ../errors/errors.txt : Remove error numbers added earlier.
26431
26432         * ../errors/cs1019.cs : Test case for error # 1019
26433
26434         * ../errros/cs1020.cs : Test case for error # 1020
26435
26436         * cs-parser.jay : Clean out commented cruft.
26437         (dimension_separators, dimension_separator): Comment out. Ostensibly not
26438         used anywhere - non-reducing rule.
26439         (namespace_declarations): Non-reducing rule - comment out.
26440
26441         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
26442         with TypeContainer::AddEnum.
26443
26444         * delegate.cs : New file for delegate handling classes.
26445         (Delegate): Class for declaring delegates.
26446
26447         * makefile : Update.
26448
26449         * cs-parser.jay (delegate_declaration): Implement.
26450
26451 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
26452
26453         * class.cs (Event::Define): Implement.
26454         (Event.EventBuilder): New member.
26455
26456         * class.cs (TypeContainer::Populate): Update to define all enums and events
26457         we have.
26458         (Events): New property for the events arraylist we hold. Shouldn't we move to using
26459         readonly fields for all these cases ?
26460
26461 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
26462
26463         * class.cs (Property): Revamp to use the convention of making fields readonly.
26464         Accordingly modify code elsewhere.
26465
26466         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
26467         the Define method of the Property class.
26468
26469         * class.cs : Clean up applied patch and update references to variables etc. Fix 
26470         trivial bug.
26471         (TypeContainer::Populate): Update to define all the properties we have. Also
26472         define all enumerations.
26473
26474         * enum.cs (Define): Implement.
26475
26476 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
26477
26478         * cs-parser.jay (overloadable_operator): The semantic value is an
26479         enum of the Operator class.
26480         (operator_declarator): Implement actions.
26481         (operator_declaration): Implement.
26482
26483         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
26484         validity of definitions.
26485         (Operator::CheckBinaryOperator): Static method to check for binary operators
26486         (TypeContainer::AddOperator): New method to add an operator to a type.
26487
26488         * cs-parser.jay (indexer_declaration): Added line to actually call the
26489         AddIndexer method so it gets added ;-)
26490
26491         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
26492         already taken care of by the MS compiler ?  
26493
26494 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
26495
26496         * class.cs (Operator): New class for operator declarations.
26497         (Operator::OpType): Enum for the various operators.
26498
26499 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
26500
26501         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
26502         ostensibly handle this in semantic analysis.
26503
26504         * cs-parser.jay (general_catch_clause): Comment out
26505         (specific_catch_clauses, specific_catch_clause): Ditto.
26506         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
26507         (catch_args, opt_catch_args): New productions.
26508         (catch_clause): Rewrite to use the new productions above
26509         (catch_clauses): Modify accordingly.
26510         (opt_catch_clauses): New production to use in try_statement
26511         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
26512         and re-write the code in the actions to extract the specific and
26513         general catch clauses by being a little smart ;-)
26514
26515         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
26516         Hooray, try and catch statements parse fine !
26517
26518 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26519
26520         * statement.cs (Block::GetVariableType): Fix logic to extract the type
26521         string from the hashtable of variables.
26522
26523         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
26524         I end up making that mistake ;-)
26525         (catch_clauses): Fixed gross error which made Key and Value of the 
26526         DictionaryEntry the same : $1 !!
26527
26528 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26529
26530         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
26531
26532         * cs-parser.jay (event_declaration): Correct to remove the semicolon
26533         when the add and remove accessors are specified. 
26534
26535 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26536
26537         * cs-parser.jay (IndexerDeclaration): New helper class to hold
26538         information about indexer_declarator.
26539         (indexer_declarator): Implement actions.
26540         (parsing_indexer): New local boolean used to keep track of whether
26541         we are parsing indexers or properties. This is necessary because 
26542         implicit_parameters come into picture even for the get accessor in the 
26543         case of an indexer.
26544         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
26545
26546         * class.cs (Indexer): New class for indexer declarations.
26547         (TypeContainer::AddIndexer): New method to add an indexer to a type.
26548         (TypeContainer::indexers): New member to hold list of indexers for the
26549         type.
26550
26551 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26552
26553         * cs-parser.jay (add_accessor_declaration): Implement action.
26554         (remove_accessor_declaration): Implement action.
26555         (event_accessors_declaration): Implement
26556         (variable_declarators): swap statements for first rule - trivial.
26557
26558         * class.cs (Event): New class to hold information about event
26559         declarations.
26560         (TypeContainer::AddEvent): New method to add an event to a type
26561         (TypeContainer::events): New member to hold list of events.
26562
26563         * cs-parser.jay (event_declaration): Implement actions.
26564
26565 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26566
26567         * cs-parser.jay (dim_separators): Implement. Make it a string
26568         concatenating all the commas together, just as they appear.
26569         (opt_dim_separators): Modify accordingly
26570         (rank_specifiers): Update accordingly. Basically do the same
26571         thing - instead, collect the brackets here.
26572         (opt_rank_sepcifiers): Modify accordingly.
26573         (array_type): Modify to actually return the complete type string
26574         instead of ignoring the rank_specifiers.
26575         (expression_list): Implement to collect the expressions
26576         (variable_initializer): Implement. We make it a list of expressions
26577         essentially so that we can handle the array_initializer case neatly too.
26578         (variable_initializer_list): Implement.
26579         (array_initializer): Make it a list of variable_initializers
26580         (opt_array_initializer): Modify accordingly.
26581
26582         * expression.cs (New::NType): Add enumeration to help us
26583         keep track of whether we have an object/delegate creation
26584         or an array creation.
26585         (New:NewType, New::Rank, New::Indices, New::Initializers): New
26586         members to hold data about array creation.
26587         (New:New): Modify to update NewType
26588         (New:New): New Overloaded contructor for the array creation
26589         case.
26590
26591         * cs-parser.jay (array_creation_expression): Implement to call
26592         the overloaded New constructor.
26593
26594 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
26595
26596         * class.cs (TypeContainer::Constructors): Return member
26597         constructors instead of returning null.
26598
26599 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
26600
26601         * typemanager.cs (InitCoreTypes): Initialize the various core
26602         types after we have populated the type manager with the user
26603         defined types (this distinction will be important later while
26604         compiling corlib.dll)
26605
26606         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
26607         on Expression Classification.  Now all expressions have a method
26608         `Resolve' and a method `Emit'.
26609
26610         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
26611         generation from working.     Also add some temporary debugging
26612         code. 
26613
26614 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
26615
26616         * codegen.cs: Lots of code generation pieces.  This is only the
26617         beginning, will continue tomorrow with more touches of polish.  We
26618         handle the fundamentals of if, while, do, for, return.  Others are
26619         trickier and I need to start working on invocations soon.
26620
26621         * gen-treedump.cs: Bug fix, use s.Increment here instead of
26622         s.InitStatement. 
26623
26624         * codegen.cs (EmitContext): New struct, used during code
26625         emission to keep a context.   Most of the code generation will be
26626         here. 
26627
26628         * cs-parser.jay: Add embedded blocks to the list of statements of
26629         this block.  So code generation proceeds in a top down fashion.
26630
26631 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
26632
26633         * statement.cs: Add support for multiple child blocks.
26634
26635 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
26636
26637         * codegen.cs (EmitCode): New function, will emit the code for a
26638         Block of code given a TypeContainer and its ILGenerator. 
26639
26640         * statement.cs (Block): Standard public readonly optimization.
26641         (Block::Block constructors): Link children. 
26642         (Block::Child): Child Linker.
26643         (Block::EmitVariables): Emits IL variable declarations.
26644
26645         * class.cs: Drop support for MethodGroups here, delay until
26646         Semantic Analysis.
26647         (Method::): Applied the same simplification that I did before, and
26648         move from Properties to public readonly fields.
26649         (Method::ParameterTypes): Returns the parameter types for the
26650         function, and implements a cache that will be useful later when I
26651         do error checking and the semantic analysis on the methods is
26652         performed.
26653         (Constructor::GetCallingConvention): Renamed from CallingConvetion
26654         and made a method, optional argument tells whether this is a class
26655         or a structure to apply the `has-this' bit.
26656         (Method::GetCallingConvention): Implement, returns the calling
26657         convention. 
26658         (Method::Define): Defines the type, a second pass is performed
26659         later to populate the methods.
26660
26661         (Constructor::ParameterTypes): implement a cache similar to the
26662         one on Method::ParameterTypes, useful later when we do semantic
26663         analysis. 
26664
26665         (TypeContainer::EmitMethod):  New method.  Emits methods.
26666
26667         * expression.cs: Removed MethodGroup class from here.
26668
26669         * parameter.cs (Parameters::GetCallingConvention): new method.
26670
26671 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
26672
26673         * class.cs (TypeContainer::Populate): Drop RootContext from the
26674         argument. 
26675
26676         (Constructor::CallingConvention): Returns the calling convention.
26677         (Constructor::ParameterTypes): Returns the constructor parameter
26678         types. 
26679
26680         (TypeContainer::AddConstructor): Keep track of default constructor
26681         and the default static constructor.
26682
26683         (Constructor::) Another class that starts using `public readonly'
26684         instead of properties. 
26685
26686         (Constructor::IsDefault): Whether this is a default constructor. 
26687
26688         (Field::) use readonly public fields instead of properties also.
26689
26690         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26691         track of static constructors;  If none is used, turn on
26692         BeforeFieldInit in the TypeAttributes. 
26693
26694         * cs-parser.jay (opt_argument_list): now the return can be null
26695         for the cases where there are no arguments. 
26696
26697         (constructor_declarator): If there is no implicit `base' or
26698         `this', then invoke the default parent constructor. 
26699
26700         * modifiers.cs (MethodAttr): New static function maps a set of
26701         modifiers flags into a MethodAttributes enum
26702         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
26703         MethodAttr, TypeAttr to represent the various mappings where the
26704         modifiers are used.
26705         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
26706
26707 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
26708
26709         * parameter.cs (GetParameterInfo): Fix bug where there would be no
26710         method arguments.
26711
26712         * interface.cs (PopulateIndexer): Implemented the code generator
26713         for interface indexers.
26714
26715 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
26716
26717         * interface.cs (InterfaceMemberBase): Now we track the new status
26718         here.  
26719
26720         (PopulateProperty): Implement property population.  Woohoo!  Got
26721         Methods and Properties going today. 
26722
26723         Removed all the properties for interfaces, and replaced them with
26724         `public readonly' fields. 
26725
26726 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
26727
26728         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26729         initialize their hashtables/arraylists only when they are needed
26730         instead of doing this always.
26731
26732         * parameter.cs: Handle refs and out parameters.
26733
26734         * cs-parser.jay: Use an ArrayList to construct the arguments
26735         instead of the ParameterCollection, and then cast that to a
26736         Parameter[] array.
26737
26738         * parameter.cs: Drop the use of ParameterCollection and use
26739         instead arrays of Parameters.
26740
26741         (GetParameterInfo): Use the Type, not the Name when resolving
26742         types. 
26743
26744 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
26745
26746         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26747         and instead use public readonly fields.
26748
26749         * class.cs: Put back walking code for type containers.
26750
26751 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
26752
26753         * class.cs (MakeConstant): Code to define constants.
26754
26755         * rootcontext.cs (LookupType): New function.  Used to locate types 
26756
26757
26758 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
26759
26760         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
26761         this System.Reflection code is.  Kudos to Microsoft
26762
26763         * typemanager.cs: Implement a type cache and avoid loading all
26764         types at boot time.  Wrap in LookupType the internals.  This made
26765         the compiler so much faster.  Wow.  I rule!
26766
26767         * driver.cs: Make sure we always load mscorlib first (for
26768         debugging purposes, nothing really important).
26769
26770         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
26771         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
26772
26773         * rootcontext.cs: Lookup types on their namespace;  Lookup types
26774         on namespaces that have been imported using the `using' keyword.
26775
26776         * class.cs (TypeContainer::TypeAttr): Virtualize.
26777         (Class::TypeAttr): Return attributes suitable for this bad boy.
26778         (Struct::TypeAttr): ditto.
26779         Handle nested classes.
26780         (TypeContainer::) Remove all the type visiting code, it is now
26781         replaced with the rootcontext.cs code
26782
26783         * rootcontext.cs (GetClassBases): Added support for structs. 
26784
26785 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
26786
26787         * interface.cs, statement.cs, class.cs, parameter.cs,
26788         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26789         Drop use of TypeRefs, and use strings instead.
26790
26791 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
26792
26793         * rootcontext.cs: 
26794
26795         * class.cs (Struct::Struct): set the SEALED flags after
26796         checking the modifiers.
26797         (TypeContainer::TypeAttr): new property, returns the
26798         TypeAttributes for a class.  
26799
26800         * cs-parser.jay (type_list): Oops, list production was creating a
26801         new list of base types.
26802
26803         * rootcontext.cs (StdLib): New property.
26804         (GetInterfaceTypeByName): returns an interface by type name, and
26805         encapsulates error handling here.
26806         (GetInterfaces): simplified.
26807         (ResolveTree): Encapsulated all the tree resolution here.
26808         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26809         types. 
26810
26811         * driver.cs: Add support for --nostdlib, to avoid loading the
26812         default assemblies.
26813         (Main): Do not put tree resolution here. 
26814
26815         * rootcontext.cs: Beginning of the class resolution.
26816
26817 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
26818
26819         * rootcontext.cs: Provide better error reporting. 
26820
26821         * cs-parser.jay (interface_base): set our $$ to be interfaces.
26822
26823         * rootcontext.cs (CreateInterface): Handle the case where there
26824         are no parent interfaces.
26825
26826         (CloseTypes): Routine to flush types at the end.
26827         (CreateInterface): Track types.
26828         (GetInterfaces): Returns an array of Types from the list of
26829         defined interfaces.
26830
26831         * typemanager.c (AddUserType): Mechanism to track user types (puts
26832         the type on the global type hash, and allows us to close it at the
26833         end). 
26834
26835 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
26836
26837         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26838         RecordInterface instead.
26839
26840         * cs-parser.jay: Updated to reflect changes above.
26841
26842         * decl.cs (Definition): Keep track of the TypeBuilder type that
26843         represents this type here.  Not sure we will use it in the long
26844         run, but wont hurt for now.
26845
26846         * driver.cs: Smaller changes to accomodate the new code.
26847
26848         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26849         when done. 
26850
26851         * rootcontext.cs (CreateInterface):  New method, used to create
26852         the System.TypeBuilder type for interfaces.
26853         (ResolveInterfaces): new entry point to resolve the interface
26854         hierarchy. 
26855         (CodeGen): Property, used to keep track of the code generator.
26856
26857 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
26858
26859         * cs-parser.jay: Add a second production for delegate_declaration
26860         with `VOID'.
26861
26862         (enum_body): Put an opt_comma here instead of putting it on
26863         enum_body or enum_member_declarations so we can handle trailing
26864         commas on enumeration members.  Gets rid of a shift/reduce.
26865
26866         (type_list): Need a COMMA in the middle.
26867
26868         (indexer_declaration): Tell tokenizer to recognize get/set
26869
26870         * Remove old targets.
26871
26872         * Re-add the parser target.
26873
26874 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26875
26876         * cs-parser.jay: Add precendence rules for a number of operators
26877         ot reduce the number of shift/reduce conflicts in the grammar.
26878
26879 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
26880
26881         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26882         and put it here.
26883
26884         Get rid of old crufty code.
26885
26886         * rootcontext.cs: Use this to keep track of the parsed
26887         representation and the defined types available to the program. 
26888
26889         * gen-treedump.cs: adjust for new convention.
26890
26891         * type.cs: Split out the type manager, and the assembly builder
26892         from here. 
26893
26894         * typemanager.cs: the type manager will live here now.
26895
26896         * cil-codegen.cs: And the code generator here. 
26897
26898 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
26899
26900         * makefile: Fixed up for easy making.
26901
26902 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26903
26904         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26905         the 
26906
26907         (unary_expression): Expand pre_increment_expression and
26908         post_decrement_expression to reduce a shift/reduce.
26909
26910 2001-07-11  Simon Cozens
26911
26912         * cs-tokenizer.cs: Hex numbers should begin with a 0.
26913
26914         Improve allow_keyword_as_indent name.
26915
26916 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
26917
26918         * Adjustments for Beta2. 
26919
26920 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
26921
26922         * decl.cs: Added `Define' abstract method.
26923         (InTransit): new property, used to catch recursive definitions. 
26924
26925         * interface.cs: Implement `Define'. 
26926
26927         * modifiers.cs: Map Modifiers.constants to
26928         System.Reflection.TypeAttribute flags.
26929
26930         * class.cs: Keep track of types and user-defined types.
26931         (BuilderInit): New method for creating an assembly
26932         (ResolveType): New function to launch the resolution process, only
26933         used by interfaces for now.
26934
26935         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26936         that are inserted into the name space. 
26937
26938 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
26939
26940         * ARGH.  I have screwed up my tree so many times due to the use of
26941         rsync rather than using CVS.  Going to fix this at once. 
26942
26943         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
26944         load types.
26945
26946 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
26947
26948         * Experiment successful: Use System.Type rather that our own
26949         version of Type.  
26950
26951 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
26952
26953         * cs-parser.jay: Removed nsAliases from here.
26954
26955         Use new namespaces, handle `using XXX;' 
26956
26957         * namespace.cs: Reimplemented namespace handling, use a recursive
26958         definition of the class.  Now we can keep track of using clauses
26959         and catch invalid using clauses.
26960
26961 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
26962
26963         * gen-treedump.cs: Adapted for all the renaming.
26964
26965         * expression.cs (Expression): this class now has a Type property
26966         which returns an expression Type.
26967
26968         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26969         `Type', as this has a different meaning now in the base
26970
26971 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
26972
26973         * interface.cs, class.cs: Removed from all the sources the
26974         references to signature computation, as we can not do method
26975         signature computation during the parsing time, as we are not
26976         trying to solve at that point distinguishing:
26977
26978         class X {
26979                 void a (Blah x) {}
26980                 void a (NS.Blah x) {}
26981         }
26982
26983         Which depending on the context might be valid or not, as we do not
26984         know if Blah is the same thing as NS.Blah at that point.
26985
26986         * Redid everything so the code uses TypeRefs now instead of
26987         Types.  TypeRefs are just temporary type placeholders, that need
26988         to be resolved.  They initially have a pointer to a string and the
26989         current scope in which they are used.  This is used later by the
26990         compiler to resolve the reference to an actual Type. 
26991
26992         * DeclSpace is no longer a CIR.Type, and neither are
26993         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
26994         are all DeclSpaces, but no Types. 
26995
26996         * type.cs (TypeRefManager): This implements the TypeRef manager,
26997         which keeps track of all the types that need to be resolved after
26998         the parsing has finished. 
26999
27000 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
27001
27002         * ARGH.  We are going to have to store `foreach' as a class rather
27003         than resolving it, as we need to verify error 1579 after name
27004         resolution.   *OR* we could keep a flag that says `This request to
27005         IEnumerator comes from a foreach statement' which we can then use
27006         to generate the error.
27007
27008 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
27009
27010         * class.cs (TypeContainer.AddMethod): we now add methods to the
27011         MethodGroup instead of the method hashtable.  
27012
27013         * expression.cs: Add MethodGroup abstraction, which gets us one
27014         step closer to the specification in the way we handle method
27015         declarations.  
27016
27017         * cs-parser.jay (primary_expression): qualified_identifier now
27018         tried to match up an identifier to a local variable reference or
27019         to a parameter reference.
27020
27021         current_local_parameters is now a parser global variable that
27022         points to the current parameters for the block, used during name
27023         lookup.
27024
27025         (property_declaration): Now creates an implicit `value' argument to
27026         the set accessor.
27027
27028 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
27029
27030         * parameter.cs: Do not use `param' arguments as part of the
27031         signature, per the spec.
27032
27033 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
27034
27035         * decl.cs: Base class for classes, structs and interfaces.  This
27036         is the "Declaration Space" 
27037
27038         * cs-parser.jay: Use CheckDef for checking declaration errors
27039         instead of having one on each function.
27040
27041         * class.cs: Factor out some code for handling error handling in
27042         accordance to the "Declarations" section in the "Basic Concepts"
27043         chapter in the ECMA C# spec.
27044
27045         * interface.cs: Make all interface member classes derive from
27046         InterfaceMemberBase.
27047
27048 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
27049
27050         * Many things: all interfaces are parsed and generated in
27051         gen-treedump.  Support for member variables, constructors,
27052         destructors, properties, constants is there.
27053
27054         Beginning of the IL backend, but very little done, just there for
27055         testing purposes. 
27056
27057 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
27058
27059         * cs-parser.jay: Fix labeled statement.
27060
27061         * cs-tokenizer.cs (escape): Escape " and ' always.
27062         ref_line, ref_name: keep track of the line/filename as instructed
27063         by #line by the compiler.
27064         Parse #line.
27065
27066 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
27067
27068         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
27069         to match the values in System.CodeDOM.
27070
27071         Divid renamed to Divide.
27072
27073         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
27074         statements. 
27075         (Statements.set): remove.
27076
27077         * System.CodeDOM/CodeCatchClause.cs: always have a valid
27078         statements. 
27079
27080         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
27081         falseStatements always have valid values. 
27082
27083         * cs-parser.jay: Use System.CodeDOM now.
27084