2007-04-13 Jonathan Pobst <monkey@jpobst.com>
[mono.git] / mcs / gmcs / ChangeLog
1 2007-04-12  Duncan Mak  <duncan@a-chinaman.com>
2
3         * cs-parser.jay (interface_method_declaration_body): Fixed typo.
4
5 2007-04-08  Marek Safar  <marek.safar@gmail.com>
6
7         * cs-parser.jay, linq.cs: First select implementation (hacky).
8
9         * generic.cs (InferTypeArguments): Simplified.
10
11 2007-03-31  Marek Safar  <marek.safar@gmail.com>
12
13         * generic.cs (InferTypeArguments): Restored validation check.
14         (InferTypeArguments): Move all logic to Compatible method for re-usability.
15
16 2007-03-25  Marek Safar  <marek.safar@gmail.com>
17
18         * generic.cs (InferTypeArguments): Infer arguments before they are used
19         for compatibility check.
20
21 2007-03-15  Marek Safar  <marek.safar@gmail.com>
22
23         * generic.cs (InflatedConstraints): Fixed the check order.
24         (TypeArguments.Resolve): Small optimization for generic parameters.
25         (InferTypeArguments): Add infering support for anonymous methods.
26
27 2007-03-15  Martin Baulig  <martin@ximian.com>
28
29         Fix #79984.
30
31         * generic.cs
32         (TypeParameter.HasConstructorConstraint): Removed.
33         (ConstraintChecker.HasDefaultConstructor): Removed the
34         `TypeBuilder' argument here; correctly check for the ctor
35         constraint on type parameters.
36
37 2007-03-15  Martin Baulig  <martin@ximian.com>
38
39         Fix #79302.
40
41         * generic.cs
42         (TypeParameter): Create a `MemberCache' here as well.  Note that
43         we need to create this on-demand when it's actually used.
44
45 2007-03-10  Marek Safar  <marek.safar@gmail.com>
46
47         * generic.cs (TypeArguments.Resolve): Avoid redundant checks.
48
49 2007-03-09  Raja R Harinath  <rharinath@novell.com>
50
51         * cs-parser.jay (WHERE): Move before QUERY_FIRST_TOKEN.  'where'
52         is a valid keyword outside a linq expression too.
53
54 2007-03-03  Marek Safar  <marek.safar@gmail.com>
55
56         * cs-parser.jay: Implemented basic linq grammar.
57
58         * linq.cs: New file for hosting query specific classes.
59
60 2007-02-26  Marek Safar  <marek.safar@gmail.com>
61
62         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
63
64 2007-02-20  Marek Safar  <marek.safar@gmail.com>
65
66         A fix for bug #80650
67         * cs-parser.jay: Anonymous container starts at constructor declaration
68         and not at block beginning because it has to be usable in constructor
69         initializer.
70
71 2007-02-18  Marek Safar  <marek.safar@gmail.com>
72
73         A fix for bug #80493 by Atsushi Enomoto
74         * cs-parser.jay: Ignore invalid attribute target.
75
76 2007-02-15  Miguel de Icaza  <miguel@novell.com>
77
78         * Remove the call to SetExpression for lambda expressions, we do
79         not actually need it.
80
81         Remove expression tracking code as its not needed.
82
83 2007-02-11  Miguel de Icaza  <miguel@novell.com>
84
85         * cs-parser.jay (lambda_expression_body): when the body is an
86         expression add a statement of the form:
87
88                 contextual-return expression.
89
90         Where `contextual-return' is similar to `return', the difference
91         being that if the delegate that the lambda will be converted to
92         has a void return type, it will check that the result is a
93         ExpressionStatement and the result is a plain ret (no return
94         values on the stack).  If the return type of the delegate is of a
95         given type, this turns into a return with a value and does the
96         regular checking to check that the computed value can be
97         implicitly converted to the delegate return.
98
99 2007-01-30  Miguel de Icaza  <miguel@novell.com>
100
101         * cs-parser.jay (anonymous_method_expression): move the
102         before/after productions to the start_anonymous and end_anonymous
103         methods so the code can be reused for lambda functions.
104
105         (lambda_expression_body): wrap expressions implicitly into a
106         block.
107
108         (block): factor out the setup/teardown of parsing a block so we
109         can reuse that in lambda_expression_body
110
111         (lambda_expression): use new anonymous method helper methods.
112
113 2007-01-29  Miguel de Icaza  <miguel@novell.com>
114
115         * cs-parser.jay: oob_stack make it static (am guessing that is why
116         we no longer initialize it anymore) and reuse it across
117         instances.
118
119 2007-01-28  Miguel de Icaza  <miguel@novell.com>
120
121         * cs-parser.jay (open_parens): Introduce new non-terminal that
122         abstracts OPEN_PARENS and OPEN_PARENS_LAMBDA as the later can now
123         be returned in places where types are followed by identifiers
124         (this is expected in declaration, fixed, using, foreach and catch
125         clauses). 
126
127         Use open_parens in those places, keep OPEN_PARENS in the
128         expressions.  
129
130         cs-parser.jay: New grammar bits for parsing lambda expressions. 
131
132 2007-01-28  Raja R Harinath  <rharinath@novell.com>
133
134         Fix #80534, gtest-309.cs
135         * generic.cs (UnifyType): Rename from InferType.  Make unification
136         of generic insts simpler and don't insist on inferring all generic
137         parameters in a single generic inst unification.
138         (UnifyTypes): New.
139         (InferGenericInstance): Remove.
140         Analysis and initial patch by David Mitchell <dmitchell@logos.com>.
141
142 2007-01-20  Marek Safar  <marek.safar@gmail.com>
143
144         * cs-parser.jay: Better parameter error handling.
145
146 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
147             Raja R Harinath  <rharinath@novell.com>
148
149         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
150         Note the order in which accessors are declared in the source.
151
152 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
153
154         * generic.cs (TypeParameter.FindMembers): Use the generic
155         constraints, not the constraints to check for methods (first fix
156         of 80518).
157
158 2006-12-30  Marek Safar  <marek.safar@gmail.com>
159
160         * cs-parser.jay: Better syntax errors handling.
161
162 2006-11-21  Marek Safar  <marek.safar@gmail.com>
163
164         * cs-parser.jay: Tiny change to work with mcs tokenizer.
165
166         * cs-tokenizer.cs: Remove after unification with mcs.
167
168 2006-10-28  Marek Safar  <marek.safar@gmail.com>
169
170         A fix for bug #78998
171         * generic.cs (ConstructedType.AsAccessible): Check accessibility of type
172         arguments as well.
173
174 2006-10-26  Marek Safar  <marek.safar@gmail.com>
175
176         A fix for bug #76591
177         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous methods.
178
179 2006-10-25  Brian Crowell  <brian@fluggo.com>
180
181         Fix #79703
182         * generic.cs (CheckConstraints): Allow generic parameters with
183         inheritance constraints to satisfy reference type constraints.
184
185 2006-10-09  Martin Baulig  <martin@ximian.com>
186
187         * generic.cs
188         (NullCoalescingOperator.DoResolve): Fix #78964; added gtest-294.cs.
189
190 2006-09-25  Martin Baulig  <martin@ximian.com>
191
192         * class.cs: Remove after unification with mcs source.
193
194 2006-09-24  Raja R Harinath  <harinath@gmail.com>
195
196         * convert.cs: Remove after unification with mcs source.
197
198 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
199
200         * class.cs (MemberBase.VerifyClsCompliance): When method has type
201         parameters verify them as well.
202
203         * generic.cs (Constraints.VerifyClsCompliance): Verify CLS-Compliance of
204         the type parameter constraints.
205         (Generics.VerifyClsCompliance): Ditto.
206
207 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
208
209         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
210         for anonymous block with out argument.
211
212 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
213
214         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
215         not used private events only.
216
217 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
218
219         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
220
221         * cs-parser.jay: Parse correctly cast of default (T).
222
223         * generic.cs (DefaultValueExpression.DoResolve): Check for void type.
224         Store original type via EmptyConstantCast.
225
226 2006-09-22  Martin Baulig  <martin@ximian.com>
227
228         * delegate.cs: Removed; this file is now shared with mcs.
229
230         * attribute.cs: Removed; this file is now shared with mcs.
231
232 2006-09-22  Martin Baulig  <martin@ximian.com>
233
234         * ecore.cs: Removed; this file is now shared with mcs.
235
236 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
237
238         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
239
240         * ecore.cs (NullCast): Derives from NullConstant.
241
242         * generic.cs (DefaultValueExpression): Fixed to cope with the constant
243         results.
244
245 2006-09-21  Martin Baulig  <martin@ximian.com>
246
247         * decl.cs: Removed; this file is now shared with mcs.
248
249 2006-09-21  Raja R Harinath  <rharinath@novell.com>
250
251         * rootcontext.cs: Remove after unification with mcs source.
252
253         * report.cs: Remove after unification with mcs source.
254         * generic.cs (AddTypeParameter, LookupTypeParameter): Move to
255         mcs/typemanager.cs.
256         (InitGenerics, CleanUpGenerics): Remove.
257
258         * support.cs: Remove after unification with mcs source.
259
260 2006-09-20  Raja R Harinath  <rharinath@novell.com>
261
262         * codegen.cs: Remove after unification with mcs source.
263
264 2006-09-19  Martin Baulig  <martin@ximian.com>
265
266         * expression.cs: Removed; this file is now shared with mcs.
267
268 2006-09-19  Martin Baulig  <martin@ximian.com>
269
270         * generic.cs
271         (TypeManager.IsEqual): Moved into ../mcs/typemanager.cs.
272         (TypeManager.DropGenericTypeArguments): Likewise.
273         (TypeManager.DropGenericMethodArguments): Likewise.
274         (TypeManager.GetTypeArguments): Likewise.
275         (TypeManager.HasGenericArguments): Likewise.
276
277 2006-09-19  Martin Baulig  <martin@ximian.com>
278
279         * ecore.cs (PropertyExpr.InstanceResolve): Fix the CS1540 check.
280
281 2006-09-19  Martin Baulig  <martin@ximian.com>
282
283         * typemanager.cs: Removed; this file is now shared with mcs.
284
285 2006-09-16  Raja R Harinath  <rharinath@novell.com>
286
287         * Makefile (LOCAL_MCS_FLAGS): Use instead of PROFILE_MCS_FLAGS.
288         * AssemblyInfo.cs, driver.cs: Remove after unification with mcs source.
289
290 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
291
292         A fix for #79401
293         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
294         only if parent type is class.
295         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
296         update.
297
298 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
299
300         * cs-parser.jay,
301         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
302         keywords are used.
303         * typemanager.cs(CSharpName): Converts NullType to null.
304
305 2006-09-15  Martin Baulig  <martin@ximian.com>
306
307         * pending.cs: Removed; this file is now shared with mcs.
308
309 2006-09-15  Martin Baulig  <martin@ximian.com>
310
311         * statement.cs: Removed; this file is now shared with mcs.
312
313 2006-09-15  Martin Baulig  <martin@ximian.com>
314
315         * rootcontext.cs (RootContext.BrokenCircularDeps): Removed.
316
317         * driver.cs: Removed the `--broken-cycles' argument.
318
319 2006-09-15  Martin Baulig  <martin@ximian.com>
320
321         * namespace.cs: Removed; this file is now shared with mcs.
322
323 2006-09-15  Martin Baulig  <martin@ximian.com>
324
325         * decl.cs (MemberName): Minor code cleanups.
326
327 2006-09-15  Martin Baulig  <martin@ximian.com>
328
329         * parameter.cs: Removed; this file is now shared with mcs.
330
331 2006-09-15  Martin Baulig  <martin@ximian.com>
332
333         * enum.cs: Removed; this file is now shared with mcs.
334
335 2006-09-15  Martin Baulig  <martin@ximian.com>
336
337         * Makefile: Define `GMCS_SOURCE'.
338
339         * flowanalysis.cs: Removed; this file is now shared with mcs.
340
341 2006-09-15  Martin Baulig  <martin@ximian.com>
342
343         Removed modifiers.cs, literal.cs, location.cs, roottypes.cs,
344         assign.cs, const.cs, cfold.cs, constant.cs, symbolwriter.cs and
345         doc.cs - they are now shared with mcs.
346
347         * gmcs.exe.sources: Include these files from ../mcs/.
348
349 2006-09-15  Martin Baulig  <martin@ximian.com>
350
351         * old-code.cs, gen-il.cs, gen-treedump.cs: Removed old stuff.
352         * g1.cs, sample-hello.cs, sample-stack.il: Likewise.
353
354 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
355
356         * assign.cs, ecore.cs, expression.cs: Share error message text.
357         * class.cs (FieldMember.Define): Check for variable of static type.
358         * decl.cs (check_type_parameter): Report correct type name.
359         * driver.cs (LoadAssembly): Uses error output for errors.
360         * generic.cs (Constraints.Resolve): Add check for constraint accessibility
361         (TypeArguments.Resolve): Static class cannot be used as an argument.
362         * statement.cs (ResolveMeta): Constants cannot be generic types.
363
364 2006-09-12  Martin Baulig  <martin@ximian.com>
365
366         * generic.cs (TypeManager.IsIList): Moved into convert.cs.
367
368         * convert.cs (Convert.Array_To_IList): Moved here and correctly
369         implement it; fixes #79345.
370
371 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
372
373         * decl.cs (DeclSpace.SetParameterInfo): Check for nonexistent type
374         parameter.
375         * expression.cs (TypeOf.GetAttributableValue): Check for open generic
376         types.
377         * generic.cs: Improved error messages.
378         * typemanager.cs (RemoveGenericArity): Made public.
379
380 2006-09-08  Martin Baulig  <martin@ximian.com>
381
382         * typemanager.cs (TypeManager.interlocked_type): New public field.
383         (TypeManager.int_interlocked_compare-exchange): New public field.
384         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
385         enumerator types here and call InitGenericCoreTypes().
386         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
387         after calling InitEnumUnderlyingTypes().
388
389         * rootcontext.cs
390         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
391         `classes_second_stage'. 
392
393 2006-09-07  Marek Safar  <marek.safar@seznam.cz>
394  
395         * class.cs, generic.cs (GenericMethod.Define): Check for type parameter
396         collisions.
397         * statement.cs (Block.Variables): Made public.
398
399 2006-09-07  Martin Baulig  <martin@ximian.com>
400
401         * driver.cs
402         (MainDriver): Revert r62663 from Marek; see #70506 for details.
403
404 2006-09-01  Martin Baulig  <martin@ximian.com>
405
406         * generic.cs
407         (TypeManager.IsIList): Also handle base classes and interfaces. 
408
409 2006-09-01  Raja R Harinath  <rharinath@novell.com>
410
411         Fix #79238
412         * expression.cs (Invocation.MoreSpecific): Check for reference
413         types earlier.
414
415 2006-08-29  Miguel de Icaza  <miguel@novell.com>
416
417         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
418
419 2006-08-17  Miguel de Icaza  <miguel@novell.com>
420
421         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
422         #52019 and #79064, the use of the \uXXXX sequence in source code
423         to represent unicode characters.
424
425 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
426  
427         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
428         support.
429         * class.cs, ecore.cs, statement.cs: Merged to one error message.
430
431 2006-08-14  Raja R Harinath  <rharinath@novell.com>
432
433         Fix #79067
434         * cs-tokenizer.cs (parse_less_than): Allow '*' to appear in a type
435         parameter too.  This only avoids a parse error -- the semantic
436         error is caught elsewhere.
437
438 2006-08-13  Miguel de Icaza  <miguel@novell.com>
439
440         * assign.cs: Catch attempts to assign to a method groups in += and
441         report as 1656
442
443 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
444
445         A fix for #79056
446         * cs-parser.jay: Don't destroy current array type by typeof of array's.
447
448 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
449
450         * cs-parser.jay: Check whether a constraint clause has already been
451         specified for type parameter.
452         * generic.cs (Constraints): Exposed location.
453
454 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
455
456         * class.cs (Method.Define): Issue a warning when generic method looks like
457         an entry point.
458         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
459         as well.
460         * report.cs: New warning number.
461
462 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
463  
464         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
465         looking for ctor.
466         * decl.cs (MemberCache.FindMembers): When container is interface we need to
467         search all base interfaces as a member can be ambiguous.
468         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
469         Constructor member type filter. 
470         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
471         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
472         reporting for returned memberinfos.
473         * report.cs: Updated.
474         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
475         version to work on all runtimes.
476         (TypeManager.RealMemberLookup): Removed members filtering.
477
478 2006-08-08  Raja R Harinath  <rharinath@novell.com>
479
480         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
481         (PropertyExpr.EmitAssign): Likewise.
482         * expression.cs (Indirection.EmitAssign): Likewise.
483         (LocalVariableReference.EmitAssign): Likewise.
484         (ParameterReference.EmitAssign): Likewise.
485         (Invocation.EmitArguments): Likewise.
486         (ArrayAccess.EmitAssign): Likewise.
487         (IndexerAccess.EmitAssign): Likewise.
488         (This.EmitAssign): Likewise.
489         (ConditionalLogicalOperator.Emit): Likewise.
490
491         Fix #79026
492         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
493         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
494         leave it in after returning it.
495         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
496
497 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
498
499         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
500         message.
501
502 2006-08-05  Marek Safar  <marek.safar@seznam.cz>
503
504         * class.cs (TypeContainer.AddPartial): Add check for partial declarations
505         with different type names.
506         (TypeContainer.UpdateTypeParameterConstraints): Updated an error message.
507
508 2006-08-03  Raja R Harinath  <rharinath@novell.com>
509
510         Fix cs0146-3.cs and cs0146-4.cs.
511         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
512         enclosing types don't depend on the current type.
513
514 2006-08-02  Raja R Harinath  <rharinath@novell.com>
515
516         Fix #77963
517         * class.cs (TypeContainer.DoDefineMembers): Use
518         FindBaseMemberWithSameName on Parent, since we're interested in
519         whether we hide inherited members or not.
520         (FindBaseMemberWithSameName): Make slightly more robust.
521
522         Fix #77396
523         * codegen.cs (IResolveContext.GenericDeclContainer): New.
524         (EmitContext): Implement new interface requirement.
525         * namespace.cs (UsingEntry, LocalAliasEntry): Likewise.
526         * decl.cs (MemberCore): Likewise.
527         (DeclSpace.GenericDeclContainer): Rename from DeclContainer.
528         * ecore.cs (SimpleName.ResolveAsTypeTerminal): Use
529         ec.GenericDeclContainer to check for generic parameters.
530         (SimpleName.DoSimpleNameResolve): Likewise.
531         * generic.cs (TypeParameter.DeclContainer): Remove override.
532
533         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
534         declspaces for doppelgangers too.
535         (UsingEntry): Implement IResolveContext.
536         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
537         'this' as the resolve context.
538         (LocalAliasEntry): Likewise.
539
540         Implement parts of #77403
541         * roottypes.cs (RootDeclSpace): New.  Used to represent the
542         toplevel declaration space.  Each namespace declaration introduces
543         a "partial" root declaretion space.
544         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
545         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
546         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
547         from 'current_namespace.SlaveDeclSpace'.
548         (namespace_declaration): Likewise.
549         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
550         check.  It can't happen now.
551         * decl.cs (DeclSpace.LookupType): Likewise.
552         * driver.cs (MainDriver): Sanity check.
553
554 2006-08-01  Raja R Harinath  <rharinath@novell.com>
555
556         * decl.cs (DeclSpace.FindNestedType): Remove.
557         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
558         LookupTypeContainer to get the container of the nested type.
559         * class.cs (TypeContainer.FindNestedType): Make non-override.
560
561 2006-07-31  Raja R Harinath  <rharinath@novell.com>
562
563         * decl.cs (DeclSpace.PartialContainer): Move field from ...
564         * class.cs (TypeContainer.PartialContainer): ... here.
565         (TypeContainer.AddBasesForPart): New helper.
566         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
567         instead.
568         * cs-parser.jay (current_class): Convert to DeclSpace.
569         (struct_declaration, interface_declaration, class_declaration):
570         Use AddBasesForPart instead of .Bases directly.
571         * const.cs, iterators.cs: Update to changes.
572
573 2006-07-28  Raja R Harinath  <rharinath@novell.com>
574
575         * class.cs (TypeContainer.AddMemberType): Rename from
576         AddToTypeContainer.
577         (TypeContainer.AddMember): Rename from AddToMemberContainer.
578         (AddTypeContainer): New.  Combine AddClassOrStruct and
579         AddInterface.
580         (AddPartial): Update.  Add 'is_partial' argument.
581         * roottypes.cs: Update to changes.
582         * cs-parser.jay (push_current_class): New helper for handling
583         current_container and current_class.
584         (struct_declaration, interface_declaration, class_declaration):
585         Use it.
586
587 2006-07-26  Raja R Harinath  <rharinath@novell.com>
588
589         * roottypes.cs: Rename from tree.cs.
590
591         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
592         * tree.cs (Tree, ITreeDump): Remove types.
593         * rootcontext.cs (tree, Tree): Remove fields.
594         (root, ToplevelTypes): New.
595         * *.cs: Update to rename.
596
597         * tree.cs (Tree.RecordDecl): Remove.
598         (RootTypes.AddToTypeContainer): Record the toplevel type in its
599         namespace here.
600         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
601
602 2006-07-23  Raja R Harinath  <harinath@gmail.com>
603
604         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
605         DoFlowAnalysis and OmitStructFlowAnalysis here.
606         (ec.With): Rename from WithUnsafe and generalize.
607         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
608         (ec.WithFlowAnalyis): New.
609         * ecore.cs, expression.cs, statement.cs: Update.
610
611 2006-07-22  Raja R Harinath  <harinath@gmail.com>
612
613         * statement.cs (Block.ResolveMeta): Simplify slightly.
614
615         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
616         multiple boolean fields.  Convert InUnsafe, constant_check_state,
617         check_state to flags.
618         (CheckState, ConstantCheckState): Update.
619         (InUnsafe): New read-only property.
620         (FlagsHandle): Rename from CheckStateHandle and convert to handle
621         arbitrary flags.
622         (WithUnsafe): New helper similar to WithCheckState.
623         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
624         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
625
626 2006-07-21  Raja R Harinath  <rharinath@novell.com>
627
628         Make comparisons use the same IL irrespective of whether they're
629         in a 'checked' or 'unchecked' context: one of the issues in #78899
630         * codegen.cs (EmitContext.CheckState): Make read-only property.
631         (EmitContext.ConstantCheckState): Likewise.
632         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
633         helper that implement a save/restore stack for CheckState
634         values.  This is the only way to change check-state.
635         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
636         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
637         (CheckedExpr.EmitBranchable): New forwarding method.
638         (UnCheckedExpr): Likewise.
639         * statement.cs (Block.ResolveMeta): Use WithCheckState.
640         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
641         (Checked.Resolve, checked.DoEmit): Likewise.
642
643 2006-07-21  Martin Baulig  <martin@ximian.com>
644
645         * generic.cs (TypeManager.InferType): When inferring an array
646         type, also allow IList<T> and ICollection<T>.  Fixes #78900.
647
648 2006-07-21  Martin Baulig  <martin@ximian.com>
649
650         * generic.cs (TypeManager.IsIEnumerable): Renamed into IsIList()
651         and allow IList`1 and all its base interfaces.
652
653         * convert.cs (Convert.ImplicitReferenceConversion): Allow
654         converting from an array-type of T to IList<T>.
655
656 2006-07-21  Martin Baulig  <martin@ximian.com>
657
658         * ecore.cs (SimpleName.DoSimpleNameResolve): Added CS0307 check.
659
660 2006-07-20  Miguel de Icaza  <miguel@novell.com>
661
662         * anonymous.cs: Cache the resolved anonymous delegate, and return
663         this so that the ResolveTopBlock is only triggered once, not
664         twice.
665
666         Currently we trigger ResolvetopBlock twice due to a first pass of
667         argument check compatibility, and a second pass that does the
668         actual resolution.   
669
670 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
671
672         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
673         modifiers.
674         * rootcontext.cs (Reset): Add helper_classes.
675
676 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
677
678         A fix for #78860
679         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
680         correctly.
681
682 2006-07-13  Miguel de Icaza  <miguel@novell.com>
683
684         * statement.cs (Lock): Handle expressions of type
685         TypeManager.null_type specially.  Fixes #78770
686
687 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
688
689         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
690         to an event.
691
692 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
693
694         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
695         for accessors as well.
696         * ecore.cs (EventExpr): Add AccessorTable.
697
698 2006-07-03  Martin Baulig  <martin@ximian.com>
699
700         * ecore.cs (UnboxCast.Emit): Also use `Unbox_Any' for generic
701         instances of value types.
702
703         * convert.cs (Convert.ExplicitConversion): Correctly handle
704         object->nullable conversions.   
705
706 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
707
708         A fix for #78738
709         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
710         for CS0122 where appropriate.
711         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
712         level attributes.
713         (Filter): Assembly can be null in the case of top level attributes.
714
715 2006-06-28  Raja R Harinath  <rharinath@novell.com>
716
717         Fix #78716
718         * generic.cs (TypeManager.InferParamsTypeArguments): If there are
719         no arguments, return 'false': nothing can be inferred.
720
721 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
722
723         A fix for #78690
724
725         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
726         is done at global level.
727
728 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
729
730         A fix for #77002, Implemented TypeForwarder support.
731
732         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
733         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Add TypeForwarder
734         attribute handling.
735         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
736         * typemanager.cs (): Add type_forwarder_attr_type.
737
738 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
739
740         * report.cs: Add CS0469 warning.
741
742 2006-06-22  Martin Baulig  <martin@ximian.com>
743
744         * class.cs
745         (TypeContainer.GetNormalBases): Also use ResolveAsBaseTerminal()
746         for interfaces; fixes #78686, which is a modification of #78380
747         with interfaces instead of classes.
748
749 2006-06-21  Martin Baulig  <martin@ximian.com>
750
751         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
752         the `try'-block, so we also report CS0016 etc. there.
753
754 2006-06-21  Martin Baulig  <martin@ximian.com>
755
756         * ecore.cs (FieldExpr.EmitAssign, FieldExpr.AddressOf): Correctly
757         handle SetAssigned() and SetMemberIsUsed() for generic types;
758         fixes #77545.
759
760 2006-06-21  Martin Baulig  <martin@ximian.com>
761
762         * delegate.cs
763         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
764
765 2006-06-21  Martin Baulig  <martin@ximian.com>
766
767         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
768         also report CS1686 for parameters.
769
770 2006-06-21  Martin Baulig  <martin@ximian.com>
771
772         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
773         instead of an error if the value is not implicitly convertible to
774         the switch types; fixes #77964.
775
776 2006-06-21  Raja R Harinath  <rharinath@novell.com>
777
778         Fix #78673
779         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
780         FieldBuilder is null.
781
782         Fix #78662
783         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
784         'left' and 'right' before error-checking.
785
786 2006-06-19  Martin Baulig  <martin@ximian.com>
787
788         * convert.cs
789         (Convert.ImplicitConversionStandard): Cleanup and correctly
790         implement nullable conversions.
791         (Convert.ImplicitStandardConversionExists): Likewise.
792         (Convert.ExplicitConversion): Likewise.
793
794 2006-06-19  Martin Baulig  <martin@ximian.com>
795
796         * generic.cs
797         (Nullable.Wrap.Create, Nullable.Unwrap.Create): New public static
798         methods; make the ctors protected.
799
800 2006-06-19  Martin Baulig  <martin@ximian.com>
801
802         Fixed #78380; added gtest-273.cs.
803
804         * ecore.cs
805         (Expression.ResolveAsBaseTerminal): Move the constraint checking
806         into ResolveAsTypeTerminal().
807
808         * generic.cs
809         (ConstraintChecker.HasDefaultConstructor): Use the non-cache based
810         TypeManager.FindMembers() to check for the default ctor.
811
812 2006-06-18  Marek Safar  <marek.safar@seznam.cz>
813
814         * generic.cs: Fixed NullableInfo accessibility.
815
816 2006-06-16  Martin Baulig  <martin@ximian.com>
817
818         * generic.cs
819         (Constraints.InflatedConstraints.inflate): Correctly inflate
820         generic types; fixes #78400.
821
822 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
823
824         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
825         Fixed bug #78601.
826         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
827         (FieldExpr.DoResolve): likewise.
828         (PropertyExpr.InstanceResolve): likewise.
829         (EventExpr.InstanceResolve): likewise. 
830
831 2006-06-15  Martin Baulig  <martin@ximian.com>
832
833         * statement.cs
834         (SwitchLabel.ResolveAndReduce): Added `bool allow_nullable'
835         argument; always allow a `null' label if true.
836         (Switch.SwitchGoverningType): Take an `Expression expr' argument.
837         (Switch.TableSwitchEmit, Switch.SimpleSwitchEmit): Check whether
838         we have a `null' label and mark the new `null_target' label;
839         default to the `default' label.
840         (Switch.Resolve): Add support for nullable types.  Fixes #78630.
841
842 2006-06-15  Martin Baulig  <martin@ximian.com>
843
844         * class.cs (Operator.Define): Allow an implicit/explicit operator
845         to convert to/from a nullable value of the enclosing type.
846
847         * generic.cs (TypeManager.IsNullableTypeOf): New public method.
848         (Nullable.Unwrap, Nullable.Wrap): Make these classes public.
849
850         * convert.cs
851         (Convert.ImplicitStandardConversionExists): Add support for lifted
852         implicit/explicit conversions.
853         (Convert.ImplicitConversionStandard): Likewise.
854
855 2006-06-13  Martin Baulig  <martin@ximian.com>
856
857         * ecore.cs (SimpleName.DoSimpleNameResolve): Check whether we have
858         type arguments and create a ConstructedType if necessary.  Fixes #78400.
859
860 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
861
862         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
863         attribute applicable tests for attribute argument.
864
865 2006-06-02  Raja R Harinath  <rharinath@novell.com>
866
867         Fix #78079
868         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
869         (Binary.OverloadResolve_PredefinedIntegral): New.
870         (Binary.OverloadResolve_PredefinedFloating): New.
871         (Binary.OverloadResolve_PredefinedString): New.
872         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
873         Follow the standard more closely, and treat numeric promotions in
874         terms of overload resolution.
875         (Binary.CheckShiftArguments): Simplify.
876
877 2006-06-01  Raja R Harinath  <rharinath@novell.com>
878
879         * flowanalysis.cs (MyBitVector): Simplify representation.
880         (MyBitVector.Clone): Avoid allocating BitArray.
881         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
882         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
883         (*): Update.  Change all references to MyBitVector.And and
884         MyBitVector.Or to &= and |=.
885
886 2006-05-31  Raja R Harinath  <rharinath@novell.com>
887
888         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
889         Use bne.un instead of ceq+brfalse.
890
891         Fix cs0208-[23].cs
892         * typemanager.cs (IsUnmanagedType): Disallow generic types and
893         generic parameters.
894
895 2006-05-29  Raja R Harinath  <rharinath@novell.com>
896
897         Fix cs0231-[34].cs.
898         * cs-parser.jay (formal_parameter_list): Extend the pattern below
899         to param arguments too.
900
901 2006-05-26  Miguel de Icaza  <miguel@novell.com>
902
903         * cs-parser.jay: Catch another parsing form for arglist being
904         followed by other arguments.  Fixes #78313.
905
906 2006-05-25  Raja R Harinath  <rharinath@novell.com>
907
908         Fix #78324
909         * expression.cs (Binary.DoResolve): Use Nullable.LiftedBinaryOperator
910         also when one of the operands is a null literal.
911         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality): Rewrite
912         to improve clarity, and generate slightly better code.
913
914 2006-05-24  Raja R Harinath  <rharinath@novell.com>
915
916         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
917         checking of out parameters to ...
918         (FlowBranchingToplevel.Merge): ... here.
919         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
920         set, propagate the origin upward, and only complain if there was
921         no other error.
922         (FlowBranchingException.AddContinueOrigin): Likewise.
923         (FlowBranchingException.AddReturnOrigin): Likewise.
924         (FlowBranchingException.AddGotoOrigin): Likewise.       
925
926 2006-05-23  Raja R Harinath  <rharinath@novell.com>
927
928         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
929         unreachable, skip it.
930         (FlowBranchingException.Merge): Always propagate jumps, even if
931         the finally block renders subsequent code unreachable.
932
933 2006-05-18  Raja R Harinath  <rharinath@novell.com>
934
935         Fix #77601
936         * statement.cs (Goto.Resolve): Move responsibility for resolving
937         'goto' to FlowBranching.AddGotoOrigin.
938         (Goto.SetResolvedTarget): New.  Callback to set the
939         LabeledStatement that's the target of the goto.
940         (Goto.DoEmit): Use Leave instead of Br when crossing an
941         unwind-protect boundary.
942         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
943         LookupLabel and adjust to new semantics.
944         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
945         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
946         Goto.SetResolvedTarget to update target.
947         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
948         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
949         AddBreakOrigin & co.  Delay propagation until ...
950         (FlowBranchingException.Merge): ... this.
951
952         * statement.cs (Block.Resolve): Always depend on flow-branching to
953         determine unreachability.  Kill workaround that originally emitted
954         only one statement after an "unreachable" label (see infloop in
955         test-515.cs).
956
957         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
958         This is still "wrong", but anything better would probably need a
959         multi-pass algorithm.
960         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
961         usage vector.  Force current usage vector to be reachable, to
962         optimistically signify backward jumps.
963         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
964         detected.
965         (FlowBranchingLabeled.Merge): New.  If no backward jump was
966         detected, return the original salted-away usage vector instead,
967         updated with appropriate changes.  Print unreachable warning if
968         necessary.
969         * statement.cs (Block.Resolve): Don't print unreachable warning on
970         a labeled statement.
971
972 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
973
974         * driver.cs: Pass filename without path to AssemblyBuilder's
975         AddResourceFile. Fixes bug #78407.
976
977 2006-05-17  Raja R Harinath  <rharinath@novell.com>
978
979         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
980         * flowanalysis.cs (FlowBranchingLabeled): ... here.
981         (FlowBranching.MergeChild): Overwrite
982         reachability information from Labeled branchings too.
983
984 2006-05-16  Raja R Harinath  <rharinath@novell.com>
985
986         * statement.cs (Goto.Resolve): Merge jump origins here ...
987         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
988
989         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
990         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
991         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
992         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
993         here, ...
994         * statement.cs (Goto.Resolve): ... not here.
995         (Goto.Emit): Remove CS1632 check.
996
997 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
998
999         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
1000         error message.
1001
1002 2006-05-11  Raja R Harinath  <rharinath@novell.com>
1003
1004         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
1005         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
1006         (FlowBranchingException.Label): Likewise.
1007
1008         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
1009         given value.
1010         (MyBitVector.Or): Use it to avoid losing information (Count).
1011         (FlowBranching.MergeOrigins): Likewise.
1012
1013         * flowanalysis.cs (UsageVector.IsDirty): Remove.
1014         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
1015         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
1016         (UsageVector.ToString): Simplify.
1017         (UsageVector.MergeSiblings): Move here from ...
1018         (FlowBranching.Merge): ... here.
1019         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
1020         not a MyBitVector.
1021
1022 2006-05-10  Raja R Harinath  <rharinath@novell.com>
1023
1024         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
1025         null bitvector is treated as all-true.
1026
1027         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
1028         (MyBitVector): Rationalize invariants.  'vector != null' implies
1029         that we have our own copy of the bitvector.  Otherwise,
1030         'InheritsFrom == null' implies all inherited bits are true.
1031
1032 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
1033
1034         * statement.cs (LocalInfo): Add IsConstant.
1035         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
1036         local variable for constants.
1037
1038 2006-05-09  Raja R Harinath  <rharinath@novell.com>
1039
1040         * flowanalysis.cs (MyBitVector.Empty): New.
1041         (MyBitVector): Don't allow InheritedFrom to be null.
1042         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
1043         (UsageVector, FlowBranching): Update to changes.
1044
1045         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
1046         recursion.  The 'Parent == null' condition isn't sufficient for
1047         anonymous methods.
1048         (FlowBranching.AddBreakOrigin): Likewise.
1049         (FlowBranching.AddContinueOrigin): Likewise.
1050         (FlowBranching.AddReturnOrigin): Likewise.
1051         (FlowBranching.StealFinallyClauses): Likewise.
1052         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
1053         (FlowBranching.CheckOutParameters): Likewise.
1054         (FlowBranchingToplevel): Terminate all the above recursions here.
1055         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
1056         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
1057
1058         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
1059         toplevel block.
1060         (FlowBranchingToplevel): New.  Empty for now.
1061         (FlowBranching.MergeTopBlock): Update.
1062         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1063         branching for the anonymous delegate.
1064         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1065
1066         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1067         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1068         information at the start of the merge.  Reorganize.
1069
1070 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1071
1072         * class.cs (MethodData.Define): Method cannot implement interface accessor.
1073
1074 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1075
1076         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1077         to newly introduced ctor.
1078
1079         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1080         message to one place.
1081         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1082         global namespace.
1083
1084 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1085
1086         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1087
1088         * ecore.cs (Expression.ResolveAsConstant): Updated.
1089
1090         * statement.cs (ResolveMeta): Updated.
1091
1092 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1093
1094         * cs-parser.jay: __arglist cannot be used in initializer.
1095
1096 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1097
1098         A fix for #77879
1099         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1100         private types.
1101
1102 2006-05-05  Raja R Harinath  <rharinath@novell.com>
1103
1104         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1105         (LabeledStatement): Add 'name' parameter.
1106         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1107         (Block.AddLabel): Update to changes.
1108         * cs-parser.jay (labeled_statement): Likewise.
1109
1110         * flowanalysis.cs (BranchingType.Labeled): New.
1111         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1112         (FlowBranchingLabeled): New.  Does nothing for now, but will
1113         eventually handle 'goto' flows.
1114         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1115         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1116         that's terminated ...
1117         (Block.Resolve): ... here.
1118
1119         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1120         (UsageVector.MergeFinallyOrigins): Likewise.
1121         (FlowBranching.InTryOrCatch): Likewise.
1122         (FlowBranching.AddFinallyVector): Likewise.
1123         (FlowBranchingException): Update to changes.
1124
1125         Fix #78290
1126         * statement.cs (Return.Resolve): Move error checking to ...
1127         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1128         (FlowBranchingException): Handle return origins like break and
1129         continue origins.
1130         (FlowBranching.UsageVector.CheckOutParameters): Remove.
1131
1132 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1133
1134         A fix for #76122
1135         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1136         filter.
1137
1138 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1139
1140         A fix for #77543
1141         * class.cs (MethodData.Define): Do public accessor check only when method
1142         implements an interface.
1143
1144 2006-05-04  Raja R Harinath  <rharinath@novell.com>
1145
1146         Remove special handling of 'break'
1147         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1148         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
1149         (UsageVector.Break): Remove.
1150         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1151         reachability.
1152         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1153
1154         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1155         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
1156
1157 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1158
1159         A fix for #75726
1160         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1161         be the interface member.
1162
1163 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1164
1165         A fix for #60069
1166         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1167         for emitting small (int) values.
1168
1169 2006-05-03  Raja R Harinath  <rharinath@novell.com>
1170
1171         Fix #59427
1172         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1173         control-flow passes through the 'finally' after merging-in all the
1174         control-flows from 'try' and the 'catch' clauses.
1175
1176         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1177         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
1178         always true at the only non-recursive entry point.
1179         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1180         FlowBranchingBreakable.
1181         (FlowBranchingLoop): Remove.
1182         * statement.cs (Return.DoResolve): Update to changes.
1183
1184         Fix #76471, #76665
1185         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1186         (FlowBranching.CreateBranching): Handle it: create a
1187         FlowBranchingContinuable.
1188         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1189         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1190         except that it handles the 'continue' command.
1191         (FlowBranching.UsageVector.MergeOrigins): Rename from
1192         MergeBreakOrigins.
1193         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1194         except that it overrides AddContinueOrigin.
1195         (FlowBranchingException): Override AddContinueOrigin, similar to
1196         AddBreakOrigin.
1197         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1198         Create a new branching around the embedded statement.
1199         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
1200         control flow after the embedded statement.
1201         (Continue.Resolve): Move all error checking to AddContinueOrigin.
1202
1203         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1204         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1205         FlowBranchingBreakable.
1206         (FlowBranchingSwitch): Remove.
1207
1208         Fix test-503.cs
1209         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
1210         error reporting to ...
1211         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1212         Rename from 'AddBreakVector'.  Add new location argument.  Return
1213         a bool indicating whether the 'break' crosses an unwind-protect.
1214         (FlowBranchingException.AddBreakOrigin): Add.
1215         (FlowBranchingException.Merge): Propagate 'break's to surrounding
1216         flowbranching after updating with the effects of the 'finally'
1217         clause.
1218         (FlowBranchingBreakable): New common base class for
1219         FlowBranchingLoop and FlowBranchingSwitch.
1220
1221         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1222         embedded statement.
1223         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1224
1225 2006-05-02  Raja R Harinath  <rharinath@novell.com>
1226
1227         * statement.cs (Do.Resolve): If the loop is infinite, set the
1228         barrier.
1229         (While.Resolve, For.Resolve): Set a barrier after the embedded
1230         statement.  There's no direct control flow that goes from the end
1231         of the embedded statement to the end of the loop.
1232         * flowanalysis.cs (FlowBranching.Infinite): Remove.
1233         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
1234         above ensure that the reachability is correctly computed.
1235
1236         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1237         (UsageVector.MergeBreakOrigins): If the current path is
1238         unreachable, treat it as if all parameters/locals are initialized.
1239         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
1240         infinite loops before merging-in break origins.
1241
1242         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1243         (Reachability.Reachable): Split part into ...
1244         (Reachability.Unreachable): ... this.  Simplify.
1245         (Reachability.IsUnreachable): Use 'Unreachable' instead.
1246
1247         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1248         (Reachability.SetThrowsSometimes): Likewise.
1249         (FlowBranchingBlock.MergeTopBlock): Don't compare against
1250         TriState.Always, use corresponding property.
1251         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1252         (Block.Resolve): Likewise.  Remove some redundant checks.
1253
1254 2006-05-02  Raja R Harinath  <harinath@gmail.com>
1255
1256         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1257         (Reachability.Meet): Don't bother checking AlwaysThrows --
1258         barrier is always set.
1259         (FlowBranchingBlock.Merge): Likewise.
1260
1261 2006-05-01  Rafael Teixeira <rafaelteixeirabr@hotmail.com>
1262
1263         * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
1264         defined, so it's references should also compile only for NET_2_0
1265         (as occurs in mcs version)
1266
1267 2006-05-01  Raja R Harinath  <harinath@gmail.com>
1268
1269         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1270         checks for unreachable.
1271
1272 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
1273
1274         A fix for #77980
1275         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1276
1277         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1278         whether field is really assigned.
1279
1280 2006-04-30  Raja R Harinath  <harinath@gmail.com>
1281
1282         * flowanalysis.cs (Reachability): Make 4-argument constructor
1283         private.
1284         (Reachability.Meet): Rename from 'And'.  Remove static variant.
1285         (Reachability.Always): Rename from the highly misleading
1286         'Reachability.Never'.
1287         (FlowBranching.Merge): Update to changes.  Mark an impossible
1288         situation with a 'throw'.
1289         (*): Update to changes.
1290
1291 2006-04-29  Raja R Harinath  <harinath@gmail.com>
1292
1293         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1294         Remove 'Undefined'.
1295         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1296         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1297         (*): Update to changes.
1298         * statement.cs: Update to changes.
1299
1300 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
1301
1302         A fix for #78049
1303         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1304
1305 2006-04-28  Raja R Harinath  <harinath@gmail.com>
1306
1307         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1308         dummy UsageVector.
1309
1310         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1311         argument to two arguments: an usage-vector and a bool.  Move call
1312         to FlowBranching.Merge () ...
1313         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1314
1315         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1316         handling of loop and switch reachability to ...
1317         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1318
1319 2006-04-27  Raja R Harinath  <harinath@gmail.com>
1320
1321         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1322         handling to FlowBranchingLoop.InLoop.
1323         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1324
1325 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
1326
1327         A fix for #78115
1328         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1329         anonymous method is allowed from AnonymousContainer here.
1330
1331         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1332
1333 2006-04-24  Raja R Harinath  <rharinath@novell.com>
1334
1335         Fix #78156
1336         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1337
1338 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
1339
1340         A fix for #49011.
1341         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1342         (DoubleConstant.Reduce): Ditto.
1343
1344 2006-04-23  Raja R Harinath  <rharinath@novell.com>
1345
1346         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1347         Remove 'lvalue_right_side' argument.  Move parts to ...
1348         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1349         (LocalVariable.DoResolveLValue): ... these.
1350
1351 2006-04-21  Raja R Harinath  <rharinath@novell.com>
1352
1353         Fix cs1655.cs
1354         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1355         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1356         (LocalVariableReference.DoResolveBase): Use it to implement new
1357         CS1655 check.
1358         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1359         (Argument.Resolve): Simplify.  Move CS1510 check ...
1360         * ecore.cs (Expression.ResolveLValue): ... here.
1361         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1362         (PropertyExpr.DoResolveLValue): Likewise.
1363         (FieldExpr.Report_AssignToReadonly): Likewise.
1364         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
1365         LValueMemberAccess or LValueMemberOutAccess on instance depending
1366         on it.
1367         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1368         DoResolve as appropriate.
1369
1370 2006-04-20  Raja R Harinath  <rharinath@novell.com>
1371
1372         Fix #75800
1373         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1374         implicit conversions on 'out' and 'ref' arguments.
1375
1376         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1377         improve clarity.  Remove dead code.
1378
1379         Fix #66031
1380         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1381         (Catch.Resolve): Resolve VarBlock if it exists.
1382
1383 2006-04-19  Miguel de Icaza  <miguel@novell.com>
1384
1385         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1386         twice, this was some residual code, the enumerator was emitted
1387         properly in the two branche of if later.
1388
1389         Fixes #78031
1390         
1391         Thanks to Martin for finding the source of the problem
1392         
1393 2006-04-19  Raja R Harinath  <rharinath@novell.com>
1394
1395         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
1396         cast is never an lvalue.
1397         (Cast.DoResolve, Cast.ResolveRest): Combine.
1398         (Argument.Emit): Simplify slightly.  Move 'Expr is
1399         IMemoryLocation' check ...
1400         (Argument.Resolve): ... here.
1401         (Argument.Error_LValueRequired): Remove.  Inline into only user.
1402
1403         Simplifications.  Fix cs0191-2.cs
1404         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1405         CS1649 and CS1651 to ...
1406         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
1407         the actual selection of the error code and message to a lookup
1408         table.  Add a dummy return value to simplify callsites.
1409         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1410         readonly fields of other instances of the same type.  Move CS0197
1411         warning from ...
1412         * expression.cs (Argument.Resolve): ... here.  Simplify code.
1413         Ensure that ec.InRefOutArgumentResolving is only set during LValue
1414         resolution of an out or ref argument.  The code simplification
1415         above uses this invariant.
1416
1417 2006-04-18  Raja R Harinath  <rharinath@novell.com>
1418
1419         Possibly fix #77752.  Fix cs1690-[4-7].cs.
1420         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1421         CheckMarshallByRefAccess.  Drop parameter.
1422         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
1423         warning.
1424         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1425         InstanceExpression.
1426         * report.cs (AllWarnings): Add CS1690.
1427         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1428         for ref access too.
1429         (LocalVariableReference.DoResolveBase): Update.
1430
1431 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1432
1433         * class.cs (MethodOrOperator): Moved common parts from method class.
1434         detect obsolete attributes.
1435         (Method.Define): Simplified as it reuses code from base.
1436         (Constructor.ValidAttributeTargets): Fixed issue found during
1437         refactoring.
1438         (Destructor.ValidAttributeTargets): Fixed issue found during
1439         refactoring.
1440         (Operator): Finished refactoring set off by #78020. Operator class is now
1441         ordinary method class.
1442
1443         * anonymous.cs: Updated.
1444
1445 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1446
1447         * class.cs (Constructor.Emit): Don't emit the attributes twice.
1448
1449 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1450
1451         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1452         detect obsolete attributes.
1453         (Method.CreateEmitContext): Moved to MethodOrOperator.
1454
1455 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1456
1457         A fix for #78048.
1458         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1459         customized exception to make crash detection easier.
1460         (MethodOrOperator): Started to work on new base class for methods and
1461         operators.
1462         (Method): Derives from MethodOrOperator.
1463         (Constructor.Emit): Emits its own attributes.
1464         (AbstractPropertyEventMethod.Emit): Ditto.
1465         (Operator): Derives from MethodOrOperator, will refactor fully in extra
1466         patch.
1467         (Operator.Emit): It's temporary more tricky than should be.
1468         
1469         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1470
1471         * report.cs (InternalErrorException): Add ctor with inner exception.
1472
1473 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
1474
1475         A fix for #76744.
1476         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1477         only not visible.
1478
1479 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
1480
1481         A fix for #77916.
1482         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1483         array.
1484
1485 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1486
1487         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1488         attribute is present and Guid not.
1489         (Interface.ApplyAttributeBuilder): Ditto.
1490
1491         * attribute.cs: Add error message.
1492
1493 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1494
1495         A fix for #78020.
1496
1497         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1498         sources (it's composite) so hold them in extra array as they are used in
1499         Emit phase only. It worked in the previous versions by mistake.
1500         (Attribute.Emit): Emit attribute for more owners when exist.
1501
1502         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1503         it has now different behaviour.
1504
1505 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
1506
1507         * constant.cs (Constant.IsDefaultInitializer): New method.
1508
1509         * class.cs: Updated.
1510
1511         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1512         re-initialize default values. It saves KBs almost for every assembly.
1513         Thanks Zoltan for the idea.
1514         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1515         (ArrayCreation.DoResolve): Resolve only once.
1516         (ArrayCreation.Emit): Emit static initializer only when it is faster.
1517         (ArrayCreation.GetAttributableValue): Cope with optimized values.
1518
1519 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
1520
1521         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1522         From #77961.
1523
1524 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1525
1526         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1527         in an embedded statement too.
1528
1529 2006-04-01  Raja R Harinath  <rharinath@novell.com>
1530
1531         Fix #77929
1532         * typemanager.cs (IsNestedChildOf): Drop generic arguments before
1533         testing.
1534
1535         Fix #77958
1536         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1537
1538         Fix #77962
1539         * report.cs (SymbolRelatedToPreviousError): Drop generic type
1540         arguments before checking whether a type is reflected or not.
1541
1542         Fix #77954
1543         * expression.cs (Invocation.IsApplicable): Ensure a generic method
1544         definition doesn't take part in overload resolution.
1545         (Invocation.IsParamsMethodApplicable): Likewise.
1546         (Invocation.OverloadResolve): When replacing a reflected override
1547         method with its base definition, ensure that type arguments are
1548         applied.
1549
1550 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1551
1552         A fix for #77966.
1553
1554         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1555         was not specified.
1556
1557         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1558
1559 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
1560
1561         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1562         phase.
1563
1564         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1565         LocalTemporary change.
1566
1567         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1568         TypeContainer.
1569         (ClassOrStruct.DefineFieldInitializers): Implemented static field
1570         initializers optimization.
1571         (ClassOrStruct.TypeAttr): Moved from modifiers.
1572         (Constructor.CheckBase): Don't crash when static ctor has parameters.
1573         (FieldBase.ResolveInitializer): Resolves initializer.
1574         (FieldBase.HasDefaultInitializer): New property.
1575
1576         * cs-parser.jay: Removed message.
1577
1578         * expression.cs (CompilerGeneratedThis): New specialization.
1579
1580         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1581
1582 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
1583
1584         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1585
1586 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1587
1588         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1589         be now EnumConstants only.
1590
1591 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1592
1593         * attribute.cs, driver.cs: Reset more caches.
1594
1595 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1596
1597         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1598
1599 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1600
1601         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1602         for easier reuse. Updated all overrides.
1603         (IntegralConstant): New base class for all integral constants.
1604         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1605         of the constant range, report custom error.
1606         (UIntConstant.Reduce): Fixed uint conversion.
1607
1608         * ecore.cs, literal.cs: Reduce updates.
1609
1610 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1611
1612         A fix for #75813.
1613
1614         * class.cs (Constructor.Define): Removed extra if for default ctors.
1615         A patch from Atsushi Enomoto.
1616
1617 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1618
1619         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1620         GetAttributableValue.
1621
1622         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1623         when required.
1624
1625         * convert.cs (ImplicitConversionRequired): Error message moved to
1626         DoubleLiteral.
1627
1628         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1629         automatic implicit conversion of an output value.
1630         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1631
1632         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1633         conversion.
1634         (TypeOf.GetAttributableValue): Add extra handling for object type.
1635
1636         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1637         special error message.
1638
1639 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
1640
1641         * class.cs (Constructor.Emit): Don't crash when struct ctor is
1642         InternalCall.
1643         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1644         compatible with MS runtime.
1645
1646 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
1647
1648         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1649         attribute arguments here.
1650
1651         * class.cs (Indexer.Define): The check was moved to attribute class.
1652
1653 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1654
1655         * expression.cs (StringConcat.Append): Reverted back to no warning state.
1656
1657 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1658
1659         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1660
1661         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1662         the blocks too.
1663
1664 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
1665
1666         * doc-bootstrap.cs : fix build.
1667
1668 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1669
1670         * expression.cs (StringConcat.Append): Issue a warning when empty string
1671         is going to append.
1672
1673 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1674
1675         * assign.cs (CompoundAssign.ResolveSource): Removed.
1676
1677         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1678         clean up.
1679
1680         * class.cs (TypeContainer.FindMethods): Removed.
1681         (TypeContainer.CheckMemberUsage): Made static.
1682
1683         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1684
1685         * constant.cs (CheckRange): Removed unused type argument.
1686         (CheckUnsigned): Removed unused type argument.
1687
1688         * cs-parser.jay: Updated after MemberAccess clean up.
1689         Uses Length for empty string test.
1690
1691         * cs-tokenizer.cs: Uses Length for empty string test.
1692         (IsCastToken): Made static.
1693         (is_hex): Made static.
1694         (real_type_suffix): Made static.
1695
1696         * decl.cs (SetupCache): Made static.
1697         (OnGenerateDocComment): Removed unused ds argument.
1698
1699         * delegate.cs (VerifyDelegate): Removed unused argument.
1700
1701         * doc.cs: Uses Length for empty string test.
1702
1703         * driver.cs: Uses Length for empty string test.
1704
1705         * enum.cs (IsValidEnumType): Made static
1706
1707         * expression.cs (EnumLiftUp): Removed unused argument.
1708         (ResolveMethodGroup): Ditto.
1709         (BetterConversion): Ditto.
1710         (GetVarargsTypes): Ditto.
1711         (UpdateIndices): Ditto.
1712         (ValidateInitializers): Ditto.
1713         (MemberAccess.ctor): Ditto.
1714         (GetIndexersForType): Ditto.
1715
1716         * flowanalysis.cs: (MergeFinally): Removed unused argument.
1717
1718         * iterators.cs: Updated after MemberAccess clean up.
1719
1720         * location.cs: Uses Length for empty string test.
1721
1722         * namespace.cs: Uses Length for empty string test.
1723
1724          * report.cs (CheckWarningCode): Made static.
1725
1726         * statement.cs (LabeledStatement): Removed unused argument.
1727
1728         * typemanager.cs (FilterNone): Removed.
1729
1730 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1731
1732         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1733         obsolete.
1734
1735         * class.cs: Updated.
1736
1737 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1738
1739         * cs-parser.jay.cs: __arglist is not allowed for delegates.
1740
1741 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1742
1743         A fix for #77816.
1744
1745         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
1746         host container.
1747         (AnonymousMethod.ImplicitStandardConversionExists): New method.
1748         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1749         Add more error reporting; Fixed issue with params.
1750
1751         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1752
1753         * cs-parser.jay: AnonymousMethod requires host container.
1754
1755         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1756
1757 2006-03-18  Raja R Harinath  <harinath@gmail.com>
1758
1759         * class.cs: Change 'TypeContainer ds' constructor argument to
1760         'DeclSpace parent'.  Some classes were missed below due to
1761         different naming convention.
1762
1763         * class.cs (MemberCore.Parent): Delete.  This makes the
1764         ParentContainer changes below enforceable by the compiler.
1765
1766         Treat pointers to enclosing declaration space as 'DeclSpace', not
1767         'TypeContainer'.
1768         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1769         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1770
1771         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1772         of TypeContainer.
1773         (Block.AddThisVariable): Likewise.
1774         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1775         (AbstractPropertyEventMethod.Emit): Likewise.
1776         (AbstractPropertyEventMethod.EmitMethod): Likewise.
1777         (GetMethod.Define, SetMethod.Define): Likewise.
1778         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1779         (DelegateMethod.EmitMethod): Likewise.
1780
1781         Fix regression test-partial-13.cs.
1782         Rationalize use of PartialContainer.  Ensure that the partial
1783         class semantics can be tied to type-correctness, i.e., any
1784         violation will cause a compile error.
1785         * class.cs, const.cs: Access all fields that belong to class
1786         TypeContainer via ParentContainer.  Arguments of EmitContexts and
1787         Resolve()-like functions still use 'Parent'.
1788
1789         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1790         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1791         (PropertyMethod.CheckModifiers): Remove unused argument.
1792         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1793         DeclSpace.
1794
1795 2006-03-28  Raja R Harinath  <rharinath@novell.com>
1796
1797         * decl.cs (DeclSpace.LookupGeneric): Update to changes.
1798
1799 2006-03-17  Raja R Harinath  <harinath@gmail.com>
1800
1801         Make semantics of PartialContainer simpler.
1802         * decl.cs (DeclSpace.IsPartial): Remove.
1803         * class.cs (TypeContainer.IsPartial): Likewise.
1804         (TypeContainer..ctor): Set PartialContainer to point to self.
1805         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1806         (TypeContainer.FindNestedType): Likewise.
1807         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
1808
1809 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
1810
1811         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1812
1813 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1814
1815         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1816         classes.
1817
1818 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1819
1820         * class.cs (Operator.Define): An error for base conversion was not
1821         reported correctly.
1822
1823 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
1824
1825         A fix for #77593, #77574.
1826
1827         * class.cs (MethodCore.CheckBase): Another if for operator.
1828
1829 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1830
1831         A fix for #77822.
1832
1833         * expression.cs (VerifyArgumentsCompat): Reverted to double error
1834         reporting, it's more tricky than I thought.
1835
1836 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
1837
1838         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1839         were not resolved
1840
1841         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1842         (DelegateCreation.ImplicitStandardConversionExists): New method for just
1843         conversion test.
1844         
1845         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1846         not needed.
1847
1848 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
1849
1850         A fix for #77353.
1851
1852         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1853         (Event.Define): ditto
1854         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1855
1856         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1857         Removed redundant code and set NewSlot for Invoke method too.
1858
1859         * parameter.cs (Parameters.ctor): Add custom, type ctor.
1860         (Parameters.MergeGenerated): New method. Use this method when you merge
1861         compiler generated argument with user arguments.
1862
1863 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
1864
1865         * attribute.cs (ResolveAsTypeTerminal): Removed.
1866
1867         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1868         specialization for predefined types; 30% speed up.
1869         Finally placed obsolete check to right place.
1870         (Expression.ResolveType): Removed.
1871
1872         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1873         Updated after ResolveType was removed.
1874
1875         * expression.cs (Cast.ctor): Check void cast.
1876         (Binary.ResolveAsTypeTerminal): Is never type.
1877         (Conditional.ResolveAsTypeTerminal): Is never type.
1878
1879         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1880
1881 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1882
1883         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
1884
1885 2006-03-23  Martin Baulig  <martin@ximian.com>
1886
1887         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
1888         type check if either of the types is an open generic type.
1889
1890 2006-03-23  Martin Baulig  <martin@ximian.com>
1891
1892         * convert.cs
1893         (Convert.ExplicitTypeParameterConversion): New method; implement
1894         explicit type parameter conversions.
1895
1896 2006-03-23  Martin Baulig  <martin@ximian.com>
1897
1898         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
1899         blindly allow all conversions if we do not have any constraints.
1900
1901 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
1902
1903         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1904         these two separated members to simplify the code.
1905         (Attribute.Resolve): Refactored to use new fields and methods.
1906         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1907         implemented obsolete attribute checking.
1908         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1909         implemented obsolete checking again. It look line never ending quest ;-)
1910         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1911
1912         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1913
1914         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1915
1916         *class.cs (Property.Define): Add RegisterProperty call.
1917
1918         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1919         argument groups (only 2).
1920
1921         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1922         encoding expression to arguments.
1923         (Expression.ExprClassToResolveFlags): Just turned to property.
1924
1925         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1926         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1927         optimized as well as implemented support for zero-length attributes.
1928
1929         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1930         Add caching of PropertyInfo's.
1931
1932 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1933
1934         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1935         error multiple times.
1936
1937 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1938
1939         New partial class implementation.
1940         A fix for #77027, #77029, #77403
1941
1942         * attribute.cs (Attributable): Made attributes protected.
1943
1944         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1945         the replacements of ClassPart and PartialContainer.
1946         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1947         (TypeContainer.AddInterface): Ditto.
1948         (TypeContainer.AddPartial): The main method for partial classes. It checks
1949         for errors and merges ModFlags and attributes. At the end class is added to
1950         partial_parts list.
1951         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1952         required here.
1953         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1954         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1955         from the rest of partial classes.
1956         (TypeContainer.GetClassBases): Simplified.
1957         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1958         DefineType.
1959         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1960         (TypeContainer.HasExplicitLayout): Uses Flags now.
1961         (PartialContainer): Removed.
1962         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1963         (StaticClass): Was merged with Class.
1964         (Class.GetClassBases): class and static class bases are verified here.
1965         (Class.TypeAttr): Added static attributes when class is static.
1966         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1967         (MemberBase): In some cases we need to call parent container for partial
1968         class. It should be eliminated but it's not easy now.
1969
1970         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1971
1972         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1973         partial classed to accumulate class comments.
1974         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1975
1976         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1977
1978         * driver.cs (MainDriver): Tree.GetDecl was removed.
1979
1980         * modifiers.cs (Modifiers): Add partial modifier.
1981
1982         * tree.cs (Tree.decl): Removed.
1983         (RootTypes): Started to use this class more often for root types
1984         specializations.
1985
1986 2006-03-23  Raja R Harinath  <rharinath@novell.com>
1987
1988         * generic.cs (TypeParameter.UpdateConstraints): Update
1989         'constraints' if null.
1990
1991 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1992
1993         A fix for #77615
1994
1995         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1996         external interface does not have an attribute.
1997
1998 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1999
2000         Another prerequisites for new partial classs implementation.
2001         
2002         * attribute.cs (Attribute.Equal): Implemented.
2003         (Attribute.Emit): Changed as attributes can be applied more than twice.
2004         (Attributes.Emit): Check for duplicate attributes here.
2005
2006         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
2007         as a parameter, clean-up.
2008
2009 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2010
2011         A fix for #77485
2012
2013         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
2014         contains obsolete attribute check which can in some cases look for base
2015         type of current class which is not initialized yet.
2016         (TypeContainer.BaseType): Replacement of ptype.
2017
2018         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2019
2020 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2021
2022         First of prerequisites for new partial classs implemention.
2023         
2024         * attribute.cs (Attributable): Extended by ResolveContext;
2025         Attributes finally have correct context for resolving in all cases.
2026         (AttachTo): Attribute owner is assigned here.
2027
2028         * codegen.cs (IResolveContext): Introduce new interface to hold
2029         all information needed in resolving phase.
2030         (EmitContext): Implements IResolveContext; more clean-up needed here.
2031         
2032         * decl.cs (MemberCore): Implemented IResolveContext.
2033
2034         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
2035         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
2036         parameter.cs, statement.cs, tree.cs, typemanager.cs:
2037         Refactored to use new IResolveContext instead of EmitContext; cleanup
2038
2039 2006-03-22  Raja R Harinath  <rharinath@novell.com>
2040
2041         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
2042         mcs to keep code differences small.
2043         * attribute.cs (Attribute.GetParameterDefaultValue): New.
2044         * typemanager.cs (parameter_default_value_attribute_type): New.
2045         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
2046         CS1908 check.
2047
2048 2006-03-22  Martin Baulig  <martin@ximian.com>
2049
2050         * generic.cs
2051         (Nullable.NullableLiteral): Derive from `NullLiteral'.
2052
2053         * convert.cs
2054         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
2055         instead of the normal `NullLiteral'.
2056
2057 2006-03-21  Martin Baulig  <martin@ximian.com>
2058
2059         Fix #77583.
2060         * generic.cs (TypeManager.InferType): If `pt' is a generic
2061         parameter, don't check whether `pt == at'.
2062
2063 2006-03-20  Raja R Harinath  <rharinath@novell.com>
2064
2065         Fix #77852
2066         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
2067         (TypeParameter.Resolve): Update to change.
2068         (ConstraintChecker.CheckConstraints): Resolve type-argument
2069         constraints before use.
2070
2071 2006-03-16  Martin Baulig  <martin@ximian.com>
2072
2073         * generic.cs
2074         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
2075         and don't have any instance constructors, also lookup in the base class.
2076         (TypeManager.IsNullableValueType): New public method.
2077
2078         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
2079         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
2080         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
2081
2082         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
2083         instead of just TypeManager.IsNullableType() to determine whether
2084         a lifted operator exists.
2085         (UnaryMutator.DoResolve): Likewise.
2086         (Conditional.DoResolve): Likewise.
2087         (Binary.DoResolve): A lifted operator only exists if both operands
2088         are valuetypes and at least one of them is a nullable type.
2089
2090 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
2091
2092         * iterator.cs : yield break is allowed in try statement which has
2093           catch clauses. Fixed bug #77767.
2094
2095 2006-03-12  Martin Baulig  <martin@ximian.com>
2096
2097         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
2098         private IsSignatureEqual() to compare types; see the comment in
2099         that method; fixes #77674.
2100
2101 2006-03-10  Raja R Harinath  <rharinath@novell.com>
2102
2103         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
2104         (Expression.ResolveAsTypeTerminal): Likewise.
2105         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
2106         * expression.cs, generic.cs, iterators.cs: Likewise.
2107         * parameter.cs, statement.cs, typemanager.cs: Likewise.
2108
2109 2006-03-09  Martin Baulig  <martin@ximian.com>
2110
2111         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
2112         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
2113
2114 2006-03-09  Martin Baulig  <martin@ximian.com>
2115
2116         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
2117         `prepared' flag is set.
2118
2119         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
2120         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
2121         issues; see gtest-254.cs.
2122
2123 2006-03-07  Martin Baulig  <martin@ximian.com>
2124
2125         * generic.cs (TypeManager.InferType): Allow infering
2126         `IEnumerable<T>' with an array of T; see gtest-251.cs.
2127
2128 2006-03-06  Martin Baulig  <martin@ximian.com>
2129
2130         * generic.cs
2131         (TypeManager.InferType): Fix gtest-250.cs.
2132
2133         * typemanager.cs
2134         (TypeManager.IsSubclassOf): Also check the base class.
2135
2136         * expression.cs
2137         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
2138         fixes gtest-249.cs.
2139
2140 2006-03-01  Raja R Harinath  <rharinath@novell.com>
2141
2142         Fix #77679.
2143         * expression.cs (ParameterReference.DoResolveBase): Change return
2144         type to bool.
2145         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2146         Update.
2147
2148         Fix #77628.
2149         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2150
2151         Fix #77642.
2152         * typemanager.cs (GetFullNameSignature): Don't nullref on
2153         protected accessors.
2154
2155 2006-02-16  Martin Baulig  <martin@ximian.com>
2156
2157         * generic.cs
2158         (TypeManager.GetGenericFieldDefinition): New public method; use it
2159         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
2160
2161 2006-02-14  Martin Baulig  <martin@ximian.com>
2162
2163         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
2164
2165 2006-02-14  Martin Baulig  <martin@ximian.com>
2166
2167         * generic.cs
2168         (TypeManager.DropGenericMethodArguments): New public method; don't
2169         use GetGenericMethodDefinition() on something which is not a
2170         generic method.
2171
2172 2006-02-14  Martin Baulig  <martin@ximian.com>
2173
2174         * generic.cs
2175         (ConstraintChecker.CheckConstraints): If a type parameter has the
2176         `struct' constraint, the type must be a non-nullable valuetype.
2177
2178 2006-02-10  Martin Baulig  <martin@ximian.com>
2179
2180         * typemanager.cs
2181         (TypeManager.IsOverride): Make this work for instantiated methods
2182         in a generic class; fixes #77509.
2183         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
2184         rather than calling it directly; fixes #77488.  
2185
2186 2006-02-08  Martin Baulig  <martin@ximian.com>
2187
2188         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
2189         reporting into CheckConstraint() so we can use the correctly
2190         instantiated type.
2191
2192 2006-02-08  Martin Baulig  <martin@ximian.com>
2193
2194         * expression.cs (BaseAccess): Add support for generic methods.
2195
2196         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
2197         the new MethodGroupExpr.
2198
2199 2006-02-07  Martin Baulig  <martin@ximian.com>
2200
2201         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
2202         also reference types; fixes #77483.
2203
2204 2006-02-07  Martin Baulig  <martin@ximian.com>
2205
2206         * generic.cs
2207         (TypeManager.IsGenericMethod): We now return whether something is
2208         an instantiated generic method (and not a generic method def).
2209         (TypeManager.IsGenericMethodDefinition): New public method.
2210
2211         * typemanager.cs
2212         (TypeManager.CSharpSignature): Only include type arguments for
2213         "real" generic methods, not for any instantiated method.
2214         (TypeManager.GetMethodName): Likewise, but also allow generic
2215         method definitions here.
2216
2217 2006-02-06  Miguel de Icaza  <miguel@novell.com>
2218
2219         * codegen.cs (EmitScopeInitFromBlock): check here the
2220         capture_context, there is no need to make two calls to the
2221         EmitContext. 
2222
2223         * anonymous.cs: Add some debugging messages that might help me
2224         track other instances of this problem in the future (the
2225         regression of test 467).
2226
2227         * cs-parser.jay: track the variable block, as we need to initalize
2228         any captured variables declared in this block for the "catch"
2229         portion of the "Try" statement.
2230
2231         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2232         scope initialization for captured variables. 
2233
2234         Also, move the emit for the variables after the block location has
2235         been marked.
2236
2237 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
2238
2239        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2240         
2241 2006-02-06  Martin Baulig  <martin@ximian.com>
2242
2243         * class.cs (TypeContainer.DefineType): If we're a struct, pass
2244         `TypeManager.value_type' as parent type to
2245         ModuleBuilder.DefineType().  Fixes #77358.      
2246
2247 2006-02-02  Miguel de Icaza  <miguel@novell.com>
2248
2249         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2250         commit yesterday, the initialization for the roots is necessary.
2251         What is not necessary is the scope activation.
2252
2253 2006-02-02  Raja R Harinath  <rharinath@novell.com>
2254
2255         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2256         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2257         CS0206 checks.
2258         (Argument.Resolve): Remove CS0206 checks.
2259
2260 2006-02-01  Miguel de Icaza  <miguel@novell.com>
2261
2262         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2263         scopes for all the roots, the scopes will now be emitted when the
2264         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
2265
2266         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2267         code.  This reduces a lot of existing cruft.
2268         
2269         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2270         that the ScopeInfo is generated as we enter the scope, not at the
2271         time of use, which is what we used to do before.
2272
2273         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2274         every time a Block is about to be emitted if we have a
2275         CaptureContext. 
2276
2277 2006-02-01  Raja R Harinath  <rharinath@novell.com>
2278
2279         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
2280         attribute for mscorlib too.
2281
2282         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2283         (Reset): Update.
2284         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2285
2286         * typemanager.cs (cons_param_array_attribute): Make private.
2287         (Reset): Set it to null.
2288         (InitCoreHelpers): Don't initialize it.
2289         (ConsParamArrayAttribute): New.  Initialize it as needed.
2290         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2291
2292 2006-01-31  Miguel de Icaza  <miguel@novell.com>
2293
2294         * expression.cs: There might be errors reported during the
2295         selection of applicable methods.  If there are errors, do not
2296         continue execution as it will lead the compiler to crash.
2297
2298 2006-01-30  Miguel de Icaza  <miguel@novell.com>
2299
2300         * expression.cs: Member access is not allowed on anonymous
2301         methods.  Fixes #77402.
2302
2303 2006-01-30  Raja R Harinath  <rharinath@novell.com>
2304
2305         Fix #77401
2306         * cs-parser.jay (VariableDeclaration): Don't set
2307         current_array_type to null.
2308         (field_declaration, event_declaration, declaration_statement):
2309         Set it to null here.
2310
2311 2006-01-29  Raja R Harinath  <harinath@gmail.com>
2312
2313         Fix part of #77397
2314         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
2315
2316 2006-01-28  Raja R Harinath  <harinath@gmail.com>
2317
2318         * typemanager.cs (GenericParameterPosition): New.
2319         * doc.cs: Use it.
2320
2321 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
2322
2323         * doc.cs : To process "include" elements, first we should create
2324           another list than XmlNodeList, because it could result in node
2325           removal, which could result in that the XmlNodeList gives up
2326           yielding next node.
2327
2328 2006-01-25  Miguel de Icaza  <miguel@novell.com>
2329
2330         * expression.cs: Introduce an error report that we were not
2331         catching before.   Gonzalo ran into it.
2332
2333 2006-01-23  Miguel de Icaza  <miguel@novell.com>
2334
2335         A fix for bug: #76957
2336         
2337         * iterators.cs (MoveNextMethod.CreateMethodHost): call
2338         ComputeMethodHost before creating the method, this is a new
2339         requirement. 
2340
2341         * anonymous.cs (AnonymousContainer): Now we track all the scopes
2342         that this method references (RegisterScope).  The actual scope
2343         where the method is hosted is computed with the ComputeMethodHost
2344         before we create the method.
2345
2346         Moved the Deepest routine here.
2347
2348         (AnonymousContainer.ComputeMethodHost): New routine used to
2349         compute the proper ScopeInfo that will host the anonymous method.
2350
2351         (ScopeInfo): Deal with multiple roots.  The problem was that we
2352         did not have a unique root where all ScopeInfos could be hanged
2353         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
2354         of roots.  
2355
2356         Remove AdjustMethodScope which is now computed at the end.  Remove
2357         LinkScope which did a partial link, instead link all ScopeInfos
2358         before code generation from the new "LinkScopes" routine. 
2359
2360         Simplify all the Add* routines as they no longer need to maintain
2361         the tree, they just need to record that they are using variables
2362         from a ScopeInfo.
2363
2364         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2365         routines to produce the forest of ScopeInfo trees.
2366
2367         * class.cs (TypeContainer.AppendMethod): This is just like
2368         AddMethod, but ensures that an interface implementation method
2369         (IEnumerable.XXX) is not inserted at the beginning of the queue of
2370         methods, but at the end.
2371
2372         We use this functionality to ensure that the generated MoveNext
2373         method in the iterator class is resolved/emitted before the
2374         enumerator methods created.   
2375
2376         This is required because the MoveNext method computes the right
2377         ScopeInfo for the method.  And the other methods will eventually
2378         need to resolve and fetch information computed from the anonymous
2379         method. 
2380
2381         
2382 2006-01-23  Raja R Harinath  <rharinath@novell.com>
2383
2384         Improve implementation of section 14.4.2.2 (Better function member).
2385         * expression.cs (Invocation.MoreSpecific): Compare all type
2386         arguments before deciding if one type is more specific than
2387         another.  Handle array types too.  Return the more specific type.
2388         (Invocation.BetterFunction): Add more tie-breaking rules from
2389         section 14.4.2.2.  Perform "more specific" check after
2390         other tie-breaking rules.  Compare all parameter types before
2391         choosing the "more specific" method.
2392
2393 2006-01-21  Raja R Harinath  <harinath@gmail.com>
2394             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
2395
2396         Fix rest of #76995.
2397         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2398         the 'aliases' hash.
2399         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2400         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2401
2402 2006-01-18  Martin Baulig  <martin@ximian.com>
2403
2404         * class.cs (TypeContainer.AddToMemberContainer): Use
2405         `symbol.MemberName.MethodName' instead of just `symbol.Name';
2406         fixes #77124.
2407
2408 2006-01-18  Martin Baulig  <martin@ximian.com>
2409
2410         Fix #76417: a generic class may now have methods which may unify
2411         for some type parameter substitutions.
2412
2413         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
2414         for methods which may unify anymore.
2415
2416         * expression.cs (Invocation.MoreSpecific): New private static
2417         method; checks whether one method is more specific than another
2418         according to 14.4.2.2 of the spec.
2419         (Invocation.BetterFunction): Implement the tie-breaking rules from
2420         14.4.2.2 of the spec: if two methods unify for some type parameter
2421         substitution, we need to pick the more specific one.
2422
2423 2006-01-18  Raja R Harinath  <rharinath@novell.com>
2424
2425         Fix #76656, cs0231-2.cs.
2426         * cs-parser.jay (formal_parameter_list): Make error case catch
2427         more issues.
2428         (parenthesized_expression_0): Add CS1026 check.
2429         (invocation_expression): Remove unused { $$ = lexer.Location }.
2430
2431 2006-01-17  Raja R Harinath  <rharinath@novell.com>
2432
2433         Fix #76824.
2434         * cs-parser.jay (statement_expression): Don't list out the
2435         individual statement-expressions.  Convert syntax error into
2436         CS0201 check.
2437
2438 2006-01-16  Raja R Harinath  <rharinath@novell.com>
2439
2440         Fix #76874.
2441         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2442         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
2443         CheckIntermediateModification.
2444         (FieldExpr.DoResolve): Add new two-argument version that
2445         allows us to resolve the InstanceExpression as an lvalue.
2446         The one-argument variant is now just a wrapper.
2447         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2448         Resolve the lhs as an lvalue if the it has a value type.
2449         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2450         from Assign.DoResolve.
2451         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2452         resolved as an lvalue.
2453         (PropertyExpr.DoResolve): Update.
2454         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2455         has a value type.  Move CS1612 check here from
2456         CheckIntermediateModification.
2457         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2458         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
2459         'right_side' of a ResolveLValue on an 'out' argument.
2460         (EmptyExpression.LValueMemberAccess): New.  Used as the
2461         'right_side' of a propagated ResolveLValue on a value type.
2462         (LocalVariableReference.DoResolveBase): Recognize
2463         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2464         Add CS1654 check.
2465         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2466         EmptyExpression.Null.
2467
2468 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
2469
2470         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
2471           Type.IsGenericParameter(). Fixed bug #77183.
2472         * doc.cs : it is now identical to doc.cs in mcs.
2473
2474 2006-01-16  Martin Baulig  <martin@ximian.com>
2475
2476         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
2477
2478 2006-01-16  Martin Baulig  <martin@ximian.com>
2479
2480         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
2481         ctors; fixes #77250.
2482
2483 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2484
2485         This fixes the problem where we used ldfld instead of ldflda to
2486         load the "THIS" pointer on captured parameters, when THIS is a
2487         value type.  See bug #77205.
2488         
2489         * iterators.cs (CapturedThisReference.Emit): Pass false to
2490         EmitThis (we do not need the address).
2491
2492         * codegen.cs (EmitThis): it needs to know whether we need the
2493         address of `this' or not.  This is used by value types.  
2494
2495         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2496         every other call passes false.
2497
2498 2006-01-12  Raja R Harinath  <rharinath@novell.com>
2499
2500         Fix #77221.
2501         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2502         GetOverride.
2503         * expression.cs (Invocation.OverloadResolve): Update.
2504         (Invocation.DoResolve): Avoid double resolution of invocation.
2505
2506 2006-01-11  Raja R Harinath  <rharinath@novell.com>
2507
2508         Fix #77180.
2509         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2510         unary negation of floating point types as 0-expr; negation cannot
2511         overflow in floating point types.
2512
2513         Fix #77204.
2514         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2515         on operands of 'void' type.
2516
2517         Fix #77200.
2518         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2519         and ExclusiveOr for boolean constants too.
2520
2521 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
2522
2523         * expression.cs: Fix Console.WriteLine ((this = x).foo);
2524
2525 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2526
2527         * cs-tokenizer.cs (Position): New class used to save and restore
2528         the position state in the tokenizer.  Before this patch the save
2529         and restore was not complete enough so the line and columns would
2530         start to drift and the debugger and stack traces will get the
2531         wrong data.
2532
2533 2006-01-10  Martin Baulig  <martin@ximian.com>
2534
2535         * generic.cs
2536         (TypeParameter.InflateConstraints): New public method.
2537
2538         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
2539         constraints; fixes #77042.
2540
2541 2006-01-10  Martin Baulig  <martin@ximian.com>
2542
2543         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
2544         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
2545         #77061. 
2546
2547 2006-01-09  Raja R Harinath  <rharinath@novell.com>
2548
2549         Fix #75636.
2550         * expression.cs (Invocation.OverloadResolve): Replace reflected
2551         override methods with their base virtual methods, rather than
2552         skipping over them.
2553         * typemanager.cs (TypeManager.GetOverride): New.
2554
2555 2005-12-21  Miguel de Icaza  <miguel@novell.com>
2556
2557         * driver.cs: Report the case of no source files and no -out:
2558         argument provided.
2559
2560 2005-12-20  Raja R Harinath  <rharinath@novell.com>
2561
2562         Fix #77035.
2563         * expression.cs (ComposedCast.GetSignatureForError): Define.
2564
2565 2006-01-05  Jb Evain  <jbevain@gmail.com>
2566
2567         * class.cs (Property.Define, Indexer.Define): do not tag the
2568         properties as SpecialName | RTSpecialName.
2569
2570 2006-01-04  Miguel de Icaza  <miguel@novell.com>
2571
2572         * class.cs (MethodCore.IsDuplicateImplementation): This method was
2573         doing a low-level comparission of parameter types.  It was lacking
2574         a check for __argslist. 
2575
2576 2005-12-30  Miguel de Icaza  <miguel@novell.com>
2577
2578         * expression.cs (ParameterReference.DoResolveBase): Allow
2579         reference parameters if they are local to this block. 
2580
2581         This allows the ref and out parameters of a delegate to be used in
2582         an anonymous method, for example:
2583
2584         delegate void set (out int x);
2585
2586         set s = delegate (out int x){
2587                 x = 0;
2588         };
2589
2590         This is used by functionality introduced late in the C# language.
2591         
2592         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2593         method that take ref and out parameters. 
2594
2595         Fixes #77119 which was a late change in the spec.
2596
2597 2005-12-23  Miguel de Icaza  <miguel@novell.com>
2598
2599         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2600         parent if its the same scope.  Fixes #77060.
2601
2602 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
2603
2604         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
2605
2606 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2607
2608         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
2609         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
2610         that doesn't contain the full public key. This is a update of the
2611         friend assemblies in .Net 2.0 release.
2612         
2613 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2614
2615         Fix #76995
2616
2617         * namespace.cs (NamespaceEntry): Add extern_aliases as a
2618         ListDictionary, to contain the ExternAliasEntry entries (in
2619         addition to the NamespaceEntry.aliases hashtable). This field is
2620         shared between the original entry and its doppelganger (bodyless 
2621         copy of it).
2622         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2623         extern_aliases field.
2624         (NamespaceEntry.Lookup): Move the IsImplicit check after the
2625         lookup in extern_aliases.
2626
2627 2005-12-16  Raja R Harinath  <rharinath@novell.com>
2628
2629         Fix #77006.
2630         * class.cs (TypeContainer.Mark_HasEquals): New.
2631         (TypeContainer.Mark_HasGetHashCode): New.
2632         (ClassPart): Override them.
2633         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2634
2635         * generic.cs (GenericMethod.DefineMembers): Update to changes.
2636         (TypeParameter.TypeParameter): Change type of 'parent' argument to
2637         DeclSpace.
2638
2639         Fix #77008.
2640         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2641         'parent' argument to the base constructor.
2642
2643         Remove all mention of TypeContainer from decl.cs.
2644         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2645         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2646         (DeclSpace.DeclSpace): Likewise.
2647         (DeclSpace.DefineMembers): Remove unused argument.
2648         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
2649         debugging check -- we don't care if the debug code throws an
2650         InvalidCastException instead of an InternalErrorException.
2651         * class.cs (TypeContainer.DefineMembers): Update to changes.
2652         (TypeContainer.DoDefineMembers): Likewise.
2653         (TypeContainer.GetMethods): Likewise.
2654         (PropertyMember.Define): Likewise.
2655         (MemberBase.Parent): New property that forwards to
2656         MemberCore.Parent, but ensures that we get a TypeContainer.
2657         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2658         (RootContext.PopulateTypes): Likewise.  Remove special case code
2659         for !RootContext.StdLib: DefineMembers is idempotent.
2660
2661 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
2662
2663         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2664
2665 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
2666
2667         * doc.cs : The search for referenced namespace was insufficient to
2668           get global one as it used to do. Fixed bug #76965.
2669
2670 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
2671
2672         * doc.cs : check name in cref in the last phase that whether it is
2673           namespace or not.
2674
2675 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2676
2677         * cs-tokenizer.cs : reverted the latest change: it somehow broke
2678           Mono.C5.
2679
2680 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2681
2682         * doc.cs : so it turned out that we cannot skip override check for 
2683           interface members. Fixed bug #76954.
2684
2685 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2686
2687         * cs-tokenizer.cs : fixed bug #75984:
2688           - #warning and #error should not be handled when the source line
2689             is disabled.
2690           - #line is not checked strictly when the source line is disabled.
2691           - #define and #undef is on the other hand checked strictly at any
2692             state.
2693
2694 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
2695
2696         * cs-tokenizer.cs : missing Location (actually, filename) in one of
2697           CS1027 report.
2698
2699 2005-12-15  Raja R Harinath  <rharinath@novell.com>
2700
2701         * generic.cs (TypeManager.IsGeneric): Remove unused method.
2702
2703         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
2704         nested types.
2705
2706 2005-12-14  Martin Baulig  <martin@ximian.com>
2707
2708         * typemanager.cs (TypeManager.GetFullName): Make this public;
2709         `Type.Fullname' now never returns null.
2710
2711         * class.cs (Method.Define): Use TypeManager.GetFullName() for
2712         explicit interface implementations; we're now using the same
2713         naming convention than csc does.
2714
2715 2005-12-14  Miguel de Icaza  <miguel@novell.com>
2716
2717         * convert.cs (ExplicitConversionCore): Check the return value from
2718         ExplicitConversionCore which can return null on failure.  Fixes #76914
2719
2720 2005-12-09  Raja R Harinath  <rharinath@novell.com>
2721
2722         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
2723         instead of IsGenericInstance.
2724         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
2725         code that's now covered by the more general test.
2726         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
2727
2728         * generic.cs (DropGenericTypeArguments): New.  Captures the common
2729         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
2730         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
2731         * generic.cs, report.cs, typemanager.cs: Likewise.
2732
2733 2005-12-08  Martin Baulig  <martin@ximian.com>
2734
2735         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
2736
2737         * typemanager.cs (TypeManager.CSharpSignature): Include type
2738         arguments in the signature of a generic method.
2739
2740 2005-12-07  Martin Baulig  <martin@ximian.com>
2741
2742         Add support for custom attributes on type parameters.
2743
2744         * cs-parser.jay (type_arguments): Added `opt_attributes'.
2745
2746         * generic.cs (TypeParameterName): New public class; we use this
2747         instead of a `string' to store the name of a type parameter, so we
2748         can also have `Attributes'.
2749         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
2750         array instead of a `string[]' array.
2751         (TypeParameter.ctor): We now also take an `Attributes' argument.
2752         (TypeParameter.EmitAttributes): New public method; emit our
2753         `OptAttributes' here.
2754         (GenericMethod.EmitAttributes): New public method; emit the custom
2755         attributes on all our type parameters.
2756
2757         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
2758         our type parameters.
2759         (MethodData.Define): If we're a generic method, call
2760         EmitAttributes() on it.
2761
2762 2005-12-07  Martin Baulig  <martin@ximian.com>
2763
2764         * generic.cs
2765         (ConstraintChecker): New public abstract class; move the
2766         constraint checking here from `ConstructedType' and also do
2767         constraint checking for generic methods here.
2768
2769         * expression.cs (Invocation.OverloadResolve): Use
2770         ConstraintChecker.CheckConstraints() if we resolved to a generic
2771         method.  Fix #76806.
2772
2773 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2774
2775         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2776
2777         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2778         event initializers.
2779         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2780         (FieldBase.Initializer): Initializer is now optional.
2781         (EventField.Define): Only event field can have initializer.
2782
2783         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2784
2785         * const.cs (Const): Reuse initializer.
2786
2787         * cs-parser.jay: Updated after FieldBase changes.
2788         Added current_array_type to simplify array initializers.
2789
2790         * ecore.cs (NullCast.IsDefaultValue): Implemented.
2791
2792         * expression.cs, iterators.cs: Updated.
2793
2794         * namespace.cs (NamespaceEntry): Made UsingFound private.
2795
2796 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2797
2798         * parameterCollection.cs: Obsolete, removed.
2799         * parser.cs: Obsolete, removed.
2800
2801 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2802
2803         Fix #76849.
2804         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2805
2806         * enum.cs (Enum.Define): Set obsolete context here.
2807
2808 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2809
2810         * doc.cs :
2811           - FindDocumentedMember() now expects 1) paramList as null
2812             when "we don't have to check the number of parameters" and
2813             2) Type.EmptyTypes when "there is no arguments".
2814           - Introduced FoundMember struct to hold the exact type which was
2815             used to find the documented member (the above change broke
2816             test-xml-044; it might be better just to use DeclaringType than
2817             what MS does, like this change does, but it depends on usage.)
2818
2819 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2820
2821         * doc.cs : documented member might be from DeclaringType for nested
2822           types. Fixed bug #76782.
2823
2824 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
2825
2826         * anonymous.cs: Have the param code handle leaving copies on the
2827         stack etc. Allows anonymous params to take part in the assignment
2828         code (++, +=, etc). Fixes bug #76550
2829
2830         * expression.cs: Handle the prepare_for_load/leave_copy by passing
2831         it down to the anon code.
2832
2833         * iterators.cs: Use dummy var here
2834
2835         * codegen.cs: Handle new vars
2836
2837 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2838
2839         Fix #76849.
2840         * class.cs (MethodData.Define): Set proper Obsolete context.
2841
2842         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2843         obsolete context.
2844         (FieldExpr.DoResolve): Ditto.
2845
2846 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2847
2848         Fix #76849.
2849         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2850         parent is not obsolete.
2851
2852 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
2853
2854         * doc.cs : (FindDocumentedMember) find parameterless members first
2855           and get CS0419 in the early stage. Fixed first case of bug #76727.
2856
2857 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
2858
2859         Fix #76859.
2860         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2861         no error was reported.
2862
2863         *expression.cs (Binary.DoResolve): left can be null.
2864
2865 2005-12-06  Raja R Harinath  <rharinath@novell.com>
2866
2867         * class.cs (MethodCore.CheckGenericOverride): Delete unused
2868         abstract method and all overrides.
2869         * support.cs (ParameterData.GenericConstraints): Delete.
2870         (ReflectionParameters.type_params): Delete.
2871         (ReflectionParameters.ReflectionParameters): Make private.
2872         (ReflectionParameters.GetConstaints): New factory method.
2873         * generic.cs (TypeParameterDefineType): Use it.
2874         (TypeManager.GetTypeParameterConstraints): Likewise.
2875
2876 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
2877
2878         Fix #76783.
2879         * class.cs (MethodData.Emit): Parameters should be labeled first.
2880
2881 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
2882
2883         Fix #76761.
2884         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2885
2886 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
2887
2888         * attribute.cs (AreParametersCompliant): Moved to Parameter.
2889
2890         * class.cs (MethodCore): Parameter clean up.
2891         (IMethodData): Added ParameterInfo.
2892         (MethodData): Parameter clean up.
2893         (Indexer.Define): Parameter clean up.
2894
2895         * anonymous.cs,
2896         * codegen.cs,
2897         * cs-parser.jay,
2898         * decl.cs,
2899         * doc.cs,
2900         * ecore.cs,
2901         * flowanalysis.cs,
2902         * iterators.cs,
2903         * pending.cs,
2904         * statement.cs,
2905         * typemanager.cs: Parameter clean up.
2906
2907         * delegate.cs (Define): Get rid of duplicated code.
2908
2909         * expression.cs (ParameterReference): Removed useless parameters
2910         and simplified.
2911         (Invocation): Ditto.
2912
2913         * parameter.cs (ParamsParameter): New class, params specialization.
2914         (ArglistParameter): Attemp to separate arglist.
2915         (Parameter): Refactored to be reusable and faster.
2916         (Parameter.Modifier): Made understandable.
2917         (Parameters): Changed to be used as a class for `this' assembly
2918         parameters. Refactored to use new specialized classes.
2919
2920         * support.cs (ParameterData): Added Types property.
2921         (InternalParameters): Deleted.
2922
2923 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2924
2925         * doc.cs : the previous patch does not actually fix the bug.
2926           PropertyInfo override check is now implemented and really fixed it.
2927         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2928
2929 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2930
2931         * doc.cs : apply "override filter" also to properties.
2932           Fixed bug #76730.
2933
2934 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2935
2936         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2937           no need to check overrides. For classes, omit those results from 
2938           interfaces since they must exist in the class. Fixed bug #76726.
2939
2940 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2941
2942         * typemanager.cs : (GetFullNameSignature) differentiate indexers
2943           with different parameters. Fixed the second problem in #76685.
2944
2945 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2946
2947         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2948           get expected 'protected' access in CheckValidFamilyAccess()).
2949           Fixed bug #76692.
2950
2951 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2952
2953         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2954           Fixed bug #76705.  CS1569 was incorrectly commented out.
2955
2956 2005-11-23  Martin Baulig  <martin@ximian.com>
2957
2958         * generic.cs (Constraints.Define): Removed.
2959         (TypeParameter.DefineConstraints): Removed.
2960         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
2961         on the GenericTypeParameterBuilder here.
2962
2963 2005-11-23  Martin Baulig  <martin@ximian.com>
2964
2965         * typemanager.cs (TypeManager.GetProperty): Make this public.
2966
2967         * generic.cs (Nullable.NullableInfo.ctor): Use
2968         TypeManager.GetProperty() rather than using reflection directly.
2969
2970 2005-11-17  Martin Baulig  <martin@ximian.com>
2971
2972         * expression.cs (Indexers.GetIndexersForType): Added support for
2973         generic parameters; fixes #76587.
2974
2975 2005-11-17  Martin Baulig  <martin@ximian.com>
2976
2977         * anonymous.cs
2978         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2979         inherit the scope from our parent.  Fixes #76653.
2980
2981 2005-11-15  Martin Baulig  <martin@ximian.com>
2982
2983         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
2984         instead of `ScopeTypeBuilder' to refer to the "current" type.
2985         (AnonymousMethod.CreateScopeType): Correctly create the helper
2986         class if we're inside a generic type definition.
2987
2988 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2989
2990         * doc.cs : use Invocation.IsOverride() to do real override check.
2991         * expression.cs : made Invocation.IsOverride() internal.
2992
2993 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2994
2995         * doc.cs : use TypeManager.FindMembers() instead of (possible)
2996           TypeBuilder.FindMembers() and filter overriden base members out.
2997           Fixed bug #76990.
2998
2999 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3000
3001         * doc.cs : ref/out parameters are represented as '@' (instead of
3002           '&' in type FullName). Fixed bug #76630 (additionally crefs).
3003
3004 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3005
3006         * doc.cs : when there was no '.' in cref to methods in doc comment,
3007           then parameters were missing in the output. Fixed bug #76691.
3008
3009 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3010
3011         * driver.cs : don't output docs when there is an error.
3012           Fixed bug #76693.
3013
3014 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3015
3016         * doc.cs :
3017           Now it should detect indexers. Fixed primary concern in bug #76685.
3018           Fixed CS0419 message to not show the identical member signature in
3019           the message.
3020
3021 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3022
3023         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
3024           instead of Type.FindMembers() since it does not handle events.
3025           Fixed bug #71604.
3026
3027 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
3028
3029         * codegen.cs: Fixed typo (speficied -> specified).
3030
3031 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3032
3033         Fix #76369.
3034         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3035
3036 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3037
3038         * attribute.cs: Changed error message.
3039
3040         * cs-tokenizer.cs: One more check.
3041
3042 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3043
3044         * statement.cs (Block.Resolve): Ignore empty statement.
3045
3046 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3047
3048         * report.cs: Made error/warning methods more strict to avoid
3049         their misuse.
3050
3051         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3052         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3053         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3054         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3055
3056 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3057
3058         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
3059         Use the more explicit AssemblyName.FullName instead of 
3060         AssemblyName.Name to report errors.
3061         
3062 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3063
3064         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
3065         with mcs.
3066
3067 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3068
3069         * class.cs,
3070         * convert.cs,
3071         * cs-parser.jay,
3072         * decl.cs,
3073         * enum.cs,
3074         * expression.cs,
3075         * generic.cs,
3076         * pending.cs,
3077         * report.cs: Fixed error reporting and typos.
3078
3079         * generic.cs (TypeParameter.GetSignatureForError): New method.
3080         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
3081
3082         * typemanager.cs (GetFullName): Refactored.
3083
3084 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
3085
3086         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3087         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3088
3089         * class.cs (TypeContainer.IsComImport): New property.
3090         (Constructor.Define): Create proper ctor for ComImport types.
3091
3092         * expression.cs (New.CheckComImport): Fixed.
3093
3094 2005-11-07  Miguel de Icaza  <miguel@novell.com>
3095
3096         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3097         that a parameter has been captured does not mean that we do not
3098         have to do the rest of the processing.  This fixes the second part
3099         of #76592.  If there was another anonymous method capturing
3100         values in the past, the Scope would never be set for the second
3101         method that captured the same parameter.
3102
3103         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3104         properly manipulate the stack.   Second part of fix for #76592.
3105
3106         * expression.cs (New): Add support for invoking "new" on
3107         interfaces that have been flagged with the ComImport attribute and
3108         the CoClass.  Fixes #76637 
3109
3110         * statement.cs (Try.DoEmit): When a variable is captured, do not
3111         try to emit the vi.LocalBuilder variable as it has been captured.
3112         Create a temporary variable and store the results on the
3113         FieldBuilder.  Fixes #76642
3114
3115 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3116
3117         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3118
3119         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3120
3121         * expression.cs (Binary.DoResolve): Added && optimalization.
3122     
3123         * typemanager.cs (AddUserType): Removed useless argument.
3124
3125 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
3126
3127         * statement.cs (Block.variables): Uses ListDictionary.
3128
3129 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3130
3131         Fix #75969.
3132         * class.cs (PartialContainer.EmitType): Customized to emit
3133         security attributes.
3134         (ClassPart.ApplyAttributeBuilder): Transform security attribute
3135         for partial classes.
3136
3137 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3138
3139         Fix #76599.
3140         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3141         access has to be fixed.
3142         
3143         * typemanager.cs (IsUnmanagedType): Wrong common field type.
3144
3145 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
3146
3147         Fix #76590.
3148         * ecore.cs (NullCast.Reduce): Implemented.
3149
3150         * expression.cs (ArrayCreation.CheckIndices): Correcly check
3151         constant type.
3152         
3153         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3154         properly.
3155         (Foreach.Resolve): Catch null properly.
3156
3157 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3158  
3159         * cs-tokenizer.cs: Warning text fix.
3160
3161         * driver.cs: AllWarningNumbers exposed on public interface.
3162
3163         * report.cs (): Reviewed warning numbers.
3164         (IsValidWarning): Use binary search.
3165
3166 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3167  
3168         * driver.cs: Implemeted resource visibility.
3169         (Resources): New class for code sharing between /res: and
3170         /linkres:
3171  
3172 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3173
3174         decl.cs (CurrentTypeParameters): Fixed to be public.
3175
3176 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3177
3178         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
3179
3180 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3181
3182         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
3183
3184 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
3185
3186         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
3187
3188 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3189
3190         Add friend assembly access support.
3191         * typemanager.cs: assembly_internals_vis_attrs
3192         cache for friend assembly access. 
3193         (TypeManager.IsFriendAssembly): New method for
3194         checking friend assembly access.
3195         (TypeManager.Error_FriendAccessNameNotMatching): New
3196         helper method.
3197         (TypeManager.CompareKeyTokens): Likewise.
3198         (TypeManager.Filter): Handle friend accessible
3199         members.
3200
3201         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
3202         friend accessible types.
3203
3204         * ecore.cs (Expression.IsAccessorAccessible): Handle
3205         friend accessible properties.
3206
3207         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
3208         accessible types.
3209         
3210 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
3211
3212         Fix #76568.
3213         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3214         folding.
3215         
3216         * convert (Convert.ImplicitReferenceConversion): NullCast holds
3217         contants only.
3218         
3219         * ecore.cs (NullCast): Child is contant only.
3220         
3221         * literal.cs (NullLiteral.Reduce): null can be converted to any
3222         reference type.
3223
3224 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
3225
3226         * driver.cs: Use Encoding.Default as default code page instead
3227           of ISO-28591.
3228
3229 2005-10-27  Raja R Harinath  <rharinath@novell.com>
3230
3231         Fix #76085.
3232         * expression.cs (Invocation.Error_InvalidArguments): Handle
3233         __arglist parameters.
3234         (Invocation.VerifyArgumentsCompat): Likewise.
3235         * support.cs (ReflectionParameters.GetSignatureForError): Print
3236         __arglist parameters.
3237         (InternalParamters.GetSignatureForError): Likewise.
3238         * parameter.cs (Parameters.GetSignatureForError): Likewise.
3239
3240 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
3241
3242         * attribute.cs (GetPropertyValue): Made public.
3243
3244         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3245         Resolve.
3246         Add new property WrapNonExceptionThrows to handle 2.0 assembly
3247         attribute.
3248         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3249         is not defined.
3250         
3251         * driver.cs: Reflect method name change.
3252         
3253         * statement.cs (Try.Resolve): Warn when try has both general
3254         exception handlers.
3255         
3256         * typemanager.cs: runtime_compatibility_attr_type new predefined
3257         type.
3258
3259 2005-10-26  Raja R Harinath  <harinath@gmail.com>
3260
3261         Fix #76419.
3262         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3263         treat it as an empty parameter list.
3264
3265 2005-10-26  Raja R Harinath  <rharinath@novell.com>
3266
3267         Fix #76271.     
3268         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
3269         ResolveAsTypeStep silent.
3270         * statement.cs (Block.AddConstant): Mark block as used.
3271         (Block.ResolveMeta): Avoid piling on error messages
3272         if a constant initializer resolution fails.
3273
3274 2005-10-25  Raja R Harinath  <rharinath@novell.com>
3275
3276         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3277         Remove.
3278         (NamespaceEntry.VerifyAllUsing): New.
3279         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
3280         behaviour.  Delegates actual resolution of alias to ...
3281         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
3282         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3283         Update.
3284         * driver.cs (Driver.MainDriver): Update.
3285         
3286         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3287         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3288         property.
3289         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3290         Remove.
3291         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3292         RootNamespace.DefineNamespacesForAll.
3293
3294 2005-10-24  Raja R Harinath  <harinath@gmail.com>
3295
3296         * typemanager.cs (assemblies, external_aliases, modules)
3297         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3298         (ComputeNamespaces, GetRootNamespace): Remove extra staging
3299         overhead.  Move resposibility ...
3300         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
3301         * driver.cs, attribute.cs, codegen.cs: Update to changes.
3302
3303 2005-10-23  Raja R Harinath  <harinath@gmail.com>
3304
3305         * namespace.cs (RootNamespace.all_namespaces): Renamed from
3306         cached_namespaces.  Improve usage.
3307         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3308         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3309         Move from GlobalRootNamespace and simplify.
3310         (RootNamespace.Global): Make instance variable.
3311         (RootNamespace.RootNamespace): Add "alias name" parameter.
3312         (GlobalRootNamespace): Simplify drastically.
3313         (Namespace.Lookup): Don't use GetNamespace.
3314         * typemanager.cs (GetRootNamespace): Rename from
3315         ComputeNamespaceForAlias.
3316         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3317
3318 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3319
3320         * anonymous.cs (AnonymousContainer): Don't crash when container
3321         doesn't exist.
3322
3323 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3324
3325         * expression.cs (Binary.DoResolve): Warn when comparing same
3326         values.
3327
3328 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3329
3330         Fix #76486.
3331         * expression.cs (Binary.DoResolve): It looks like there are no
3332         convetsion rules in enum context.
3333
3334 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3335
3336         Add support for extern alias qualifiers.
3337         * typemanager.cs: Move some LookupTypeReflection code
3338         to namespace.cs, to have cleaner code. Added some methods
3339         to help us keep track of the extern aliased references.
3340         * driver.cs: Add suport for extern alias assemblies on command
3341         line and check for their warnings/errors. Also keep track of the
3342         extern aliased assemblies.
3343         * namespace.cs: Move the global functionality of Namespace
3344         to GlobalRootNamespace/RootNamespace. Now the global namespace
3345         is GlobalRootNamespace.Globa. Also the code moved from 
3346         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
3347         Finally added LocalAliasEntry (AliasEntry before) and
3348         ExternAliasEntry, to handle alias statements.
3349         * cs-parser.jay: Add support in the grammar for extern alias
3350         statement.
3351         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
3352         Update callings to Namespace (now in GlobalRootNamespace).
3353
3354 2005-10-25  Martin Baulig  <martin@ximian.com>
3355
3356         * convert.cs (ImplicitTypeParameterConversion): Make base
3357         interfaces actually work; fixes #76557.
3358
3359 2005-10-25  Martin Baulig  <martin@ximian.com>
3360
3361         * generic.cs
3362         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
3363         all the type parameters; fixes #76551.
3364
3365 2005-10-25  Martin Baulig  <martin@ximian.com>
3366
3367         Fix #76472.
3368
3369         * generic.cs
3370         (GenericMethod.ctor): Added `Expression return_type' and
3371         `Parameters parameters' arguments.
3372         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
3373         parameter and return types to check their constraints if they're
3374         generic types.
3375
3376         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
3377         boolean field.
3378
3379         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3380         constraints of a generic type if `ec.ResolvingGenericMethod'.
3381
3382         * class.cs (MethodCore.DoDefineParameters): Set
3383         `ec.ResolvingGenericMethod' if we're a generic method.
3384         (MemberBase.MemberType): Likewise.
3385
3386 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3387
3388         * typemanager.cs (TypeManager): Added 
3389         TypeManager.internals_visible_attr_type to cache
3390         S.R.CompilerServices.InternalsVisibleToAttribute.
3391
3392         * codegen.cs (AssemblyClass): Added checks for 
3393         InternalsVisibleToAttribute in new method 
3394         CheckInternalsVisibleAttribute () and also cache the
3395         AssemblyName in AssemblyClass.Name.
3396         
3397 2005-10-24  Martin Baulig  <martin@ximian.com>
3398
3399         * typemanager.cs
3400         (TypeManager.ExpandInterfaces): Added overloaded version which
3401         just takes a `Type[]' array.
3402
3403         * generic.cs
3404         (Constraints.Resolve): Don't expand the interfaces here; ie. we
3405         just use the interfaces which were explicitly specified and not
3406         the interfaces they inherit.  Fixes #76482.
3407         (TypeParameter.FindMembers): Expand the interfaces here.
3408
3409 2005-10-21  Martin Baulig  <martin@ximian.com>
3410
3411         * generic.cs
3412         (Constraints.Resolve): Also resolve the actual types here.
3413         (Constraints.ResolveTypes): Just check the constraints here.
3414         Fixes #76363; see gtest-218.cs.
3415
3416 2005-10-21  Martin Baulig  <martin@ximian.com>
3417
3418         * convert.cs
3419         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
3420         instead of a `BoxedCast'; fixes gtest-217.cs.
3421
3422 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
3423
3424         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
3425           1) "new()" is specified as generic parameter constraint and 2) the
3426           type is TypeBuilder and 3) the type is abstract even if it has a
3427           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
3428
3429 2005-10-20  Martin Baulig  <martin@ximian.com>
3430
3431         * generic.cs
3432         (GenericConstraints.TypeParameter): New public property.
3433         (TypeParameter.ctor): Also take a `DeclSpace' argument.
3434         (TypeParameter.DeclSpace): New public property.
3435         (TypeParameter.DefineType): Inflate the constraints if our
3436         `DeclSpace' is an `Iterator'.   
3437
3438 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
3439
3440         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
3441           GenericMethod argument to compare methods' generic type arguments.
3442           Fixed bug #76382.
3443
3444 2005-10-19  Martin Baulig  <martin@ximian.com>
3445
3446         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
3447         not ResolveType() when resolving the base type, so we're not
3448         checking the constraints here.
3449         (TypeContainer.ResolveType): Call ResolveType() on our base_type
3450         if we have any.
3451
3452 2005-10-19  Martin Baulig  <martin@ximian.com>
3453
3454         * generic.cs (ConstructedType.CheckConstraints): Committing
3455         untested fix for #76441.
3456
3457 2005-10-18  Raja R Harinath  <rharinath@novell.com>
3458
3459         Fix #76371.
3460         * class.cs (TypeContainer.DefineType): Move updating of
3461         topological sort earlier in the code.
3462         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3463
3464 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
3465
3466         Fix #76273.
3467         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3468         
3469         * constant.cs (Constant.TryReduce): Moved from Cast class.
3470         (Reduce): Made little bit more OO and fixed missing conversions.
3471         
3472         * ecore.cs (Reduce): Implemented.
3473         (Binary.EnumLiftUp): New method to upgrade values to enum values.
3474         
3475         * literal.cs (Reduce): Implemented.
3476         
3477         * class.cs: Reverted Miguel's wrong commit.
3478
3479 2005-10-14  Miguel de Icaza  <miguel@novell.com>
3480
3481         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3482
3483 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
3484
3485         * cs-parser.jay, expression.cs : CS0214 was missing error location
3486           for constants. Fixed bug #76404.
3487
3488 2005-10-10  Raja R Harinath  <rharinath@novell.com>
3489
3490         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3491         InstanceExpression.
3492         (PropertyExpr.EmitCall): Likewise.
3493         * expression.cs (Invocation.EmitArguments): Handle case where
3494         arguments == null.
3495         (Invocation.EmitCall): Avoid allocating temporary variable if
3496         there are no arguments.
3497
3498 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
3499
3500         Fix #76370.
3501         * convert.cs (ExplicitConversionCore): Fixed object->enum
3502         conversion.
3503
3504 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3505
3506         Fix #76323.
3507         * convert.cs (ImplicitConversionStandard): Move conversion of
3508         void* to arbitrary pointer types ...
3509         (ExplicitConversionStandard): .. here.
3510         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3511         error to always print typenames.
3512
3513 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3514
3515         * convert.cs (GetConversionOperator): Rename from
3516         GetConversionOperators.  Move operator selection code from ...
3517         (UserDefinedConversion): ... here.
3518
3519 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
3520
3521         * convert.cs (ExplicitConversionCore): Removed duplicate enum
3522         conversion.
3523
3524 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
3525
3526         * assign.cs (Assign.DoResolve): Error method changed.
3527
3528         * cfold.cs (DoConstantNumericPromotions): Error method changed.
3529         
3530         * const.cs (ResolveValue): Reset in_transit immediately.
3531         
3532         * constant.cs: Error method changed.
3533         
3534         * convert.cs: Removed useless location parameter.
3535         (ExplicitNumericConversion): Don't do double enum check.
3536         (ExplicitConversionCore): Renamed from ExplicitConversion.
3537         (ExplicitUnsafe): Extracted from ExplicitConversion.
3538         (ExplicitConversion): Uses for error reporting.
3539         
3540         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3541         error messages.
3542         (ResolveBoolean): Uses common error method.
3543         (CastToDecimal): Get rid of ec.
3544         (CastFromDecimal): Optimized.
3545         (ConvCast): Get rid of ec.
3546         
3547         * enum.cs (ResolveValue): Reset in_transit immediately.
3548         (Emit): Return after first error.
3549         
3550         * expression.cs: Convert changes.
3551         
3552         * literal.cs: Error method changed.
3553         
3554         * statement.cs: Error method changed.
3555
3556 2005-10-06  Raja R Harinath  <rharinath@novell.com>
3557
3558         Fix gtest-131.cs and gtest-211.cs.
3559         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
3560         Only emit code for a label if it is used.  Unreachable code can
3561         violate ECMA evaluation stack invariants.
3562
3563 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3564
3565         * anonymous.cs: Implemented ExprClassName.
3566         
3567         * assign.cs (Assign.DoResolve): Don't chrash when type is not
3568         delegate.
3569         
3570         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3571         check.
3572         
3573         * class.cs (StaticClass.DefineContainerMembers): Report protected
3574         members as error.
3575         
3576         * codegen.cs: if(ed) PRODUCTION.
3577         
3578         * convert.cs (Error_CannotImplicitConversion): Better error
3579         distinction.
3580         
3581         * cs-parser.jay: More error checks.
3582         
3583         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3584         
3585         * driver.cs (CSCParseOption): Enabled wrong option check.
3586         
3587         * ecore.cs (Expression.ExprClassName): Turned to property.
3588         (MemberExpr.CheckIntermediateModification): For checking boxed
3589         value types     modification.
3590         
3591         * statement.cs (Fixed.Resolve): Expression type must be
3592         convertible to fixed type.
3593         (CollectionForeach.GetEnumeratorFilter,TryType):
3594         Small refactoring for easier error checking.
3595
3596 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
3597
3598         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3599         attributes.
3600         
3601         * class.cs (GeneratedBaseInitializer): New class for customization
3602         compiler generated initializers.
3603         (MemberBase.DoDefine): Check Obsolete attribute here.
3604         (FieldMember.DoDefine): Ditto.
3605         
3606         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3607         constants.
3608         
3609         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3610         (MemberCore.GetObsoleteAttribute): Removed argument.
3611         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3612         (MemberCore.CheckObsoleteType): New helper.
3613         
3614         * delegate.cs,
3615         * enum.cs,
3616         * statement.cs: Updates after MemberCore changes.
3617         
3618         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3619         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3620         
3621         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3622         obsolete attribute for compiler construct.
3623         (As.DoResolve): Cache result.
3624         
3625         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3626
3627 2005-10-01  Miguel de Icaza  <miguel@novell.com>
3628
3629         * expression.cs (Probe): instead of having a "Type probe_type"
3630         keep the extra information as a TypeExpr probe_type_expr since the
3631         "As" operator needs to perform some type checks.
3632
3633         * (As.DoResolve): If the type is a type parameter, ensure that it
3634         is constrained by a class.
3635
3636 2005-09-22  Miguel de Icaza  <miguel@novell.com>
3637
3638         * statement.cs (Lock): Use the TemporaryVariable class instead of
3639         manually using local variables as those do not work when variables
3640         are captured.
3641
3642         * ecore.cs: Moved the TemporaryVariable class from being a nested
3643         class inside Foreach to be a public class that can be employed in
3644         other places. 
3645
3646 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
3647
3648         * cs-parser.jay: interface_accessors replaced by
3649         accessor_declarations.
3650
3651         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3652         location.
3653         
3654         * statement.cs (GotoCase.Resolve): Convert null constant to
3655         null case.
3656         (SwitchLabel.ResolveAndReduce): Ditto.
3657         (SwitchLabel.NullStringCase): Custom null stamp.
3658         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3659         
3660         typemanager.cs (CSharpSignature): Don't skip first argument
3661         for full names.
3662
3663 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
3664
3665         * cfold.cs, constant.cs, convert.cs, ecore.cs,
3666         expression.cs, iterators.cs, literal.cs: Store constants and
3667         literals location.
3668         
3669         * class.cs (MemberBase.ShortName): Pass location.
3670         
3671         * cs-parser.jay: Some location fixes.
3672         
3673         * ecore.cs (Expression.Location): Made virtual.
3674
3675 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3676
3677         Fix #72930.
3678         * const.cs (Const.ResolveValue): Check for assigning non-null
3679         value to reference type.
3680
3681 2005-09-26  Raja R Harinath  <rharinath@novell.com>
3682
3683         Fix #76133.
3684         * expression.cs (This.VerifyFixed): In a value type T, the type of
3685         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
3686         value type R, 'this' is treated as a value parameter.
3687
3688 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3689
3690         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3691         if the underlying types are the same, otherwise we need to produce
3692         code that will do the proper cast.
3693
3694         This was exposed by Marek's constant rewrite which produced
3695         invalid code for the call site:
3696
3697         enum X : long { a }
3698         void Method (X v) {}
3699
3700         Method ((X) 5)
3701
3702         This fixes test-49.cs
3703
3704 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3705
3706         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3707           Type/Object should be allowed as well. Fixed bug #75968.
3708
3709 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3710
3711         * expression.cs : (Binary.DoResolve): when one is enum constant and
3712           another is constant 0, then return enum one *as enum type*.
3713           Fixed bug 74846.
3714
3715 2005-10-04  Martin Baulig  <martin@ximian.com>
3716
3717         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
3718         `SetMemberIsUsed()' work for generics, too.
3719
3720 2005-10-04  Martin Baulig  <martin@ximian.com>
3721
3722         * expression.cs (DelegateInvocation.EmitStatement): Make this work
3723         for corlib.  Fixes #75691.
3724
3725 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
3726
3727         Fix #76255.
3728         * driver.cs: Fix compilation files with full root path.
3729
3730 2005-09-25  Miguel de Icaza  <miguel@novell.com>
3731
3732         * report.cs (SymbolRelatedToPreviousError): Format the output so
3733         it does not use an open parenthesis that is never closed. 
3734
3735         * driver.cs: Follow coding guidelines
3736
3737 2005-09-18  Miguel de Icaza  <miguel@novell.com>
3738
3739         * driver.cs: Set InEmacs based on the environment variable EMACS. 
3740
3741         * location.cs (InEmacs): in this mode, do not report column
3742         location as it confuses Emacs.
3743
3744 2005-10-03  Raja R Harinath  <rharinath@novell.com>
3745
3746         * support.cs (SeekableStreamReader.Position): Don't error out when
3747         the requested position is just beyond the end of the current
3748         buffered data.
3749
3750 2005-09-28  Raja R Harinath  <rharinath@novell.com>
3751
3752         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
3753         try to keep in sync with the byte count of the underlying Stream.
3754         However, this limits us to a window size of 2048 characters: i.e.,
3755         the maximum lookahead of our lexer/parser can be 2048 characters.
3756
3757 2005-09-22  Martin Baulig  <martin@ximian.com>
3758
3759         * driver.cs: Removed a debugging FIXME.
3760
3761 2005-09-21  Raja R Harinath  <rharinath@novell.com>
3762
3763         * cs-parser.jay (type_arguments): Add CS1644 check.
3764         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
3765
3766 2005-09-15  Raja R Harinath  <rharinath@novell.com>
3767
3768         * Makefile (PROGRAM): Make profile specific.
3769         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
3770         the current directory.
3771
3772         Fix test-455.cs.
3773         * expression.cs (Invocation.EmitCall): Remove optimization on
3774         this_call since it doesn't handle 'this' being a value type.
3775
3776 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
3777
3778         * driver.cs: Ensure file handles are closed after parsing
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  Martin Baulig  <martin@ximian.com>
3797
3798         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
3799         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
3800
3801         * cs-parser.jay (delegate_declaration): Small fix for #75852.
3802
3803 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3804
3805         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
3806           to be a pointer type due to the spec 25.2, so check if declaring
3807           type is generic type definition. Fixed bug #75772.
3808
3809 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3810
3811         Fixed bug #75957.
3812         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
3813           both types are not defined by methods.
3814         * expression.cs : (Invocation.IsApplicable): it should work when
3815           the argument type is equal to the parameter type, not only when
3816           ImplicitConversionExists() returns true.
3817
3818 2005-09-02  Raja R Harinath  <rharinath@novell.com>
3819
3820         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3821         internal.
3822
3823         Fix #75941.
3824         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3825         flow-branching for LocalVariableReferences in case we were invoked
3826         from a MemberAccess.
3827         * expression.cs (LocalVariableReference.VerifyAssigned): New.
3828         Carved out of ...
3829         (LocalVariableReference.DoResolveBase): ... this.
3830         (MemberAccess.Resolve): Do the check that was disabled during
3831         SimpleNameResolve.
3832
3833 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3834
3835         * class.cs :
3836           (PartialContainer.Create): check abstract/sealed/static strictly
3837           but abstract/sealed can exist only at one side. Fixed bug #75883.
3838
3839 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
3840
3841         Fix #75945.
3842         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3843         specified, don't default to UnmanagedType.I4.
3844
3845 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3846
3847         * expression.cs : conditional operator should check possibly
3848           incorrect assign expression. Fixed bug #75946.
3849
3850 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3851
3852         Fix #75934.
3853         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3854         (ScopeInfo.EmitScopeType): Use it to construct field names from
3855         names of captured locals.
3856
3857         Fix #75929.
3858         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3859         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3860         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
3861         (ExplicitConversion): Remove enum cases already handled by
3862         implicit conversion.  Move implicit conversion check to the beginning.
3863         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3864         * expression.cs (ArrayCreation.EmitDynamicInitializers):
3865         Don't treat System.Enum as a struct.
3866
3867 2005-08-30  Jb Evain  <jbevain@gmail.com>
3868
3869         * attribute.cs: handles as expression in parameters.
3870
3871 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3872
3873         Fix #75802.
3874         * class.cs (TypeContainer.VerifyClsName): Don't use a
3875         PartialContainer when verifying CLS compliance.
3876         (AbstractPropertyEventMethod): Set Parent here, ...
3877         (PropertyMethod): ... not here.
3878
3879 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
3880
3881         * attribute.cs : escaped attribute name should not be allowed to be
3882           resolved (e.g. @class as classAttribute). Fixed bug #75930.
3883
3884 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3885
3886         Fix #75927.
3887         * convert.cs (ImplicitStandardConversionExists): Allow zero also
3888         when converting a long constant to unsigned long.
3889         * expression.cs (Invocation.OverloadResolve): Add sanity check to
3890         detect where IsApplicable and VerifyArgumentsCompat disagree.
3891
3892 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3893         and Carlos Alberto Cortez  <carlos@unixmexico.org>
3894
3895         Fix #75848.
3896         * class.cs (TypeContainer.CanElideInitializer): New helper.
3897         (TypeContainer.EmitFieldInitializers): Use it to determine if we
3898         can safely emitting the initializer of a field.
3899
3900 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3901
3902         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3903           allowed inside a switch (without loop). Fixed bug #75433.
3904
3905 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3906
3907         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3908         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3909
3910 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3911
3912         * driver.cs : kinda reverting the default encoding changes (not exact 
3913           revert since I noticed that "codepage:reset" might not work fine).
3914
3915 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3916
3917         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3918           Location. Now getter and setter store location correctly.
3919           (errors/cs0111-12.cs now reports the expected location.)
3920
3921 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3922
3923         * driver.cs : Use default encoding on the environment.
3924           Removed (now that) extra parameter for SeekableStreamReader.
3925         * support.cs : (SeekableStreamReader) third .ctor() argument for
3926           StreamReader is not required (always true). preamble size could
3927           be acquired in simpler and safe way.
3928
3929 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
3930
3931         * cs-parser.jay: report CS0642 at warning level 3
3932           and report CS0642 for an if else statement also
3933           fixes bug #74745. Patch by John Luke (and a bit
3934           modified by me).
3935           Removed extra CS0642 warning check for "while",
3936           "for" and "fixed".
3937         * statement.cs: In Block.Resolve(), CS0642 check
3938           is reimplemented to check a sequence of an empty
3939           statement and a block.
3940
3941           Both fix bug #66777.
3942
3943 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
3944
3945         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3946         detection until I fix it.
3947         
3948         * cs-tokenizer.cs: Changed error message.
3949         
3950         * cs-parser.jay: Fixed 2 error locations.
3951         
3952         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3953         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3954         properties.
3955         
3956         * enum.cs (GetSignatureForError): Fixed.
3957         
3958         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3959         method detection.
3960         
3961         * class.cs,
3962         * typemanager.cs (RegisterProperty): Removed.
3963         
3964         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3965
3966 2005-08-24  Raja R Harinath  <rharinath@novell.com>
3967
3968         Fix #75874.
3969         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3970         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3971
3972 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3973
3974         * expression.cs : tiny fix is required for not warning positive ulong.
3975           See test-441.cs.
3976
3977 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3978
3979         * expression.cs : add CS0652 check for constant and integral
3980           expression. Fixed bug #53974.
3981
3982 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3983
3984         * expression.cs : in DoNumericPromotions(), check if there is implicit
3985           conversion overload for string (to check CS0034). Fixed bug #52492.
3986
3987 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3988
3989         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3990
3991 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3992
3993         * ecore.cs : report location when it is *not* Null.
3994
3995 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3996
3997         * codegen.cs,
3998           ecore.cs,
3999           flowanalysis.cs,
4000           expression.cs:
4001           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
4002           correctly. Fixed bug #75721.
4003
4004 2005-08-23  Raja R Harinath  <rharinath@novell.com>
4005
4006         * support.cs (SeekableStreamReader.Position): Avoid an expensive
4007         loop that performs 'min (pos, char_count)'.
4008
4009         Fix #75862.
4010         * expression.cs (Unary.ResolveOperator): Don't discard implicit
4011         converted value in Operator.OnesComplement.
4012
4013 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
4014
4015         * anonymous.cs: If the anon method is pulled into a helper class,
4016         it needs to be `internal' not `private'. Fixes runtime behavior on
4017         msft. bug #75704
4018
4019 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
4020
4021         Fix #75803
4022         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
4023         is a partial class.
4024
4025 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
4026
4027         The big constants rewrite
4028         Fix #75746, #75685 and more
4029         As a side effect saved 1MB for MWF ;-)
4030         
4031         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
4032         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
4033         enum based for corlib compilation.
4034         
4035         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
4036         subtractions.
4037         
4038         * class.cs (FixedField.Define): Use ResolveAsConstant.
4039         
4040         * const.cs (IConstant): Interface constants and enums.
4041         (Const.ResolveValue): New method for constant resolvning.
4042         (ExternalConstant): Constants from imported assemblies.
4043         
4044         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
4045         conversion; like enums.
4046         (Constant.ToType): Converts this constant to different type.
4047         (Constant.Increment): Adds 1.
4048         
4049         * convert.cs (ImplicitConversionRequired): Simplified.
4050         
4051         * cs-parser.jay: Create EnumMember directly.
4052         
4053         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
4054         
4055         * doc.cs (GenerateEnumDocComment): Removed.
4056         
4057         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
4058         (ConvertIntLiteral): Removed.
4059         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4060         
4061         * enum.cs (EnumMember): Implement IConstant.
4062         (Enum.IsValidEnumConstant): Removed.
4063         (Enum.GetNextDefaultValue): Removed.
4064         (Enum.FindMembers): Updated.
4065         (Enum.GenerateDocComment): Iterate enum members.
4066         
4067         * expression.cs (Cast.TryReduce): Handle enums correctly.
4068         (New.Constantify): Made public.
4069         (MemberAccess.DoResolve): Removed contant specific if(s).
4070         
4071         * literal.cs (NullLiteral): Implement new abstract methods.
4072         
4073         * statement.cs (GotoCase.Resolve): Use new constant methods.
4074         (SwitchLabel.ResolveAndReduce): Use new constant methods.
4075         
4076         * typemanager.cs (LookupEnum): Removed.
4077         (IsEnumType): Fixed to work with corlib.
4078         (RegisterConstant): Removed.
4079         (LookupConstant): Removed.
4080         (GetConstant): Changed to work with IConstant.
4081
4082 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
4083
4084         * location.cs : Fixed overflown (>255) column number.
4085
4086 2005-08-03  Raja R Harinath  <rharinath@novell.com>
4087
4088         First cut of the qualified-alias-member feature.
4089         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4090         token.
4091         * cs-parser.jay (DOUBLE_COLON): New token.
4092         (namespace_or_type_name): Add rule for recognizing
4093         qualified-alias-members.
4094         (primary_expression): Likewise.
4095         (element_access): Allow QualifiedAliasMember as a possible
4096         type-bearing expression.
4097         (local_variable_type, local_variable_pointer_type): Likewise.
4098         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
4099         aliases in the current and enclosing namespace declarations.
4100         (NamespaceEntry.UsingAlias): Add CS0440 warning.
4101         * decl.cs (MemberName.is_double_colon): New.
4102         (MemberName.MemberName): Add new constructor for alias-member.
4103         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4104         * expression.cs (QualifiedAliasMember): New expression type.
4105
4106 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4107
4108         * location.cs : it borked when no argument was specified.
4109
4110 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4111
4112         * location.cs : tiny ToString() format fix.
4113
4114 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4115
4116         * statement.cs : oops, it was missing.
4117
4118 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4119
4120         A set of fixes for precise line/column location.
4121
4122         * location.cs :
4123           "token" field now holds a file/line "delta", a line number offset 
4124           from the segment, and a column number. See also:
4125           http://lists.ximian.com/pipermail/mono-devel-list/2004-
4126           December/009508.html
4127           Removed static IsNull. Use instance IsNull property instead.
4128         * cs-tokenizer.cs :
4129           For some tokens it stores Location. For Identifier it stores
4130           LocatedToken which is a pair of string name and location.
4131           Column numbers are adjusted only at getChar().
4132         * report.cs :
4133           Use Location.ToString() for reporting (it now contains column).
4134         * cs-parser.jay :
4135           Largely modified to use LocatedToken instead of
4136           string (IDENTIFIER), and to acquire Location from some tokens.
4137         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4138           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4139           codegen.cs :
4140           Now MemberName holds Location. DeclSpace.ctor() receives Location
4141           as a parameter. Removed extra parameters to all derived classes.
4142           Replaced Location.IsNull() with instance property.
4143         * assign.cs, expression.cs :
4144           Added .ctor() overload that omits Location.
4145         * attribute.cs :
4146           Added "nameEscaped" flag that indicates the identifier was escaped
4147           in the source file. This fixes bug #57047.
4148
4149 2005-09-02  Martin Baulig  <martin@ximian.com>
4150
4151         * class.cs: Make CS3005 a warning, not an error.
4152
4153 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
4154
4155         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4156         New method, looking for lo-case imported cls type.
4157
4158         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4159         here.
4160
4161         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4162
4163         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4164
4165         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4166         all_imported_types.
4167         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4168
4169         Optimized to save 3.5 MB for SWF compilation.
4170
4171 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4172
4173         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4174         (PartialContainer.Create): Moved logic AddToContainer.
4175         (PartialContainer.MarkForDuplicationCheck): Shares name.
4176         
4177         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4178         place.
4179         
4180         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4181         initialization.
4182         (Namespace.GetSignatureForError): New method.
4183         
4184         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4185         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4186
4187 2005-08-01  Raja R Harinath  <rharinath@novell.com>
4188
4189         Fix #75669.
4190         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4191         member lookup rather than qualifier_type, since qualifier_type can
4192         be null.
4193
4194 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4195
4196         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4197         enum member.
4198
4199 2005-07-31  Miguel de Icaza  <miguel@novell.com>
4200
4201         * statement.cs: Copy the local exception into the exception
4202         captured local.  Fixes 75674
4203
4204 2005-07-31  Raja R Harinath  <harinath@gmail.com>
4205
4206         Fix #75658.
4207         * expression.cs (Invocation.OverloadResolve): Don't report error
4208         CS1501 if error CS1502 has been reported.
4209         (New.DoResolve): Delegate CS1501 reporting to
4210         Invocation.OverloadResolve.
4211
4212         Fix #75656.
4213         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4214         invariant-meaning-in-block property in an enclosing block if
4215         necessary.
4216
4217 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
4218
4219         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4220         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4221         (Switch.CheckSwitch): Just save 50kb for SWF.
4222
4223 2005-07-27  Martin Baulig  <martin@ximian.com>
4224
4225         * anonymous.cs (CaptureContext.AddField): Added
4226         `AnonymousContainer am' argument; compute its toplevel scope if
4227         it's not already computed.  Fixes #75649.
4228
4229 2005-07-26  Raja R Harinath  <rharinath@novell.com>
4230
4231         Fix #75628.
4232         * class.cs (Constructor.Emit): Reset block to null if the block
4233         resolve fails.
4234
4235 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4236
4237         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4238
4239 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4240
4241         * class.cs (MethodData.Define): Check whether accessor implementing
4242         interface is public.
4243
4244         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4245
4246 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
4247
4248         Fix #57245
4249         * namespace.cs (LookupType): Moved same type check to...
4250         
4251         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4252         with the same name.
4253
4254 2005-07-21  Raja R Harinath  <rharinath@novell.com>
4255
4256         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4257         already found a typebuilder.
4258         * class.cs (MethodCore.IsDuplicateImplementation): Compare
4259         MemberNames, not strings.
4260
4261         * const.cs (Error_ExpressionMustBeConst): 
4262         Rename from Error_EpressionMustBeConst.
4263         * const.cs, class.cs, statement.cd: Update.
4264
4265 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
4266
4267         Fix #65573
4268
4269         * const.cs (Const.LookupConstantValue): Report missing contant expression
4270         everytime.
4271         (Error_EpressionMustBeConstant): Only one error method.
4272
4273         * class.cs, statement.c: Updated.
4274
4275 2005-07-20  Raja R Harinath  <rharinath@novell.com>
4276
4277         * statement.cs (Block.Flags): Add back HasVarargs.
4278         (Block.flags): Make protected.
4279         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4280
4281         * typemanager.cs (types, typecontainers, user_types): Remove.
4282         (UserTypes, TypeContainers): Likewise.
4283         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4284         (CleanUp, Reset): Update.
4285         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
4286         (GetNestedType): Use Type.GetNestedType.
4287         (CoreLookupType): Take two arguments, the namespace and the
4288         basename of the type.  Update to use the Namespace.Lookup
4289         mechanism.
4290         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4291         (RealMemberLookup): Use IsNestedChildOf instead of playing with
4292         string concatenation and substring matches.
4293         * class.cs, enum.cs, delegate.cs: Update to changes.
4294
4295 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
4296
4297         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4298         Expression and made virtual.
4299
4300         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4301         (ImplicitStandardConversionExists): Fixed `byte' typo ?
4302
4303         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4304
4305         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4306         error message.
4307
4308         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4309         change.
4310
4311 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
4312
4313         Fix #57707
4314         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4315         AssemblyCultureAttribute is not used on executable.
4316
4317         * rootcontext.cs,
4318         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4319
4320 2005-07-16  Raja R Harinath  <rharinath@novell.com>
4321
4322         Fix #60638.
4323         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4324         New.  Reports CS0252/CS0253.
4325         Mostly taken from preliminary patch by Duncak Mak.
4326         (Binary.DoResolveOperator): Store results of operator lookup.
4327         Use them to detect if we need to warn about unintended reference
4328         comparisons.
4329
4330 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4331
4332         Fix #72969.
4333         * namespace.cs (Namespace.Lookup): Add back location parameter.
4334         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
4335         * delegate.cs, ecore.cs, expression.cs: Update to changes.
4336
4337         * codegen.cs (EmitContext.DeclSpace): Make readonly.
4338         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4339         (Namespace.LookupType): ... this.
4340         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4341         of namespaces.
4342         * typemanager.cs (LookupTypeReflection): Remove buggy code that
4343         purported to handle pointers.
4344         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4345         CoreLookupType.
4346
4347 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
4348
4349         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4350         type as namespace.
4351
4352 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4353
4354         * namespace.cs (Namespace.Lookup): Drop location parameter.
4355         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
4356         (NamespaceEntry.Lookup): ... this.
4357         (NamespaceEntry.Error_AmbiguousTypeReference):
4358         Move here from DeclSpace.
4359         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4360         names ...
4361         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4362         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4363         Move to NamespaceEntry.
4364         * delegate.cs, expression.cs: Update to changes.
4365
4366 2005-08-31  Martin Baulig  <martin@ximian.com>
4367
4368         Committing a patch from Atsushi Enomoto for #75850.
4369
4370         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
4371         Prefer a generic enumerator over a non-generic one.
4372
4373 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
4374
4375         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4376         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4377
4378 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4379
4380         * driver.cs : reverting default encoding change as well as mcs.
4381
4382 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4383
4384         * driver.cs, support.cs : merged r48826.
4385           Marek Safer wrote:
4386           > could you integrate your mcs changes to gmcs otherwise
4387           > gmcs cannot compile some files.
4388
4389 2005-08-20  Martin Baulig  <martin@ximian.com>
4390
4391         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4392         scope if we don't already have it.
4393
4394         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4395         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4396         fixes #75867.
4397
4398 2005-07-31  Miguel de Icaza  <miguel@novell.com>
4399
4400         * statement.cs: Copy the local exception into the exception
4401         captured local.  Fixes 75674
4402
4403 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
4404
4405         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4406         type as namespace.
4407
4408 2005-08-12  Martin Baulig  <martin@ximian.com>
4409
4410         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
4411         for nested types here to avoid hitting the cache too early.
4412
4413 2005-08-09  Miguel de Icaza  <miguel@novell.com>
4414
4415         * enum.cs: On the new compiler CLS error 3005 is now a warning not
4416         an error. 
4417
4418 2005-08-03  Martin Baulig  <martin@ximian.com>
4419
4420         Make iterators in generic methods work; see gtest-191.cs.
4421
4422         * generic.cs
4423         (Constraints.Resolve): Protect against being called twice.
4424
4425         * class.cs
4426         (TypeContainer.GetClassBases): Make this `protected virtual'.
4427
4428         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
4429         (Iterator.GetClassBases): Override this and compute the base
4430         classes here.
4431         (Iterator.DefineNestedTypes): If we're a generic method, all our
4432         method type parameters become class type parameters on the proxy
4433         class.
4434
4435         * statement.cs
4436         (ToplevelBlock.Parameters): Make this a property, not a field.
4437         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
4438
4439 2005-08-03  Martin Baulig  <martin@ximian.com>
4440
4441         * typemanager.cs (TypeManager.IsSubclassOf): Use
4442         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
4443         (TypeManager.GetFullName_recursed): Improved.
4444
4445 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4446
4447         Fix #75417
4448         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
4449         Private accessor case, using TypeManager.IsPrivateAccessible instead of
4450         invocation_type == mi.DeclaringType, since the first one also checks
4451         other condition used by generic instances.
4452         
4453 2005-07-27  Martin Baulig  <martin@ximian.com>
4454
4455         * anonymous.cs (CaptureContext.AddField): Added
4456         `AnonymousContainer am' argument; compute its toplevel scope if
4457         it's not already computed.  Fixes #75649.
4458
4459 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
4460
4461         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4462         CheckAttributeType and refactored.
4463         (Attribute.ResolvePossibleAttributeType): Changed to reuse
4464         ResolveAsTypeTerminal error handling.
4465         (ResolveAsTypeTerminal): Introduced because of global attributes extra
4466         handling.
4467         (GetSignatureForError): Print errors in same way.
4468
4469         * class.cs,
4470         * codegen.cs: Reflect attribute GetSignatureForError change.
4471
4472         * ecore.cs,
4473         * expression.cs: Add silent parameter to ResolveAsTypeStep.
4474
4475         * namespace.cs (UsingEntry): Refactored to make fields private.
4476
4477         * assign.cs,
4478         statement.cs: Error_UnexpectedKind has extra parameter.
4479
4480 2005-07-14  Raja R Harinath  <rharinath@novell.com>
4481
4482         * ecore.cs (IAlias): Remove.
4483         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
4484         that implement the interface.
4485         * namespace.cs (Namespace): Likewise.
4486         (Namespace.declspaces): Renamed from 'defined_names'.
4487         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
4488         DeclSpace instead of an IAlias.
4489         * tree.cs (Tree.AddDecl): Update.
4490
4491 2005-07-12  Raja R Harinath  <rharinath@novell.com>
4492
4493         * statement.cs (Block.Flags); Remove HasVarargs.
4494         (Block.HasVarargs): Move to ToplevelBlock.
4495         (Block.ThisVariable, Block.AddThisVariable): Likewise.
4496         (Block.Variables): Make protected.  Initialize variable hashtable
4497         if necessary.
4498         (Block.AddVariable): Update.
4499         (Block.Resolve): Update to changes.
4500         (ToplevelBlock.HasVarargs): New boolean.
4501         (ToplevelBlock.ThisVariable): Move here from Block.
4502         (ToplevelBlock.AddThisVariable): Likewise.
4503         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
4504         * expression.cs (This.ResolveBase): Update to changes.
4505         (ArglistAccess.DoResolve): Likewise.
4506
4507 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4508
4509         Fix #75321
4510         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4511
4512         * class.cs (TypeContainer.VerifyMembers): Distinguish between
4513         not used and not used & assigned.
4514         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4515
4516 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4517
4518         Fix #75053
4519         * expression.cs (Is.DoResolve): null is never provided type.
4520
4521 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
4522
4523         Fix #52496
4524         * cs-parser.jay: Less strict event error rule to catch more errors.
4525
4526 2005-07-11  Martin Baulig  <martin@ximian.com>
4527
4528         * generic.cs (ConstructedType.CheckConstraints): Improve the check
4529         for the constructor constraint: we do not only have to check
4530         whether the class has a public constructor, but also ensure that
4531         it's parameterless.  Fixes #75492.
4532
4533 2005-07-11  Martin Baulig  <martin@ximian.com>
4534
4535         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
4536         between type parameters if they either have the reference type
4537         constraint or the class constraint.
4538
4539 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
4540
4541         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
4542
4543 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
4544
4545         Fix #74975
4546         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4547         (ExtractSecurityPermissionSet): Cope with self referencing security
4548         attributes properly.
4549
4550         * driver.cs (SetOutputFile): Made public property OutputFile.
4551
4552 2005-07-07  Raja R Harinath  <rharinath@novell.com>
4553
4554         Fix #75486.
4555         * class.cs (TypeContainer.first_nonstatic_field): Rename from
4556         has_nonstatic_fields.  Make into a FieldBase pointer.
4557         (TypeContainer.AddField): Add CS0282 check.
4558         (TypeContainer.EmitType): Update.
4559
4560 2005-07-06  Miguel de Icaza  <miguel@novell.com>
4561
4562         * cs-tokenizer.cs (consume_identifier): Do not create strings to
4563         compare if they start with __.
4564
4565 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4566
4567         * statement.cs (Switch.SwitchGoverningType): Only look at
4568         UserCasts that don't need implicit standard conversions to one of
4569         the allowed switch types (Fixes test-322.cs).
4570         (LocalInfo.Resolve): Re-enable sanity-test.
4571
4572 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
4573
4574         * cs-tokenizer.cs (consume_identifier): Detect double undescores
4575         
4576         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4577         
4578         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4579
4580 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4581
4582         Fix #75472.
4583         * ecore.cs (SimpleName.GetSignatureForError): Add.
4584         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4585         (MemberAccess.GetSignatureForError): Add.
4586
4587 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
4588  
4589         The big error and warning messages review.
4590         
4591         * anonymous.cs,
4592         * assign.cs,
4593         * attribute.cs,
4594         * class.cs,
4595         * codegen.cs,
4596         * convert.cs,
4597         * cs-parser.jay,
4598         * cs-tokenizer.cs,
4599         * decl.cs,
4600         * delegate.cs,
4601         * doc.cs,
4602         * driver.cs,
4603         * ecore.cs,
4604         * enum.cs,
4605         * expression.cs,
4606         * flowanalysis.cs,
4607         * iterators.cs,
4608         * literal.cs,
4609         * location.cs,
4610         * modifiers.cs,
4611         * namespace.cs,
4612         * parameter.cs,
4613         * pending.cs,
4614         * report.cs,
4615         * rootcontext.cs,
4616         * statement.cs,
4617         * support.cs,
4618         * tree.cs,
4619         * typemanager.cs: Updated.
4620         
4621         * class.cs: (MethodCore.SetYields): Moved here to share.
4622         (PropertyMethod.Define): Moved iterator setup here.
4623         
4624         * iterators.cs: Add orig_method to have full access to parent
4625         container.
4626
4627 2005-07-05  Raja R Harinath  <rharinath@novell.com>
4628
4629         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4630         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4631         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4632         variable of struct type.
4633         * expression.cs (Unary.ResolveOperator): Update to change.
4634         (Indirection.VerifyFixed): Likewise.
4635         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4636         (ParameterReference.VerifyFixed): Value parameters are fixed.
4637         (This.VerifyFixed): Treat 'this' as a value parameter.
4638         * statement.cs (LocalInfo.IsFixed): Remove.
4639
4640 2005-07-01  Martin Baulig  <martin@ximian.com>
4641
4642         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4643         `ec.EmitThis ()' to get the correct scope.
4644
4645 2005-07-01  Martin Baulig  <martin@ximian.com>
4646
4647         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4648         instance is a ParameterReference; fixes #75299.
4649
4650 2005-06-30  Raja R Harinath  <rharinath@novell.com>
4651
4652         Fix #75412.
4653         * expression.cs (Indexers.map): Remove.
4654         (Indexers.Append): Filter out inaccessible setters and getters.
4655         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4656
4657         Fix #75283.
4658         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
4659         Refactored from ...
4660         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4661         (FieldExpr.Emit, PropertyExpr.Emit): Update.
4662         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4663         * expression.cs (Invocation.EmitCall): Add CS0120 check.
4664
4665 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
4666
4667         Fix #75322
4668         * class.cs (FieldBase.GetInitializerExpression): One more field
4669         for backup.
4670
4671 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4672
4673         * pending.cs: Do not define a proxy if the base method is virtual,
4674         it will be picked up by the runtime (bug 75270).
4675
4676 2005-07-08  Martin Baulig  <martin@ximian.com>
4677
4678         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4679         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4680
4681 2005-07-07  Martin Baulig  <martin@ximian.com>
4682
4683         * generic.cs (ConstructedType.CheckConstraint): Use
4684         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
4685         called recursively; fixes #75329.
4686
4687 2005-07-06  Martin Baulig  <martin@ximian.com>
4688
4689         * generic.cs (TypeManager.InferTypeArguments): Added support for
4690         anonymous methods; fixes #75461.
4691
4692 2005-07-01  Martin Baulig  <martin@ximian.com>
4693
4694         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4695         `ec.EmitThis ()' to get the correct scope.
4696
4697 2005-07-01  Martin Baulig  <martin@ximian.com>
4698
4699         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
4700         instance is `This'; fixes #75299.
4701
4702 2005-06-30  Martin Baulig  <martin@ximian.com>
4703
4704         * class.cs (Indexer): Implement IIteratorContainer; added support
4705         for iterators in indexers.
4706
4707         * codegen.cs
4708         (EmitContext.CurrentIterator): Make this a property, not a field.
4709
4710         * anonymous.cs (AnonymousContainer.Iterator): New public property.
4711
4712 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4713
4714         * pending.cs: Do not define a proxy if the base method is virtual,
4715         it will be picked up by the runtime (bug 75270).
4716
4717 2005-06-28  Martin Baulig  <martin@ximian.com>
4718
4719         * cs-parser.jay (interface_method_declaration): Avoid a
4720         reduce/reduce conflict by moving some of the code into a separate
4721         `interface_method_declaration_body' rule; fixes #75368.
4722
4723 2005-06-28  Martin Baulig  <martin@ximian.com>
4724
4725         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
4726         array check after the check for TypeBuilder's.
4727
4728 2005-06-21  Raja R Harinath  <rharinath@novell.com>
4729
4730         * convert.cs (FindMostEncompassedType): Add two trivial special
4731         cases (number_of_types == 0 || number_of_types == 1).
4732         (FindMostEncompasingType): Likewise.
4733
4734 2005-06-17  Raja R Harinath  <rharinath@novell.com>
4735
4736         Some cleanups preparing for the fix of #75283.
4737         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4738         error testing.
4739         (EventExpr.InstanceResolve): Likewise.
4740         (EventExpr.DoResolve): Remove redundant checks.
4741
4742 2005-06-08  Miguel de Icaza  <miguel@novell.com>
4743
4744         * class.cs: Small fix.
4745
4746 2005-06-08  Raja R Harinath  <rharinath@novell.com>
4747
4748         Fix #75160.
4749         * class.cs (GetPartialBases): Fix return value check of
4750         part.GetClassBases.
4751
4752 2005-06-07  Raja R Harinath  <rharinath@novell.com>
4753
4754         Ensure that partial classes are registered in their enclosing
4755         namespace.  Initial part of fix of #75160.
4756         * tree.cs (Tree.RecordDecl): Add new namespace argument.
4757         Register declspace with namespace here, not in
4758         DeclSpace.RecordDecl.
4759         * cs-parser.jay: Pass namespace to RecordDecl.
4760         * class.cs (PartialContainer.Create): Likewise.
4761         (ClassPart.DefineType): New sanity-check.  Throws an exception if
4762         called.
4763         * decl.cs (Declspace.RecordDecl): Remove.
4764         * namespace.cs (NamespaceEntry.DefineName): Remove.
4765
4766 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4767
4768         * rootcontext.cs: Reset TargetExt as well.
4769
4770 2005-06-03  Raja R Harinath  <rharinath@novell.com>
4771
4772         * ecore.cs (Expression.Resolve): Emit CS0654 error when
4773         -langversion:ISO-1.
4774
4775 2005-06-02  Raja R Harinath  <rharinath@novell.com>
4776
4777         Fix #75080, cs0119.cs.
4778         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
4779         of ...
4780         (Expression.Resolve): ... this.  Use it.  Remove bogus code
4781         allowing ExprClass.Type and ExprClass.Namespace for
4782         ResolveFlags.VariableOrValue.
4783         (Expression.Resolve) [1-argument variant]: Change default resolve
4784         flags based on language version.
4785         (Expression.Error_UnexpectedKind): Use a simple string array
4786         rather than an ArrayList.
4787         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4788         not ExprClass.Type.
4789         (TypeOfVoid.DoResolve): Likewise.
4790         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
4791         flags argument -- it always has the same value.
4792
4793 2005-05-31  Raja R Harinath  <rharinath@novell.com>
4794
4795         Fix #75081.
4796         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4797         Use it in the error message.
4798         * assign.cs, expression.cs, statement.cs: Update.
4799
4800 2005-05-30  Raja R Harinath  <rharinath@novell.com>
4801
4802         Fix #75088.
4803         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4804         the "almostMatchedMember" case too.
4805         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4806         that failed the accessibility checks to 'almost_match'.
4807
4808 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
4809
4810         * attribute.cs: Use internal MethodBuilder methods to set
4811         ExactSpelling and SetLastError on PInvoke methods, instead
4812         of passing them via charset.  Fixes #75060.
4813
4814 2005-05-27  Raja R Harinath  <rharinath@novell.com>
4815
4816         * parameter.cs (Parameter): Remove TODO comment.
4817         (Parameter.DefineParameter): Remove Location parameter.
4818         (Parameters.LabelParameters): Likewise.
4819         * class.cs (Constructor.Emit): Update to change.
4820         (MethodData.Emit): Likewise.
4821         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
4822         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4823
4824 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
4825
4826         * parameter.cs,
4827           Removed Parameters.Location and added Parameter.Location instead.
4828           Removed Location parameter from Emit() and GetSignature().
4829         * anonymous.cs,
4830           class.cs,
4831           cs-parser.jay,
4832           delegate.cs,
4833           iterators.cs,
4834           statement.cs :
4835           Modified all related calls.
4836
4837 2005-06-21  Martin Baulig  <martin@ximian.com>
4838
4839         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
4840         left-hand side is not a nullable type; fixes #75328.
4841
4842 2005-06-21  Martin Baulig  <martin@ximian.com>
4843
4844         * typemanager.cs
4845         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
4846         (TypeManager.GetFullNameSignature): Likewise.
4847
4848         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
4849         `source.FullName' and `target.FullName' to check whether there are
4850         two conflicting definitions.
4851
4852 2005-06-21  Martin Baulig  <martin@ximian.com>
4853
4854         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
4855         a BoxedCast - also for reference types - to be compatible with csc.
4856
4857 2005-06-21  Martin Baulig  <martin@ximian.com>
4858
4859         * expression.cs (MemberAccess.DoResolve): Add support for nested
4860         types in a generic instance; fixes #75320.
4861
4862 2005-06-20  Martin Baulig  <martin@ximian.com>
4863
4864         * generic.cs (TypeManager.InferType): Also walk the class
4865         hierarchy for generic instances; fixes #75261.
4866
4867 2005-06-17  Martin Baulig  <martin@ximian.com>
4868
4869         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
4870         to make things work for corlib.
4871
4872 2005-06-15  Martin Baulig  <martin@ximian.com>
4873
4874         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
4875         obsolete `SecurityAction' values.
4876
4877 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4878
4879         * rootcontext.cs: Reset TargetExt as well.
4880         
4881 2005-06-09  Martin Baulig  <martin@ximian.com>
4882
4883         * delegate.cs (Delegate.VerifyMethod): Added
4884         `MethodGroupExpr old_mg' argument; inherit its
4885         `HasTypeParameters'; fix #75085.
4886
4887 2005-06-09  Martin Baulig  <martin@ximian.com>
4888
4889         * expression.cs (Invocation.OverloadResolve): Correctly handle
4890         generic methods for the SetMemberIsUsed(); fix #75064.
4891
4892 2005-06-09  Martin Baulig  <martin@ximian.com>
4893
4894         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
4895         fixes #75062.
4896
4897 2005-06-08  Martin Baulig  <martin@ximian.com>
4898
4899         * cs-parser.jay (nullable_type_or_conditional): If we put the
4900         nullable back and our `type' is a `ComposedCast', remove the
4901         nullable from it.  Fixes #75156.
4902
4903         * expression.cs (ComposedCast.RemoveNullable): New public method.
4904
4905 2005-06-08  Martin Baulig  <martin@ximian.com>
4906
4907         The big Iterators rewrite :-)
4908
4909         * iterators.cs: Rewrite this to use the anonymous methods framework.
4910
4911         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4912         before the TypeContainers; see 2test-21.cs.
4913
4914         * class.cs
4915         (TypeContainer.DefineType): Don't create a new EmitContext if we
4916         already have one (this only happens if we're an Iterator).
4917         (TypeContainer.Define): Also call Define() on all our iterators.
4918         (Method.CreateEmitContext): Added support for iterators.
4919
4920         * anonymous.cs
4921         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4922         (AnonymousContainer.CreateMethodHost): Moved here from
4923         AnonymousMethod and made abstract.
4924         (AnonymousContainer.CreateScopeType): New abstract method.
4925         (AnonymousContainer.IsIterator): New public property.
4926         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4927         get the ScopeTypeBuilder rather than manually defining it here. 
4928         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4929         iterators here.
4930
4931         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4932         before RootContext.DefineTypes().
4933
4934         * codegen.cs (EmitContext.RemapToProxy): Removed.
4935         (EmitContext.CurrentAnonymousMethod): Changed type from
4936         AnonymousMethod -> AnonymousContainer.
4937         (EmitContext.ResolveTopBlock): Protect from being called twice.
4938         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4939         (EmitContext.EmitThis): Removed the iterators hacks; use the
4940         anonymous methods framework for that.
4941
4942         * statement.cs
4943         (ToplevelBlock.Container): Make this a property, not a field.
4944         (ToplevelBlock.ReParent): New public method; move the
4945         ToplevelBlock into a new container.
4946         (Foreach.TemporaryVariable): Simplify.
4947
4948 2005-06-05  Martin Baulig  <martin@ximian.com>
4949
4950         * statement.cs (LocalInfo.CompilerGenerated): New flag.
4951         (Block.AddTemporaryVariable): New public method; creates a new
4952         `LocalInfo' for a temporary variable.
4953         (Block.EmitMeta): Create the LocalBuilders for all the temporary
4954         variables here.
4955         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4956         non-iterator variables.
4957
4958 2005-06-05  Martin Baulig  <martin@ximian.com>
4959
4960         * statement.cs (Foreach.TemporaryVariable): Create the
4961         LocalBuilder in the Emit phase and not in Resolve since in some
4962         situations, we don't have an ILGenerator during Resolve; see
4963         2test-19.cs for an example.
4964
4965 2005-06-04  Martin Baulig  <martin@ximian.com>
4966
4967         The big Foreach rewrite - Part II.
4968
4969         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4970         with `PropertyInfo ienumerator_getcurrent'.
4971
4972         * codegen.cs (VariableStorage): Removed.
4973
4974         * statement.cs
4975         (Foreach): Derive from Statement, not ExceptionStatement.
4976         (Foreach.CollectionForeach): New nested class.  Moved all the code
4977         dealing with collection foreach here.
4978         (Foreach.ForeachHelperMethods): Removed.
4979         (Foreach.TemporaryVariable): Implement IMemoryLocation.
4980
4981 2005-05-23  Martin Baulig  <martin@ximian.com>
4982
4983         * statement.cs (Try.DoResolve): Don't create a `finally' if we
4984         don't need to.  Fix #75014.
4985
4986 2005-05-26  Raja R Harinath  <rharinath@novell.com>
4987
4988         Improve user-defined conversion handling.
4989         * convert.cs (GetConversionOperators): Rewrite.  Return only the
4990         applicable operators.
4991         (AddConversionOperators): New.  Helper for GetConversionOperators.
4992         (FindMostEncompassedType, FindMostEncompassingType): Verify that
4993         there is only one most encompassed/encompassing type.
4994         (FindMostSpecificSource, FindMostSpecificTarget): Remove
4995         "applicable operator" handling.
4996         (UserConversion): Move cache here from GetConversionOperators.
4997         Directly cache the chosen operator, rather than the whole
4998         MethodGroup.
4999         (ExplicitNumericConversion): Fix buggy implementation of Decimal
5000         case.  Allow conversion of decimal to sbyte and byte too.
5001         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5002         New static methods.  Used to avoid allocating EmptyExpressions in
5003         convert.cs.
5004
5005 2005-05-24  Duncan Mak  <duncan@novell.com>
5006
5007         * ecore.cs (CastFromDecimal): New class for casting a decimal to
5008         another class, used in Convert.ExplicitNumericConversion.
5009         (CastToDecimal): New class, similar to above, but casts to
5010         System.Decimal, used in Convert.ImplicitNumericConversion and also
5011         in explicit convesion from double/float to decimal.
5012
5013         * convert.cs (ImplicitNumericConversion): Handle implicit
5014         conversions to System.Decimal.
5015         (ExplicitNumericConversion): handle explicit conversions to
5016         System.Decimal.
5017
5018         This fixes #68711.
5019         
5020 2005-05-20  Miguel de Icaza  <miguel@novell.com>
5021
5022         * typemanager.cs: Do not throw an exception in the TypeBuilder
5023         case, we take care of it on the TypeCode.
5024
5025 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
5026         
5027         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
5028         is back.
5029         
5030         * cs-parser.jay: Catch more lexical errors.
5031         
5032         * report.cs: Add one more Error method.
5033         
5034         * rootcontext.cs,
5035         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
5036
5037 2005-05-20  Martin Baulig  <martin@ximian.com>
5038
5039         * class.cs (TypeContainer.CircularDepException): Removed.
5040         (TypeContainer.DefineType): Removed the `InTransit' stuff.
5041         (TypeContainer.CheckRecursiveDefinition): Check for circular class
5042         (CS0146) and interface (CS0529) dependencies here.
5043
5044 2005-05-20  Martin Baulig  <martin@ximian.com>
5045
5046         * expression.cs (New.DoResolve): Move the CS0712 check above the
5047         CS0144 check; otherwise it can never be reached.
5048
5049 2005-05-20  Martin Baulig  <martin@ximian.com>
5050
5051         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
5052
5053 2005-05-20  Martin Baulig  <martin@ximian.com>
5054
5055         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
5056
5057         * typemanager.cs (TypeManager.IsAttributeType): New public method.
5058
5059 2005-05-19  Martin Baulig  <martin@ximian.com>
5060
5061         * delegate.cs
5062         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
5063         to disable error reporting.
5064
5065         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
5066         here since we don't want to report an error; see the new test-336.cs.
5067
5068 2005-05-19  Raja R Harinath  <rharinath@novell.com>
5069
5070         * statement.cs (ToplevelBlock.GetParameterReference)
5071         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
5072         Move here from class Block.
5073         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
5074         * expression.cs (ParameterReference.DoResolveBase): Likewise.
5075
5076 2005-05-18  Martin Baulig  <martin@ximian.com>
5077
5078         Fix #74978.
5079
5080         * flowanalysis.cs
5081         (FlowBranching.Reachability): Add non-static public And() and Or()
5082         methods.
5083         (FlowBranchingSwitch): New class; do the `break_origins' thing
5084         like in FlowBranchingLoop.
5085         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5086         reachability, not just locals and parameters.
5087         (FlowBranching.MergeChild): Remove some of the hacks for loop and
5088         switch; MergeBreakOrigins() now takes care of that.
5089
5090 2005-05-18  Martin Baulig  <martin@ximian.com>
5091
5092         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5093         a loop and may leave it, reset the barrier; fixes #74974.
5094
5095 2005-05-16  Raja R Harinath  <rharinath@novell.com>
5096
5097         Fix test-382.cs.  Emit values of decimal constants.
5098         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5099         Carved out of ...
5100         (TypeContainer.AddField): ... this.
5101         (TypeContainer.EmitFieldInitializers): Allow the list of fields
5102         with initializers to include 'Const's.
5103         (ClassPart.RegisterFieldForInitialization): Forward to
5104         PartialContainer.
5105         * const.cs (Const.Const): Pass initializer to base class.
5106         (Const.Define): In case of decimal constants, register them for
5107         initialization in a static constructor.
5108
5109 2005-05-14  Martin Baulig  <martin@ximian.com>
5110
5111         * statement.cs (Block.Resolve): Correctly handle unreachable code;
5112         do not call ResolveUnreachable() on unreachable statements in
5113         here, see the comment in the source code.
5114
5115 2005-05-13  Raja R Harinath  <rharinath@novell.com>
5116
5117         Fix #74934.
5118         * expression.cs (BinaryResolveOperator): If one of the operands of
5119         an equality comparison is 'null' and the other is a pointer type,
5120         convert the null to a NullPointer.
5121         * convert.cs (ImplicitReferenceConversion): If the expression is a
5122         NullLiteral and the target type is a pointer type, return a
5123         NullPointer instead.
5124         (ImplicitConversionStandard): Likewise.
5125
5126 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
5127         
5128         * cs-parser.jay: Set readonly context based on special constructs.
5129         
5130         * expression.cs (LocalVariableReference.DoResolveBase): Improved
5131         readonly variable error handling.
5132         
5133         * rootcontext.cs (EmitCode): Don't verify members when error
5134         occurred.
5135         
5136         * statement.cs (LocalInfo): Add reaodnly context information.
5137         (SetReadOnlyContext, GetReadOnlyContext): New methods.
5138
5139 2005-05-17  Martin Baulig  <martin@ximian.com>
5140
5141         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5142         #70970. 
5143
5144 2005-05-13  Martin Baulig  <martin@ximian.com>
5145
5146         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
5147         handle unreachable blocks.
5148
5149 2005-05-13  Martin Baulig  <martin@ximian.com>
5150
5151         * class.cs
5152         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
5153         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
5154         #74905. 
5155
5156 2005-05-13  Martin Baulig  <martin@ximian.com>
5157
5158         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5159         instance variable, not a local.  Fix #74873.
5160         (Block.ResolveUnreachable): Set it to true here.
5161
5162 2005-05-12  Martin Baulig  <martin@ximian.com>
5163
5164         * cs-parser.jay (property_declaration): Pass the `current_class',
5165         not the `current_container' to Property's .ctor.  Fixes #74912.
5166
5167 2005-05-11  Martin Baulig  <martin@ximian.com>
5168
5169         * typemanager.cs (Closure): Copy this from MCS and merge all the
5170         GMCS-specific changes into it.
5171
5172 2005-05-12  Raja R Harinath  <harinath@gmail.com>
5173
5174         Fix #74920.
5175         * typemanager.cs (unmanaged_enclosing_types): New.
5176         (IsUnmanagedType): Avoid infloops by using
5177         'unmanaged_enclosing_types' to talk with recursive invocations.
5178
5179 2005-05-11  Duncan Mak  <duncan@novell.com>
5180
5181         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5182         continuing to process for 'arg'.
5183         (handle_preprocessing_directive): Check the argument of the #endif
5184         directive and report error CS1025 if there are any trailing
5185         characters.
5186
5187         According to the C# spec, having even whitespace after the #endif
5188         directive is illegal; however, because we call arg.TrimEnd ()
5189         beforehand, we have the same behavior as csc, allowing whitespace
5190         after the directive.
5191
5192         Fixes #74892.
5193
5194 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
5195
5196         Fix #74863.
5197         
5198         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5199         (Constructor.GetObsoleteAttribute): Implemented correctly.
5200
5201 2005-05-10  Martin Baulig  <martin@ximian.com>
5202
5203         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
5204         resolve the type; fixes #74864.
5205         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
5206         in DoResolve(); fixes #74862.
5207
5208 2005-05-10  Martin Baulig  <martin@ximian.com>
5209
5210         * support.cs (ReflectionParameters.ParameterModifier): Use
5211         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5212         and `ParameterAttributes.In'.  Fixes #74884.
5213
5214 2005-05-10  Martin Baulig  <martin@ximian.com>
5215
5216         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
5217         the cache if we're just looking for `MemberTypes.NestedType' in a
5218         generic instance.
5219
5220         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
5221         constraints if we're still resolving the type tree.
5222         (Expression.MemberLookup): If we're resolving the type tree, only
5223         look for `MemberTypes.NestedType' since we're only interested in
5224         getting types.
5225
5226         * class.cs (TypeContainer.DefineType): Don't resolve the type
5227         parameters here; do this later in ResolveType() after the type
5228         tree has been resolved.
5229         (TypeContainer.ResolveType): New public method; this is called
5230         after the type tree is resolved and before the types are being
5231         populated.  We resolve the generic constraints here.
5232         (TypeContainer.DoDefineMember): Check the constraints on our base
5233         class and interfaces.
5234
5235         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
5236         set the `ResolvingTypeTree' flag on the EmitContext.
5237
5238         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
5239
5240 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
5241
5242         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5243         
5244         * expression.cs (Argument.GetParameterModifier): Turned to property.
5245         (Invocation.Error_InvalidArguments): Add more descriptive errors.
5246         
5247         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5248         its C# equivalent.
5249         
5250 2005-05-09  Raja R Harinath  <rharinath@novell.com>
5251
5252         Fix #74852.
5253         * decl.cs (MemberCache.AddMethods): Register override methods,
5254         rather than non-override methods.
5255         * typemanager.cs (RegisterOverride): New.
5256         (IsOverride): Update.
5257
5258 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
5259
5260         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
5261
5262 2005-05-06  Martin Baulig  <martin@ximian.com>
5263
5264         * attribute.cs
5265         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
5266         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
5267
5268 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
5269
5270         Fix #73105.
5271         
5272         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5273         recursive declaration.
5274         
5275         * statement.cs (Block.ResolveMeta): Report any error in resolving.
5276         
5277 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
5278
5279         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5280         
5281         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5282
5283 2005-05-05  Raja R Harinath  <rharinath@novell.com>
5284
5285         Fix #74797.
5286         * decl.cs (DeclSpace.FamilyAccessible): 
5287         Use TypeManager.IsNestedFamilyAccessible.
5288
5289         Fix reopened #64812.
5290         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5291         internal'.
5292
5293 2005-05-04  Raja R Harinath  <rharinath@novell.com>
5294             Abin Thomas  <projectmonokochi@rediffmail.com>
5295             Anoob V E  <projectmonokochi@rediffmail.com>
5296             Harilal P R  <projectmonokochi@rediffmail.com>
5297
5298         Fix #64812.
5299         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5300         allow access to all static members.
5301
5302 2005-05-04  Martin Baulig  <martin@ximian.com>
5303
5304         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5305
5306 2005-05-04  Martin Baulig  <martin@ximian.com>
5307
5308         Fix #74655.
5309
5310         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5311         section at the end; make things work if `default' is not the last
5312         section.        
5313
5314 2005-05-04  Martin Baulig  <martin@ximian.com>
5315
5316         Fix #70400.
5317
5318         * statement.cs (Switch): Replaced the `got_default' field with a
5319         `default_section' one.
5320         (Switch.CheckSwitch): Set `default_section' here.
5321         (Switch.Resolve): If we're a constant switch and the constant is
5322         not found, use the default section.
5323
5324 2005-05-03  Martin Baulig  <martin@ximian.com>
5325
5326         * expression.cs (ArrayAccess.EmitGetLength): New public method.
5327
5328         * statement.cs (Foreach.ArrayForeach): New nested class.
5329         (Foreach.TemporaryVariable): New nested class.
5330         (Foreach.EmitArrayForeach): Removed; this is now in the new
5331         ArrayForeach class.
5332
5333 2005-05-03  Raja R Harinath  <rharinath@novell.com>
5334
5335         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
5336         more conservative.
5337         (VerifyPendingMethods): Revert change below.
5338
5339         * typemanager.cs (IsOverride, RegisterNonOverride): New.
5340         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5341         that used to trigger warning -28.  Remove warning -28.
5342         * expression.cs (Invocation.OverloadResolve): Use
5343         TypeManager.IsOverride to distinguish override methods.
5344
5345         Fix #74773.
5346         * pending.cs (VerifyPendingMethods): If a base type implements the
5347         requested interface, don't bother checking individual methods of
5348         the base type.  As a side-effect, this prevents the creation of
5349         unnecessary proxies.
5350
5351 2005-05-02  Martin Baulig  <martin@ximian.com>
5352
5353         Fix #70182.
5354
5355         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5356         Also `And' the locals if the old vector is null.
5357         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5358         null; in this case we basically reset all the variables.        
5359
5360 2005-05-02  Martin Baulig  <martin@ximian.com>
5361
5362         Fix #74529.
5363
5364         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5365         Added `FlowBranching branching' argument; always `and' the
5366         variables instead of `or'ing them unless we're an infinite loop.
5367
5368         * statement.cs (While.Resolve): Create a new sibling unless we're
5369         infinite.       
5370
5371 2005-05-02  Martin Baulig  <martin@ximian.com>
5372
5373         Fix #70140.
5374
5375         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5376         arguments; use it instead of creating a new TopLevelBlock.
5377         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5378         our ConstructorInitializer.
5379
5380         * statement.cs
5381         (TopLevelBlock.TopLevelBranching): New public property.
5382         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5383         and create our `TopLevelBranching'.
5384
5385         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5386         anonymous method host, use `block.TopLevelBranching' rather than
5387         creating a new branching.
5388
5389 2005-04-20  Miguel de Icaza  <miguel@novell.com>
5390
5391         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5392         a ScopeInfo, if any of the current children is a child of the new
5393         entry, move those children there.
5394
5395 2005-04-30  Martin Baulig  <martin@ximian.com>
5396
5397         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5398         at the beginning of a SwitchSection.  Fix #73335.
5399
5400 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
5401
5402         Fix #74378
5403         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5404         
5405         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5406         (FieldExpr.DoResolve): Obsolete members are ignored for field
5407         initializers.
5408         
5409 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
5410
5411         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5412         of arrays detection.
5413
5414         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5415         verification.
5416         (Field.VerifyClsCompliance): Volatile fields are not compliant.
5417
5418         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5419         arrays report.
5420
5421 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
5422
5423         * cs-parser.jay: Use the prefered version of -unsafe in error
5424         message.
5425
5426 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
5427
5428         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5429         circumstances.
5430
5431 2005-04-20  John Luke  <john.luke@gmail.com>
5432
5433         * driver.cs: fix typo in error message, --outout to --output
5434
5435 2005-04-30  Martin Baulig  <martin@ximian.com>
5436
5437         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
5438         handle the .NET 2.x security attributes.
5439
5440 2005-04-30  Martin Baulig  <martin@ximian.com>
5441
5442         * typemanager.cs
5443         (TypeManager.ExpandInterfaces): Don't add things twice.
5444
5445         * class.cs
5446         (TypeContainer.VerifyClsCompliance): Allow generic instances.
5447
5448 2005-04-29  Martin Baulig  <martin@ximian.com>
5449
5450         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
5451
5452         * anonymous.cs: Added support for anonymous generic methods.
5453
5454 2005-04-29  Martin Baulig  <martin@ximian.com>
5455
5456         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
5457         generic instances.
5458
5459 2005-04-29  Martin Baulig  <martin@ximian.com>
5460
5461         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
5462
5463         * expression.cs (New.DoResolve): Fix the CS0304 check.
5464
5465 2005-04-29  Martin Baulig  <martin@ximian.com>
5466
5467         * typemanager.cs (TypeManager.GetFullName): Updated to the new
5468         naming schema.
5469
5470         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
5471         explicit interface implementation, compare the interface types.
5472         (MethodData.Define): Use the new naming scheme from the latest
5473         .NET 2.x beta2.
5474         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
5475
5476         * decl.cs (MemberName.GetMemberName): Removed.
5477         (MemberName.MethodName, FullName): New properties.
5478
5479 2005-04-25  Raja R Harinath  <rharinath@novell.com>
5480
5481         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
5482
5483 2005-04-22  Martin Baulig  <martin@ximian.com>
5484
5485         * generic.cs (GenericMethod): Create the EmitContext in the
5486         `Define()'; in `Define(MethodBuilder)', create the type parameters
5487         before calling `Define()'.  Fixes #73933.
5488
5489 2005-04-22  Martin Baulig  <martin@ximian.com>
5490
5491         * generic.cs
5492         (Constraints.Resolve): Make things work wrt. the new type lookup system.
5493         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
5494
5495         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
5496         ConstructedType, check its constraints.
5497
5498 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
5499
5500         * codegen.cs (InRefOutArgumentResolving): New field.
5501         
5502         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5503         fields outside contructor.
5504         
5505         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5506         
5507 2005-04-19  Miguel de Icaza  <miguel@novell.com>
5508
5509         * anonymous.cs (CaptureContext.EmitParameterInstance): The
5510         parameter code was not completed ever, so it was not as up-to-date
5511         as local variables.  Must finish it.
5512
5513         The bug fix was to compare the Toplevel of the block, not the
5514         current block.  Thanks for Ben for pointing this out. 
5515
5516 2005-04-19  Raja R Harinath  <rharinath@novell.com>
5517
5518         * decl.cs (AddMethods): Use the declaring type of the problem
5519         method to determine if we want to squash a warning.
5520
5521 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
5522
5523         * attribute.cs: Removed debug output.
5524
5525         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5526         
5527         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5528         Report.Stderr.
5529         
5530 2005-04-18  Raja R Harinath  <rharinath@novell.com>
5531
5532         Fix #74481.
5533         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5534         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5535         all null comparisons against reference types.
5536
5537 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
5538
5539         Fix# 74565
5540         * class.cs (TypeContainer.CircularDepException) New nested
5541         exception class.
5542         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5543         (TypeContainer.DefineType): Removed error, reset InTransit before
5544         exit.
5545         (Class.DefineType): Throw exception when is in Transit.
5546         Catch exception and report error.
5547         (Struct.DefineType): Throw exception when is in Transit.
5548         Catch exception and report error.
5549         (Interface.DefineType): Throw exception when is in Transit.
5550         Catch exception and report error.
5551
5552         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5553         handle nested exception handlers.
5554
5555         * flowanalysis.cs (InTryWithCatch): New method, search for try with
5556         a catch.
5557
5558         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5559         InFinally and InCatch storage.
5560
5561         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5562         (Catch.Resolve): Set and Restore ec.InCatch.
5563         (Try.Resolve): Set and Restore ec.InFinally.
5564         (Try.HasCatch): True when try has catch.
5565
5566 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
5567
5568         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5569           for the same event member, so exclude such cases from warning 419.
5570           Fixed bug #74633.
5571
5572 2005-04-16  Miguel de Icaza  <miguel@novell.com>
5573
5574         * expression.cs (Binary.ResolveOperator): Apply patch from John
5575         Luke to fix bug 59864: operators &, | and ^ on enumerations
5576         require that the same enum type on both sides.
5577
5578         * driver.cs: Add warnings to old flag usage, this is to assist
5579         people who produce Makefiles and hope that the Makefiles will be
5580         used on Windows.
5581
5582         * class.cs (TypeContainer.EmitType): Moved the definition of the
5583         special $PRIVATE$ field from the resolve phase to the Emit phase.
5584         During resolve we do not know if we are a struct with
5585         HasExplicitLayout, we know this only after the attributes for the
5586         type are emitted.
5587
5588         Set the FieldOffset to zero on the dummy field that we create for
5589         the class.   Fixes 74590.
5590
5591 2005-04-16  Raja R Harinath  <rharinath@novell.com>
5592
5593         Fix #73834.
5594         * ecore.cs (PropertyExpr.resolved): New.
5595         (DoResolve): Use it to handle a case of double resolution here.
5596         Handle a case of identical-name-and-type-name.
5597         * expression.cs (ArrayCreation.CheckIndices): Avoid double
5598         resolution by storing the results of expression resolution back
5599         into the "probes" array.
5600
5601 2005-04-15  Raja R Harinath  <rharinath@novell.com>
5602
5603         Fix cs0208-7.cs and cs0208-8.cs.
5604         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5605         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
5606         error reporting to point out the reason a struct is not unmanaged.
5607
5608 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5609
5610         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
5611           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5612
5613 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5614
5615         Fix #74528.
5616         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5617         IdenticalNameAndTypeName here.
5618         (EventExpr.InstanceResolve): Likewise.
5619
5620 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
5621
5622         C# 2.0 DefaultCharSetAttribute implementation
5623         
5624         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5625         which allows us to set GlobalNamespace for every resolve.
5626         (Attribute.ResolveArguments): Cut from Resolve.
5627         (Attribute.GetCharSetValue): Returns CharSet named argument.
5628         (Attribute.DefinePInvokeMethod): Gets default charset from
5629         module settings.
5630         (GlobalAttribute.ResolveAsTypeStep): Override.
5631         (GlobalAttribute.ResolveArguments): Override.
5632         
5633         * class.cs (TypeAttr): Is protected.
5634         
5635         * codegen.cs (ModuleClass.DefaultCharSet): New member.
5636         (ModuleClass.DefaultCharSetType): New memeber.
5637         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5638         
5639         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5640         charset from module.
5641         
5642         * delegate.cs (TypeAttr): Override.
5643         (Delegate.DefineType): Use this TypeAttr.
5644         
5645         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5646         at very early stage (before types are defined) to resolve model
5647         module attributes. It will probably not work with corlib but it
5648         should be ok.
5649         
5650         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5651         charset from module.
5652         
5653         * typemanager.cs (default_charset_type): New type.
5654
5655 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5656
5657         * decl.cs (MemberCache.AddMethods): Don't warn if
5658         System.Object.Finalize has buggy MethodAttributes.
5659
5660         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5661         removed below.
5662
5663 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5664
5665         * doc.cs : detect ambiguous reference to overloaded members.
5666           Fixed bug #71603. MS 1.1 csc does not detect it.
5667
5668 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5669
5670         * doc.cs : delegates must not be referenced with parameters.
5671           Fixed bug #71605.
5672
5673 2005-04-12  Miguel de Icaza  <miguel@novell.com>
5674
5675         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5676
5677 2005-04-10  Miguel de Icaza  <miguel@novell.com>
5678
5679         * driver.cs (MainDriver): Stop processing if the CLS stage found
5680         errors. 
5681
5682         (CompilerCallableEntryPoint.InvokeCompiler): Always
5683         reset after execution;   Take a TextWriter argument for the
5684         output.
5685
5686         * report.cs: Use the error stream instead of hardcoding stderr. 
5687
5688 2005-04-09  Miguel de Icaza  <miguel@novell.com>
5689
5690         * class.cs: Reduce code paths to test, too small of an
5691         optimization to make it worth the extra testing.  Always perform
5692         it. 
5693
5694 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5695
5696         Fix #74510.
5697         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5698         operators that had errors reported on them.
5699
5700 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
5701
5702         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5703         argument types.
5704         (Attribute.Resolve): Add named argument type checking.
5705         
5706         * class.cs (FixedField.Define): Use IsPrimitiveType
5707         
5708         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5709         
5710         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5711         unsafe parameter types.
5712         
5713         * statement.cs (Using.ResolveExpression): Add better error description.
5714         
5715         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5716         
5717 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5718
5719         Fix #74484.
5720         * attribute.cs (Attribute.GetAttributeUsage): Resolve
5721         AttributeUsageAttribute in the emitcontext of the attribute class,
5722         not in the emitcontext of the attributable entity it was attached to.
5723         * cs-parser.jay: Use 'current_class', not 'current_container',
5724         when creating a GlobalAttribute.
5725
5726 2005-04-08  Alp Toker  <alp@atoker.com>
5727
5728         * pending.cs: The fix to #58413 failed to compile methods implementing
5729         interfaces with/without params modifiers and vice versa, even though
5730         params modifiers aren't part of the signature. Make the modifier check
5731         less strict as in csc.
5732
5733 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
5734             Anoob V E  <projectmonokochi@rediffmail.com>
5735             Harilal P R  <projectmonokochi@rediffmail.com>
5736
5737         Fix #58413.
5738         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
5739         modifiers of pending methods.
5740         (PendingImplementation.PendingImplementation): Initialize it.
5741         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5742         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5743         with ParameterData.  Add check for modifiers.
5744         * class.cs (MethodData.Define): Update to changes.
5745
5746 2005-04-07  Raja R Harinath  <rharinath@novell.com>
5747
5748         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5749
5750 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
5751
5752         * class.cs (PropertyMethod.Define): Check private accessor in abstract
5753         property.
5754         
5755         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5756         
5757         * rootcontext.cs,
5758         * typemanager.cs: Registered RequiredAttributeAttribute.
5759         
5760 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
5761
5762         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5763         Warning CS0169 is back at level 3.
5764         (IMethodData.SetMemberIsUsed): New method.
5765         
5766         * decl.cs (IsUsed): New value; moved from FieldBase.Status
5767         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5768         
5769         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5770
5771         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5772         contants.
5773         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5774         is used.
5775         
5776         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5777         is used.
5778         
5779         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5780         to avoid the problems with nested types.
5781
5782 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
5783             Anoob V.E  <projectmonokochi@rediffmail.com>
5784             Harilal P.R  <projectmonokochi@rediffmail.com>
5785             Raja R Harinath  <rharinath@novell.com>
5786
5787         Fix #73820.
5788         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5789         attribute.
5790         * typemanager (GetConstructor): Make public.
5791
5792 2005-04-05  John Luke  <john.luke@gmail.com>
5793             Raja R Harinath  <rharinath@novell.com>
5794
5795         Fix #62232.
5796         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5797         struct too.  Return false quicker in a few cases.
5798         (VerifyUnManaged): Use it.
5799
5800 2005-04-05  Raja R Harinath  <rharinath@novell.com>
5801
5802         Fix #74041.
5803         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5804         not 'unreachable_seen'.
5805
5806 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
5807
5808         * attribute.cs (Attribute.GetValue): Removed unused.
5809         
5810         * codegen.cs (CodeGen.TrimExt): Removed unused.
5811         
5812         * cs-parser.jay (output): Removed unused.
5813         
5814         * cs-tokenizer.cs (hex_digits): Removed unused.
5815         
5816         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5817         
5818         * expression.cs (Indirection.LoadExprValue): Removed unused.
5819         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5820         
5821         * iterators.cs (Iterator.param_types): Removed unused.
5822         
5823         * statement.cs (Goto.block): Removed unused.
5824         (ToplevelBlock.did): Removed unused.
5825         (Switch.ResolveConstantSwitch): Removed unused.
5826
5827 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
5828
5829         * rootcontext.cs: Allow mcs to bootstrap with the compilation
5830         resetting thingy.
5831
5832 2005-04-19  Martin Baulig  <martin@ximian.com>
5833
5834         Merged r42462 from MCS and made it work for GMCS.
5835
5836         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
5837
5838         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
5839
5840 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5841
5842         Fix #74232 and cs0208-3.cs.
5843         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5844         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5845         unmanaged type.  Don't use FieldBuilders when 't' is a
5846         TypeBuilder.  Use ModFlags and MemberType fields.
5847         * class.cs (MemberBase.member_type): Rename from MemberType.
5848         (MemberBase.MemberType): New property.  Determines member_type on
5849         demand.
5850         (MemberBase.DoDefine): Don't initialize MemberType here.
5851         (FieldMember.Define): Likewise.
5852
5853 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
5854
5855         Fix #74241
5856         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5857         Attributes are emitted there.
5858         
5859 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5860
5861         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5862         keyword in 'partial enum' too.
5863         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5864         is not allowed).
5865         Report from Kamil Skalski <nazgul@omega.pl>.
5866
5867         Fix #74309.
5868         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5869         have partial containers too.
5870
5871         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5872         in block' checks to Block.CheckInvariantMeaningInBlock.
5873         * statement.cs (Block.GetKnownVariableInfo): Make private.
5874         (Block.IsVariableUsedInChildBlock): Remove.
5875         (Block.IsVariableUsedInBlock): Likewise.
5876         (Block.CheckInvariantMeaningInBlock): New.  Show location of
5877         conflicting declaration.
5878         (Block.AddVariable): Make error messages less long-winded and more
5879         specific.  Show location of conflicting declaration.
5880         * parameter.cs (Parameters.Location): New readonly property.
5881
5882 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5883
5884         Clean up semantics of invoking ResolveMemberAccess.
5885         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5886         can have an instance, ensure that we pass in a non-TypeExpression
5887         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
5888         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5889         argument.  Update to changes and simplify.
5890         (FieldExpr.Emitinstance): Remove CS0120 check.
5891         (PropertyExpr.EmitInstance): Likewise.
5892         * expression.cs (Argument.Resolve): Likewise.
5893         (Invocation.DoResolve): Update to changes in semantics of
5894         InstanceExpression.
5895
5896 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
5897
5898         Fix #74241
5899         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5900         customization.
5901         
5902         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5903
5904 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5905
5906         Fix difference in behaviour with commandline invocation.
5907         * driver.cs (Driver.Reset): New.
5908         (CompilerCallableEntryPoint): Call it.
5909
5910         * statement.cs (If.Resolve): Avoid spurious "uninitialized
5911         variable" warnings if the boolean expression failed to resolve.
5912
5913 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
5914
5915         * attribute.cs: Fix the union of several permissions when some of them
5916         are unrestricted (so the result isn't an unrestricted permission set).
5917         Fix #74036.
5918
5919 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5920
5921         * ecore.cs (MemberExpr): New class.  Convert from interface
5922         IMemberExpr.
5923         (MemberExpr.ResolveMemberAccess): Refactor and move here from
5924         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
5925         error checks.
5926         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5927         (MethodGroupExpr.IsExplicitImpl): Remove.
5928         (Expression.GetFieldFromEvent): Remove.
5929         (SimpleName.MemberStaticCheck): Remove.
5930         (SimpleName.DoSimpleNameResolve): Update to changes.
5931         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5932         (MemberAccess.IdenticalNameAndTypeName): Remove.
5933         (MemberAccess.error176): Move to MemberExpr.
5934         (MemberAccess.DoResolve): Update to changes.
5935         (BaseAccess.DoResolve): Likewise.
5936
5937 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
5938
5939         C# 2.0 Conditional attribute class implementation
5940         
5941         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5942         Analyzes class whether it has attribute which has ConditionalAttribute
5943         and its condition is not defined.
5944         
5945         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5946         (Class.IsExcluded): New method. Search for at least one defined
5947         condition in ConditionalAttribute of attribute class.
5948
5949 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5950
5951         * ecore.cs (PropertyExpr): Derive from Expression, not
5952         ExpressionStatement.
5953         (PropertyExpr.EmitStatement): Remove.
5954
5955 2005-03-29  Raja R Harinath  <rharinath@novell.com>
5956
5957         Fix #74060.
5958         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5959         internal field "value__" of an enum be private.  The examples for
5960         "value__" that I found on MSDN all used FieldAttributes.Private.
5961
5962         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5963         Don't mention IL method attribute names.
5964
5965         Fix #47991.  Remove a TODO.
5966         * statement.cs (Block.Toplevel): Make into a field.
5967         (Block.Parameters): Move into ToplevelBlock.
5968         (Block.known_variables): Rename from child_variable_names.
5969         (Block.Block): Remove variants that take Parameters.  Initialize
5970         'Toplevel' with the immediately surrounding toplevel block.
5971         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
5972         LocalInfo parameter.
5973         (Block.GetKnownVariableInfo): New.
5974         (Block.IsVariableNameUsedInChildBlock): Update.
5975         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
5976         the block, even though it may not be in scope.
5977         (Block.AddVariable): Remove Parameters parameter.  Use
5978         Toplevel.Parameters instead.
5979         (Block.AddConstant): Remove Parameters parameter.
5980         (Block.GetParameterReference): Update to use Toplevel.Parameters.
5981         (Block.IsParamaterReference): Likewise.
5982         (Block.IsLocalParameter): Likewise.  Simplify a lot.
5983         (ToplevelBlock.Parameters): New.  Moved from Block.
5984         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
5985         initialize Parameters to a non-null value.
5986         * cs-parser.jay: Update to changes.
5987         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5988         simple names that mean different things in the same block.  Use
5989         Block.IsVariableNameUsedInBlock.
5990
5991 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5992
5993         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5994
5995 2005-03-26  Raja R Harinath  <harinath@acm.org>
5996
5997         Fix #73038.
5998         * assign.cs (Assign.DoResolve): When the RHS of an assignment
5999         fails to resolve, ensure that the LHS is still resolved as an
6000         lvalue.
6001
6002 2005-03-25  Raja R Harinath  <harinath@acm.org>
6003
6004         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
6005         ec.ContainerType.
6006         (Enum.current_ec): Remove.
6007         (Enum.LookupEnumValue): Remove EmitContext argument.
6008         Just uses the one created during DefineType.
6009         (Enum.FindMembers): Update.
6010         * expression.cs (MemberAccess.DoResolve): Update.
6011
6012 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
6013
6014         * assign.cs (Assign.DoResolve): Check for CS1717 when
6015         source and target are same (uses Equals).
6016
6017         * expression.cs (LocalVariableReference, ParameterReference,
6018         This): Implemented Equals, GetHashCode.
6019
6020         * statement.cs (Block.GetParameterReference): Removed useless
6021         local variable.
6022
6023 2005-03-22  Raja R Harinath  <rharinath@novell.com>
6024
6025         Fix cs0128.cs
6026         * statement.cs (Block.AddVariable): Ensure that we skip implicit
6027         blocks before deciding whether the error is cs0136 or cs0128.
6028
6029         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
6030         (using_alias_directive, using_namespace_directive): Pass
6031         MemberName, not an expression to Namespace.UsingAlias and
6032         Namespace.Using.
6033         (MakeName): Use the MemberName of the namespace.
6034         * namespace.cs (Namespace.MemberName): New.
6035         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
6036         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
6037         Likewise.
6038         * decl.cs (MemberName.Name): Make readonly.
6039         (MemberName.FromDotted): New "constructor".
6040         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
6041         (MemberCore.Name): Compute from MemberName on demand.
6042         (MemberCore.SetMemberName): Provide a way to change the
6043         MemberName.
6044         (MemberCore.AddToContainer): Don't take a fullname parameter.
6045         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
6046         fully qualified name of the container to the member name.
6047         (TypeContainer.AddToTypeContainer): Use a fully qualified name
6048         only if the type is a member of the root container.
6049         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
6050         MemberName.Left rather than searching for an embedded ".".
6051         (PartialContainer.CreatePart): Update to changes in RootContext.
6052         (MemberBase.ShortName): Turn into a property.  Use
6053         MemberCore.SetMemberName.
6054         (MemberBase.ExplicitInterfaceName): Remove.
6055         (MemberBase.UpdateMemberName): Remove.
6056         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
6057         (PropertyBase.SetMemberName): New override.
6058         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
6059         (Tree.GetDecl): New.
6060         (Tree.AllDecls): Rename from Decls.
6061         * attribute.cs, enum.cs, report.cs: Update to changes.
6062         * driver.cs (MainDriver): Use MemberName.FromDotted on
6063         RootContext.MainClass.
6064
6065 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
6066
6067         * class.cs (FixedField.Define): Check for CS1664 and more sanity
6068         checks.
6069
6070         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
6071
6072 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
6073
6074         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
6075         property accessor modifiers.
6076
6077         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
6078         fixed buffer attribute (CS1716).
6079         (PropertyMethod.HasCustomAccessModifier): When property accessor
6080         has custom modifier.
6081
6082         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6083         modifiers.
6084         (PropertyExpr.DoResolveLValue): Add CS0272.
6085
6086 2005-03-17  Miguel de Icaza  <miguel@novell.com>
6087
6088         * convert.cs: When converting to a pointer, use the proper Conv.U
6089         or Conv.I depending on the source data type.
6090
6091         * cs-tokenizer.cs: Make the size for large decimal constants,
6092         fixes #72957.
6093
6094 2005-03-17  Martin Baulig  <martin@ximian.com>
6095
6096         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6097         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
6098
6099 2005-03-17  Martin Baulig  <martin@ximian.com>
6100
6101         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6102         to bool so we can return an error condition.
6103         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6104         returned an error.
6105
6106 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
6107
6108         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6109         attributes.
6110
6111 2005-03-16  Raja R Harinath  <rharinath@novell.com>
6112
6113         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6114         Refactor to avoid traversing the list of assemblies, and to avoid
6115         string concatenation.
6116         * typemanager.cs (guid_attr_type): Remove.
6117         (negative_hits, pointers, references): Remove hashes.
6118         (type_hash): New.
6119         (GetConstructedType): New.  Uses type_hash to handle constructed
6120         types (arrays, references, pointers).
6121         (GetReferenceType, GetPointerType): Use it.
6122         (GetNestedType): New.  Uses type_hash to handle nested types of
6123         reflected types.
6124         (LookupType, LookupTypeDirect): Remove.
6125         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
6126         'types' hash and LookupTypeReflection directly.
6127         (params_string, params_object): Use GetConstructedType.
6128         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
6129         top-level types.
6130         (Namespace.Lookup): Use cached_types.
6131         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6132         provided by old TypeManager.LookupType.
6133         * rootcontext.cs (MakeFQN): Remove.
6134         * decl.cs (DeclSpace.MakeFQN): Likewise.
6135         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
6136         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6137         TypeManager.GetConstructedType.
6138         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
6139
6140 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
6141
6142         * cs-parser.jay: Fix build.
6143
6144 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
6145
6146         * class.cs (TypeContainer.CircularDepException) New nested
6147         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
6148
6149         * cs-parser.jay: Reports CS1527 for any namespace element.
6150
6151         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
6152         Added CS0407.
6153
6154         * expression.cs (ParameterReference.IsAssigned): Changed error to
6155         CS0269.
6156         (Error_WrongNumArguments): Moved CS0245 detection here.
6157
6158         * statement.cs (Return.Resolve): Add CS1622 report.
6159
6160 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
6161
6162         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
6163
6164 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
6165
6166         * attribute.cs expression.cs: Get rid of some allocations.
6167
6168 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
6169
6170         * doc.cs : just eliminate the latest change.
6171
6172 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6173
6174         * doc.cs : commented out the latest change. It breaks xml-030.cs
6175
6176 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6177
6178         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6179           fail. So invoke CreateType() in FindDocumentedType().
6180
6181 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6182
6183         * cs-tokenizer.cs : added IsKeyword().
6184         * doc.cs : Detect keyword incorrectly used as identifier.
6185           Allow identifiers prefixed by @.
6186
6187 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
6188
6189         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6190         It caused exception in namespace resolving (again!).
6191         
6192         * class.cs (Class.ctor): Removed exit.
6193         (PropertyMethod.ctor): ditto.
6194         
6195         * codegen.cs (Codegen.Reset): Reset static data.
6196         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6197         
6198         * cs-tokenizer.cs (Cleanup): Removed.
6199         
6200         * driver.cs (GetSystemDir): Rewrote to one line command.
6201         It caused problem with unloaded dynamic modules.
6202         (UnixParseOption): Removed Exit.
6203         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6204         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6205         Now can be mcs used as library.
6206         
6207         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6208         empty location.
6209         
6210         * location.cs (Reset): Reset static data.
6211         
6212         * namespace.cs (Reset): Reset static data.
6213         
6214         * report.cs (Report.Reset): Reset static data.
6215         
6216         * rootcontext.cs (RootContext.Reset): Reset static data.
6217         
6218         * tree.cs (RootTypes.ctor): Use Location.Null
6219         
6220         * typemanager.cs (TypeManager.Reset): Reset static data.
6221         (CoreLookupType): Removed Exit.
6222         (TypeHandle.Reset): Reset static data.
6223         
6224 2005-03-10  Raja R Harinath  <rharinath@novell.com>
6225
6226         Fix #73516.
6227         * typemanager.cs (ComputeNamespaces): Import namespaces from
6228         referenced modules too.
6229
6230 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6231
6232         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6233         than '.'.
6234
6235 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6236
6237         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6238         enclosing DeclSpace.  This ensures that a name-lookup populates
6239         more caches and there are fewer 'TypeExpression's.  Carve out
6240         nested type lookup into ...
6241         (LookupNestedTypeInHierarchy): ... this.
6242
6243 2005-04-15  Martin Baulig  <martin@ximian.com>
6244
6245         Merged r41590 from MCS and make it work in the generics land.
6246
6247         * generic.cs (TypeParameter.UpdateConstraints): Removed the
6248         `check' argument.
6249
6250         * class.cs (PartialContainer.UpdateConstraints): Removed.
6251         (PartialContainer.CheckConstraints): Removed.
6252         (PartialContainer.SetParameterInfo): Store the constraints here.
6253         (PartialContainer.DefineTypeParameters): New public method;
6254         resolve the type parameter's constraints here.  Note that the
6255         PartialContainer doesn't have an EmitContext anymore, so we must
6256         do this in the ClassPart.
6257
6258 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6259
6260         Clean up a few partial-class semantics.  
6261         Fixes test-357.cs and cs1618-2.cs.
6262         * cs-parser.jay (struct_declaration): Use 'current_class' as
6263         parent of newly-created struct.  Remove call to Register ().
6264         Use 'pop_current_class' to complete handing the current struct.
6265         (interface_declaration): Likewise.
6266         (class_declaration): Likewise.
6267         (enum_declaration): Use 'current_class' as parent of newly created
6268         enum.
6269         (delegate_declaration): Likewise.
6270         (pop_current_class): New function.  This is used to handle closing
6271         up the 'current_class' and 'current_container', and pointing them
6272         to the enclosing class/container.
6273         (CSharpParser): Initialize 'current_class' too.
6274         * decl.cs (MemberCore): Add check for invariant: a partial
6275         container is not a parsed entity, and thus does not enclose any
6276         parsed members.
6277         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6278         (DeclSpace.BaseTypeExpr): Use it.
6279         (DeclSpace.LookupType): Add check for invariant.
6280         * class.cs (TypeContainer): Add check for invariant: a nested
6281         class should have the same NamespaceEntry as its enclosing class.
6282         (TypeContainer.EmitFieldInitializers): Make virtual.
6283         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6284         MemberCore.
6285         (TypeContainer.Register): Remove.
6286         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6287         null.  Use TypeResolveEmitContext for resolving base types and
6288         interfaces.  Move initialization of Parts.TypeBuilder here from
6289         ...
6290         (TypeContainer.DefineNestedTypes): ... here.
6291         (PartialContainer): Take a Namespace not a NamespaceEntry.
6292         (PartialContainer.Create): Don't use Register.  Call the
6293         appropriate Add... function directly.
6294         (ClassPart): Take both the PartialContainer and the enclosing
6295         class as constructor arguments.
6296         (ClassPart.EmitFieldInitializers): Override.
6297         (ClassPart.PartFindNestedTypes): Remove.
6298         (FieldBase.GetInitializerExpression): Resolve the initializer
6299         expression in the emit context of the enclosing class.
6300         * tree.cs (RootTypes): Remove Register ().
6301         
6302 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
6303
6304         * cs-parser.jay: Removed CS0134.
6305         
6306         * driver.cs: Removed CS1901.
6307         
6308         * expression.cs (SizeOf.DoResolve): Don't report CS0233
6309         for predefined types.
6310
6311 2005-03-07  Duncan Mak  <duncan@novell.com>
6312
6313         * codegen.cs (Save):  Catch UnauthorizedAccessException as
6314         well. Fixes bug #73454.
6315
6316 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
6317
6318         * cs-tokenizer.cs (xtoken): Add CS1035.
6319         
6320         * class.cs (MethodData.Define): Add CS0683.
6321         (FieldMember.ctor): Add CS0681.
6322
6323 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6324
6325         * ecore.cs (SimpleName.DoResolve): Rename from
6326         SimpleName.DoResolveAllowStatic.
6327         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6328         Pass 'intermediate' flag to MemberStaticCheck.
6329         (SimpleName.MemberStaticCheck): Skip "static check" only in case
6330         of "intermediate" lookups via MemberAccess.
6331         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
6332         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6333
6334 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6335
6336         Fix #73394.
6337         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6338         slipped in because of variable names that are identical to a
6339         builtin type's BCL equivalent ('string String;', 'int Int32;').
6340         (PropertyExpr.EmitInstance): Likewise.
6341
6342 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
6343
6344         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6345         
6346         * report.cs (warning_ignore_table): Made public.
6347
6348 2005-03-04  Raja R Harinath  <rharinath@novell.com>
6349
6350         Fix #73282.
6351         * class.cs (MethodData.Emit): Pass 'container' to
6352         container.GetObsoleteAttribute instead of 'container.Parent'.
6353
6354 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
6355
6356         * cs-parser.jay: Add 1534 error test.
6357
6358         * iterators.cs (Yield.CheckContext): Add error 1629.
6359         (Iterator.ctor): Save unsafe modifier.
6360         (MoveNextMethod.DoEmit): Restore unsafe context.
6361
6362         * namespace.cs (UsingAlias): Better error message.
6363
6364 2005-03-03  Dan Winship  <danw@novell.com>
6365
6366         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6367         the warning message [#73219]
6368
6369 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6370
6371         Fix compile with MCS 1.0.0.0.
6372         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6373         w_restore to not depend on string constant folding.
6374
6375 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6376
6377         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
6378         CS0246 check to users who passed 'silent = false'.
6379         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6380         check.
6381         (SimpleName.SimpleNameResolve): Update.
6382         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6383         (MemberAccess.IdenticalNameAndTypeName): Update.
6384         * doc.cs (FindDocumentedTypeNonArray): Update.
6385
6386 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
6387
6388         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6389         * parameters.cs (ComputeAndDefineParameters): Remove.
6390         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6391         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6392         Use GetParameterInfo.
6393
6394 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
6395
6396         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6397
6398 2005-03-02  Raja R Harinath  <rharinath@novell.com>
6399
6400         Unify DeclSpace.LookupType and DeclSpace.FindType.
6401         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
6402         is in charge of defining nested types on demand.
6403         (DeclSpace.LookupType): Use it when the current_type is a
6404         TypeBuilder.  Use LookupTypeDirect for reflected types.
6405         (DeclSpace.FindType): Remove.
6406         (DeclSpace.LookupInterfaceOrClass): Likewise.
6407         (DeclSpace.DefineTypeAndParents): Likewise.
6408         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6409         DeclSpace.LookupType.
6410         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6411         * typemanager.cs (LookupType): Simplify.
6412         (AddUserType): Remove type from negative_hits.
6413         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6414         * class.cs (TypeContainer.FindMembers): Move handling of nested
6415         types ...
6416         (TypeContainer.FindMembers_NestedTypes): ... here.
6417         (TypeContainer.FindNestedType): Implement override.
6418         (ClassPart.FindNestedType): Delegate to PartialContainer.
6419         (ClassPart.PartFindNestedType): Looks up the nested types of the
6420         part alone.
6421
6422 2005-04-14  Martin Baulig  <martin@ximian.com>
6423
6424         * generic.cs (ConstructedType): Moved all the type lookup and
6425         nested class logic into SimpleName.
6426         (ConstructedType.ResolveConstructedType): Our underlying type is
6427         already fully resolved; all the type lookup stuff is in
6428         SimpleName.
6429
6430         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
6431         constructed types here instead of in ConstructedType.
6432
6433         * decl.cs (MemberName.GetTypeExpression): Always create a
6434         SimpleName, not a ConstructedType.
6435         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
6436
6437 2005-03-02  Martin Baulig  <martin@ximian.com>
6438
6439         * class.cs (TypeContainer.DoDefineMembers): We also need a default
6440         static constructor in static classes.
6441
6442 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
6443
6444         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6445         sizeParamIndex is not specified.
6446
6447 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
6448
6449         Fix #73117
6450         * report.cs (WarningMessage.IsEnabled): Missing null check.
6451
6452 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6453
6454         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6455         in the fields and not in the properties.
6456
6457 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
6458
6459         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
6460         fields as well.
6461
6462 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6463
6464         * attribute.cs: Small refactoring (improved robustness).
6465         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6466         (ValidateGuid): Removed.
6467         (Resolve): Removed referenced to above mentioned.
6468         (GetAttributeUsage): Made private and changed to work without
6469         class assistance.
6470         (GetIndexerAttributeValue): Don't crash.
6471         (GetConditionalAttributeValue): Ditto.
6472         (GetClsCompliantAttributeValue): Ditto.
6473         (ExtractSecurityPermissionSet): All attributes exceptions are
6474         error 648.
6475         (GetPropertyValue): New helper.
6476         (GetMethodImplOptions): New method.
6477         (DefinePInvokeMethod): Reuse common code. Implemented handling of
6478         some missing properties.
6479         
6480         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6481         (Method.ApplyAttributeBuilder): Updated.
6482         
6483         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6484         exception.
6485
6486 2005-02-28  Raja R Harinath  <rharinath@novell.com>
6487
6488         Fix #73052.
6489         * report.cs (Report.SymbolRelatedToPreviousError): Handle
6490         non-simple types (array, pointer, reference).
6491
6492 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6493
6494         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6495
6496         * class.cs (MethodCore.IsDuplicateImplementation): Special error
6497         for operators.
6498         (Method.CheckBase): Catch wrong destructor here.
6499         (MethodData.Define): Add errors 550, 668.
6500
6501         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6502
6503         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6504
6505         * pending.cs (VerifyPendingMethods): Add error 551.
6506
6507         * typemanager.cs (CSharpName): Next error report helper.
6508
6509 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
6510
6511         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6512         attributes. Removed useless attribute double check.
6513         It saves almost 2MBs for corlib.
6514
6515 2005-02-25  Raja R Harinath  <rharinath@novell.com>
6516
6517         Fix #72924.
6518         * statement.cs (ExpressionStatement.Resolve): Make robust to being
6519         called twice in case of error.
6520
6521 2005-02-23  Chris Toshok  <toshok@ximian.com>
6522
6523         Fix compiler portions of #72827.
6524         * statement.cs (Block.Emit): call Begin/EndScope on the
6525         EmitContext instead of the ILGenerator.
6526
6527         * codegen.cs (EmitContext.BeginScope): new method, call
6528         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6529         we have one.)
6530         (EmitContext.BeginScope): same, but EndScope and CloseScope
6531
6532         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6533         offset and call the superclass's OpenScope(int) with it.
6534         (SymbolWriter.CloseScope): get the current il
6535         offset and call superclass's CloseScope(int) with it.
6536
6537 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
6538
6539         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6540         CS1677 for out and ref as well.
6541
6542         * class.cs (Method.Define): Add error CS1599 detection.
6543         
6544         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6545         
6546         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6547         
6548         * delegate.cs (Delegate.Define): Add error CS1599 detection.
6549         
6550         * support.cs.cs (ModifierDesc): New helper method.
6551
6552 2005-02-23  Raja R Harinath  <rharinath@novell.com>
6553             Abin Thomas  <projectmonokochi@rediffmail.com>
6554             Anoob V E  <projectmonokochi@rediffmail.com>
6555             Harilal P R  <projectmonokochi@rediffmail.com>
6556
6557         Fix #57851, #72718.
6558         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6559         MemberLookup (used for error reporting) actually returns a result.
6560         Fix error report number (122, not 112).
6561
6562 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
6563             Anoob V E  <projectmonokochi@rediffmail.com>
6564             Harilal P R  <projectmonokochi@rediffmail.com>
6565
6566         Fix #71134.
6567         * pending.cs (PendingImplementation.GetAbstractMethods):
6568         Find NonPublic members too.
6569
6570 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
6571
6572         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6573         Fixed error 217.
6574         
6575         * class.cs (MethodCore.CheckMethodAgainstBase):
6576         Add error 239 report.
6577
6578 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6579
6580         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6581         
6582         * class.cs (Operator.Define): Add error 217 report.
6583         
6584 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6585
6586         Fix #68955.
6587         * expression.cs (Invocation.IsApplicable): Make public.
6588         (Invocation.IsParamsMethodApplicable): Likewise.
6589         * delegate.cs (Delegate.VerifyApplicability): Don't use
6590         Invocation.VerifyArgumentCompat for parameter applicability
6591         testing.  Use Invocation.IsApplicable and
6592         Invocation.IsParamsMethodApplicable.
6593
6594 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6595
6596         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6597         
6598         * class.cs (Operator.Define): Add error 217 report.
6599         
6600 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6601
6602         * namespace.cs (UsingEntry.Resolve): Undo change below.
6603
6604 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6605
6606         Fix #72756.
6607         * ecore.cs (Expression.MemberLookupFailed): Add argument to
6608         disable the error message when the extended MemberLookup also
6609         fails.
6610         (Expression.MemberLookupFinal): Update.
6611         (SimpleName.DoSimpleNameResolve): Update.
6612         * expression.cs (MemberAccess.ResolveNamespaceOrType):
6613         Don't use MemberLookupFinal.
6614         (New.DoResolve): Update.
6615         (BaseAccess.CommonResolve): Update.
6616
6617 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6618
6619         Fix #72732.
6620         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6621         occured previously, don't resolve again.
6622
6623 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6624
6625         Fix #69949
6626         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6627         argument. Call ResolveAttributeUsage for unresolved.
6628         when types doesn't match ctor arguments.
6629         
6630         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6631         for nested attribute classes.
6632         (Class.attribute_usage): Removed.
6633         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6634         for attribute class.
6635         
6636         * ecore.cs (IsAttribute): Removed.
6637         
6638         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6639         
6640         * rootcontext.cs (RegisterAttribute): Removed, attributes are
6641         now normal types.
6642         (attribute_types): Removed.
6643         (EmitCode): Global attributes are emited as the latest.
6644
6645 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
6646
6647         * class.cs (EmitFieldInitializers): Don't emit field initializer
6648         for default values when optimilization is on.
6649         
6650         * constant.cs (Constant.IsDefaultValue): New property.
6651         
6652         * driver.cs: Add /optimize handling.
6653         
6654         * constant.cs,
6655         * ecore.cs,
6656         * literal.cs: Implement new IsDefaultValue property.
6657         
6658         * rootcontext.cs (Optimize): New field, holds /optimize option.
6659
6660 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6661
6662         Fix crasher in re-opened #72347.
6663         * namespace.cs (Namespace.Lookup): Return null if
6664         DeclSpace.DefineType returns null.
6665
6666         Fix #72678.
6667         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6668
6669 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6670
6671         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
6672         now returns null if it cannot resolve to an lvalue.
6673         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6674         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6675         returned null.  Remove check for SimpleName.
6676         (EventExpr.DoResolveLValue): New.
6677         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6678         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
6679         error from ...
6680         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
6681         avoid CS0131 error.
6682         (Unary.ResolveOperator): Move CS0211 check ...
6683         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
6684         CS0131 error.
6685         (Unary.DoResolveLValue): Simplify.
6686         (AddressOf.DoResolveLValue): New.
6687         (ArrayAccess.DoResolveLValue): New.
6688
6689 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
6690
6691         * attribute.cs (Attribute.Resolve): Add arguments casting for
6692         when types doesn't match ctor arguments.
6693
6694 2005-02-16  Raja R Harinath  <rharinath@novell.com>
6695
6696         Fix parts of #63202.
6697         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6698         lookup of operator in base type.  Ensure that all checks happen
6699         when the operator resolves to an "op_..." method.
6700
6701 2005-02-15  Raja R Harinath  <rharinath@novell.com>
6702
6703         Fix #71992.
6704         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6705         'ignore_cs0104' parameter.  Pass it to ...
6706         (NamespaceEntry.Lookup): ... this.
6707         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6708         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6709         (TypeLookupExpression.DoResolveAsTypeStep): Update.
6710         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6711         Update.  Request that cs0104 errors be ignored.
6712         (ComposedCast.ResolveAsTypeStep): Update.
6713
6714 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6715
6716         Fix #59209.
6717         * expression.cs (Invocation.BetterFunction): Remove support for
6718         comparing virtual functions and their overrides.
6719         (Invocation.IsOverride): New.
6720         (Invocation.OverloadResolve): Don't consider 'override' functions
6721         during candidate selection.  Store them in a lookaside list.
6722         If the selected method is a 'virtual' function, use the list to
6723         find any overrides that are closer to the LHS type.
6724
6725 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
6726
6727         * expression.cs (New.DoResolve): Add complex core type reduction.
6728         (New.Constantify): Converts complex core type syntax like 'new int ()'
6729         to simple constant.
6730         
6731 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6732
6733         * decl.cs (EntryType.EntryType): New constructor to create an
6734         updated copy of a cache entry.
6735         (MemberCache.AddMethods): Use it.
6736         (MemberCache.ClearDeclaredOnly): Remove.
6737         (MemberCache.MemberCache): Update.
6738
6739 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6740
6741         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6742         variable.  This one is represents the actual low-level declaration
6743         of the method, as opposed to the semantic level `IsStatic'.   
6744
6745         An anonymous method which is hosted into a static method might be
6746         actually an instance method.  IsStatic would reflect the
6747         container, while MethodIsStatic represents the actual code
6748         generated.
6749
6750         * expression.cs (ParameterReference): Use the new MethodIsStatic
6751         instead of IsStatic.
6752
6753         * anonymous.cs (AnonymousMethod.Compatible): Pass the
6754         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6755         set on the current EmitContext. 
6756
6757         * expression.cs (Cast): Overload DoResolveLValue so we can pass
6758         resolve our casted expression as an LValue.  This triggers the
6759         proper LValue processing that is later required by Assign.
6760
6761         This fixes 72347.
6762
6763         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6764
6765 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
6766
6767         C# 2.0 Fixed buffer implementation
6768
6769         * anonymous.cs: Update after RegisterHelperClass renaming.
6770
6771         * attribute.cs (AttributeTester.fixed_buffer_cache):
6772         Cache of external fixed buffers.
6773         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6774         implementation if field is fixed buffer else null.
6775
6776         * class.cs
6777         (TypeContainer.AddField): Accept FieldMember instead of Field.
6778         (FieldBase.IsFieldClsCompliant): Extracted code from
6779         VerifyClsCompliance descendant customization.
6780         (FixedField): New class handles fixed buffer fields.
6781         (FixedFieldExternal): Keeps information about imported fixed
6782         buffer.
6783         (IFixedField): Make access to internal or external fixed buffer
6784         same.
6785
6786         * cs-parser.jay: Add fixed buffer parsing.
6787
6788         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6789         buffer.
6790
6791         * expression.cs (Indirection): Extended implementation to accept
6792         fixed buffer field.
6793         (PointerArithmetic.Emit): Get element from fixed buffer as well.
6794         (ElementAccess.MakePointerAccess): Get type as parameter.
6795         (DoResolve): Add fixed buffer field expression conversion.
6796         (DoResolveLValue): Ditto.
6797         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6798         (ArrayPtr): Derives from FixedBufferPtr.
6799         (ArrayPtr.Emit): Add extra emit for array elements.
6800
6801         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6802
6803         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6804         for compiler generated types.
6805         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6806
6807         * statement.cs (Fixed): Refactored to be easier add fixed buffer
6808         and consume less memory.
6809         (Fixed.Resolve): Add fixed buffer case.
6810
6811         * typemanager.cs (compiler_generated_attr_ctor,
6812         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6813         (HasElementType): Add our own implementation to work on every
6814         runtime.
6815
6816 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6817
6818         * anonymous.cs (CaptureContext): Track whether `this' has been
6819         referenced.   
6820
6821         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
6822         only captured `this' if it was implicitly done (instance
6823         methods/variables were used). 
6824
6825         * codegen.cs (EmitContext.CaptureThis): New method to flag that
6826         `this' must be captured.
6827
6828 2005-01-30  Miguel de Icaza  <miguel@novell.com>
6829  
6830         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6831         is null it means that there has been no need to capture anything,
6832         so we just create a sibling.
6833
6834         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6835
6836         Just a partial fix.  The other half is fairly elusive.
6837         
6838 2005-02-10  Raja R Harinath  <rharinath@novell.com>
6839
6840         Fix #52586, cs0121-4.cs.
6841         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
6842         and return a hashtable.
6843         (MemberCache.ClearDeclaredOnly): New.
6844         (MemberCache.MemberCache): Update to change.  Make a deep copy of
6845         the method_hash of a base type too.
6846         (MemberCache.AddMethods): Adapt to having a deep copy of the base
6847         type methods.  Overwrite entries with the same MethodHandle so
6848         that the ReflectedType is correct.  The process leaves in base
6849         virtual functions and their overrides as distinct entries.
6850         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
6851         matters since it was boxed in a ArrayList before.
6852         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6853         modifier.
6854         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
6855         case of a virtual function and its override (choose the overload
6856         as better).
6857         (Invocation.OverloadResolve): Avoid 'override' members during
6858         'applicable_type' calculation.
6859
6860 2005-03-28  Raja R Harinath  <rharinath@novell.com>
6861
6862         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6863         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6864         GetTypeHandle.  It is possible for a reflected type to derive from
6865         a TypeBuilder (e.g., int[] derives from the TypeBuilder
6866         System.Array during mscorlib compilation).
6867         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6868         contain a method_hash, don't create one either.  Don't create a
6869         deep copy of the base cache's method_hash.
6870         (MemberCache.SetupCache): Rename back from DeepCopy.
6871         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6872         already initialized.  If we see an override function, add its
6873         underlying base virtual function to the member_hash too.
6874
6875 2005-02-09  Raja R Harinath  <rharinath@novell.com>
6876
6877         Combine two near-redundant caches.
6878         * typemanager.cs (method_params): Rename from method_internal_params.
6879         (TypeManager.GetParameterData): New.  Replace
6880         Invocation.GetParameterData.
6881         (TypeManager.LookupParametersByBuilder): Remove.
6882         * expression.cs (Invocation.method_parameter_cache): Remove.
6883         (Invocation.GetParameterData): Remove.
6884         Update to changes.
6885         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6886         Update to changes.
6887
6888 2005-02-08  Raja R Harinath  <rharinath@novell.com>
6889
6890         Fix #72015.
6891         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6892         TypeManager.multicast_delegate_type is null, resolve it by looking
6893         up "System.MulticastDelegate".
6894         * rootcontext.cs (RootContext.ResolveCore): Simplify.
6895
6896 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
6897             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
6898             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
6899
6900         Fix cs0164.cs.
6901         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6902         (LabeledStatement.AddReference): New.  Set 'referenced'.
6903         (Goto.Resolve): Use it.
6904
6905 2005-02-05  John Luke  <john.luke@gmail.com>
6906
6907         * driver.cs: remove duplicate -doc line in Usage ()
6908
6909 2005-02-04  Raja R Harinath  <rharinath@novell.com>
6910
6911         * location.cs (Location.AddFile): Fix CS2002 error report.
6912
6913 2005-02-02  Martin Baulig  <martin@ximian.com>
6914
6915         * delegate.cs (Delegate.DefineType): Report an internal error if
6916         TypeManager.multicast_delegate_type is null.  See bug #72015 for
6917         details.        
6918
6919 2005-02-02  Raja R Harinath  <rharinath@novell.com>
6920
6921         Fix a crasher in a variant of #31984.
6922         * const.cs (Constant.CheckBase): New override that defers the
6923         new-or-override check in case the base type hasn't been populated
6924         yet.
6925         (Constant.Define): Ensure the new-or-override check is performed.
6926
6927 2005-02-01  Duncan Mak  <duncan@ximian.com>
6928
6929         * const.cs (LookupConstantValue): Check that `ce' is not null
6930         before calling GetValue ().
6931
6932 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6933
6934         Fix test-334.cs (#69519).
6935         * cs-parser.jay (using_alias_directive): Pass in an expression to
6936         NamespaceEntry.UsingAlias.
6937         (using_namespace_directive): Pass in an expression to
6938         NamespaceEntry.Using.
6939         (namespace_name): Don't flatten to a string.
6940         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6941         (NamespaceEntry.AliasEntry.Resolve): Lookup using
6942         ResolveAsTypeStep.
6943         (NamespaceEntry.UsingEntry): Likewise.
6944         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6945         changes.
6946         (NamespaceEntry.LookupForUsing): Remove.
6947         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6948         names.
6949         (NamespaceEntry.Lookup): Remove support for dotted names.
6950
6951 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6952
6953         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6954         split into two.
6955         (NamespaceEntry.ImplicitParent): Compute on demand.
6956         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6957         parallels the current.
6958         (NamespaceEntry.LookupForUsing): Use it.
6959         (NamespaceEntry.Lookup): If the current namespace-entry is
6960         implicit, don't search aliases and using tables.
6961
6962 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6963
6964         Fix #31984.
6965         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6966         BaseCache here.
6967         (TypeContainer.BaseCache): Compute on demand.
6968         (TypeContainer.FindMembers): Define constants and types if they're
6969         not already created.
6970         (FieldMember.Define): Move resetting of ec.InUnsafe before error
6971         check.
6972         * const.cs (Constant.Define): Make idempotent.
6973
6974 2005-01-29  Miguel de Icaza  <miguel@novell.com>
6975
6976         * pending.cs: Produce better code (no nops produced by using Ldarg
6977         + value).
6978         
6979         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6980         i - 1' it should be arg + 1.
6981
6982         Fixes bug #71819.
6983
6984 2005-01-28  Raja R Harinath  <rharinath@novell.com>
6985
6986         * attribute.cs (Attribute.CheckAttributeType): Make private
6987         non-virtual.
6988         (Attribute.ResolveType): Make virtual.
6989         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6990         handling of RootContext.Tree.Types.
6991
6992 2005-01-27  Raja R Harinath  <rharinath@novell.com>
6993
6994         Update attribute-handling to use the SimpleName/MemberAccess
6995         mechanisms.
6996         * cs-parser.jay (attribute): Pass in an expression to the
6997         constructors of Attribute and GlobalAttribute.
6998         * attribute.cs (Attribute): Take an expression for the name.
6999         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
7000         passed in attribute name expression.
7001         (Attribute.CheckAttributeType): Use it.
7002         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
7003         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
7004         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
7005         argument to prevent error messages if the lookup fails.
7006
7007 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
7008
7009         * expression.cs (Indirection): Implemented IVariable interface
7010         to support indirection in AddressOf operator.
7011         (PointerArithmetic.Emit): Add optimalization for case where
7012         result can be precomputed.
7013
7014 2005-01-26  Martin Baulig  <martin@ximian.com>
7015
7016         * class.cs (TypeContainer.AttributeTargets): Return the correct
7017         AttributeTargets depending on our `Kind' instead of throwing an
7018         exception; fixes #71632.
7019
7020 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
7021
7022         Fix #71257
7023         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
7024         constant members.
7025
7026 2005-03-17  Martin Baulig  <martin@ximian.com>
7027
7028         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
7029         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
7030
7031 2005-03-17  Martin Baulig  <martin@ximian.com>
7032
7033         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
7034         to bool so we can return an error condition.
7035         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
7036         returned an error.
7037
7038 2005-03-17  Martin Baulig  <martin@ximian.com>
7039
7040         * generic.cs (TypeMananager.IsIEnumerable): New public method.
7041
7042         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
7043         converting from an array-type of T to `IEnumerable<T>'.
7044
7045 2005-03-16  Martin Baulig  <martin@ximian.com>
7046
7047         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
7048         (Nullable.LiftedUnaryMutator): New public class.
7049
7050         * expression.cs (UnaryMutator.DoResolve): Added support for
7051         Nullable Types.
7052
7053 2005-03-14  Martin Baulig  <martin@ximian.com>
7054
7055         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
7056
7057 2005-03-14  Martin Baulig  <martin@ximian.com>
7058
7059         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
7060         the comparision operators `<', `>', `<=' and `>='.
7061
7062 2005-03-13  Martin Baulig  <martin@ximian.com>
7063
7064         * generic.cs
7065         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
7066         avoid confusion with the `NullLiteral'.
7067         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
7068
7069 2005-03-13  Martin Baulig  <martin@ximian.com>
7070
7071         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
7072         comparing arbitrary types with the null literal.
7073
7074 2005-03-13  Martin Baulig  <martin@ximian.com>
7075
7076         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
7077         boolean operators '&&', '||', '&' and '|'.
7078         (Nullable.OperatorTrueOrFalse): New public class.
7079
7080         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
7081         instead of a `StaticCallExpr'; added support for nullables.
7082
7083 2005-03-10  Martin Baulig  <martin@ximian.com>
7084
7085         * expression.cs
7086         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
7087         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
7088
7089 2005-03-07  Martin Baulig  <martin@ximian.com>
7090
7091         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
7092         it work if `expr' is not an IMemoryLocation.
7093         (Nullable.Lifted): Implement IMemoryLocation.
7094         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
7095         target type.
7096
7097 2005-03-05  Martin Baulig  <martin@ximian.com>
7098
7099         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
7100         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
7101         (Nullable): Added support for lifted unary and binary operators.
7102
7103         * expression.cs (Unary.DoResolve): Added support for nullable types.
7104         (Binary.DoResolve): Likewise.
7105         (Conditional.DoResolve): Likewise.
7106
7107 2005-03-02  Martin Baulig  <martin@ximian.com>
7108
7109         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
7110
7111         * class.cs (ClassPart.SetParameterInfo): Override this.
7112         (PartialContainer.SetParameterInfo): Override this.
7113         (TypeContainer.CheckConstraints): New protected method.
7114         (PartialContainer.CheckConstraints): Override this and check
7115         whether the same contraints were specified in all parts of a
7116         partial generic type definition.
7117         (PartialContainer.UpdateConstraints): New public method.
7118
7119         * generic.cs (TypeParameter.UpdateConstraints): New public method.
7120
7121 2005-03-02  Martin Baulig  <martin@ximian.com>
7122
7123         Committing a patch from Carlos Alberto Cortez to fix #72887.
7124
7125         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
7126         casts from `T []' to `int []'.
7127
7128 2005-03-02  Martin Baulig  <martin@ximian.com>
7129
7130         * generic.cs (TypeManager.IsEqual): Make this symmetric.
7131
7132         * expression.cs (Binary.ResolveOperator): When resolving a
7133         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
7134         `=='.  Fixes #71866.  See gen-127.cs.
7135
7136 2005-03-02  Martin Baulig  <martin@ximian.com>
7137
7138         * class.cs (TypeContainer.DoDefineMembers): We also need a default
7139         static constructor in static classes.
7140
7141 2005-03-02  Martin Baulig  <martin@ximian.com>
7142
7143         * generic.cs
7144         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
7145         (Nullable.LiftedConversion): Added support for user-defined
7146         conversions.
7147
7148         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
7149
7150         * cs-parser.jay: Use ComposedCast everywhere instead of
7151         NullableType, so we don't need to check for NullableType
7152         everywhere.
7153         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
7154         case where we'll be resolved into a `parenthesized_expression_0'
7155         afterwards.
7156
7157         * convert.cs
7158         (Convert.UserDefinedConversion): Added nullable conversions.
7159
7160 2005-02-28  Martin Baulig  <martin@ximian.com>
7161
7162         * generic.cs (TypeManager.IsNullableType): New static method.
7163         (Nullable): New abstract class.
7164         (Nullable.NullLiteral): New public class.
7165         (Nullable.LiftedConversion): New public class.
7166
7167         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
7168         `builtin_types opt_nullable'.
7169
7170         * convert.cs
7171         (Convert.ImplicitConversionStandard): Added nullable conversions.
7172         (Convert.ExplicitConversionStandard): Likewise.
7173         (Convert.ExplicitConversion): Likewise.
7174
7175 2005-02-26  Martin Baulig  <martin@ximian.com>
7176
7177         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
7178         begin with a "?", for instance "?[]".  Don't do a type lookup if
7179         `dim' is empty.
7180
7181 2005-02-25  Martin Baulig  <martin@ximian.com>
7182
7183         The first part of Nullable Types :-)
7184
7185         * generic.cs (NullableType): New public class.
7186         (NullCoalescingOperator): New public class.
7187         (TypeArguments.Resolve): Add a CS0306 check.
7188
7189         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
7190         (opt_nullable): New rule.
7191         (type): Added `opt_nullable' to `namespace_or_type_name',
7192         `builtin_types' and `pointer_type'.
7193         (array_type): Added `opt_nullable'.
7194         (opt_rank_specifier_or_nullable): New rule; this is the
7195         combination of `opt_rank_specifier' and `opt_nullable'.
7196         (opt_error): New rule; catch errors here.
7197         (nullable_type_or_conditional): New rule; we use this to check for
7198         nullable and still detect the conditional operator.
7199         (local_variable_type): Use `opt_rank_specifier_or_nullable'
7200         instead `opt_rank_specifier'.
7201
7202         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
7203         for nullables.
7204
7205 2005-02-24  Martin Baulig  <martin@ximian.com>
7206
7207         * README, README.Changes: Removed; they're old and obsolete.
7208
7209 2005-02-22  Martin Baulig  <martin@ximian.com>
7210
7211         * generic.cs (TypeParameter.Resolve): If resolving the constraints
7212         returned an error, set `constraints' to null to avoid a crash
7213         later on.
7214         (TypeParameter.ResolveType): Likewise.
7215
7216 2005-02-22  Martin Baulig  <martin@ximian.com>
7217
7218         * generic.cs
7219         (Constraints.ResolveTypes): Protect against being called twice.
7220         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
7221         (TypeParameter.ResolveType): New public method; calls
7222         constraints.ResolveTypes().
7223         (TypeParameter.DefineType): Moved constraints.ResolveType() out
7224         into the new ResolveType().
7225         (GenericMethod.Define): Call ResolveType() on all our
7226         TypeParameter's.        
7227
7228 2005-02-21  Martin Baulig  <martin@ximian.com>
7229
7230         * generic.cs
7231         (TypeManager.generic_nullable_type): New static public field.
7232         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
7233
7234         * rootcontext.cs
7235         (RootContext.ResolveCore): Resolve "System.Nullable`1".
7236
7237 2005-02-15  Martin Baulig  <martin@ximian.com>
7238
7239         * generic.cs (ConstructedType.Constraints): Correctly check
7240         constraints if the argument type is a type parameter; fixes
7241         #72326. 
7242
7243 2005-02-02  Martin Baulig  <martin@ximian.com>
7244
7245         * delegate.cs (Delegate.DefineType): Report an internal error if
7246         TypeManager.multicast_delegate_type is null.  See bug #72015 for
7247         details.        
7248
7249 2005-01-29  Miguel de Icaza  <miguel@novell.com>
7250
7251         * pending.cs: Produce better code (no nops produced by using Ldarg
7252         + value).
7253         
7254         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7255         i - 1' it should be arg + 1.
7256
7257         Fixes bug #71819.
7258         
7259 2005-01-26  Martin Baulig  <martin@ximian.com>
7260
7261         * cs-parser.jay (indexer_declarator): Don't report an error if we
7262         have type parameters since we can be an explicit interface
7263         implementation; fixes #71449.
7264
7265 2005-01-26  Martin Baulig  <martin@ximian.com>
7266
7267         * class.cs (TypeContainer.AttributeTargets): Return the correct
7268         AttributeTargets depending on our `Kind' instead of throwing an
7269         exception; fixes #71632.
7270
7271 2005-01-26  Martin Baulig  <martin@ximian.com>
7272
7273         * delegate.cs (Delegate.DefineType): Correctly define our type
7274         parameters.  Fixes #71483.
7275
7276 2005-01-25  Raja R Harinath  <rharinath@novell.com>
7277
7278         Fix #71602.
7279         * expression.cs (MemberAccess.DoResolve): Don't complain with
7280         cs0572 when the LHS of a member access has identical name and type
7281         name.
7282
7283 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
7284
7285         Fix #71651, #71675
7286         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7287         CreatePermission.
7288         Create custom PermissionSet only for PermissionSetAttribute.
7289
7290 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
7291
7292         Fix #71649
7293         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7294         delegates in static class.
7295
7296 2005-01-24  Martin Baulig  <martin@ximian.com>
7297
7298         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7299         merging an implicit block, just use its reachability.
7300
7301         * statement.cs (Block.Resolve): Make the unreachable code check
7302         work wrt. implicit blocks; see test-337 from #63842.
7303
7304 2005-01-21  Alp Toker  <alp@atoker.com>
7305  
7306         * cs-parser.jay: destructor_declaration's container is PartialContainer
7307         not Class when partial types are used, so use Kind prop instead of
7308         'is'.
7309         
7310 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
7311
7312         * cs-parser.jay: Improve error reporting when an interface
7313         declares new types.
7314
7315 2005-01-20  Dick Porter  <dick@ximian.com>
7316
7317         * support.cs: SeekableStreamReader fix from Sandor Dobos
7318         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7319         chars are read.  Fixes bug 70369.
7320
7321 2005-01-20  Raja R Harinath  <rharinath@novell.com>
7322
7323         * cs-parser.jay (catch_clause): Simplify current_block handling
7324         somewhat.
7325
7326 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
7327
7328         * convert.cs (ImplicitStandardConversionExists): Synchronize the
7329         code with ImplicitStandardConversion to handle the implicit
7330         conversion of method groups into valid delegate invocations. 
7331
7332         The problem is that in parameter handling we were using this code
7333         path.  Fixes bug #64698
7334
7335 2005-01-19  Raja R Harinath  <rharinath@novell.com>
7336
7337         * cs-parser.jay: Fix several infelicities.
7338         - Avoid assigning to the parser value stack.  Code like 
7339           '$3 = null' is unclean.  Synthesize a value for the code block
7340           instead. 
7341         - Avoid using oob_stack for storing location information.  Use ...
7342         (_mark_): ... this.  New (empty) rule.  Saves the current location
7343         in $$.
7344         (foreach_statement): Avoid using oob_stack for current_block
7345         handling.  Use technique used in for_statement and
7346         using_statement.  Synthesize a value for the code block to store
7347         additional intermediate information.
7348
7349 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
7350
7351         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7352         of a different type is only allowed to private fields of a
7353         containing type, not on fields of a base class.
7354
7355         See test-174.cs and error cs0122-9.cs
7356
7357 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7358
7359         Fix test-335.cs (bug #58126).
7360         * cs-parser.jay (argument): Split out non-expression parts of the
7361         rule into 'non_simple_argument'.
7362         (invocation_expression): Support parenthesized invocations with
7363         multiple arguments, and with single non-simple arguments.
7364
7365 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7366
7367         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7368         places.
7369
7370 2005-01-12  Raja R Harinath  <rharinath@novell.com>
7371
7372         Fix cs0038-1.cs, cs1640-6.cs.
7373         * ecore.cs (Expression.Resolve): Remove special-case for
7374         SimpleName in error-handling.
7375         (Expression.almostMatchedMembers): Relax access permission to
7376         protected.
7377         (Expression.MemberLookupFailed): Handle duplicates in
7378         almostMatchedMembers list.
7379         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7380         * expression.cs (New.DoResolve): Report CS1540 for more cases.
7381         * typemanager.cs (GetFullNameSignature): Use the MethodBase
7382         overload if the passed in MemberInfo is a MethodBase.
7383
7384 2005-01-25  Martin Baulig  <martin@ximian.com>
7385
7386         * doc.cs
7387         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
7388
7389 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
7390
7391         Fix #70749
7392         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7393         for non-CAS & merge permission sets properly.
7394
7395 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7396
7397         Improve standard-compliance of simple name and member access 
7398         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
7399         * ecore.cs (FullNamedExpression): New abstract base class 
7400         for Namespaces and TypeExpressions.
7401         (ResolveFlags.SimpleName): Remove.
7402         (SimpleName): Remove support for dotted names.
7403         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
7404         DeclSpace.FindType and DeclSpace.LookupType.
7405         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7406         (Expression.ExprClassName): Make member function.
7407         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7408         a namespace.  Remove creation of dotted "SimpleName"s.
7409         (MemberAccess.DoResolve): Likewise.
7410         * decl.cs (DeclSpace.Cache): Make private.
7411         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7412         (DeclSpace.FindType): Update.
7413         (DeclSpace.LookupType): Move here from RootContext.  Return a 
7414         FullNamedExpression.
7415         * namespace.cs (Namespace): Derive from FullNamedExpression
7416         so that it can be part of expression resolution.
7417         (Namespace.Lookup): Return an FullNamedExpression.
7418         (NamespaceEntry.LookupAlias): Lookup aliases only in current
7419         namespace.
7420         * rootcontext.cs (NamespaceLookup): Remove.
7421         (LookupType): Move to DeclSpace.
7422         * attribute.cs (CheckAttributeType): Update.
7423         * doc.cs (FindDocumentedType): Remove allowAlias argument.
7424         (FindDocumentedTypeNonArray): Likewise.
7425
7426 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7427
7428         Fix cs0509.cs, cs1632.cs.
7429         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7430         is the same as IsInterface.
7431         (TypeContainer.GetClassBases): Likewise.
7432         * statement.cs (LabeledStatement.ig): New field.
7433         (LabeledStatement.LabelTarget): Save ILGenerator which created the
7434         label.
7435         (LabeledStatement.DoEmit): Check that the label was created with
7436         the same ILGenerator.
7437
7438 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7439
7440         Fix #71058
7441         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7442         accessors to its properties.
7443
7444         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
7445         from accessors to property.
7446         
7447 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7448
7449         Fix #70722
7450         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
7451         only for overrides.
7452         
7453 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
7454
7455         * attribute.cs: Check for null and empty strings.  
7456
7457         I have lost another battle to Paolo.
7458
7459 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
7460
7461         Fix #70942
7462         * class.cs (PropertyMethod): Set Parent field in ctors.
7463         (SetMethod.InternalParameters): Add unsafe switch hack.
7464         Override MarkForDuplicationCheck where it is appropriate.
7465
7466         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
7467         It says whether container allows members with the same name.
7468         Base default is no.
7469         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
7470         Removed is_method parameter.
7471
7472 2005-01-06  Duncan Mak  <duncan@ximian.com>
7473
7474         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
7475         because the previous change led to incorrect reporting of CS1032
7476         ("Cannot define/undefine preprocessor symbols after first token in
7477         file"). Instead of using `tokens_seen' as the only flag that
7478         triggers CS1040, introduce `comments_seen'. This new flag is used
7479         to signify having seen comments on the current line, so it is
7480         unset after a newline.
7481
7482 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7483
7484         * doc.cs : When searching for a type, find nested type too.
7485           This fixes bug #71040.
7486
7487 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7488
7489         * doc.cs :
7490           - Warn missing member comment on those classes which also does not
7491             have doc comments. Fixed bug #71041.
7492           - Don't warn missing doc comment on default constructor.
7493             Fixed bug #71042.
7494
7495 2005-01-06  Duncan Mak  <duncan@ximian.com>
7496
7497         * cs-tokenizer.cs (xtoken): After handling traditional C-style
7498         comments, set `tokens_seen' to true. This allows us to detect
7499         misplaced preprocessor directives (i.e. not at the beginning of
7500         the a line, nor after whitespaces). In that case, report error
7501         CS1040. This fixes bug #56460.
7502
7503         * cs-parser.jay (interface_member_declaration): Add checks for
7504         IsExplicitImpl, and report CS0541 error if an interface member is
7505         defined as an explicit interface declaration.
7506
7507 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
7508
7509         Fix #70817
7510         * class.cs (PropertyMethod): Set Parent field in ctors.
7511         (SetMethod.InternalParameters): Add unsafe switch hack.
7512         
7513         * decl.cs (MemberCore.Parent): Cannot be readonly.
7514
7515 2005-01-06  Raja R Harinath  <rharinath@novell.com>
7516
7517         * decl.cs (DeclSpace.ResolveType): Remove.
7518         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7519         Merge in code from ...
7520         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
7521         * class.cs, enum.cs: Update to changes.
7522
7523 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
7524
7525         * anonymous.cs: Ensure that we init the scope of our parent if it
7526         has not been initialized yet.
7527
7528 2004-12-30  Duncan Mak  <duncan@ximian.com>
7529
7530         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7531         if field.FieldBuilder is null. Fixes #70758.
7532
7533         * convert.cs: Fixed some typos and updated some of the comments.
7534         (ImplicitStandardConversionExists):
7535         (TryImplicitIntConversion): If `target_type' is an interface and
7536         the type of `ic' implements this interface, return true or a new
7537         BoxedCast instead of null. This fixes #70468.
7538
7539 2004-12-29  Duncan Mak  <duncan@ximian.com>
7540
7541         * expression.cs (Argument.Emit): Check that Expr is
7542         IMemoryLocation before casting to it, and report CS1510 otherwise.
7543
7544         This fixes #70402.
7545
7546 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
7547
7548         * statement.cs (Block.ThisVariable): remove the recursion here, to
7549         make the --profile more sane.
7550
7551 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
7552
7553         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7554         assembly, by JB Evain.
7555
7556 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7557
7558         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
7559           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7560         "parent" refers to enclosing type/class.  "base" refers to superclass.
7561
7562 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7563
7564         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7565         Ensure that we only have GlobalAttributes.
7566         * attribute.cs (Attribute.Emit): Make non-virtual.
7567         (GlobalAttribute.Emit): Remove.
7568         (Attribute.Resolve): Make virtual.
7569         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
7570         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7571         the argument. Don't create one.
7572         (Attribute.GetObsoleteAttribute): Likewise.
7573         (Attribute.GetClsCompliantAttributeValue): Likewise.
7574         * class.cs, decl.cs: Update to changes.
7575
7576 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
7577
7578         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7579         
7580         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7581         
7582         * statement.cs (Foreach.Resolve): Add error 186 report.
7583
7584 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
7585
7586         * expression.cs (Conditional.DoResolve): Add warning 429.
7587         
7588         * statement.cs (If.Resolve): Add warning 665.
7589
7590 2004-12-16  Raja R Harinath  <rharinath@novell.com>
7591
7592         New invariant: RootContext.Tree.Types.NamespaceEntry == null
7593         except when in the parser, and in GlobalAttribute.
7594         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7595         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7596         RootContext.Tree.Types.NamespaceEntry once work is done.
7597         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
7598         and resets RootContext.Tree.Types.NamespaceEntry.
7599
7600 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
7601
7602         * cs-parser.jay: Don't create a block for every variable.
7603
7604 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
7605
7606         * location.cs: Provide extra information.
7607
7608         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7609         variables from the captured environment, it is the ldarg_0.
7610
7611 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7612
7613         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7614         find a conclusion.
7615         
7616         * class.cs: Changed warning level for 169 to avoid developer
7617         displeasure from warning flooding. It will be changed back when they
7618         fix most of current BCL warnings.
7619         
7620         * RootContext.cs: Pushed default WarningLevel to 3.
7621         
7622         * statement.cs: Removed unused variable.
7623
7624 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7625
7626         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7627         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7628         Add error 502 report.
7629         (StaticClass.DefineType): Add error 441 report.
7630         (Class.AllowedModifiersProp): New virtual property as temporary
7631         extension to AllowedModifiers.
7632         (Class.DefineType): Add error 418 report. Moved ModFlags check here
7633         to share implementation with StaticClass and don't call virtual
7634         methods from ctor.
7635         
7636         * driver.cs (MainDriver): Add error 1558 test.
7637
7638         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7639         report. Moved error 36 test here.
7640
7641         * statement.cs (Throw.Resolve): Add error 724 report.
7642
7643         * typemanager.cs: Add out_attribute_type core type.
7644         
7645 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
7646
7647         * class.cs (TypeContainer.VerifyClsCompliance): Add error
7648         3018 report.
7649         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7650
7651         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7652         3017 report.
7653         
7654         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7655
7656         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
7657         Add error 3023 report.
7658         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7659
7660         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7661         implementation.
7662
7663 2004-12-12  John Luke  <john.luke@gmail.com>
7664
7665         * driver.cs (AddArgs): take -- into account when
7666         adding arguments, fixes bug 65710 
7667
7668 2004-12-12  Martin Baulig  <martin@ximian.com>
7669
7670         * expression.cs (Unary.TryReduceNegative): Added support for
7671         SByteConstant and ByteConstant.
7672         (Unary.Reduce): Check error values from TryReduceNegative().
7673
7674 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
7675
7676         * attributes.cs (Attribute.Resolve): Avoid multiple error report
7677         and report exception as error 182.
7678
7679 2004-12-10  Raja R Harinath  <rharinath@novell.com>
7680
7681         * driver.cs (Main): Fix message when there are warnings.
7682
7683 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
7684
7685         * delegate.cs: Fixed my fix from yesterday, sorry about that.
7686
7687 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
7688
7689         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
7690         Reduced number of warnings.
7691         
7692         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7693
7694 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
7695
7696         * driver.cs: Removed message.
7697
7698         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7699
7700 2004-12-08    <vargaz@freemail.hu>
7701
7702         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7703
7704 2004-12-08  Martin Baulig  <martin@ximian.com>
7705
7706         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7707         instead of a CS3002 for properties and indexer.
7708
7709 2004-12-08  Martin Baulig  <martin@ximian.com>
7710
7711         * decl.cs (MemberName.ToString): Make this work again.
7712
7713 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
7714
7715         * attribute.cs (Resolve): Add error 591 detection.
7716
7717         * class.cs (FieldMember.Define): Add error 1547 detection.
7718         (Indexer.Define): Add error 620 detection.
7719         (Operator.Define): Add error 590 detection.
7720
7721         * ecore.cs: Missing argument for error 79.
7722
7723         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7724         detection.
7725
7726 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
7727
7728         Fix #70106
7729         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7730         only.
7731
7732 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7733
7734         * cs-parser.jay : handle doc comments on implicit/explicit operators.
7735           Some operator comments were suppressed.
7736         * doc.cs : Implicit/explicit operator name in doc comments are like
7737           "op_Explicit(type)~returnType", so added suffix handling.
7738
7739 2005-01-21  Alp Toker  <alp@atoker.com>
7740
7741         * cs-parser.jay: destructor_declaration's container is PartialContainer
7742         not Class when partial types are used, so use Kind prop instead of 'is'.
7743
7744 2004-12-12  Martin Baulig  <martin@ximian.com>
7745
7746         * expression.cs (Unary.TryReduceNegative): Added support for
7747         SByteConstant and ByteConstant.
7748         (Unary.Reduce): Check error values from TryReduceNegative().
7749
7750 2004-12-11  Martin Baulig  <martin@ximian.com>
7751
7752         * support.cs (ReflectionParameters.ParameterName): If we have a
7753         `gpd', call `ParameterName' on it.
7754
7755         * parameter.cs (Parameter.GetParameterAttributes): New static method.
7756
7757         * pending.cs (PendingImplementation.DefineProxy): Call
7758         DefineParameter() for all of the MethodBuilder's arguments.
7759
7760 2004-12-09  Martin Baulig  <martin@ximian.com>
7761
7762         * doc.cs (DocUtil): Make this a static class.
7763
7764 2004-12-09  Martin Baulig  <martin@ximian.com>
7765
7766         * expression.cs (Invocation.InferType): Moved the type inference
7767         implementation into TypeManager.
7768
7769         * generics.cs (TypeManager): Moved the type inference
7770         implementation here.
7771
7772 2004-12-09  Martin Baulig  <martin@ximian.com>
7773
7774         * typemanager.cs (TypeManager): Make this a partial class.
7775
7776         * generics.cs
7777         (TypeManager): Move the generics part of `TypeManager' here.
7778
7779 2004-12-08  Martin Baulig  <martin@ximian.com>
7780
7781         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7782         instead of a CS3002 for properties and indexer.  Added CS3024
7783         check for generic interfaces.
7784
7785         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
7786         instances are not CLS-compliant.
7787
7788 2004-12-08  Martin Baulig  <martin@ximian.com>
7789
7790         * cs-parser.jay
7791         (void_pointer_expression): New rule for `void*', `void**' etc.
7792         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
7793
7794 2004-12-08  Martin Baulig  <martin@ximian.com>
7795
7796         * expression.cs (Invocation.InferType): Removed the hack for
7797         MethodCore.MayUnify().  
7798
7799         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
7800         this actually work.
7801
7802         * class.cs (MethodCore.MayUnify): Use
7803         TypeManager.MayBecomeEqualGenericTypes().       
7804
7805 2004-12-08  Martin Baulig  <martin@ximian.com>
7806
7807         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
7808         parameter, box it.  Fixes #69233.
7809
7810 2004-12-08  Martin Baulig  <martin@ximian.com>
7811
7812         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
7813         have the ctor constraint.  Fixes #68326.
7814
7815 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7816
7817         * cs-parser.jay : interface comment was not consumed because of
7818           extra opt_semicolon before doc handling.
7819
7820 2004-12-03  Raja R Harinath  <rharinath@novell.com>
7821
7822         Fix test-327.cs, test-328.cs, and put in early infrastructure
7823         for eventually fixing #52697.
7824         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7825         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7826         from other methods.
7827         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7828         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7829         (VerifyUsing, error246): Update.
7830         * rootcontext.cs (RootContext.NamespaceLookup): Just use
7831         'NamespaceEntry.LookupNamespaceOrType'.
7832
7833 2004-12-07  Martin Baulig  <martin@ximian.com>
7834
7835         * driver.cs: Call it "BETA SOFTWARE" :-)
7836
7837 2004-12-06  Raja R Harinath  <rharinath@novell.com>
7838
7839         Fix crash on cs0657-17.cs.
7840         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7841         Use RootContext.Tree.Types, not 'new RootTypes ()'.
7842         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7843         the case where the NamespaceEntry gets overwritten.
7844
7845 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
7846
7847         Fixed #69195, #56821
7848         * ecore.cs (ResolveBoolean): Tiny refactoring.
7849
7850         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7851         of right expression resolving when left is false constant and
7852         operator is LogicalAnd OR true constant and operator is LogicalOr.
7853
7854         * statement.cs (ResolveUnreachable): Always reports warning.
7855
7856 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
7857
7858         * class.cs: Distinguish between 1721 and 1722 (just a little help
7859         for the programmer).
7860
7861 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
7862
7863         * delegate.cs: Only allow this on new versions of the language. 
7864
7865 2004-12-02  Duncan Mak  <duncan@ximian.com>
7866
7867         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7868         Expression class.
7869         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7870         here as a static method. Take an additional bool out parameter
7871         `must_do_cs1540_check' for signaling to InstanceResolve.
7872         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7873         member field from PropertyExpr class and made it an argument of
7874         the method instead.
7875         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7876         check for MarshalByRefObject, and report CS0122 instead of CS1540.
7877         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7878         and `remove_accessor' as well as InstanceResolve: report CS0122
7879         where applicable.
7880
7881         Fixes #70129.
7882
7883 2004-12-07  Martin Baulig  <martin@ximian.com>
7884
7885         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
7886         and CS0692 where appropriate.
7887
7888 2004-12-06  Martin Baulig  <martin@ximian.com>
7889
7890         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
7891         IsDuplicateImplementation() and improved it.
7892
7893         * expression.cs (Invocation.InferTypeArguments): Added
7894         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
7895         and removed the "ref" modifier from `infered_types'.
7896
7897         * decl.cs (MemberName.ToString): Removed the exception.
7898
7899 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
7900
7901         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7902           comments are allowed.
7903
7904 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7905
7906         * delegate.cs: Add checks for subtypes in paramaters and return values
7907         in VerifyMethod () to add support for Covariance/Contravariance
7908         in delegates.
7909         
7910 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
7911
7912         * report.cs: Remove extra closing parenthesis.
7913
7914         * convert.cs (Error_CannotImplicitConversion): If the name of the
7915         types are the same, provide some extra information.
7916
7917 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
7918
7919         Fix bug #70102
7920         * attribute.cs (Resolve): Improved implementation of params
7921         attribute arguments.
7922
7923         * support.cs (ParameterData): Add HasParams to be faster.
7924
7925 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
7926
7927         all things are for /doc support:
7928
7929         * doc.cs: new file that supports XML documentation generation.
7930         * mcs.exe.sources: added doc.cs.
7931         * driver.cs:
7932           Handle /doc command line option.
7933           Report error 2006 instead of 5 for missing file name for /doc.
7934           Generate XML documentation when required, after type resolution.
7935         * cs-tokenizer.cs:
7936           Added support for picking up documentation (/// and /** ... */),
7937           including a new XmlCommentState enumeration.
7938         * cs-parser.jay:
7939           Added lines to fill Documentation element for field, constant,
7940           property, indexer, method, constructor, destructor, operator, event
7941           and class, struct, interface, delegate, enum.
7942           Added lines to warn incorrect comment.
7943         * rootcontext.cs :
7944           Added Documentation field (passed only when /doc was specified).
7945         * decl.cs:
7946           Added DocComment, DocCommentHeader, GenerateDocComment() and
7947           OnGenerateDocComment() and some supporting private members for
7948           /doc feature to MemberCore.
7949         * class.cs:
7950           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7951         * delegate.cs:
7952           Added overriden DocCommentHeader.
7953         * enum.cs:
7954           Added overriden DocCommentHeader and GenerateDocComment().
7955
7956 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
7957
7958         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7959         unwrapping the enumeration values, chain to
7960         DoConstantNumericPromotions again, so we can promote things to the
7961         fundamental types (takes care of enums that are bytes, sbytes).
7962
7963         Fixes bug #62054.
7964
7965 2004-12-01  Raja R Harinath  <rharinath@novell.com>
7966
7967         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7968         Fix long-standing bug in type-lookup.  Use FindType instead of
7969         LookupType when ec.ResolvingTypeTree.
7970         (Attribute.ResolveType, Attribute.Resolve)
7971         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7972         Update to changes.
7973         (Attributes.Search): Remove internal version.  Update.
7974         (Attributes.SearchMulti): Update.
7975         (Attributes.GetClsCompliantAttribute): Remove.
7976         (Attributes.GetIndexerNameAttribute): Remove.
7977         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7978         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7979         * class.cs (Indexer.Define): Likewise.
7980
7981 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
7982
7983         Fix bug #68790
7984         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7985         MarshallByReference members access.
7986
7987         * expression.cs: Use CheckMarshallByRefAccess;
7988         Better error CS0197 message.
7989
7990         * report.cs: Print whole related error message.
7991
7992 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7993
7994         * class (GetClassBases): Better error 60 report.
7995         (EventProperty): Disabled warning 67 detection.
7996
7997 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7998
7999         Fix bug #60324
8000         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
8001
8002         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
8003         precise values.
8004
8005 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8006
8007         Fix bug #49488
8008         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
8009
8010         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
8011
8012 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
8013
8014         * attribute.cs (Attribute.Resolve): Refine error reporting and
8015         report a cs0117 if the identifier does not exist, to distinguish
8016         from 0617 which is a miss-use of the actual identifier.
8017
8018         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
8019         between cs0070 and cs0079.
8020
8021         * class.cs (MemberBase.DoDefine): When reporting a wrong
8022         accessibility level, we use MethodCore to compare instead of
8023         Method (this was a regression in some refactoring effort).
8024
8025         So now we correctly report cs0056 again.
8026
8027         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
8028         testing the target_type (which was known to be object_type) and
8029         not the source type (which is anonymous_method).
8030
8031         Fixed reporting of error cs1660.
8032
8033         * expression.cs (UserCast.Source): Expose the underlying cast.
8034
8035         * statement.cs (Switch.SwitchGoverningType): Sort the list of
8036         allowed types to find a match to int32 first (most common).
8037
8038         In addition, it ignores any ImplicitUserConversions that did an
8039         internal implicit conversion (as the switch statement allows only
8040         one integral conversion to exist).
8041
8042         * class.cs (PartialContainer.Create): rename `name' to
8043         `member_name' for clarity.  Then replace the string calls with a
8044         call to MemberName.GetPartialName, as now using
8045         MemberName.ToString is an error (this is due to the side effects
8046         it had, that were fixed in the past).
8047
8048         This will restore the error reporting on a number of partial class
8049         errors that were missusing this (and getting an exception as a
8050         results, which is now just a plain textual warning, because
8051         yyparse debug output would crash otherwise).
8052
8053 2004-11-26  Raja R Harinath  <rharinath@novell.com>
8054
8055         * Makefile (PROGRAM_INSTALL_DIR): Remove.
8056
8057 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
8058
8059         * rootcontext.cs (LookupType): Make sure to cache lookups that
8060         don't give us a negative result. This saves about 5% of corlib
8061         compilation time.
8062
8063 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8064
8065         * report.cs (AbstractMessage.Print): messages are sent to stderr
8066
8067         * class.cs (TypeContainer.GetClassBases): It is an error to have a
8068         non-interface in the list of interfaces (at this point, either
8069         parent was properly set, or a base class is being listed in the
8070         interfaces section).
8071
8072         This flags error 1722, and resolves the crash from bug 69259.
8073
8074 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
8075
8076         * statement.cs (Using.EmitExpressionFinally): make this work right
8077         for valuetypes. Fixes 69926.
8078
8079 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8080
8081         * const.cs (Const.ChangeType): Cope with the "0 literal can be
8082         converted to an enum" here, before we try to change the underlying
8083         type.  This code exists, but it is a different code path than the
8084         one used while encoding constants.
8085
8086         (ImplicitReferenceConversionExists): In addition, resynchronized
8087         the code here, so it matches the same code in
8088         ImplicitReferenceConversionExists for the `from any class-type S
8089         to any interface-type T'.       
8090
8091 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
8092
8093         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
8094
8095 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
8096
8097         * cs-parser.jay: Use verbosity accordingly. 
8098
8099 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8100
8101         * expression.cs (Unary.ResolveOperator): Do not report warning;
8102         AddressOf reads from variable.
8103         
8104         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
8105
8106 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8107
8108         Fix bug #69462
8109
8110         * attribute.cs (Attributable): Removed CheckTargets.
8111         (Attributes.Emit): Explicit attribute targets are tested here.
8112
8113         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
8114         not enabled for interfaces.
8115
8116         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
8117         (GetAssemblyName): Ouch next bug there.
8118
8119 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8120
8121         * expression.cs: Error 275 added.
8122         
8123 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
8124
8125         Fix bug #69177 (Implemented decimal constant support)
8126
8127         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
8128         (BinaryFold): Add DecimalConstant.
8129
8130         * const.cs (Define): Decimal constant 
8131         (is not constant.
8132         (ChangeType): Add decimal type handling.
8133         (LookupConstantValue): Don't set value for decimal type but
8134         emit DecimalConstantAttribute. Needed for constant optimization.
8135
8136         * constant.cs (ToDecimal): New method.
8137         (ConvertToDecimal): New method.
8138         (IntConstant): Implemented ConvertToDecimal.
8139         (DecimalConstant.Emit): Emit optimized version for decimals in
8140         int range.
8141
8142         * expression.cs (ResolveOperator): Changed order of constant
8143         reduction to work correctly with native types which have
8144         overloaded operators.
8145         (ResolveMemberAccess): Extract constant value from attribute
8146         for decimal type.
8147
8148         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8149
8150         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8151         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8152         (ChangeType): Decimal is special.
8153         (TypeToCoreType): Add decimal type.
8154
8155 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8156
8157         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8158         decimal types.
8159
8160 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8161
8162         * class.cs (EventField.ApplyAttributeBuilder): Fix error
8163         test cs1667-5.cs.
8164
8165 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8166
8167         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8168
8169         * pending.cs (PendingImplementation): Grab only interfaces.
8170
8171 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8172
8173         * statement.cs (ForeachHelperMethods): Add location member and
8174         error 202 detection.
8175
8176 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
8177
8178         * expression.cs (DoResolveBase): Fixed wrong warning for out
8179         variables.
8180
8181 2004-12-04  Martin Baulig  <martin@ximian.com>
8182
8183         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
8184         to check whether the conversion is ok.
8185
8186         * typemanager.cs (TypeManager.GetTypeArguments): Just return
8187         `Type.EmptyTypes' if we're not a generic TypeContainer.
8188
8189 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8190
8191         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8192         old bug: when converting from the null literal to a pointer,
8193         return an EmptyCast, not the NullLiteral.
8194
8195         This fixes #69921, the recent null_type changes probably made this
8196         bug more prominent.
8197
8198 2004-12-03  Martin Baulig  <martin@ximian.com>
8199
8200         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8201         method as our child, call AnonymousMethod.Compatible() on it.
8202
8203 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
8204
8205         * class.cs (FieldBase): Use an unused bit field from the field to
8206         encode the `has_offset' property from the FieldMember.  This saves
8207         a couple of Ks on bootstrap compilation.
8208
8209         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8210         method as our child, return the AnonymousMethod resolved
8211         expression.
8212
8213         * expression.cs (New.DoResolve): Allow return values from
8214         NewDelegate to also include AnonymousMethods.
8215
8216         Fixes #70150.
8217
8218 2004-11-29  Raja R Harinath  <rharinath@novell.com>
8219
8220         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
8221         cs1648 report.
8222         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
8223         System.Runtime.InteropServices._Exception, since it's a base
8224         interface of the core type System.Exception in the net_2_0 profile.
8225
8226 2004-11-27  Martin Baulig  <martin@ximian.com>
8227
8228         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
8229
8230 2004-11-26  Raja R Harinath  <rharinath@novell.com>
8231
8232         * Makefile: Convert to use executable.make.
8233         * gmcs.exe.sources: New.
8234
8235 2004-11-25  Martin Baulig  <martin@ximian.com>
8236
8237         * expression.cs (Invocation.InferType): Added support for byref types.
8238
8239 2004-11-25  Martin Baulig  <martin@ximian.com>
8240
8241         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
8242         in TypeManager.TypeToCoreType().
8243
8244 2004-11-25  Martin Baulig  <martin@ximian.com>
8245
8246         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
8247         "Dispose" method from the `current_type'.
8248         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
8249         DoDefineMembers() instead of using the MethodBuilder; this is
8250         required for generic iterators.
8251
8252         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
8253
8254 2004-11-24  Martin Baulig  <martin@ximian.com>
8255
8256         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
8257
8258 2004-11-20  Martin Baulig  <martin@ximian.com>
8259
8260         * expression.cs (Invocation.InferType): Correctly infer generic
8261         instances; see gen-103.cs.
8262         (Invocation.InferTypeArguments): If a generic method doesn't have
8263         any unbound type parameters, we don't need to infer anything.
8264
8265 2004-11-19  Raja R Harinath  <rharinath@novell.com>
8266
8267         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
8268
8269 2004-11-17  Raja R Harinath  <rharinath@novell.com>
8270
8271         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8272         (TypeHandle.GetMemberCache): New.
8273         (TypeHandle.TypeHandle): Update.
8274         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8275         (TypeManager.LookupParentInterfacesCache):
8276         Rename from LookupInterfaceCache.  Optimize slightly.
8277         (TypeManager.MemberLookup_FindMembers): Update.
8278         * decl.cs (MemberCache.MemberCache): Set Container to null in the
8279         multi-type variant.
8280         (AddCacheContents): Rename from AddHashtable.
8281         * class.cs (TypeContainer.parent_container): Remove.
8282         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8283         (TypeContainer.DoDefineMembers): Don't initialize it.
8284         Update to name changes.
8285         
8286 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
8287
8288         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8289         that factors the code to check access modifiers on override.  
8290
8291         (PropertyBase): Use the code here.
8292
8293         Patch from Lluis S'anchez, fixes bug #69361.
8294
8295 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
8296
8297         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8298         routine that is used to report the use of a captured variable
8299         whose address has been taken.
8300
8301         There are two checks: one when variables are being captured and
8302         the other check is when the address of a variable is taken. 
8303         
8304         (because an anonymous methods might be resolved before *or* after
8305         the address has been taken) and 
8306
8307         * expression.cs (Conditional.DoResolve): Remove the special
8308         casing that Martin added to trueExpr and falseExpr being both
8309         NullLiteral.  We get the right behavior now just by introducing
8310         the null_type into the compiler. 
8311
8312         * convert.cs (ExplicitConversion): Change the code to use
8313         null_type instead of testing `expr is NullLiteral'.
8314         (ImplicitConversionStandard): use null_type too.
8315         (ImplicitReferenceConversionExists): use null_type too.
8316         (ImplicitReferenceConversion): use null_type too.
8317
8318         * literal.cs: The type of `NullLiteral' is now null_type instead
8319         of object_type. 
8320         (Resolve): Set the type here.
8321
8322         * typemanager.cs: Introduce null_type.
8323
8324 2004-11-18  Martin Baulig  <martin@ximian.com>
8325
8326         * rootcontext.cs
8327         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
8328
8329 2004-11-18  Martin Baulig  <martin@ximian.com>
8330
8331         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
8332
8333 2004-11-18  Martin Baulig  <martin@ximian.com>
8334
8335         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
8336         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
8337         call ResolveConstructedType() on it to resolve it without checking
8338         constraints.
8339         (Constraints.ResolveTypes): Check them here.
8340         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
8341         but don't check constraints.
8342         (ConstructedType.ResolveAsTypeTerminal): Override this and also
8343         check constraints here.
8344         (ConstructedType.ResolveConstructedType): New public method.  This
8345         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
8346         resolve ourselves without checking constraints.
8347
8348         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
8349
8350 2004-11-18  Martin Baulig  <martin@ximian.com>
8351
8352         * decl.cs
8353         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
8354
8355         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
8356
8357 2004-11-18  Martin Baulig  <martin@ximian.com>
8358
8359         * ecore.cs (TypeExpr.ResolveType): Removed.
8360         (Expression.ResolveAsTypeTerminal): We always return a fully
8361         resolved `TypeExpr', so we can just access its `Type'.
8362
8363         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
8364
8365 2004-11-17  Martin Baulig  <martin@ximian.com>
8366
8367         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
8368         sure we don't return any unresolved TypeExpr's.
8369         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
8370         a `TypeExpr'.
8371         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
8372
8373         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
8374         unresolved `ConstructedType's.
8375
8376 2004-11-17  Martin Baulig  <martin@ximian.com>
8377
8378         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
8379
8380 2004-11-17  Martin Baulig  <martin@ximian.com>
8381
8382         * ecore.cs
8383         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
8384
8385         * decl.cs (DeclSpace.ResolveType): Removed.
8386         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
8387
8388 2004-11-17  Martin Baulig  <martin@ximian.com>
8389
8390         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8391         direction, like FindMembers() does.  Fixes #69546, testcase is in
8392         test-315.cs.    
8393
8394 2004-11-16  Martin Baulig  <martin@ximian.com>
8395
8396         This is based on a patch from Marek Safar, see bug #69082.
8397         Fixes bugs #63705 and #67130.
8398
8399         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8400         method; create a MemberCache for an interface type and cache the
8401         result.
8402
8403         * decl.cs (IMemberContainer.ParentContainer): Removed.
8404         (IMemberContainer.ParentCache): New property.
8405         (MemberCache.SetupCacheForInterface): Removed.
8406         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8407         to create a cache for an interface's "parent".
8408
8409         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8410         interfaces too.
8411
8412 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
8413
8414         * statement.cs: Avoid adding bools to a hashtable.
8415
8416 2004-11-15  Martin Baulig  <martin@ximian.com>
8417
8418         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
8419
8420 2004-11-11  Martin Baulig  <martin@ximian.com>
8421
8422         * typemanager.cs (TypeManager.GetMethodName): New method.
8423
8424         * class.cs (MethodData.Define): Include the generic arity in the
8425         name of an explicit interface; also add it to the method name.
8426
8427         * pending.cs (PendingImplementation.InterfaceMethod): The method
8428         name now includes the generic arity.
8429
8430 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
8431
8432         * expression.cs (Invocation.OverloadResolve): Flag error if we are
8433         calling an unsafe method from a safe location.
8434
8435 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
8436
8437         Fix #69167
8438         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8439
8440 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
8441
8442         * namespace.cs (VerifyUsing): use GetPartialName instead of
8443         ToString. 
8444
8445 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
8446
8447         * statement.cs (Return.Resolve): Fix regression in typo: if
8448         `in_exc', we have to request a NeedReturnLabel, this was a typo
8449         introduced in the anonymous method check-in.  Fixes #69131.
8450
8451         * Indexers were using the ShortName when defining themselves,
8452         causing a regression in the compiler bootstrap when applying the
8453         patch from 2004-11-02 (first part), now they use their full name
8454         and the bug is gone.
8455
8456 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
8457
8458         * driver.cs: Strip the path from the names of embedded resources. Fixes
8459         #68519.
8460
8461 2004-11-04  Raja R Harinath  <rharinath@novell.com>
8462
8463         Fix error message regression: cs0104-2.cs.
8464         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8465         (AliasEntry.Resolve): Update.
8466         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
8467         'silent' flag.
8468         (RootContext.LookupType): Update.
8469
8470 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
8471
8472         * cs-parser.jay: Add support for handling accessor modifiers
8473         * class: Add support port accessor modifiers and error checking,
8474         define PropertyMethod.Define as virtual (not abstract anymore)
8475         * ecore.cs: Add checking for proeprties access with access modifiers
8476         * iterators.cs: Modify Accessor constructor call based in the modified
8477         constructor
8478 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
8479
8480         * expression.cs (StringConcat): Handle being called twice,
8481         as when we have a concat in a field init with more than two
8482         ctors in the class
8483
8484 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
8485
8486         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8487         special case explicit implementations, we should always produce
8488         the .property or .event declaration.
8489         
8490         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8491         since it will not return correct data if people use this
8492         unresolved in the presence of using statements (see test-313).
8493
8494         * class.cs (MethodData.Define): If we are an explicit interface
8495         implementation, set the method name to the full name of the
8496         interface plus the name of the method.  
8497
8498         Notice that using the method.MethodName.GetFullName() does not
8499         work, as it will only contain the name as declared on the source
8500         file (it can be a shorthand in the presence of using statements)
8501         and not the fully qualifed type name, for example:
8502
8503         using System;
8504
8505         class D : ICloneable {
8506                 object ICloneable.Clone ()  {
8507                 }
8508         }
8509
8510         Would produce a method called `ICloneable.Clone' instead of
8511         `System.ICloneable.Clone'.
8512
8513         * namespace.cs (Alias.Resolve): Use GetPartialName.
8514         
8515 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8516
8517         * cs-parser.jay: Add error 1055 report.
8518
8519 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
8520
8521         * assign.cs (Assign.DoResolve): Only do the transform of
8522         assignment into a New if the types are compatible, if not, fall
8523         through and let the implicit code deal with the errors and with
8524         the necessary conversions. 
8525
8526 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8527
8528         * cs-parser.jay: Add error 1031 report.
8529
8530         * cs-tokenizer.cs: Add location for error 1038.
8531
8532 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8533
8534         * cs-parser.jay: Add error 1016 report.
8535
8536 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8537
8538         * cs-parser.jay: Add errors 1575,1611 report.
8539
8540 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8541
8542         * cs-parser.jay: Add error 1001 report.
8543
8544 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8545
8546         Fix #68850
8547         * attribute.cs (GetMarshal): Add method argument for
8548         caller identification.
8549
8550         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8551         agument for GetMarshal and RuntimeMissingSupport.
8552
8553 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8554
8555         * attribute.cs (ExtractSecurityPermissionSet): Removed
8556         TypeManager.code_access_permission_type.
8557
8558         * typemanager.cs: Removed TypeManager.code_access_permission_type.
8559
8560 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
8561
8562         * expression.cs (LocalVariableReference.DoResolveLValue): Check
8563         for obsolete use of a variable here.   Fixes regression on errors
8564         cs0619-25 and cs0619-26.
8565
8566 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
8567
8568         Fix #62358, implemented security attribute encoding.
8569
8570         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8571         Tests permitted SecurityAction for assembly or other types.
8572         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8573         data from SecurityPermissionAttribute to PermisionSet class.
8574
8575         * class.cs (ApplyAttributeBuilder): Added special handling
8576         for System.Security.Permissions.SecurityAttribute based types.
8577
8578         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8579         special handling for System.Security.Permissions.SecurityAttribute
8580         based types.
8581
8582         * enum.cs (ApplyAttributeBuilder): Added special handling
8583         for System.Security.Permissions.SecurityAttribute based types.
8584
8585         * parameter.cs (ApplyAttributeBuilder): Added special handling
8586         for System.Security.Permissions.SecurityAttribute based types.
8587
8588         * rootcontext.cs: Next 2 core types.
8589
8590         * typemanager.cs (TypeManager.security_permission_attr_type):
8591         Built in type for the SecurityPermission Attribute.
8592         (code_access_permission_type): Build in type.
8593
8594 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
8595
8596         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8597         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8598         all of this information into
8599         EmitContext.EmitCapturedVariableInstance.
8600         
8601         * codegen.cs (EmitCapturedVariableInstance): move here the
8602         funcionality of emitting an ldarg.0 in the presence of a
8603         remapping.   This centralizes the instance emit code.
8604
8605         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8606         then emit a load of this: it means that we have reached the
8607         topmost ScopeInfo: the one that contains the pointer to the
8608         instance of the class hosting the anonymous method.
8609
8610         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8611         captures to the topmost CaptureContext.
8612
8613 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
8614
8615         * expression.cs (LocalVariableReference): Move the knowledge about
8616         the iterators into codegen's EmitCapturedVariableInstance.
8617
8618 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
8619
8620         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8621         all code paths return a value from an anonymous method (it is the
8622         same as the 161 error, but for anonymous methods).
8623
8624 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
8625
8626         The introduction of anonymous methods in the compiler changed
8627         various ways of doing things in the compiler.  The most
8628         significant one is the hard split between the resolution phase
8629         and the emission phases of the compiler.
8630
8631         For instance, routines that referenced local variables no
8632         longer can safely create temporary variables during the
8633         resolution phase: they must do so from the emission phase,
8634         since the variable might have been "captured", hence access to
8635         it can not be done with the local-variable operations from the runtime.
8636         
8637         * statement.cs 
8638
8639         (Block.Flags): New flag `IsTopLevel' to indicate that this block
8640         is a toplevel block.
8641
8642         (ToplevelBlock): A new kind of Block, these are the blocks that
8643         are created by the parser for all toplevel method bodies.  These
8644         include methods, accessors and anonymous methods.
8645
8646         These contain some extra information not found in regular blocks:
8647         A pointer to an optional CaptureContext (for tracking captured
8648         local variables and parameters).  A pointer to the parent
8649         ToplevelBlock.
8650         
8651         (Return.Resolve): Catch missmatches when returning a value from an
8652         anonymous method (error 1662).
8653         Invoke NeedReturnLabel from the Resolve phase instead of the emit
8654         phase.
8655
8656         (Break.Resolve): ditto.
8657
8658         (SwitchLabel): instead of defining the labels during the
8659         resolution phase, we now turned the public ILLabel and ILLabelCode
8660         labels into methods called GetILLabelCode() and GetILLabel() that
8661         only define the label during the Emit phase.
8662
8663         (GotoCase): Track the SwitchLabel instead of the computed label
8664         (its contained therein).  Emit the code by using
8665         SwitchLabel.GetILLabelCode ().
8666
8667         (LocalInfo.Flags.Captured): A new flag has been introduce to track
8668         whether the Local has been captured or not.
8669
8670         (LocalInfo.IsCaptured): New property, used to tell whether the
8671         local has been captured.
8672         
8673         * anonymous.cs: Vastly updated to contain the anonymous method
8674         support.
8675
8676         The main classes here are: CaptureContext which tracks any
8677         captured information for a toplevel block and ScopeInfo used to
8678         track the activation frames for various local variables.   
8679
8680         Each toplevel block has an optional capture context associated
8681         with it.  When a method contains an anonymous method both the
8682         toplevel method and the anonymous method will create a capture
8683         context.   When variables or parameters are captured, they are
8684         recorded on the CaptureContext that owns them, for example:
8685
8686         void Demo () {
8687              int a;
8688              MyDelegate d = delegate {
8689                  a = 1;
8690              }
8691         }
8692
8693         Here `a' will be recorded as captured on the toplevel
8694         CapturedContext, the inner captured context will not have anything
8695         (it will only have data if local variables or parameters from it
8696         are captured in a nested anonymous method.
8697
8698         The ScopeInfo is used to track the activation frames for local
8699         variables, for example:
8700
8701         for (int i = 0; i < 10; i++)
8702                 for (int j = 0; j < 10; j++){
8703                    MyDelegate d = delegate {
8704                         call (i, j);
8705                    }
8706                 }
8707
8708         At runtime this captures a single captured variable `i', but it
8709         captures 10 different versions of the variable `j'.  The variable
8710         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8711         recorded on a child.  
8712
8713         The toplevel ScopeInfo will also track information like the `this'
8714         pointer if instance variables were referenced (this is necessary
8715         as the anonymous method lives inside a nested class in the host
8716         type of the method). 
8717
8718         (AnonymousMethod): Expanded to track the Toplevel, implement
8719         `AnonymousMethod.Compatible' to tell whether an anonymous method
8720         can be converted to a target delegate type. 
8721
8722         The routine now also produces the anonymous method content
8723
8724         (AnonymousDelegate): A helper class that derives from
8725         DelegateCreation, this is used to generate the code necessary to
8726         produce the delegate for the anonymous method that was created. 
8727
8728         * assign.cs: API adjustments for new changes in
8729         Convert.ImplicitStandardConversionExists.
8730
8731         * class.cs: Adjustments to cope with the fact that now toplevel
8732         blocks are of type `ToplevelBlock'. 
8733
8734         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8735         insteda of standard blocks.
8736
8737         Flag errors if params arguments are passed to anonymous methods.
8738
8739         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8740         `CurrentAnonymousMethod' which points to the current Anonymous
8741         Method.  The variable points to the AnonymousMethod class that
8742         holds the code being compiled.  It is set in the new EmitContext
8743         created for the anonymous method.
8744
8745         (EmitContext.Phase): Introduce a variable and an enumeration to
8746         assist in enforcing some rules about when and where we are allowed
8747         to invoke certain methods (EmitContext.NeedsReturnLabel is the
8748         only one that enfonces this right now).
8749
8750         (EmitContext.HaveCaptureInfo): new helper method that returns
8751         whether we have a CapturedContext initialized.
8752
8753         (EmitContext.CaptureVariable): New method used to register that a
8754         LocalInfo must be flagged for capturing. 
8755
8756         (EmitContext.CapturedParameter): New method used to register that a
8757         parameters must be flagged for capturing. 
8758         
8759         (EmitContext.CapturedField): New method used to register that a
8760         field must be flagged for capturing. 
8761
8762         (EmitContext.HaveCapturedVariables,
8763         EmitContext.HaveCapturedFields): Return whether there are captured
8764         variables or fields. 
8765
8766         (EmitContext.EmitMethodHostInstance): This is used to emit the
8767         instance for the anonymous method.  The instance might be null
8768         (static methods), this (for anonymous methods that capture nothing
8769         and happen to live side-by-side with the current method body) or a
8770         more complicated expression if the method has a CaptureContext.
8771
8772         (EmitContext.EmitTopBlock): Routine that drives the emission of
8773         code: it will first resolve the top block, then emit any metadata
8774         and then emit the code.  The split is done so that we can extract
8775         any anonymous methods and flag any captured variables/parameters.
8776         
8777         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8778         during this phase, the ILGenerator should not be used as labels
8779         and local variables declared here might not be accessible to any
8780         code that is part of an anonymous method.  
8781
8782         Exceptions to this include the temporary variables that are
8783         created by some statements internally for holding temporary
8784         variables. 
8785         
8786         (EmitContext.EmitMeta): New routine, in charge of emitting all the
8787         metadata for a cb
8788
8789         (EmitContext.TemporaryReturn): This method is typically called
8790         from the Emit phase, and its the only place where we allow the
8791         ReturnLabel to be defined other than the EmitMeta.  The reason is
8792         that otherwise we would have to duplicate a lot of logic in the
8793         Resolve phases of various methods that today is on the Emit
8794         phase. 
8795
8796         (EmitContext.NeedReturnLabel): This no longer creates the label,
8797         as the ILGenerator is not valid during the resolve phase.
8798
8799         (EmitContext.EmitThis): Extended the knowledge in this class to
8800         work in anonymous methods in addition to iterators. 
8801
8802         (EmitContext.EmitCapturedVariableInstance): This emits whatever
8803         code is necessary on the stack to access the instance to a local
8804         variable (the variable will be accessed as a field).
8805
8806         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8807         EmitContext.EmitAddressOfParameter): Routines to support
8808         parameters (not completed at this point). 
8809         
8810         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
8811         will also remove the parameters.
8812
8813         * convert.cs (Convert): Define a `ConstantEC' which points to a
8814         null.  This is just to prefity some code that uses
8815         ImplicitStandardConversion code and do not have an EmitContext
8816         handy.
8817
8818         The idea is to flag explicitly that at that point in time, it is
8819         known that the conversion will not trigger the delegate checking
8820         code in implicit conversions (which requires a valid
8821         EmitContext). 
8822
8823         Everywhere: pass new EmitContext parameter since
8824         ImplicitStandardConversionExists now requires it to check for
8825         anonymous method conversions. 
8826
8827         (Convert.ImplicitStandardConversionExists): If the type of an
8828         expression is the anonymous_method_type, and the type is a
8829         delegate, we invoke the AnonymousMethod.Compatible method to check
8830         whether an implicit conversion is possible. 
8831
8832         (Convert.ImplicitConversionStandard): Only do implicit method
8833         group conversions if the language level is not ISO_1.
8834
8835         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8836         MethodInfo for the Invoke method.  used by Delegate and
8837         AnonymousDelegate.
8838
8839         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8840         method conversions if the target type is a delegate.
8841
8842         Removed extra debugging nops.
8843
8844         (LocalVariableReference): Turn the `local_info' into a public
8845         field. 
8846
8847         Add `prepared' field, the same hack used for FieldExprs to cope
8848         with composed assignments, as Local variables do not necessarily
8849         operate purely on the stack as they used to: they can be captured
8850         fields. 
8851
8852         Add `temp' for a temporary result, like fields.
8853
8854         Refactor DoResolve and DoResolveLValue into DoResolveBase.
8855
8856         It now copes with Local variables that are captured and emits the
8857         proper instance variable to load it from a field in the captured
8858         case. 
8859
8860         (ParameterReference.DoResolveBase): During the resolve phase,
8861         capture parameters if we are in an anonymous method.
8862
8863         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8864         anonymous method, use the EmitContext helper routines to emit the
8865         parameter reference.
8866
8867         * iterators.cs: Set RemapToProxy to true/false during the
8868         EmitDispose class.
8869
8870         * parameters.cs (GetParameterByName): New helper method. 
8871
8872         * typemanager.cs (anonymous_method_type) a new type that
8873         represents an anonyous method.  This is always an internal type,
8874         used as a fencepost to test against the anonymous-methodness of an
8875         expression. 
8876         
8877 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
8878
8879         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8880         561 report.
8881         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8882
8883 2004-11-10  Martin Baulig  <martin@ximian.com>
8884
8885         * expression.cs (Invocation.BetterFunction): If two methods have
8886         equal parameter types, but only one of them is generic, the
8887         non-generic one wins.
8888         (New.DoResolve): Don't set `is_struct' to false if we're a generic
8889         instance; just use `Type.IsValueType' to determine whether
8890         something is a struct or not.
8891         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
8892         so we can be called multiple times.
8893
8894 2004-11-10  Martin Baulig  <martin@ximian.com>
8895
8896         * generic.cs (TypeParameter.DefineConstraints): New public method.
8897         (TypeParameter.CheckAccessLevel): Override this and return true.
8898         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
8899         override ResolveType() anymore.
8900         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
8901
8902 2004-11-10  Martin Baulig  <martin@ximian.com>
8903
8904         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
8905         call DeclSpace.ResolveNestedType() on it.
8906
8907 2004-11-10  Martin Baulig  <martin@ximian.com>
8908
8909         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
8910         non-null, call ParameterModifier() on it.
8911
8912 2004-11-10  Martin Baulig  <martin@ximian.com>
8913
8914         * iterators.cs
8915         (Iterators): Added `current_type' and `this_type' fields.
8916         (Iterators.DefineIterator): Create a new EmitContext and store it
8917         in `ec'; compute `this_type'.
8918
8919 2004-11-10  Martin Baulig  <martin@ximian.com>
8920
8921         * typemanager.cs
8922         (TypeManager.IsPrivateAccessible): New public method.
8923         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
8924
8925 2004-11-10  Martin Baulig  <martin@ximian.com>
8926
8927         * class.cs (TypeContainer.DefineType): Call
8928         TypeBuilder.DefineGenericParameters() before resolving the type
8929         parameters.
8930         (MethodData.parent_method): New protected field.
8931         (MethodData..ctor): Added `MethodInfo parent_method' argument.
8932         (MethodData.Define): Compute `parent_method'.
8933
8934         * decl.cs
8935         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8936         (MemberCore.GetClsCompliantAttributeValue): Likewise.
8937         (DeclSpace.ec): New protected field; store the EmitContext here.
8938         (DeclSpace.EmitContext): New public property.
8939         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
8940         (DeclSpace.ResolveNestedType): New public method.
8941         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
8942         (DeclSpace.NestedAccessible): Added `Type tb' argument.
8943         (DeclSpace.FamilyAccessible): Likewise.
8944         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
8945         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8946         EmitContext.
8947
8948         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
8949         field.
8950
8951         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8952         (Enum.Emit): Don't create a new EmitContext.
8953
8954 2004-10-18  Martin Baulig  <martin@ximian.com>
8955
8956         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8957         `Type' directly, but call ResolveType() on it.
8958         (Catch.Resolve): Likewise.
8959         (Foreach.Resolve): Likewise.
8960
8961 2004-10-18  Martin Baulig  <martin@ximian.com>
8962
8963         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8964         `Type' directly, but call ResolveType() on it.
8965         (Probe.DoResolve): Likewise.
8966         (ArrayCreation.LookupType): Likewise.
8967         (TypeOf.DoResolve): Likewise.
8968         (SizeOf.DoResolve): Likewise.
8969
8970 2004-10-18  Raja R Harinath  <rharinath@novell.com>
8971
8972         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8973         the ResolveType.
8974
8975 2004-10-17  John Luke  <john.luke@gmail.com>
8976
8977         * class.cs (Operator.GetSignatureForError): use CSharpName
8978
8979         * parameter.cs (Parameter.GetSignatureForError): Returns
8980         correct name even if was not defined.
8981
8982 2004-10-13  Raja R Harinath  <rharinath@novell.com>
8983
8984         Fix #65816.
8985         * class.cs (TypeContainer.EmitContext): New property.
8986         (DefineNestedTypes): Create an emitcontext for each part.
8987         (MethodCore.DoDefineParameters): Use container's emitcontext.
8988         Pass type array to InternalParameters.
8989         (MemberBase.DoDefine): Use container's emitcontext.
8990         (FieldMember.Define): Likewise.
8991         (Event.Define): Likewise.
8992         (SetMethod.GetParameterInfo): Change argument to EmitContext.
8993         Pass type array to InternalParameters.
8994         (SetIndexerMethod.GetParameterInfo): Likewise.
8995         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8996         * delegate.cs (Define): Pass emitcontext to
8997         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
8998         array to InternalParameters.
8999         * expression.cs (ParameterReference.DoResolveBase): Pass
9000         emitcontext to GetParameterInfo.
9001         (ComposedCast.DoResolveAsTypeStep): Remove check on
9002         ec.ResolvingTypeTree.
9003         * parameter.cs (Parameter.Resolve): Change argument to
9004         EmitContext.  Use ResolveAsTypeTerminal.
9005         (Parameter.GetSignature): Change argument to EmitContext.
9006         (Parameters.ComputeSignature): Likewise.
9007         (Parameters.ComputeParameterTypes): Likewise.
9008         (Parameters.GetParameterInfo): Likewise.
9009         (Parameters.ComputeAndDefineParameterTypes): Likewise.
9010         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
9011         * support.cs (InternalParameters..ctor): Remove variant that takes
9012         a DeclSpace.
9013         * typemanager.cs (system_intptr_expr): New.
9014         (InitExpressionTypes): Initialize it.
9015
9016 2004-10-12  Chris Toshok  <toshok@ximian.com>
9017
9018         * cs-parser.jay: fix location for try_statement and catch_clause.
9019
9020 2004-10-18  Martin Baulig  <martin@ximian.com>
9021
9022         * class.cs (FieldMember.Define): Don't access the TypeExpr's
9023         `Type' directly, but call ResolveType() on it.
9024         (MemberBase.DoDefine): Likewise.
9025
9026         * expression.cs (New.DoResolve): Don't access the TypeExpr's
9027         `Type' directly, but call ResolveType() on it.
9028         (ComposedCast.DoResolveAsTypeStep): Likewise.
9029
9030         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
9031         `Type' directly, but call ResolveType() on it.
9032
9033 2004-10-17  John Luke  <john.luke@gmail.com>
9034
9035         * class.cs (Operator.GetSignatureForError): use CSharpName
9036
9037         * parameter.cs (Parameter.GetSignatureForError): Returns
9038         correct name even if was not defined.
9039
9040 2004-10-13  Raja R Harinath  <rharinath@novell.com>
9041
9042         Fix #65816.
9043         * class.cs (TypeContainer.EmitContext): New property.
9044         (DefineNestedTypes): Create an emitcontext for each part.
9045         (MethodCore.DoDefineParameters): Use container's emitcontext.
9046         Pass type array to InternalParameters.
9047         (MemberBase.DoDefine): Use container's emitcontext.
9048         (FieldMember.Define): Likewise.
9049         (Event.Define): Likewise.
9050         (SetMethod.GetParameterInfo): Change argument to EmitContext.
9051         Pass type array to InternalParameters.
9052         (SetIndexerMethod.GetParameterInfo): Likewise.
9053         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9054         * delegate.cs (Define): Pass emitcontext to
9055         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
9056         array to InternalParameters.
9057         * expression.cs (ParameterReference.DoResolveBase): Pass
9058         emitcontext to GetParameterInfo.
9059         (ComposedCast.DoResolveAsTypeStep): Remove check on
9060         ec.ResolvingTypeTree.
9061         * parameter.cs (Parameter.Resolve): Change argument to
9062         EmitContext.  Use ResolveAsTypeTerminal.
9063         (Parameter.GetSignature): Change argument to EmitContext.
9064         (Parameters.ComputeSignature): Likewise.
9065         (Parameters.ComputeParameterTypes): Likewise.
9066         (Parameters.GetParameterInfo): Likewise.
9067         (Parameters.ComputeAndDefineParameterTypes): Likewise.
9068         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
9069         * support.cs (InternalParameters..ctor): Remove variant that takes
9070         a DeclSpace.
9071         * typemanager.cs (system_intptr_expr): New.
9072         (InitExpressionTypes): Initialize it.
9073
9074 2004-10-12  Chris Toshok  <toshok@ximian.com>
9075
9076         * cs-parser.jay: fix location for try_statement and catch_clause.
9077
9078 2004-10-07  Raja R Harinath  <rharinath@novell.com>
9079
9080         More DeclSpace.ResolveType avoidance.
9081         * decl.cs (MemberCore.InUnsafe): New property.
9082         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
9083         with newly created EmitContext.
9084         (FieldMember.Define): Likewise.
9085         * delegate.cs (Delegate.Define): Likewise.
9086         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
9087         only if normal name-lookup fails.
9088         (TypeExpr.DoResolve): Enable error-checking.
9089         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
9090         (SizeOf.DoResolve): Likewise.
9091         (ComposedCast.DoResolveAsTypeStep): Likewise.
9092         (StackAlloc.DoResolve): Likewise.
9093         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
9094         (Block.Unsafe): New property.
9095         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
9096         (Unsafe): Set 'unsafe' flag of contained block.
9097         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
9098         (Fixed.Resolve): Likewise.
9099         (Catch.Resolve): Likewise.
9100         (Using.ResolveLocalVariableDecls): Likewise.
9101         (Foreach.Resolve): Likewise.
9102
9103 2004-10-05  John Luke <john.luke@gmail.com>
9104
9105         * cs-parser.jay: add location to error CS0175
9106
9107 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
9108
9109         * ecore.cs (Expression.Constantity): Add support for turning null
9110         into a constant.
9111
9112         * const.cs (Const.Define): Allow constants to be reference types
9113         as long as the value is Null.
9114
9115 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
9116
9117         * namespace.cs (NamespaceEntry.Using): No matter which warning
9118         level is set, check if this namespace name has already been added.
9119
9120 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
9121
9122         * expression.cs: reftype [!=]= null should always use br[true,false].
9123         # 67410
9124
9125 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
9126
9127         Fix #67108
9128         * attribute.cs: Enum conversion moved to 
9129         GetAttributeArgumentExpression to be applied to the all
9130         expressions.
9131
9132 2004-10-01  Raja R Harinath  <rharinath@novell.com>
9133
9134         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
9135         * class.c (TypeContainer.DefineType): Flag error if
9136         base types aren't accessible due to access permissions.
9137         * decl.cs (DeclSpace.ResolveType): Move logic to
9138         Expression.ResolveAsTypeTerminal.
9139         (DeclSpace.ResolveTypeExpr): Thin layer over
9140         Expression.ResolveAsTypeTerminal.
9141         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
9142         Refactor code into NestedAccess.  Use it.
9143         (DeclSpace.NestedAccess): New.
9144         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
9145         argument to silence errors.  Check access permissions.
9146         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
9147         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
9148         (Cast.DoResolve): Likewise.
9149         (New.DoResolve): Likewise.
9150         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
9151         (TypeOf.DoResolve): Likewise.
9152
9153         * expression.cs (Invocation.BetterConversion): Return the Type of
9154         the better conversion.  Implement section 14.4.2.3 more faithfully.
9155         (Invocation.BetterFunction): Make boolean.  Make correspondence to
9156         section 14.4.2.2 explicit.
9157         (Invocation.OverloadResolve): Update.
9158         (Invocation): Remove is_base field.
9159         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
9160         (Invocation.Emit): Likewise.
9161
9162 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
9163
9164         * cs-parser.jay: Reverted 642 warning fix.
9165
9166 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9167
9168         Fix bug #66615
9169         * decl.cs (FindMemberWithSameName): Indexer can have more than
9170         1 argument.
9171
9172 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9173
9174         * expression.cs (LocalVariableReference.DoResolveLValue):
9175         Do not report warning 219 for out values.
9176         (EmptyExpression.Null): New member to avoid extra allocations.
9177
9178 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9179
9180         * cs-parser.jay: Fix wrong warning 642 report.
9181
9182         * cs-tokenizer.cs (CheckNextToken): New helper;
9183         Inspect next character if is same as expected.
9184
9185 2004-09-23  Martin Baulig  <martin@ximian.com>
9186
9187         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9188         (Convert.ImplicitReferenceConversionExists): Likewise.
9189
9190 2004-11-09  Raja R Harinath  <rharinath@novell.com>
9191
9192         * Makefile (DISTFILES): Comment out a few missing files.
9193
9194 2004-10-29  Raja R Harinath  <rharinath@novell.com>
9195
9196         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
9197         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
9198         (gmcs.exe): Invoke bootstrap-libs.
9199         (clean-local): Clean the net_2_0_bootstrap profile too.
9200         (PROGRAM_INSTALL_DIR): New.
9201         (install-local): Use it.
9202
9203 2004-10-13  Martin Baulig  <martin@ximian.com>
9204
9205         * generic.cs (TypeManager.InflatedConstraints): New nested class.
9206         (TypeParameter.DefineType): If we're a method type parameter and
9207         that method is overriding something, "inflate" its constraints.
9208
9209 2004-10-12  Martin Baulig  <martin@ximian.com>
9210
9211         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
9212         and have type arguments, create and resolve a ConstructedType.
9213
9214 2004-10-12  Martin Baulig  <martin@ximian.com>
9215
9216         * decl.cs (MemberCache.FindMemberToOverride): Use
9217         TypeManager.IsEqual() to compare the parameters and Type.Equals()
9218         to compare the invocationType.
9219
9220         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
9221         When comparing two type parameters, only do the signature-only
9222         comparision for method type parameters.
9223
9224 2004-10-11  Martin Baulig  <martin@ximian.com>
9225
9226         * report.cs: Don't make --fatal abort on warnings, we have
9227         -warnaserror for that.
9228
9229 2004-10-11  Martin Baulig  <martin@ximian.com>
9230
9231         * typemanager.cs
9232         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
9233         (TypeManager.IsEqual): Call ourself recursively instead of using
9234         Type.IsEqual(). 
9235
9236 2004-10-11  Martin Baulig  <martin@ximian.com>
9237
9238         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
9239         on our own type parameters, not on the ones we inherit from a containing
9240         class.
9241
9242         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
9243         the comparision.
9244
9245         * generic.cs (TypeParameter.Define): We may only be called once.
9246
9247         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
9248         instead of TypeManager.IsEqual().
9249
9250 2004-09-28  Martin Baulig  <martin@ximian.com>
9251
9252         * generic.cs
9253         (GenericConstraints.EffectiveBaseClass): New public property.
9254         (TypeParameter.GenericConstraints): New public property.
9255         (ConstructedType.CheckConstraints): Improved.
9256
9257         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
9258         (Convert.TypeParameterConversion): New private method; use this in
9259         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
9260         for all conversions related to type parameters.
9261
9262 2004-09-24  Martin Baulig  <martin@ximian.com>
9263
9264         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
9265         type parameter conversions for type parameters which are known to
9266         be reference types.
9267
9268 2004-09-24  Martin Baulig  <martin@ximian.com>
9269
9270         * generic.cs (GenericConstraints): Added `IsReferenceType' and
9271         `IsValueType' properties.
9272
9273         * support.cs (ReflectionConstraints): Use
9274         Type.GetGenericParameterConstraints() instead of the old hack.
9275
9276 2004-09-24  Martin Baulig  <martin@ximian.com>
9277
9278         * generic.cs (GenericConstraints): Moved here and made it an
9279         abstract class.
9280
9281         * support.cs (GenericConstraints): Moved to generic.cs.
9282
9283 2004-09-24  Martin Baulig  <martin@ximian.com>
9284
9285         * support.cs
9286         (ReflectionConstraints): Un-nested this class and made it public.
9287
9288         * typemanager.cs
9289         (TypeManager.GetTypeParameterConstraints): New public method.
9290         (TypeManager.HasConstructorConstraint): Use the attributes.
9291
9292 2004-09-24  Martin Baulig  <martin@ximian.com>
9293
9294         * support.cs (GenericConstraints): Replaced `HasConstructor',
9295         `IsReferenceType' and `IsValueType' with `Attributes'.
9296         (ReflectionParameters.ReflectionConstraints): Removed the Create()
9297         method and made the .ctor public.
9298
9299         * generic.cs (Constraints.Attributes): New public property.
9300         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
9301         `IsReferenceType' -> `HasReferenceTypeConstraint' and
9302         `IsValueType' -> `HasValueTypeConstraint'.
9303
9304 2004-09-23  Martin Baulig  <martin@ximian.com>
9305
9306         * generic.cs (Constraints): Reflect latest runtime changes.
9307
9308 2004-09-23  Martin Baulig  <martin@ximian.com>
9309
9310         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9311         (Convert.ImplicitReferenceConversionExists): Likewise.
9312
9313 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9314
9315         * class.cs (Operator.Define): Add error 448 and 559 report.
9316         
9317 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9318
9319         * class.cs (MemberBase.IsTypePermitted): New protected
9320         method for checking error CS0610.
9321
9322 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9323
9324         * class.cs (TypeContainer.HasExplicitLayout): New property
9325         Returns whether container has StructLayout attribute set Explicit.
9326         (FieldMember): New abstract class for consts and fields.
9327         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
9328         (Field): Reuse FieldMember.
9329
9330         * const.cs (Const): Reuse FieldMember.
9331
9332         * rootcontext.cs: EmitConstants call moved to class.
9333
9334 2004-09-22  Martin Baulig  <martin@ximian.com>
9335
9336         Marek and me just fixed one of our oldest bugs: #28562 :-)
9337
9338         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
9339
9340         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
9341         we're an EnumConstant, just return that.
9342         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
9343         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
9344         to get the value which'll actually be written into the attribute.
9345         However, we have to use GetValue() to access the attribute's value
9346         in the compiler.        
9347
9348 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9349
9350         * constant.cs (Constant.IsNegative): New abstract property
9351         IsNegative.
9352
9353         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
9354         (StackAlloc.DoResolve): Reused IsNegative.
9355
9356 2004-09-22  Martin Baulig  <martin@ximian.com>
9357
9358         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
9359         public method; like LookupTypeContainer, but also works for
9360         generic instances.
9361
9362         * report.cs (Report.SymbolRelatedToPreviousError): Use
9363         TypeManager.LookupGenericTypeContainer().       
9364
9365 2004-09-22  Martin Baulig  <martin@ximian.com>
9366
9367         Thanks to Peter Sestoft for this bug report.
9368
9369         * expression.cs (Conditional): If both the `trueExpr' and the
9370         `falseExpr' is a NullLiteral, return a NullLiteral.
9371
9372 2004-09-22  Martin Baulig  <martin@ximian.com>
9373
9374         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
9375         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
9376         for the "get_Current" call.
9377
9378 2004-09-21  Martin Baulig  <martin@ximian.com>
9379
9380         * convert.cs (Convert.ImplicitReferenceConversion): When
9381         converting to an interface type, first check whether we're
9382         converting from a reference type.
9383
9384 2004-09-14  Martin Baulig  <martin@ximian.com>
9385
9386         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
9387
9388 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
9389
9390         Fixed bug #61902
9391         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
9392         called and is obsolete then this member suppress message
9393         when call is inside next [Obsolete] method or type.
9394
9395         * expression.cs: Use TestObsoleteMethodUsage member.
9396
9397 2004-09-14  Martin Baulig  <martin@ximian.com>
9398
9399         * genericparser.cs: Removed.
9400
9401 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
9402
9403         * class.cs (MethodCore.CheckBase): Fix bug #65757.
9404
9405 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
9406
9407         * attribute.cs (Attribute.Resolve): Add error 653 report.
9408
9409         * class.cs (Class.ApplyAttributeBuilder): Add error 641
9410         report.
9411         (Method.ApplyAttributeBuilder): Add error 685 report.
9412         (Operator.Define): Add error 564 report.
9413
9414         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9415
9416         * expression.cs (Invocation.DoResolve): Add error
9417         245 and 250 report.
9418
9419         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9420         error 674 report.
9421
9422 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9423
9424         * class.cs (ConstructorInitializer.Resolve):
9425         Wrong error number (515->516).
9426
9427 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9428
9429         * class.cs (Indexer.Define): Add error 631 report.
9430
9431 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9432
9433         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9434
9435 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9436
9437         * expression.cs (Probe.DoResolve): Add error CS0241 report.
9438
9439 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
9440
9441         * cs-parser.jay: Added error CS0241 report.
9442
9443 2004-09-10  Raja R Harinath  <rharinath@novell.com>
9444
9445         * cs-parser.jay (fixed_statement): Introduce a scope for the
9446         declaration in the 'fixed' statement.
9447
9448 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9449
9450         * cs-parser.jay: Added CS0230 error report.
9451
9452 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9453
9454         * cs-parser.jay: Added errors CS0231 and CS0257 report.
9455
9456 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9457
9458         * expression.cs (Argument.Resolve): Added error CS0192 and
9459         CS0199 report.
9460
9461 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9462
9463         C# 2.0 #pragma warning feature
9464
9465         * cs-tokenizer.cs (PreProcessPragma): New method; 
9466         Handles #pragma directive.
9467
9468         * report.cs (WarningRegions): New class; Support
9469         class for #pragma warning directive. It tests whether
9470         warning is enabled for a given line.
9471
9472 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
9473
9474         * const.cs: Add more descriptive error report, tahnks to
9475         Sebastien. 
9476
9477 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
9478
9479         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9480
9481 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
9482
9483         * expression.cs: Apply patch from Ben: Remove dead code from
9484         ArrayCreation, and remove the TurnintoConstant call in const.cs,
9485         as that code just threw an exception anwyays.
9486
9487         * const.cs: Remove the call to the turnintoconstant, for details
9488         see bug: #63144
9489         
9490         * literal.cs: The type of the null-literal is the null type;  So
9491         we use a placeholder type (literal.cs:System.Null, defined here)
9492         for it.
9493
9494         * expression.cs (Conditional.DoResolve): Remove some old code that
9495         is no longer needed, conversions have been fixed.
9496
9497         (ArrayCreationExpression.DoResolve): Return false if we fail to
9498         resolve the inner expression.
9499
9500 2004-09-07  Raja R Harinath  <rharinath@novell.com>
9501
9502         Fix test-290.cs.
9503         * cs-parser.jay (delegate_declaration): Record a delegate
9504         declaration as a type declaration.
9505         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9506
9507 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
9508
9509         * parameter.cs: Do not crash if the type can not be resolved. 
9510
9511         * expression.cs: Report errors with unsafe pointers, fixes #64896
9512
9513 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9514
9515         * expression.cs: Pointer arith always needs to do a conv.i
9516         if the operand is a long. fix 65320
9517
9518 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9519
9520         Fixed cs0619-37.cs, cs0619-38.cs
9521
9522         * enum.cs (GetObsoleteAttribute): Removed.
9523
9524         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9525         on Enum member is double staged. The first is tested member
9526         and then enum.
9527
9528 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9529
9530         Fixed #56986, #63631, #65231
9531
9532         * class.cs: (TypeContainer.AddToMemberContainer): New method,
9533         adds member to name container.
9534         (TypeContainer.AddToTypeContainer): New method, adds type to
9535         name container.
9536         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9537         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9538         AddOperator): Simplified by reusing AddToMemberContainer.
9539         (TypeContainer.UserDefinedStaticConstructor): Changed to property
9540         instead of field.
9541         (Method.CheckForDuplications): Fixed implementation to test all
9542         possibilities.
9543         (MemberBase): Detection whether member is explicit interface
9544         implementation is now in constructor.
9545         (MemberBase.UpdateMemberName): Handles IndexerName.
9546         (Accessor): Changed to keep also location information.
9547         (AbstractPropertyEventMethod): Is derived from MemberCore.
9548         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9549         will be emited or not.
9550         (PropertyBase.AreAccessorsDuplicateImplementation):
9551         Tests whether accessors are not in collision with some method.
9552         (Operator): Is derived from MethodCore to simplify common
9553         operations.
9554
9555         * decl.cs (Flags.TestMethodDuplication): Test for duplication
9556         must be performed.
9557         (DeclSpace.AddToContainer): Adds the member to defined_names
9558         table. It tests for duplications and enclosing name conflicts.
9559
9560         * enum.cs (EnumMember): Clean up to reuse the base structures
9561
9562 2004-09-03  Martin Baulig  <martin@ximian.com>
9563
9564         Merged latest changes into gmcs.  Please keep this comment in
9565         here, it makes it easier for me to see what changed in MCS since
9566         the last time I merged.
9567
9568 2004-09-03  Martin Baulig  <martin@ximian.com>
9569
9570         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9571         into TypeContainer, to make partial classes work again.
9572
9573 2004-09-03  Martin Baulig  <martin@ximian.com>
9574
9575         * rootcontext.cs (RootContext.V2): Removed.
9576
9577 2004-03-23  Martin Baulig  <martin@ximian.com>
9578
9579         * expression.cs (Invocation.OverloadResolve): Added `bool
9580         may_fail' argument and use it instead of the Location.IsNull() hack.
9581
9582 2004-09-09  Martin Baulig  <martin@ximian.com>
9583
9584         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
9585
9586 2004-09-09  Martin Baulig  <martin@ximian.com>
9587
9588         * generic.cs (TypeParameter.DefineType): Added support for
9589         explicit interface methods.
9590
9591 2004-09-09  Martin Baulig  <martin@ximian.com>
9592
9593         * README.Changes: New document.  Started to list important changes
9594         between MCS and GMCS here.
9595
9596 2004-09-08  Martin Baulig  <martin@ximian.com>
9597
9598         * class.cs
9599         (TypeContainer.CheckRecursiveDefinition): New protected method.
9600         (TypeContainer.DefineType): Move the CS0146 check into
9601         CheckRecursiveDefinition().     
9602
9603 2004-09-06  Martin Baulig  <martin@ximian.com>
9604
9605         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
9606         types for the constructor constraint.
9607
9608 2004-09-03  Martin Baulig  <martin@ximian.com>
9609
9610         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9611         into TypeContainer, to make partial classes work again.
9612
9613 2004-09-03  Martin Baulig  <martin@ximian.com>
9614
9615         * rootcontext.cs (RootContext.V2): Removed.
9616
9617 2004-03-23  Martin Baulig  <martin@ximian.com>
9618
9619         * expression.cs (Invocation.OverloadResolve): Added `bool
9620         may_fail' argument and use it instead of the Location.IsNull() hack.
9621
9622 2004-09-03  Martin Baulig  <martin@ximian.com>
9623
9624         Merged latest changes into gmcs.  Please keep this comment in
9625         here, it makes it easier for me to see what changed in MCS since
9626         the last time I merged.
9627
9628 2004-09-03  Raja R Harinath  <rharinath@novell.com>
9629
9630         Fix #61128.
9631         * expression.cs (BetterConversion): Don't allow either conversion 
9632         to be null.  Remove redundant implicit conversion test when 'q ==
9633         null' -- when this function is invoked, we already know that the
9634         implicit conversion exists.
9635         (BetterFunction): Assume that 'best' is non-null.  Remove
9636         redundant reimplementation of IsApplicable when 'best' is null.
9637         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9638         number of arguments.
9639         (IsAncestralType): Extract from OverloadResolve.
9640         (OverloadResolve): Make robust to the MethodGroupExpr being
9641         unsorted.  Implement all the logic of Section 14.5.5.1, and
9642         support overloading of methods from multiple applicable types.
9643         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
9644
9645         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9646         (RealError, Warning): Append type of report to related symbol.
9647
9648 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
9649
9650         * enum.cs: Fixed CLS-Compliance checks for enum members.
9651         Error tests cs3008-8.cs, cs3014-8.cs
9652
9653 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9654
9655         Fixed bug #62342, #63102
9656         * class.cs: ImplementIndexer uses member.IsExplicitImpl
9657         like ImplementMethod.
9658
9659 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9660
9661         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9662         Fixed bug #65170.
9663
9664 2004-09-02  Martin Baulig  <martin@ximian.com>
9665
9666         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9667         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9668         on the MethodBase.
9669
9670 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
9671
9672         C# 2.0 Static classes implemented
9673
9674         * class.cs (TypeContainer): instance_constructors,
9675         initialized_fields, initialized_static_fields,
9676         default_constructor, base_inteface_types are protected to be
9677         accessible from StaticClass.
9678         (TypeContainer.DefineDefaultConstructor): New virtual method
9679         for custom default constructor generating
9680         (StaticClass): New class to handle "Static classes" feature.
9681
9682         * cs-parser.jay: Handle static keyword on class like instance
9683         of StaticClass.
9684
9685         * driver.cs: Added "/langversion" command line switch with two
9686         options (iso-1, default).
9687
9688 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
9689
9690         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9691
9692 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
9693
9694         * delegate.cs: Style.
9695
9696 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9697
9698         * delegate.cs: Add seperate instance expr field for miguel.
9699
9700 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9701
9702         * PointerArithmetic (Resolve): make sure we are not doing
9703         pointer arith on void*. Also, make sure we are resolved
9704         by not setting eclass until resolve.
9705
9706         All callers: Make sure that PointerArithmetic gets resolved.
9707
9708 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9709
9710         * ArrayCreation (LookupType): If the type does not resolve 
9711         to an array, give an error.
9712
9713 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
9714
9715         * statement.cs (Try.Resolve): Fixed bug #64222
9716
9717 2004-08-27  Martin Baulig  <martin@ximian.com>
9718
9719         * class.cs
9720         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9721         crash here.     
9722
9723 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9724
9725         * ecore.cs (Constantify): Get underlying type via
9726         System.Enum.GetUnderlyingType to avoid StackOverflow on the
9727         Windows in special cases.
9728
9729 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9730
9731         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9732         for obtaining also private methods.
9733         (GetRemoveMethod): Used GetRemoveMethod (true)
9734         for obtaining also private methods.
9735
9736 2004-09-02  Martin Baulig  <martin@ximian.com>
9737
9738         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9739         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9740         on the MethodBase.
9741
9742 2004-08-27  Martin Baulig  <martin@ximian.com>
9743
9744         * class.cs
9745         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9746         crash here.     
9747
9748 2004-08-25  Martin Baulig  <martin@ximian.com>
9749
9750         * support.cs (ReflectionParameters..ctor): If this is a generic
9751         method, retrieve and store its type parameters.
9752         (InternalParameters..ctor): Added `TypeParameter[]' argument.
9753         (ReflectionParameters.GenericConstraints): The argument specifies
9754         the type parameter, not the method parameter.
9755         (InternalParameters.GenericConstraints): Likewise.
9756
9757         * generic.cs (TypeParameter.DefineType): Correctly handle
9758         constraints wrt. generic methods in interfaces and their
9759         implementations.        
9760
9761 2004-08-24  Martin Baulig  <martin@ximian.com>
9762
9763         * generic.cs (TypeParameter.IsSubclassOf): New public method.
9764         (Constraints.IsSubclassOf): New internal method.
9765
9766         * typemanager.cs (TypeManager.FindMembers): Added special support
9767         for GenericTypeParameterBuilder's.      
9768         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
9769         type parameters.
9770
9771 2004-08-24  Martin Baulig  <martin@ximian.com>
9772
9773         * typemanager.cs
9774         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
9775         this for accessibility checks.
9776         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
9777         IsNestedFamilyAccessible.
9778         (TypeManager.IsSubclassOf): New method, do what the name actually
9779         says.   
9780
9781 2004-08-24  Martin Baulig  <martin@ximian.com>
9782
9783         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
9784         as a SimpleName, include the generic arity.
9785
9786 2004-08-24  Martin Baulig  <martin@ximian.com>
9787
9788         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9789         MethodAttributes.HideBySig for operators.
9790
9791 2004-08-23  Martin Baulig  <martin@ximian.com>
9792
9793         Back to the old error reporting system :-)
9794
9795         * report.cs (Message): Removed.
9796         (Report.MessageData, ErrorData, WarningData): Removed.
9797         (Report.Error, Warning): Back to the old system.
9798
9799 2004-08-23  Martin Baulig  <martin@ximian.com>
9800
9801         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9802
9803         * class.cs (TypeContainer.ParentContainer): New public virtual
9804         method; replaces the explicit interface implementation.
9805         (ClassPart.ParentContainer): Override.
9806
9807 2004-08-23  Martin Baulig  <martin@ximian.com>
9808
9809         * statement.cs (Switch): Added support for constant switches; see
9810         #59428 or test-285.cs.
9811
9812 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9813
9814         Fixed bug #62740.
9815         * statement.cs (GetEnumeratorFilter): Removed useless
9816         logic because C# specs is strict. GetEnumerator must be
9817         public.
9818
9819 2004-08-22  Martin Baulig  <martin@ximian.com>
9820
9821         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9822         a switch and may break, reset the barrier.  Fixes #59867.
9823
9824 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9825
9826         CLS-Compliance speed up (~5% for corlib)
9827
9828         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9829         New method. Tests container for CLS-Compliant names
9830
9831         * class.cs (TypeContainer.VerifyClsName): New method.
9832         Checks whether container name is CLS Compliant.
9833         (Constructor): Implements IMethodData.
9834
9835         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9836         low-case table for CLS Compliance test.
9837         (MemberCache.VerifyClsParameterConflict): New method.
9838         Checks method parameters for CS3006 error.
9839
9840         * enum.cs (EnumMember): Is derived from MemberCore.
9841         (Enum.VerifyClsName): Optimized for better performance.
9842
9843 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9844
9845         * report.cs: Renamed Error_T to Error and changed all
9846         references.
9847
9848 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9849
9850         * class.cs (TypeContainer.IndexerArrayList): New inner class
9851         container for indexers.
9852         (TypeContainer.DefaultIndexerName): New constant for default
9853         indexer name. Replaced all "Item" with this constant.
9854         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9855
9856         * typemanager.cs (TypeManager.default_member_ctor): Cache here
9857         DefaultMemberAttribute constructor.
9858
9859 2004-08-05  Martin Baulig  <martin@ximian.com>
9860
9861         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9862         Fix bug #59429.
9863
9864 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
9865
9866         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9867         multi platforms problem.
9868
9869         * compiler.csproj: Included shared files.
9870
9871 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9872
9873         Fix bug 60333, 55971 in the more general way
9874         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9875         Added arg_type argument for constant conversion.
9876         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9877
9878 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9879
9880         Fix bug #59760
9881         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
9882         OperatorArrayList, MethodCoreArrayList for typecontainer
9883         containers. Changed class member types to these new types.
9884         (MethodArrayList.DefineMembers): Added test for CS0659.
9885
9886 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
9887
9888         * cfold.cs: Synchronize the folding with the code in expression.cs
9889         Binary.DoNumericPromotions for uint operands.
9890
9891         * attribute.cs: Revert patch from Raja, it introduced a regression
9892         while building Blam-1.2.1 (hard to isolate a test case).
9893
9894 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9895
9896         Fix for #55382
9897         * class.cs:
9898         (TypeContainer.Define): Renamed to DefineContainerMembers because of
9899         name collision.
9900         (MethodCore.parent_method): New member. The method we're overriding
9901         if this is an override method.
9902         (MethodCore.CheckBase): Moved from Method class and made common.
9903         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9904         private.
9905         (MethodCore.CheckForDuplications): New abstract method. For custom
9906         member duplication search in a container
9907         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9908         method and its return type.
9909         (Event.conflict_symbol): New member. Symbol with same name in the
9910         parent class.
9911
9912         * decl.cs:
9913         (MemberCache.FindMemberWithSameName): New method. The method
9914         is looking for conflict with inherited symbols.
9915
9916 2004-08-04  Martin Baulig  <martin@ximian.com>
9917
9918         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9919
9920         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9921
9922 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9923
9924         * report.cs (Message): New enum for better error, warning reference in
9925         the code.
9926         (MessageData): New inner abstract class. It generally handles printing of
9927         error and warning messages.
9928         Removed unused Error, Warning, Message methods.
9929
9930 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9931
9932         Fix for cs0592-8.cs test
9933         * attribute.cs
9934         (Attributable.ValidAttributeTargets): Made public.
9935         (Attribute.ExplicitTarget): New member for explicit target value.
9936         (Attribute.CheckTargets): Now we translate explicit attribute
9937         target to Target here.
9938
9939 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
9940
9941         * ecore.cs (MethodGroupExpr): new IsBase property.
9942
9943         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9944
9945         * delegate.cs (DelegateCreation): store a MethodGroupExpr
9946         rather than an instance expr.
9947
9948         (DelegateCreation.Emit): Use the method group rather than
9949         the instance expression. Also, if you have base.Foo as the
9950         method for a delegate, make sure to emit ldftn, not ldftnvirt.
9951
9952         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
9953
9954         (NewDelegate.DoResolve): Only check for the existance of Invoke
9955         if the method is going to be needed. Use MethodGroupExpr.
9956
9957         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
9958
9959         * expression.cs: For pointer arith., make sure to use
9960         the size of the type, not the size of the pointer to
9961         the type.
9962
9963 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9964
9965         Fix for #60722
9966         * class.cs (Class): Added error CS0502 test.
9967
9968 2004-08-03  John Luke  <jluke@cfl.rr.com>
9969             Raja R Harinath  <rharinath@novell.com>
9970
9971         Fix for #60997.
9972         * attribute.cs (Attribute.complained_before): New flag.
9973         (Attribute.ResolveType, Attribute.Resolve),
9974         (Attribute.DefinePInvokeMethod): Set it.
9975         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9976         
9977 2004-08-03  Martin Baulig  <martin@ximian.com>
9978
9979         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9980         use a user-defined operator; we still need to do numeric
9981         promotions in case one argument is a builtin type and the other
9982         one has an implicit conversion to that type.  Fixes #62322.
9983
9984 2004-08-18  Martin Baulig  <martin@ximian.com>
9985
9986         * class.cs (Method.Define): Use the correct method name when
9987         creating the MethodBuilder for a generic method.
9988
9989 2004-08-17  Martin Baulig  <martin@ximian.com>
9990
9991         * generic.cs (Constraints): Support type parameter constraints.
9992
9993 2004-08-16  Martin Baulig  <martin@ximian.com>
9994
9995         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
9996         (Token.GENERIC_DIMENSION): New token; this is returned if we
9997         encounter an unbound generic type in a typeof() expression.
9998
9999         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
10000         this token is only generated while parsing a typeof() expression.
10001         (typeof_expression): Removed the old unbound_type hack.
10002
10003         * generic.cs (TypeArguments.IsUnbound): New public property.
10004
10005         * decl.cs (MemberName): Added support for unbound types.
10006
10007 2004-08-14  Martin Baulig  <martin@ximian.com>
10008
10009         * typemanager.cs
10010         (TypeManager.IsEqualGenericInstance): New static method.
10011         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
10012         just used to check accessibility, so follow the rules of 26.1.6.        
10013
10014         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
10015         ConstructedType instead of a TypeExpression if we have type arguments.
10016
10017         * cs-parser.jay (typeof_expression): Support unbound generic types.
10018
10019         * ecore.cs (UnboundTypeExpression): New public class.
10020
10021 2004-08-12  Martin Baulig  <martin@ximian.com>
10022
10023         * typemanager.cs (TypeManager.IsNestedChildOf): Use
10024         TypeManager.IsEqual() rather than `=='.
10025
10026         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
10027         generic instances as well.
10028
10029 2004-08-12  Martin Baulig  <martin@ximian.com>
10030
10031         * expression.cs (Invocation.InferType): We can only infer method
10032         type parameters.  Fixes #62647.
10033
10034 2004-08-11  Martin Baulig  <martin@ximian.com>
10035
10036         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
10037         before resolving the base classes.
10038
10039 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10040
10041         * Makefile: install .mdb file too.
10042
10043 2004-08-05  Martin Baulig  <martin@ximian.com>
10044
10045         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
10046         initializer, the current type is just the TypeBuilder, not the
10047         instantiated generic type.
10048         (FieldExpr.IsFieldInitializer): New public property.
10049
10050 2004-08-04  Martin Baulig  <martin@ximian.com>
10051
10052         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10053
10054         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10055
10056 2004-08-03  Martin Baulig  <martin@ximian.com>
10057
10058         * class.cs (MethodData.Define): If we're an explicit
10059         implementation, remove the generic arity from the type name.
10060
10061 2004-08-03  Martin Baulig  <martin@ximian.com>
10062
10063         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10064         use a user-defined operator; we still need to do numeric
10065         promotions in case one argument is a builtin type and the other
10066         one has an implicit conversion to that type.  Fixes #62322.
10067
10068 2004-08-02  Martin Baulig  <martin@ximian.com>
10069
10070         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
10071         `TypeExpr[]' array.
10072         (TypeContainer.GetClassBases): Return the unexpanded list of
10073         interfaces; we expand them later.
10074         (TypeContainer.DefineType): After creating the TypeBuilder, call
10075         TypeManager.ExpandInterfaces() to get an expanded and resolved
10076         list of interfaces.
10077
10078         * ecore.cs (TypeExpr.GetInterfaces): Removed
10079
10080         * generics.cs (Constraints.InterfaceConstraints): Remove.
10081         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
10082         register the interface constraints.
10083
10084         * typemanager.cs
10085         (TypeManager.AddUserType): Removed the `ifaces' argument.
10086         (TypeManager.AddTypeParameter): Likewise.
10087         (TypeManager.AddUserInterface): Removed, was unused.
10088         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
10089         `TypeExpr[]' array for the interfaces.
10090         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
10091         has been defined, returns a list of the resolved interfaces types.
10092         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
10093         (TypeManager.GetExplicitInterfaces): Likewise.  
10094
10095 2004-08-02  Martin Baulig  <martin@ximian.com>
10096
10097         * expression.cs (Invocation.EmitCall): If we're invoking a method
10098         on a type parameter, use the new `Constrained' prefix opcode.
10099
10100 2004-08-02  Martin Baulig  <martin@ximian.com>
10101
10102         * statement.cs (LocalInfo.Flags): Added `IsThis'.
10103         (LocalInfo.IsThis): New public property.
10104         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10105
10106 2004-08-01  Martin Baulig  <martin@ximian.com>
10107
10108         * class.cs (TypeContainer.GetClassBases): Don't set the default
10109         here since we may get called from GetPartialBases().
10110         (TypeContainer.DefineType): If GetClassBases() didn't return a
10111         parent, use the default one.
10112
10113 2004-07-30  Martin Baulig  <martin@ximian.com>
10114
10115         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10116
10117         * class.cs (SourceMethod): New public class, derive from the
10118         symbol writer's ISourceMethod.
10119         (Method): Use the new symbol writer API.
10120
10121         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10122         as argument and use the new symbol writer.
10123
10124         * location.cs
10125         (SourceFile): Implement the symbol writer's ISourceFile.
10126         (Location.SymbolDocument): Removed.
10127         (Location.SourceFile): New public property.
10128
10129         * symbolwriter.cs: Use the new symbol writer API.
10130
10131 2004-07-30  Raja R Harinath  <rharinath@novell.com>
10132
10133         * Makefile (install-local): Remove.  Functionality moved to
10134         executable.make.
10135
10136 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
10137
10138         * Makefile: Install mcs.exe.config file together with mcs.exe.
10139         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10140         correct runtime version.
10141         
10142 2004-07-25  Martin Baulig  <martin@ximian.com>
10143
10144         * class.cs
10145         (TypeContainer.RegisterOrder): Removed, this was unused.
10146         (TypeContainer, interface_order): Removed.
10147         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10148         TypeContainer as argument since we can also be called with a
10149         `PartialContainer' for a partial class/struct/interface.
10150         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10151         of checking whether we're an `Interface' - we could be a
10152         `PartialContainer'.
10153         (PartialContainer.Register): Override; call
10154         AddClass()/AddStruct()/AddInterface() on our parent.
10155
10156         * cs-parser.jay (interface_member_declaration): Add things to the
10157         `current_container', not the `current_class'.
10158
10159         * rootcontext.cs (RegisterOrder): The overloaded version which
10160         takes an `Interface' was unused, removed.
10161
10162         * typemanager.cs (TypeManager.LookupInterface): Return a
10163         `TypeContainer', not an `Interface'.
10164         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10165         contain a `PartialContainer' for an interface, so check it's
10166         `Kind' to figure out what it is.
10167
10168 2004-07-25  Martin Baulig  <martin@ximian.com>
10169
10170         * class.cs (Class.DefaultTypeAttributes): New public constant.
10171         (Struct.DefaultTypeAttributes): Likewise.
10172         (Interface.DefaultTypeAttributes): Likewise.
10173         (PartialContainer.TypeAttr): Override this and add the
10174         DefaultTypeAttributes.
10175
10176 2004-07-25  Martin Baulig  <martin@ximian.com>
10177
10178         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10179         we can just use the `Parent' field instead.
10180
10181 2004-07-25  Martin Baulig  <martin@ximian.com>
10182
10183         * class.cs (TypeContainer.Emit): Renamed to EmitType().
10184
10185 2004-07-25  Martin Baulig  <martin@ximian.com>
10186
10187         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10188         our parts before defining any methods.
10189         (TypeContainer.VerifyImplements): Make this virtual.
10190         (ClassPart.VerifyImplements): Override and call VerifyImplements()
10191         on our PartialContainer.
10192
10193 2004-07-25  Martin Baulig  <martin@ximian.com>
10194
10195         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10196
10197         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10198         argument, we can just use the `Parent' field instead.
10199
10200         * class.cs
10201         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
10202         (MemberBase.DoDefine): Likewise.
10203
10204 2004-07-24  Martin Baulig  <martin@ximian.com>
10205
10206         * decl.cs (MemberCore.Parent): New public field.
10207         (DeclSpace.Parent): Moved to MemberCore.
10208
10209         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10210         (MemberBase.ctor): Added TypeContainer argument, pass it to our
10211         parent's .ctor.
10212         (FieldBase, Field, Operator): Likewise.
10213         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10214         (EventField, Event): Likewise.
10215
10216 2004-07-23  Martin Baulig  <martin@ximian.com>
10217
10218         * class.cs (PartialContainer): New public class.
10219         (ClassPart): New public class.
10220         (TypeContainer): Added support for partial classes.
10221         (TypeContainer.GetClassBases): Splitted some of the functionality
10222         out into GetNormalBases() and GetPartialBases().
10223
10224         * cs-tokenizer.cs (Token.PARTIAL): New token.
10225         (Tokenizer.consume_identifier): Added some hacks to recognize
10226         `partial', but only if it's immediately followed by `class',
10227         `struct' or `interface'.
10228
10229         * cs-parser.jay: Added support for partial clases.
10230
10231 2004-07-23  Martin Baulig  <martin@ximian.com>
10232
10233         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10234         a `DeclSpace' and also made it readonly.
10235         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10236         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10237         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10238
10239         * cs-parser.jay: Pass the `current_class', not the
10240         `current_container' (at the moment, this is still the same thing)
10241         to a new Method, Property, Event, Indexer or Constructor.
10242
10243 2004-07-23  Martin Baulig  <martin@ximian.com>
10244
10245         * cs-parser.jay (CSharpParser): Added a new `current_class' field
10246         and removed the `current_interface' one.
10247         (struct_declaration, class_declaration, interface_declaration):
10248         Set `current_class' to the newly created class/struct/interface;
10249         set their `Bases' and call Register() before parsing their body.
10250
10251 2004-07-23  Martin Baulig  <martin@ximian.com>
10252
10253         * class.cs (Kind): New public enum.
10254         (TypeContainer): Made this class abstract.
10255         (TypeContainer.Kind): New public readonly field.
10256         (TypeContainer.CheckDef): New public method; moved here from
10257         cs-parser.jay.
10258         (TypeContainer.Register): New public abstract method.
10259         (TypeContainer.GetPendingImplementations): New public abstract
10260         method.
10261         (TypeContainer.GetClassBases): Removed the `is_class' and
10262         `is_iface' parameters.
10263         (TypeContainer.DefineNestedTypes): Formerly known as
10264         DoDefineType().
10265         (ClassOrStruct): Made this class abstract.
10266
10267         * tree.cs (RootTypes): New public type. 
10268
10269 2004-07-20  Martin Baulig  <martin@ximian.com>
10270
10271         * tree.cs (Tree.RecordNamespace): Removed.
10272         (Tree.Namespaces): Removed.
10273
10274         * rootcontext.cs (RootContext.IsNamespace): Removed.
10275
10276         * cs-parser.jay (namespace_declaration): Just create a new
10277         NamespaceEntry here.
10278
10279 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
10280
10281         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
10282         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
10283         entry to make sure it runs in the correct runtime version.
10284         
10285 2004-07-18  Martin Baulig  <martin@ximian.com>
10286
10287         * generic.cs (ConstructedType.CheckConstraints): Improved
10288         constraints checking.
10289
10290 2004-07-18  Martin Baulig  <martin@ximian.com>
10291
10292         * expression.cs (Invocation.BetterMethod): Call
10293         TypeManager.TypeToCoreType() on all types and removed my previous
10294         hack; we're already doig the right thing here.
10295
10296 2004-07-17  Martin Baulig  <martin@ximian.com>
10297
10298         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
10299
10300 2004-07-16  Martin Baulig  <martin@ximian.com>
10301
10302         * iterators.cs: Added generics support.
10303
10304 2004-07-16  Martin Baulig  <martin@ximian.com>
10305
10306         * iterators.cs: Rewrote this.  We're now using one single Proxy
10307         class for both the IEnumerable and the IEnumerator interface and
10308         `Iterator' derives from Class so we can use the high-level API.
10309
10310         * class.cs (TypeContainer.AddIterator): New method.
10311         (TypeContainer.DoDefineType): New protected virtual method, which
10312         is called from DefineType().
10313         (TypeContainer.DoDefineMembers): Call DefineType() and
10314         DefineMembers() on all our iterators.
10315         (TypeContainer.Emit): Call Emit() on all our iterators.
10316         (TypeContainer.CloseType): Call CloseType() on all our iterators.
10317
10318         * codegen.cs (EmitContext.CurrentIterator): New public field.
10319
10320 2004-07-15  Martin Baulig  <martin@ximian.com>
10321
10322         * typemanager.cs
10323         (TypeManager.not_supported_exception_type): New type.   
10324
10325 2004-07-14  Martin Baulig  <martin@ximian.com>
10326
10327         * typemanager.cs
10328         (TypeManager.generic_ienumerable_type): New type.
10329         (TypeManager.generic_ienumerator_type): New type.
10330
10331         * rootcontext.cs
10332         (RootContext.interfaces_first_stage): Added
10333         "System.Collections.Generic.IEnumerator`1" and
10334         "System.Collections.Generic.IEnumerable`1".     
10335
10336 2004-07-14  Martin Baulig  <martin@ximian.com>
10337
10338         * iterators.cs: Use real error numbers.
10339
10340 2004-07-14  Martin Baulig  <martin@ximian.com>
10341
10342         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
10343         requires this to be a System.Collection.IEnumerable and not a
10344         class implementing that interface.
10345         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
10346
10347 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
10348
10349         * class.cs: Fixed previous fix, it broke some error tests.
10350
10351 2004-07-12  Martin Baulig  <martin@ximian.com>
10352
10353         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
10354         Fixes #61293.
10355
10356 2004-07-14  Martin Baulig  <martin@ximian.com>
10357
10358         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
10359         an exclamation mark (!) for the generic arity to reflect the
10360         latest spec changes; ie. use "System.Collections.Generic.IList`1".
10361
10362 2004-07-13  Martin Baulig  <martin@ximian.com>
10363
10364         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
10365         specifiers being part of a type argument.
10366
10367 2004-07-13  Martin Baulig  <martin@ximian.com>
10368
10369         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
10370         name for generic types.
10371
10372 2004-07-13  Martin Baulig  <martin@ximian.com>
10373
10374         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
10375         bit to fix #60119.
10376
10377 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
10378
10379         * assign.cs (LocalTemporary): Add new argument: is_address,If
10380         `is_address' is true, then the value that we store is the address
10381         to the real value, and not the value itself.
10382         
10383         * ecore.cs (PropertyExpr): use the new local temporary
10384         stuff to allow us to handle X.Y += z (where X is a struct)
10385
10386 2004-07-08  Martin Baulig  <martin@ximian.com>
10387
10388         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
10389         not always return, just like we're doing in Using.Resolve().
10390
10391 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
10392
10393         * cs-parser.jay (fixed_statement): flag this as Pinned.
10394
10395 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
10396
10397         * typemanager.cs (TypeManager): Removed MakePinned method, this
10398         mechanism is replaced with the .NET 2.x compatible mechanism of
10399         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
10400
10401         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
10402         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
10403         `IsFixed' property which has a different meaning.
10404
10405 2004-07-02  Raja R Harinath  <rharinath@novell.com>
10406
10407         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
10408         visible from inside a nested class, not just the names of the
10409         immediately enclosing class.
10410         Fix for bug #60730.
10411
10412 2004-06-24  Raja R Harinath  <rharinath@novell.com>
10413
10414         * expression.cs (BetterConversion): Remove buggy special-case
10415         handling of "implicit constant expression conversions".  At this
10416         point, we already know that the conversion is possible -- we're
10417         only checking to see which is better.
10418
10419 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10420
10421         * cs-parser.jay: Added error CS0210 test.
10422
10423 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10424
10425         * cs-parser.jay: Added error CS0134 test.
10426
10427 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10428
10429         Fix bug #52507
10430         * cs-parser.jay: Added error CS0145 test.
10431
10432 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10433
10434         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
10435
10436 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
10437         
10438         * expression.cs (StackAlloc.Resolve): The argument may not
10439         be a constant; deal with this case.
10440         
10441 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
10442
10443         * attribute.cs (IndexerName_GetIndexerName): Renamed to
10444         GetIndexerAttributeValue.
10445         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10446
10447         * class.cs (Indexer.Define): Added error tests for CS0415,
10448         CS0609.
10449
10450 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
10451
10452         * attribute.cs (Attribute.Resolve): Keep field code in sync with
10453         property code.
10454
10455 2004-06-23  Martin Baulig  <martin@ximian.com>
10456
10457         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
10458         neither return nor throw, reset the barrier as well.  Fixes #60457.
10459
10460 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
10461
10462         * class.cs : EventAttributes is now set to None by default.
10463           This fixes bug #60459.
10464
10465 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10466
10467         Fix bug #60219
10468         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10469         Don't throw exception but return null (it's sufficient now).
10470
10471 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10472
10473         * typemanager.cs (GetArgumentTypes): Faster implementation.
10474
10475 2004-06-18  Martin Baulig  <martin@ximian.com>
10476
10477         * attribute.cs (Attribute.Resolve): Check whether we're an
10478         EmptyCast which a Constant child.  Fixes #60333.
10479
10480 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
10481
10482         * statement.cs (EmitCollectionForeach): Account for the fact that
10483         not all valuetypes are in areas which we can take the address of.
10484         For these variables, we store to a temporary variable. Also, make
10485         sure that we dont emit a `callvirt' on a valuetype method.
10486
10487 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10488
10489         * expression.cs (StackAlloc.DoReSolve): Added test for
10490         negative parameter (CS0247).
10491
10492 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10493
10494         Fix bug #59792
10495         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
10496
10497 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10498
10499         Fix bug #59781
10500         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10501         ulong.
10502
10503 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10504
10505         Fix bug #58254 & cs1555.cs, cs1556.cs
10506         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10507
10508 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10509
10510         * cs-parser.jay: Added error CS1669 test for indexers.
10511
10512 2004-06-18  Martin Baulig  <martin@ximian.com>
10513
10514         * generics.cs (GenericMethod.ctor): Don't take an Attributes
10515         argument.  Fixes #60441.
10516
10517 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
10518         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
10519         The name needs to have the actual name of the method in order
10520         for other tests (such as the one in OverloadResolve for Invoke
10521         on a delegate) to work. As well, it does not really help
10522         error reporting because the method group had multiple methods.
10523         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
10524         Make profiling work.
10525         
10526 2004-06-13  Martin Baulig  <martin@ximian.com>
10527
10528         * cs-parser.jay: Don't allow generic attributes.
10529
10530 2004-06-13  Martin Baulig  <martin@ximian.com>
10531
10532         * class.cs (MemberBase.DoDefineBase): New protected method.
10533         (MemberBase.DoDefine): Compute the `flags' in the new
10534         DoDefineBase() which must be called first.
10535         (Method.Define): Call DoDefineBase() first so we have the flags
10536         when defining the generic method.
10537
10538         * cs-parser.jay (interface_method_declaration): Support generic methods.
10539
10540 2004-06-13  Martin Baulig  <martin@ximian.com>
10541
10542         * decl.cs (TypeName): Removed.
10543         (MemberName): Removed TypeName and MemberNow; now we just have
10544         MemberName.
10545
10546         * cs-parser.jay: Don't distinguish between type arguments and type
10547         parameters in the grammar and simplified the rules a bit.  The
10548         reduce/reduce conflicts are now gone (except the one we inherited
10549         from mcs).
10550
10551 2004-06-11  Martin Baulig  <martin@ximian.com>
10552
10553         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10554         call this twice: for params and varargs methods.
10555
10556 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10557
10558         * class.cs:
10559         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10560
10561 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10562
10563         * attribute.cs (Attribute.GetValidTargets): Made public.
10564
10565         * class.cs: 
10566         (AbstractPropertyEventMethod): New class for better code sharing.
10567         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10568         CS1667 report.
10569         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10570
10571 2004-06-09  Martin Baulig  <martin@ximian.com>
10572
10573         * cs-parser.jay: Removed a reduce/reduce conflict.
10574
10575 2004-06-03  Martin Baulig  <martin@ximian.com>
10576
10577         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
10578         GetSimpleName() and return a SimpleName.
10579
10580         * ecore.cs (SimpleName.Arguments): New public field.
10581         (SimpleName): Added overloaded ctor which takes an additional
10582         TypeArguments argument.
10583         (SimpleName.SimpleNameResolve): Added support for generic methods.
10584         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
10585         formerly in MemberAccess.DoResolve(), but we also need it in
10586         SimpleNameResolve().
10587
10588         * expression.cs (MemberAccess.DoResolve): Use the new
10589         MethodGroupExpr.ResolveGeneric().       
10590
10591 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10592
10593         * decl.cs: If possible, use lookuptypedirect here. We can only do
10594         this if there is no `.' after the namespace. Avoids using
10595         LookupType, which does lots of slow processing.
10596         (FindNestedType) New method, does what it says :-).
10597         * namespace.cs: use LookupTypeDirect.
10598         * rootcontext.cs: use membercache, if possible.
10599         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10600
10601 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10602
10603         * expression.cs:
10604         According to the spec, 
10605
10606         In a member access of the form E.I, if E is a single identifier,
10607         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10608         field, property, localvariable, or parameter with the same type as
10609         the meaning of E as a type-name (§3.8), then both possible
10610         meanings of E are permitted.
10611
10612         We did not check that E as a simple-name had the same type as E as
10613         a type name.
10614
10615         This trivial check gives us 5-7% on bootstrap time.
10616
10617 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10618
10619         * expression.cs (Invocation.OverloadResolve): Avoid the
10620         use of hashtables and boxing here by allocating on demand.
10621
10622 2004-05-30  Martin Baulig  <martin@ximian.com>
10623
10624         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10625         we're doing a silent lookup.  Don't try to lookup nested types in
10626         TypeManager.object_type (thanks to Ben Maurer).
10627
10628 2004-05-30  Martin Baulig  <martin@ximian.com>
10629
10630         Committing a patch from Ben Maurer.
10631
10632         * rootcontext.cs (RootContext.LookupType): Cache negative results.
10633
10634 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10635
10636         * convert.cs: add a trivial cache for overload operator resolution.
10637
10638 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
10639
10640         * attribute.cs
10641         (AttributeTester.GetObsoleteAttribute): Returns instance of
10642         ObsoleteAttribute when type is obsolete.
10643
10644         * class.cs
10645         (TypeContainer.VerifyObsoleteAttribute): Override.
10646         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10647         (MethodCode.VerifyObsoleteAttribute): Override.
10648         (MemberBase.VerifyObsoleteAttribute): Override.
10649
10650         * decl.cs
10651         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10652         and report proper error.
10653
10654         *delegate.cs
10655         (Delegate.VerifyObsoleteAttribute): Override.
10656
10657         * ecore.cs
10658         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10659         and report proper error.
10660         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10661
10662         * enum.cs
10663         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10664         and enum member.
10665
10666         * expression.cs
10667         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10668         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10669         Added test for ObsoleteAttribute.
10670
10671         * statement.cs
10672         (Catch): Derived from Statement.
10673
10674 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10675
10676         * decl.cs: If possible, use lookuptypedirect here. We can only do
10677         this if there is no `.' after the namespace. Avoids using
10678         LookupType, which does lots of slow processing.
10679         (FindNestedType) New method, does what it says :-).
10680         * namespace.cs: use LookupTypeDirect.
10681         * rootcontext.cs: use membercache, if possible.
10682         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10683
10684 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10685
10686         * expression.cs:
10687         According to the spec, 
10688
10689         In a member access of the form E.I, if E is a single identifier,
10690         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10691         field, property, localvariable, or parameter with the same type as
10692         the meaning of E as a type-name (§3.8), then both possible
10693         meanings of E are permitted.
10694
10695         We did not check that E as a simple-name had the same type as E as
10696         a type name.
10697
10698         This trivial check gives us 5-7% on bootstrap time.
10699
10700 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
10701
10702         Fixed bug #59071 & cs0160.cs
10703         * statement.cs (Try.Resolve): Check here whether order of catch
10704         clauses matches their dependencies.
10705
10706 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
10707
10708         Fixed bug #58624
10709         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
10710         unsafe type.
10711
10712 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10713
10714         * expression.cs (Invocation.OverloadResolve): Avoid the
10715         use of hashtables and boxing here by allocating on demand.
10716
10717 2004-05-30  Martin Baulig  <martin@ximian.com>
10718
10719         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10720         we're doing a silent lookup.  Don't try to lookup nested types in
10721         TypeManager.object_type (thanks to Ben Maurer).
10722
10723 2004-05-30  Martin Baulig  <martin@ximian.com>
10724
10725         Committing a patch from Ben Maurer.
10726
10727         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
10728
10729 2004-05-29  Martin Baulig  <martin@ximian.com>
10730
10731         * class.cs (IMethodData.ShouldIgnore): New method.
10732
10733         * typemanager.cs (TypeManager.MethodFlags): Don't take a
10734         `Location' argument, we don't need it anywhere.  Use
10735         `IMethodData.ShouldIgnore ()' instead of
10736         `MethodData.GetMethodFlags ()'.
10737         (TypeManager.AddMethod): Removed.
10738         (TypeManager.AddMethod2): Renamed to AddMethod.
10739
10740 2004-05-29  Martin Baulig  <martin@ximian.com>
10741
10742         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10743
10744         * convert.cs (Convert.ImplicitReferenceConversion): If we're
10745         converting from a class type S to an interface type and we already
10746         have an object on the stack, don't box it again.  Fixes #52578.
10747
10748 2004-05-29  Martin Baulig  <martin@ximian.com>
10749
10750         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10751         Added support for `params' parameters.  Fixes #59267.
10752
10753 2004-05-29  Martin Baulig  <martin@ximian.com>
10754
10755         * literal.cs (NullPointer): Provide a private .ctor which sets
10756         `type' to TypeManager.object_type.  Fixes #59048.
10757
10758 2004-05-29  Martin Baulig  <martin@ximian.com>
10759
10760         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10761         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
10762
10763         * ecore.cs (EventExpr.instance_expr): Make the field private.
10764
10765 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
10766
10767         Fixed bug #50080 & cs0214-2.cs
10768         * expression.cs (Cast.DoResolve): Check unsafe context here.
10769         
10770         * statement.cs (Resolve.DoResolve): Likewise.
10771
10772 2004-05-26  Martin Baulig  <martin@ximian.com>
10773
10774         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10775
10776         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10777         (RootContext.LookupType): Pass down the `silent' flag.
10778
10779 2004-05-25  Martin Baulig  <martin@ximian.com>
10780
10781         * expression.cs
10782         (MethodGroupExpr.IdenticalTypeName): New public property.
10783         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10784         expression actually refers to a type.
10785
10786 2004-05-25  Martin Baulig  <martin@ximian.com>
10787
10788         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10789         for #56176 and made it actually work.
10790
10791 2004-05-25  Martin Baulig  <martin@ximian.com>
10792
10793         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10794         (FieldExpr, PropertyExpr): Override and implement
10795         CacheTemporaries.  Fixes #52279.
10796
10797 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
10798
10799         * location.cs: In the new compiler listing a file twice is a
10800         warning, not an error.
10801
10802 2004-05-24  Martin Baulig  <martin@ximian.com>
10803
10804         * enum.cs (Enum.DefineType): For the `BaseType' to be a
10805         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
10806
10807 2004-05-24  Martin Baulig  <martin@ximian.com>
10808
10809         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10810         walking the `using' list.  Fixes #53921.
10811
10812 2004-05-24  Martin Baulig  <martin@ximian.com>
10813
10814         * const.cs (Const.LookupConstantValue): Added support for
10815         EmptyCast's; fixes #55251.
10816
10817 2004-05-24  Martin Baulig  <martin@ximian.com>
10818
10819         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10820         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10821         which does the CS0135 check.  The reason is that we first need to
10822         check whether the variable actually exists.
10823
10824 2004-05-24  Martin Baulig  <martin@ximian.com>
10825
10826         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10827         than RootContext.LookupType() to find the explicit interface
10828         type.  Fixes #58584.
10829
10830 2004-05-24  Raja R Harinath  <rharinath@novell.com>
10831
10832         * Makefile: Simplify.  Use executable.make.
10833         * mcs.exe.sources: New file.  List of sources of mcs.exe.
10834
10835 2004-05-24  Anders Carlsson  <andersca@gnome.org>
10836
10837         * decl.cs:
10838         * enum.cs:
10839         Use the invariant culture when doing String.Compare for CLS case
10840         sensitivity.
10841         
10842 2004-05-23  Martin Baulig  <martin@ximian.com>
10843
10844         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10845         don't have any dots.  Fixes #52622, added cs0246-8.cs.
10846
10847         * namespace.cs (NamespaceEntry.Lookup): Likewise.
10848
10849 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10850
10851         * class.cs (MemberBase.Define): Reuse MemberType member for 
10852         resolved type. Other methods can use it too.
10853
10854 2004-05-23  Martin Baulig  <martin@ximian.com>
10855
10856         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10857         the variable also exists in the current block (otherwise, we need
10858         to report a CS0103).  Fixes #58670.
10859
10860 2004-05-23  Martin Baulig  <martin@ximian.com>
10861
10862         * flowanalysis.cs (Reachability.Reachable): Compute this
10863         on-the-fly rather than storing it as a field.
10864
10865 2004-05-23  Martin Baulig  <martin@ximian.com>
10866
10867         * flowanalysis.cs (Reachability.And): Manually compute the
10868         resulting `barrier' from the reachability.      
10869        
10870 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10871
10872         Fix bug #57835
10873         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10874         instance of ObsoleteAttribute when symbol is obsolete.
10875
10876         * class.cs
10877         (IMethodData): Extended interface for ObsoleteAttribute support.
10878
10879 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10880
10881         * attribute.cs: Fix bug #55970
10882
10883 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10884
10885         Fix bug #52705
10886         * attribute.cs
10887         (GetObsoleteAttribute): New method. Creates the instance of
10888         ObsoleteAttribute.
10889         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10890         ObsoleteAttribute when member is obsolete.
10891         (AttributeTester.Report_ObsoleteMessage): Common method for
10892         Obsolete error/warning reporting.
10893
10894         * class.cs
10895         (TypeContainer.base_classs_type): New member for storing parent type.
10896
10897         * decl.cs
10898         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10899         for this MemberCore.
10900
10901 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10902
10903         * attribute.cs, const.cs: Fix bug #58590
10904
10905 2004-05-21  Martin Baulig  <martin@ximian.com>
10906
10907         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10908         out parameters if the end of the method is unreachable.  Fixes
10909         #58098. 
10910
10911 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10912
10913         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10914         Hari was right, why extra method.
10915
10916 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10917
10918         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10919
10920 2004-05-20  Martin Baulig  <martin@ximian.com>
10921
10922         * delegate.cs: Convert this file to Unix mode - like the original
10923         version in mcs is.
10924
10925 2004-05-20  Martin Baulig  <martin@ximian.com>
10926
10927         * attribute.cs: Convert this file to Unix mode - like the original
10928         version in mcs is.
10929
10930 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
10931
10932        Fix bug #58688 (MCS does not report error when the same attribute
10933        is assigned twice)
10934
10935        * attribute.cs (Attribute.Emit): Distinction between null and default.
10936
10937 2004-05-19  Raja R Harinath  <rharinath@novell.com>
10938
10939        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10940        of a top-level attribute without an attribute target.
10941        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
10942        Make non-static.
10943        (Attribute.Conditional_GetConditionName), 
10944        (Attribute.Obsolete_GetObsoleteMessage): Update.
10945        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
10946        part of ScanForIndexerName.
10947        (Attribute.CanIgnoreInvalidAttribute): New function.
10948        (Attribute.ScanForIndexerName): Move to ...
10949        (Attributes.ScanForIndexerName): ... here.
10950        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10951        (Attributes.Search): New internal variant that can choose not to
10952        complain if types aren't resolved.  The original signature now
10953        complains.
10954        (Attributes.GetClsCompliantAttribute): Use internal variant, with
10955        complaints suppressed.
10956        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10957        only if it not useful.
10958        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10959        top-level for attributes that are shared between the assembly
10960        and a top-level class.
10961        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10962        * class.cs: Update to reflect changes.
10963        (DefineIndexers): Fuse loops.
10964        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
10965        a couple more variants of attribute names.
10966
10967 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
10968
10969         Fix bug #52585 (Implemented explicit attribute declaration)
10970
10971         * attribute.cs:
10972         (Attributable.ValidAttributeTargets): New abstract method. It gets
10973         list of valid attribute targets for explicit target declaration.
10974         (Attribute.Target): It holds target itself.
10975         (AttributeSection): Removed.
10976         (Attribute.CheckTargets): New method. It checks whether attribute
10977         target is valid for the current element.
10978
10979         * class.cs:
10980         (EventProperty): New class. For events that are declared like
10981         property (with add and remove accessors).
10982         (EventField): New class. For events that are declared like field.
10983         class.cs
10984
10985         * cs-parser.jay: Implemented explicit attribute target declaration.
10986
10987         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
10988         Override ValidAttributeTargets.
10989
10990         * parameter.cs:
10991         (ReturnParameter): Class for applying custom attributes on 
10992         the return type.
10993         (ParameterAtribute): New class. Class for applying custom
10994         attributes on the parameter type.
10995
10996 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
10997
10998         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10999         definitions. 
11000
11001         (Method): Allow UNSAFE here.
11002
11003         * modifiers.cs: Support unsafe reporting.
11004
11005 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
11006
11007         * decl.cs: Fix bug #58478.
11008
11009 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11010
11011         * statement.cs: When checking for unreachable code on an EmptyStatement,
11012         set the location. Fixes bug #58488.
11013
11014 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
11015
11016         * driver.cs: Add -pkg handling.
11017
11018         From Gonzalo: UseShelLExecute=false
11019
11020 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
11021
11022         * attribute.cs:
11023         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
11024         for attribute.
11025         (Attribute.IsClsCompliaceRequired): Moved to base for better
11026         accesibility.
11027         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
11028         when attribute is AttributeUsageAttribute.
11029         (Attribute.GetValidTargets): Simplified.
11030         (Attribute.GetAttributeUsage): New method returns AttributeUsage
11031         attribute for this type.
11032         (Attribute.ApplyAttributes): Method renamed to Emit and make
11033         non-static.
11034         (GlobalAttributeSection): New class for special handling of global
11035         attributes (assembly, module).
11036         (AttributeSection.Emit): New method.
11037
11038         * class.cs: Implemented Attributable abstract methods.
11039         (MethodCore.LabelParameters): Moved to Parameter class.
11040         (Accessor): Is back simple class.
11041         (PropertyMethod): Implemented Attributable abstract class.
11042         (DelegateMethod): Implemented Attributable abstract class.
11043         (Event): New constructor for disctintion between normal Event
11044         and Event with accessors.
11045
11046         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
11047
11048         * codegen.cs, const.cs, decl.cs, delegate.cs:
11049         (CommonAssemblyModulClass): Implemented Attributable abstract class
11050         and simplified.
11051
11052         * enum.cs: Implement IAttributeSupport interface.
11053         (EnumMember): New class for emum members. Implemented Attributable
11054         abstract class
11055
11056         * parameter.cs:
11057         (ParameterBase): Is abstract.
11058         (ReturnParameter): New class for easier [return:] attribute handling.
11059
11060         * typemanager.cs: Removed builder_to_attr.
11061
11062 2004-05-11  Raja R Harinath  <rharinath@novell.com>
11063
11064         Fix bug #57151.
11065         * attribute.cs (Attribute.GetPositionalValue): New function.
11066         * class.cs (TypeContainer.VerifyMembers): New function.
11067         (TypeContainer.Emit): Use it.
11068         (ClassOrStruct): New base class for Class and Struct.
11069         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
11070         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
11071         class.
11072         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
11073         then each non-static field should have a FieldOffset attribute.
11074         Otherwise, none of the fields should have a FieldOffset attribute.
11075         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
11076         and FieldOffset attributes.
11077         * typemanager.cs (TypeManager.struct_layout_attribute_type)
11078         (TypeManager.field_offset_attribute_type): New core types.
11079         (TypeManager.InitCoreTypes): Initialize them.
11080
11081 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
11082
11083         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11084         Return correct type.
11085         From bug #58270.
11086
11087 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
11088
11089         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11090         be implicitly converted to ulong.
11091         
11092         * expression.cs: The logic for allowing operator &, | and ^ worked
11093         was wrong, it worked before because we did not report an error in
11094         an else branch.  Fixes 57895.
11095
11096         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11097         allow volatile fields to be reference types.
11098
11099 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
11100
11101         * driver.cs: Add support for /debug-
11102
11103 2004-05-07  Raja R Harinath  <rharinath@novell.com>
11104
11105         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
11106         Add a 'complain' parameter to silence errors.
11107         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
11108         silently overlooked type-resolutions.
11109         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11110         to reflect changes.
11111         (Attributes.Search): New function.
11112         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11113         (Attributes.GetAttributeFullName): Remove hack.
11114         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
11115         Update to reflect changes.
11116         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11117         Use Attributes.Search instead of nested loops.
11118
11119 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
11120
11121         * decl.cs:
11122         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11123         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11124         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11125
11126         * report.cs: (Report.Warning): Renamed to Warning_T because of
11127         parameter collision.
11128
11129 2004-05-05  Raja R Harinath  <rharinath@novell.com>
11130
11131         * expression.cs (MemberAccess.ResolveMemberAccess):
11132         Exit with non-zero status after Report.Error.
11133         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
11134         Likewise.
11135         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
11136
11137 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11138
11139         * support.cs: Don't hang when the file is empty.
11140
11141 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11142
11143         * support.cs: In SeekableStreamReader, compute the preamble size of the
11144           underlying stream. Position changes should take into account that initial
11145           count of bytes.
11146
11147 2004-05-03  Todd Berman  <tberman@sevenl.net>
11148
11149         * driver.cs: remove unused GetSysVersion function.
11150
11151 2004-05-03  Todd Berman  <tberman@sevenl.net>
11152
11153         * driver.cs: Remove the hack from saturday, as well as the hack
11154         from jackson (LoadAssemblyFromGac), also adds the CWD to the
11155         link_paths to get that bit proper.
11156
11157 2004-05-01  Todd Berman  <tberman@sevenl.net>
11158
11159         * driver.cs: Try a LoadFrom before a Load, this checks the current
11160         path. This is currently a bug in mono that is be fixed, however, this
11161         provides a workaround for now. This will be removed when the bug
11162         is fixed.
11163
11164 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
11165
11166         * CryptoConvert.cs: Updated to latest version. Fix issue with 
11167         incomplete key pairs (#57941).
11168
11169 2004-05-01  Todd Berman  <tberman@sevenl.net>
11170
11171         * driver.cs: Remove '.' from path_chars, now System.* loads properly
11172         from the GAC
11173
11174 2004-04-30  Jackson Harper  <jackson@ximian.com>
11175
11176         * codegen.cs: Open keys readonly.
11177         
11178 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11179
11180         * typemanager.cs: don't report cyclic struct layout when a struct
11181         contains 2 or more fields of the same type. Failed for Pango.AttrShape
11182         which has 2 Pango.Rectangle fields.
11183
11184 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11185
11186         * expression.cs: Handle IntPtr comparisons with IL code
11187         rather than a method call.
11188
11189 2004-04-29  Martin Baulig  <martin@ximian.com>
11190
11191         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
11192         the list of PropertyInfo's in class hierarchy and find the
11193         accessor.  Fixes #56013.
11194
11195 2004-04-29  Martin Baulig  <martin@ximian.com>
11196
11197         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
11198
11199 2004-04-29  Martin Baulig  <martin@ximian.com>
11200
11201         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11202
11203         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
11204
11205 2004-04-29  Martin Baulig  <martin@ximian.com>
11206
11207         * class.cs (ConstructorInitializer.Resolve): Check whether the
11208         parent .ctor is accessible.  Fixes #52146.
11209
11210 2004-04-29  Martin Baulig  <martin@ximian.com>
11211
11212         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11213
11214         * statement.cs (Using.EmitLocalVariableDecls): Use
11215         TypeManager.idisposable_type, not typeof (IDisposable).
11216         (Foreach.EmitCollectionForeach): Added support for valuetypes.
11217
11218 2004-04-29  Martin Baulig  <martin@ximian.com>
11219
11220         * class.cs (Event.Define): Don't emit the field and don't set
11221         RTSpecialName and SpecialName for events on interfaces.  Fixes
11222         #57703. 
11223
11224 2004-04-29  Raja R Harinath  <rharinath@novell.com>
11225
11226         Refactor Attribute.ApplyAttributes.
11227         * attribute.cs (Attributable): New base class for objects that can
11228         have Attributes applied on them.
11229         (Attribute): Make AttributeUsage fields public.
11230         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
11231         (Attribute.IsInternalCall): New property.
11232         (Attribute.UsageAttr): Convert to a public read-only property.
11233         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
11234         (Attribute.ResolveType, Attribute.Resolve)
11235         (Attribute.ScanForIndexerName): Update to reflect changes.
11236         (Attribute.CheckAttributeTarget): Re-format.
11237         (Attribute.ApplyAttributes): Refactor, to various
11238         Attributable.ApplyAttributeBuilder methods.
11239         * decl.cs (MemberCore): Make Attributable.
11240         * class.cs (Accessor): Make Attributable.
11241         (MethodData.ApplyAttributes): Use proper attribute types, not
11242         attribute names.
11243         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
11244         (TypeContainer.ApplyAttributeBuilder)
11245         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
11246         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
11247         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
11248         (Operator.ApplyAttributeBuilder): New factored-out methods.
11249         * const.cs (Const.ApplyAttributeBuilder): Likewise.
11250         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
11251         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
11252         * parameter.cs (ParameterBase): New Attributable base class
11253         that can also represent Return types.
11254         (Parameter): Update to the changes.
11255
11256 2004-04-29  Jackson Harper  <jackson@ximian.com>
11257
11258         * driver.cs: Prefer the corlib system version when looking for
11259         assemblies in the GAC. This is still a hack, but its a better hack
11260         now.
11261         
11262 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
11263
11264         * decl.cs, enum.cs: Improved error 3005 reporting.
11265   
11266         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
11267         (related_symbols): New private member for list of symbols
11268         related to reported error/warning.
11269         
11270         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
11271
11272 2004-04-29  Martin Baulig  <martin@ximian.com>
11273
11274         * ecore.cs (Expression.Constantify): If we're an enum and
11275         TypeManager.TypeToCoreType() doesn't give us another type, use
11276         t.UnderlyingSystemType.  Fixes #56178.  
11277
11278 2004-04-29  Martin Baulig  <martin@ximian.com>
11279
11280         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
11281         interfaces and for each interface, only add members directly
11282         declared in that interface.  Fixes #53255.
11283
11284 2004-04-28  Martin Baulig  <martin@ximian.com>
11285
11286         * expression.cs (ConditionalLogicalOperator): Use a temporary
11287         variable for `left' to avoid that we evaluate it more than once;
11288         bug #52588.
11289
11290 2004-04-28  Martin Baulig  <martin@ximian.com>
11291
11292         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
11293         `void[]' (CS1547).
11294
11295 2004-04-28  Martin Baulig  <martin@ximian.com>
11296
11297         * statement.cs (LocalInfo.Resolve): Check whether the type is not
11298         void (CS1547).
11299
11300         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
11301         whether the type is not void (CS1547).
11302
11303 2004-04-28  Martin Baulig  <martin@ximian.com>
11304
11305         * expression.cs (Unary.DoResolveLValue): Override this and report
11306         CS0131 for anything but Operator.Indirection.
11307
11308 2004-04-28  Martin Baulig  <martin@ximian.com>
11309
11310         Committing a patch from Ben Maurer; see bug #50820.
11311
11312         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11313         check for classes.
11314
11315         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11316         classes.        
11317
11318 2004-04-28  Martin Baulig  <martin@ximian.com>
11319
11320         Committing a patch from Ben Maurer; see bug #50820.
11321
11322         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11323         check for classes.
11324
11325         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11326         classes.        
11327
11328 2004-04-28  Martin Baulig  <martin@ximian.com>
11329
11330         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
11331         (Block.AddLabel): Call DoLookupLabel() to only search in the
11332         current block.
11333
11334 2004-04-28  Martin Baulig  <martin@ximian.com>
11335
11336         * cfold.cs (ConstantFold.BinaryFold): Added special support for
11337         comparing StringConstants and NullLiterals in Equality and Inequality.
11338
11339 2004-04-28  Jackson Harper  <jackson@ximian.com>
11340
11341         * driver.cs: Attempt to load referenced assemblies from the
11342         GAC. This is the quick and dirty version of this method that
11343         doesnt take into account versions and just takes the first
11344         canidate found. Will be good enough for now as we will not have more
11345         then one version installed into the GAC until I update this method.
11346
11347 2004-04-28  Martin Baulig  <martin@ximian.com>
11348
11349         * typemanager.cs (TypeManager.CheckStructCycles): New public
11350         static method to check for cycles in the struct layout.
11351
11352         * rootcontext.cs (RootContext.PopulateTypes): Call
11353         TypeManager.CheckStructCycles() for each TypeContainer.
11354         [Note: We only need to visit each type once.]
11355
11356 2004-04-28  Martin Baulig  <martin@ximian.com>
11357
11358         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11359
11360         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11361         success and added `out object value'.  Use a `bool resolved' field
11362         to check whether we've already been called rather than
11363         `ConstantValue != null' since this breaks for NullLiterals.
11364
11365 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11366
11367         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11368         setting of this flag, since the 'set' method may be non-public.
11369
11370 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11371
11372         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
11373         check on current_vector.Block.
11374
11375 2004-04-27  Martin Baulig  <martin@ximian.com>
11376
11377         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
11378         a field initializer.  Fixes #56459.
11379
11380 2004-04-27  Martin Baulig  <martin@ximian.com>
11381
11382         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
11383         we're not attempting to use an indexer.  Fixes #52154.
11384
11385 2004-04-27  Martin Baulig  <martin@ximian.com>
11386
11387         * statement.cs (Return): Don't create a return label if we don't
11388         need it; reverts my change from January 20th.  Thanks to Ben
11389         Maurer for this.
11390
11391 2004-04-27  Martin Baulig  <martin@ximian.com>
11392
11393         According to the spec, `goto' can only leave a nested scope, but
11394         never enter it.
11395
11396         * statement.cs (Block.LookupLabel): Only lookup in the current
11397         block, don't recurse into parent or child blocks.
11398         (Block.AddLabel): Check in parent and child blocks, report
11399         CS0140/CS0158 if we find a duplicate.
11400         (Block): Removed this indexer for label lookups.
11401         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
11402         this already does the error reporting for us.
11403
11404         * flowanalysis.cs
11405         (FlowBranching.UsageVector.Block): New public variable; may be null.
11406         (FlowBranching.CreateSibling): Added `Block' argument.
11407         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
11408         label for the target of a `goto' and check whether we're not
11409         leaving a `finally'.
11410
11411 2004-04-27  Martin Baulig  <martin@ximian.com>
11412
11413         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11414         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
11415         just for returns).
11416
11417 2004-04-27  Martin Baulig  <martin@ximian.com>
11418
11419         * statement.cs (Block.AddLabel): Also check for implicit blocks
11420         and added a CS0158 check.
11421
11422 2004-04-27  Martin Baulig  <martin@ximian.com>
11423
11424         * flowanalysis.cs (FlowBranchingLoop): New class.
11425         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11426         UsageVector's instead of an ArrayList.
11427         (FlowBranching.Label): Likewise.
11428         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11429         (FlowBranching.AddBreakVector): New method.
11430
11431 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
11432
11433         * attribute.cs: Small regression fix: only convert the type if we
11434         the type is different, fixes System.Drawing build.
11435
11436 2004-04-27  Martin Baulig  <martin@ximian.com>
11437
11438         * attribute.cs (Attribute.Resolve): If we have a constant value
11439         for a named field or property, implicity convert it to the correct
11440         type.
11441
11442 2004-04-27  Raja R Harinath  <rharinath@novell.com>
11443
11444         * statement.cs (Block.Block): Implicit blocks share
11445         'child_variable_names' fields with parent blocks.
11446         (Block.AddChildVariableNames): Remove.
11447         (Block.AddVariable): Mark variable as "used by a child block" in
11448         every surrounding block.
11449         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11450         been used in a child block, complain about violation of "Invariant
11451         meaning in blocks" rule.
11452         * cs-parser.jay (declare_local_variables): Don't use
11453         AddChildVariableNames.
11454         (foreach_statement): Don't create an implicit block: 'foreach'
11455         introduces a scope.
11456
11457 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
11458
11459         * convert.cs (ImplicitNumericConversion): 0 is also positive when
11460         converting from 0L to ulong.  Fixes 57522.
11461
11462 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11463
11464         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11465         derived class hides via 'new' keyword field from base class (test-242.cs).
11466         TODO: Handle this in the more general way.
11467         
11468         * class.cs (CheckBase): Ditto.
11469
11470 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11471
11472         * decl.cs (caching_flags): New member for storing cached values
11473         as bit flags.
11474         (MemberCore.Flags): New enum where bit flags for caching_flags
11475         are defined.
11476         (MemberCore.cls_compliance): Moved to caching_flags.
11477         (DeclSpace.Created): Moved to caching_flags.
11478
11479         * class.cs: Use caching_flags instead of DeclSpace.Created
11480         
11481 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
11482
11483         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11484         if we are only a derived class, not a nested class.
11485
11486         * typemanager.cs: Same as above, but do this at the MemberLookup
11487         level (used by field and methods, properties are handled in
11488         PropertyExpr).   Allow for the qualified access if we are a nested
11489         method. 
11490
11491 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
11492
11493         * class.cs: Refactoring.
11494         (IMethodData): New inteface; Holds links to parent members
11495         to avoid member duplication (reduced memory allocation).
11496         (Method): Implemented IMethodData interface.
11497         (PropertyBase): New inner classes for get/set methods.
11498         (PropertyBase.PropertyMethod): Implemented IMethodData interface
11499         (Event): New inner classes for add/remove methods.
11500         (Event.DelegateMethod): Implemented IMethodData interface.
11501
11502         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11503         EmitContext (related to class.cs refactoring).
11504
11505 2004-04-21  Raja R Harinath  <rharinath@novell.com>
11506
11507         * delegate.cs (Delegate.VerifyApplicability): If the number of
11508         arguments are the same as the number of parameters, first try to
11509         verify applicability ignoring  any 'params' modifier on the last
11510         parameter.
11511         Fixes #56442.
11512
11513 2004-04-08  Martin Baulig  <martin@ximian.com>
11514
11515         Merged latest changes into gmcs.  Please keep this comment in
11516         here, it makes it easier for me to see what changed in MCS since
11517         the last time I merged.
11518
11519 2004-04-16  Raja R Harinath  <rharinath@novell.com>
11520
11521         * class.cs (TypeContainer.AddIndexer): Use
11522         'ExplicitInterfaceName' to determine if interface name was
11523         explicitly specified.  'InterfaceType' is not initialized at this time.
11524         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
11525         Indexers array is already in the required order.  Initialize
11526         'IndexerName' only if there are normal indexers.
11527         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11528         (TypeContainer.Emit): Emit DefaultMember attribute only if
11529         IndexerName is initialized.
11530         Fixes #56300.
11531
11532 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
11533
11534         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11535         Fixes #57007
11536
11537 2004-04-15  Raja R Harinath  <rharinath@novell.com>
11538
11539         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11540         attributes.
11541         Fix for #56456.
11542
11543         * attribute.cs (Attribute.Resolve): Check for duplicate named
11544         attributes.
11545         Fix for #56463.
11546
11547 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
11548
11549         * iterators.cs (MarkYield): track whether we are in an exception,
11550         and generate code accordingly.  Use a temporary value to store the
11551         result for our state.
11552
11553         I had ignored a bit the interaction of try/catch with iterators
11554         since their behavior was not entirely obvious, but now it is
11555         possible to verify that our behavior is the same as MS .NET 2.0
11556
11557         Fixes 54814
11558
11559 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
11560
11561         * iterators.cs: Avoid creating temporaries if there is no work to
11562         do. 
11563
11564         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11565         Enumerations, use TypeManager.EnumToUnderlying and call
11566         recursively. 
11567
11568         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11569         bug #57013
11570
11571         (This.Emit): Use EmitContext.EmitThis to emit our
11572         instance variable.
11573
11574         (This.EmitAssign): Ditto.
11575
11576         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11577         codepaths, we will move all the functionality into
11578         Mono.CSharp.This 
11579
11580         (FieldExpr.EmitAssign): Ditto.
11581
11582         This fixes several hidden bugs that I uncovered while doing a code
11583         review of this today.
11584
11585         * codegen.cs (EmitThis): reworked so the semantics are more clear
11586         and also support value types "this" instances.
11587
11588         * iterators.cs: Changed so that for iterators in value types, we
11589         do not pass the value type as a parameter.  
11590
11591         Initialization of the enumerator helpers is now done in the caller
11592         instead of passing the parameters to the constructors and having
11593         the constructor set the fields.
11594
11595         The fields have now `assembly' visibility instead of private.
11596
11597 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
11598
11599         * expression.cs (Argument.Resolve): Check if fields passed as ref
11600         or out are contained in a MarshalByRefObject.
11601
11602         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11603         another compiler type.
11604
11605 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
11606
11607         * class.cs (Indexer.Define): use the new name checking method.
11608         Also, return false on an error.
11609         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11610         (is_identifier_[start/part]_character): make static.
11611
11612 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
11613
11614         * expression.cs (Binary.ResolveOperator): Do no append strings
11615         twice: since we can be invoked more than once (array evaluation)
11616         on the same concatenation, take care of this here.  Based on a fix
11617         from Ben (bug #56454)
11618
11619 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11620
11621         * codegen.cs: Fix another case where CS1548 must be reported (when 
11622         delay-sign isn't specified and no private is available #56564). Fix
11623         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11624         error when MCS is used on the MS runtime and we need to delay-sign 
11625         (which seems unsupported by AssemblyBuilder - see #56621).
11626
11627 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
11628
11629         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11630         (TypeManager.ComputeNamespaces): Faster implementation for
11631         Microsoft runtime.
11632
11633         * compiler.csproj: Updated AssemblyName to mcs.
11634
11635 2004-05-11  Jackson Harper  <jackson@ximian.com>
11636
11637         * Makefile: Preserve MONO_PATH
11638         
11639 2004-05-11  Jackson Harper  <jackson@ximian.com>
11640
11641         * Makefile: Use mono and mcs to build gmcs
11642         
11643 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
11644
11645         * codegen.cs: Add patch from Robert Shade
11646         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
11647         sync with mcs.
11648
11649 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
11650
11651         * CryptoConvert.cs: Updated to latest version. Fix issue with 
11652         incomplete key pairs (#57941).
11653
11654 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11655
11656         * codegen.cs: Fix another case where CS1548 must be reported (when 
11657         delay-sign isn't specified and no private is available #56564). Fix
11658         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11659         error when MCS is used on the MS runtime and we need to delay-sign 
11660         (which seems unsupported by AssemblyBuilder - see #56621).
11661
11662 2004-04-29  Jackson Harper  <jackson@ximian.com>
11663
11664         * Makefile: Set MONO_PATH to use the bootstrap corlib
11665         * driver.cs: Check the GAC for referenced assemblies.
11666                 
11667 2004-04-29  Martin Baulig  <martin@ximian.com>
11668
11669         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
11670
11671 2004-04-07  Martin Baulig  <martin@ximian.com>
11672
11673         * expression.cs (Binary.ResolveOperator): Added special case for
11674         Equality/Inequality between a type parameter and a null literal.
11675
11676 2004-04-07  Martin Baulig  <martin@ximian.com>
11677
11678         * convert.cs: Check null literal -> type parameter conversions.
11679
11680 2004-04-07  Martin Baulig  <martin@ximian.com>
11681
11682         * generic.cs (ConstructedType.CheckConstraints): Enforce the
11683         `class' and `struct' constraints.
11684
11685 2004-04-07  Martin Baulig  <martin@ximian.com>
11686
11687         * generic.cs (SpecialConstraint): New public enum.
11688         (Constraints.Resolve): Added support for the `class' and `struct'
11689         constraints.
11690
11691         * cs-parser.jay (type_parameter_constraint): Added support for the
11692         `class' and `struct' constraints.
11693
11694 2004-04-07  Martin Baulig  <martin@ximian.com>
11695
11696         * support.cs (GenericConstraints): Replaced `Types' by
11697         `ClassConstraint' and `InterfaceConstraints'; added
11698         `HasClassConstraint'.   
11699
11700 2004-04-07  Martin Baulig  <martin@ximian.com>
11701
11702         * generic.cs
11703         (Constraints.InterfaceConstraints): New public property.
11704         (Constraints.Types): Make this property public
11705         (TypeParameter): Implement IMemberContainer.
11706         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
11707         instead of a TypeBuilder/MethodBuilder; pass the interface
11708         constraints to TypeManager.AddTypeParameter().
11709         (TypeParameter.DefineType): Just take an EmitContext and no
11710         TypeBuilder/MethodBuilder.  Use the new public API.
11711
11712         * typemanager.cs (TypeManager.AddTypeParameter): Added
11713         `TypeExpr[]' argument; add the interfaces to the
11714         `builder_to_ifaces' hash.
11715         (TypeManager.LookupMemberContainer): For
11716         GenericTypeParameterBuilders, get the TypeParameter from the
11717         `builder_to_type_param'.
11718         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
11719         the TypeParameter and call FindMembers on it.
11720
11721 2004-04-07  Martin Baulig  <martin@ximian.com>
11722
11723         * class.cs
11724         (MethodCore.GenericMethod): Moved this field here from Method.
11725         (MethodCore.IsDuplicateImplementation): Take the number of type
11726         parameters into account if we're a generic method.
11727
11728         * expression.cs (Invocation.InferTypeArguments): Don't return true
11729         if `arguments' is null; we still need to check whether we actually
11730         don't need to infer anything in this case.
11731         (MemberAccess): Merged the functionality from GenericMemberAccess
11732         into this class.
11733
11734         * generic.cs (GenericMemberAccess): Removed.
11735
11736 2004-04-05  Martin Baulig  <martin@ximian.com>
11737
11738         * decl.cs (MemberCore): For generic classes, interfaces and
11739         structs, `Name' now includes the number of type parameters
11740         ("Stack!1.Node!1").
11741         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
11742         encode the number of type arguments in the type name.
11743
11744         * expression.cs (Expression.MemberLookup): Removed the
11745         `num_type_args' argument; we now encode the number of type
11746         arguments in the type name.
11747
11748         * ecore.cs (SimpleName): Encode the number of type arguments in
11749         the type name itself.
11750
11751         * generic.cs (ConstructedType): Likewise.
11752
11753         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
11754         `MemberName'; we now include the number of type parameters in the
11755         type name.
11756
11757         * typemanager.cs (TypeManager.CheckGeneric): Removed.
11758         (TypeManager.MemberLookup): Removed the
11759         `num_type_args' argument; we now encode the number of type
11760         arguments in the type name.     
11761
11762 2004-04-03  Martin Baulig  <martin@ximian.com>
11763
11764         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
11765         (MemberCore.MemberName): Moved here from MemberBase.
11766         (DeclSpace.SetParameterInfo): Just take the constraints as an
11767         ArrayList; we already have the type parameters in our
11768         `MemberName'; also do the CS0080 reporting here.
11769
11770         * cs-parser.jay (struct_declaration): Use `member_name' instead of
11771         `IDENTIFIER opt_type_parameter_list'; when constructing our
11772         `MemberName', it'll already include our type parameters.
11773         (class_declaration, interface_declaration): Likewise.
11774         (delegate_declaration): Likewise.
11775         (MakeName): Take a MemberName and return a MemberName.
11776         The following two changes are required to avoid shift/reduce conflicts:
11777         (member_name): Don't include a TypeName anymore; ie. this is now
11778         just 'IDENTIFIER opt_type_parameter_list'.
11779         (property_declaration, event_declaration): Use a
11780         `namespace_or_type_name' instead of a `member_name'.            
11781
11782 2004-04-03  Martin Baulig  <martin@ximian.com>
11783
11784         * decl.cs (MemberName): Renamed to `TypeName' and created a new
11785         `MemberName' class.
11786         (TypeName): Formerly known as MemberName.
11787
11788         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
11789         instead of a `MemberName'.
11790
11791         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
11792         (member_name): New rule; create a MemberName.
11793
11794 2004-04-02  Martin Baulig  <martin@ximian.com>
11795
11796         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
11797         (CS0305 and CS0308).
11798
11799 2004-04-02  Martin Baulig  <martin@ximian.com>
11800
11801         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
11802         support for nested types.
11803
11804 2004-04-02  Martin Baulig  <martin@ximian.com>
11805
11806         * ecore.cs (IAlias): New public interface.
11807         (TypeExpr, TypeExpression): Implement IAlias.
11808         (TypeAliasExpression): New public class.
11809
11810         * namespace.cs (Namespace): Implement IAlias.
11811         (Namespace.Lookup): Return an IAlias instead on an object.
11812         (Namespace.DefineName): Take an IAlias instead of an object.
11813         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
11814         an object.
11815         (NamespaceEntry.UsingAlias): Take a Membername instead of an
11816         Expression.
11817         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
11818         object.
11819         (NamespaceEntry.Lookup): Likewise.
11820
11821         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
11822         instead of a Type.      
11823
11824         * decl.cs (DeclSpace): Implement IAlias.
11825         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
11826
11827         * generic.cs (ConstructedType): Improved error checking.
11828
11829 2004-04-02  Martin Baulig  <martin@ximian.com>
11830
11831         * convert.cs: Added type parameter conversions.
11832
11833         * ecore.cs
11834         (UnboxCast.Emit): Emit an `unbox.any' for type params.
11835         (ClassCast.Emit): If the source type is a type parameter, box it.
11836         If the target type is a type parameter, emit an `unbox.any'
11837         instead of a `classcast'.1      
11838
11839 2004-04-01  Martin Baulig  <martin@ximian.com>
11840
11841         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
11842
11843 2004-04-01  Martin Baulig  <martin@ximian.com>
11844
11845         * generic.cs (ConstructedType.CheckConstraints): Use
11846         Convert.ImplicitStandardConversionExists(); user-defined implicit
11847         conversions are not allowed according to the spec.
11848
11849 2004-03-30  Martin Baulig  <martin@ximian.com>
11850
11851         * expression.cs (New): Added support for type parameters.
11852
11853         * typemanager.cs
11854         (TypeManager.activator_type): New public static field.
11855         (TypeManager.activator_create_instance): Likewise.
11856
11857 2004-03-30  Martin Baulig  <martin@ximian.com>
11858
11859         * typemanager.cs (TypeManager.HasConstructorConstraint): New
11860         public method.
11861
11862 2004-03-30  Martin Baulig  <martin@ximian.com>
11863
11864         * generic.cs (ConstructedType.CheckConstraints): Actually follow
11865         the spec here: the argument type must be convertible to the
11866         constraints.
11867
11868 2004-03-30  Martin Baulig  <martin@ximian.com>
11869
11870         * generic.cs
11871         (TypeParameter.Define, TypeParameter.DefineMethod): Call
11872         TypeManager.AddTypeParameter().
11873         (ConstructedType.CheckConstraints): Re-enable this and actually
11874         check whether we have a constructor constraint.
11875
11876         * typemanager.cs
11877         (TypeManager.builder_to_type_param): New static field.
11878         (TypeManager.AddTypeParameter): New static method.
11879         (TypeManager.LookupTypeParameter): New public method.
11880
11881 2004-03-30  Martin Baulig  <martin@ximian.com>
11882
11883         * generic.cs (TypeParameter.DefineType): Return a boolean and use
11884         the new API to actually define the constructor constraint.
11885
11886         * typemanager.cs
11887         (TypeManager.new_constraint_attr_type): New static field.
11888         (TypeManager.InitCoreTypes): Initialize it.
11889
11890 2004-03-30  Martin Baulig  <martin@ximian.com>
11891
11892         * generic.cs (Constraints): Completed error checking, use correct
11893         error numbers.
11894
11895 2004-03-29  Martin Baulig  <martin@ximian.com>
11896
11897         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
11898
11899         * expression.cs (Invocation.InferTypeArguments): Added overloaded
11900         public version which takes a `ParameterData pd' instead of an
11901         `ArrayList args'.
11902
11903 2004-03-29  Martin Baulig  <martin@ximian.com>
11904
11905         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
11906         not a MethodInfo.       
11907
11908 2004-03-29  Martin Baulig  <martin@ximian.com>
11909
11910         * expression.cs (Argument.ResolveMethodGroup): If we're a
11911         ConstructedType, call GetMemberAccess() on it.  
11912
11913 2004-03-29  Martin Baulig  <martin@ximian.com>
11914
11915         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
11916         (MethodCore.CheckGenericOverride): When overriding a generic
11917         method, check whether the constraints match.
11918
11919         * support.cs (GenericConstraints): New public interface.
11920         (ParameterData.GenericConstraints): New public method.
11921
11922         * parameter.cs (Parameter.Resolve): Check whether we're a generic
11923         method parameter and compute our constraints if appropriate.
11924         (Parameter.GenericConstraints): New public property.
11925
11926         * generic.cs (Constraints): Implement GenericConstraints.
11927
11928 2004-03-29  Martin Baulig  <martin@ximian.com>
11929
11930         * decl.cs (MemberCache.FindMemberToOverride): Use
11931         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
11932
11933 2004-03-29  Martin Baulig  <martin@ximian.com>
11934
11935         * generic.cs (GenericMethod.Define): Resolve our type parameters.
11936
11937 2004-03-29  Martin Baulig  <martin@ximian.com>
11938
11939         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
11940         not allowed on non-generic declarations").
11941
11942 2004-03-29  Martin Baulig  <martin@ximian.com>
11943
11944         * expression.cs (Invocation.InferTypeArguments): Added overloaded
11945         public version of this method.
11946
11947         * class.cs (MethodCore.IsDuplicateImplementation): Use
11948         Invocation.InferTypeArguments() to check this.
11949
11950 2004-03-29  Martin Baulig  <martin@ximian.com>
11951
11952         * convert.cs: Use TypeManager.IsDelegateType() instead of
11953         comparing types correctly.
11954
11955 2004-03-29  Martin Baulig  <martin@ximian.com>
11956
11957         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
11958         types directly to make it work for generic instances.
11959
11960         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
11961
11962 2004-03-29  Martin Baulig  <martin@ximian.com>
11963
11964         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
11965         support for arrays.     
11966
11967 2004-03-24  Martin Baulig  <martin@ximian.com>
11968
11969         * decl.cs (DeclSpace.FindType): Also use
11970         TypeManager.CheckGeneric() for types from the using clauses.
11971
11972 2004-03-23  Martin Baulig  <martin@ximian.com>
11973
11974         * expression.cs (Invocation.OverloadResolve): Added `bool
11975         may_fail' argument and use it instead of the Location.IsNull() hack.
11976
11977 2004-03-23  Martin Baulig  <martin@ximian.com>
11978
11979         * expression.cs (Invocation.InferType): Use correct type inference
11980         rules here.     
11981
11982 2004-03-23  Martin Baulig  <martin@ximian.com>
11983
11984         * ecore.cs (MethodGroupExpr.Name): Use
11985         TypeManager.CSharpSignature() instead of just the name.
11986
11987         * expression.cs (Invocation.OverloadResolve): Provide better error
11988         reporting.
11989         (Invocation.DoResolve): OverloadResolve() never returns null
11990         without reporting an error, so removed the error -6 reporting here.
11991
11992 2004-03-23  Martin Baulig  <martin@ximian.com>
11993
11994         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
11995         generic methods.
11996
11997         * cs-parser.jay (delegate_declaration): Support generic delegates.
11998
11999         * delegate.cs: Support generic delegates.
12000
12001 2004-03-22  Martin Baulig  <martin@ximian.com>
12002
12003         * expression.cs (Invocation.InferParamsTypeArguments): New static
12004         method; does type inference for params arguments.
12005
12006 2004-03-21  Martin Baulig  <martin@ximian.com>
12007
12008         * typemanager.cs (TypeManager.IsGenericMethod): New public static
12009         method; checks whether a method is a generic method.    
12010
12011         * expression.cs (Invocation.InferTypeArguments): New static method;
12012         infer type arguments for generic method invocation.
12013
12014         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
12015         property; we set this to true if we're resolving a generic method
12016         invocation and the user specified type arguments, ie. we're not
12017         doing type inference.
12018
12019 2004-03-20  Martin Baulig  <martin@ximian.com>
12020
12021         * class.cs (MethodData.DeclaringType): New public property.
12022         (MethodData.Define): Set DeclaringType here.
12023         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
12024         instead of OperatorMethodBuilder.DeclaringType.
12025
12026 2004-03-20  Martin Baulig  <martin@ximian.com>
12027
12028         * cs-tokenizer.cs (xtoken): Return a special
12029         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
12030
12031         * cs-parser.jay (default_value_expression): Switch to the new
12032         syntax (14.5.13).
12033
12034 2004-03-19  Martin Baulig  <martin@ximian.com>
12035
12036         * decl.cs (MemberName): New class.  We use this to "construct"
12037         namespace_or_type_name's.
12038
12039         * generics.cs (TypeArguments.GetDeclarations): New public method;
12040         returns the type arguments as a string[] and reports a CS0081 if
12041         one of them is not an identifier.
12042
12043         * class.cs (MemberBase): The .ctor now takes the name as a
12044         MemberName instead of a string.
12045         (MemberBase.ExplicitInterfaceName): Changed type from string to
12046         Expression.
12047         (MemberBase.DoDefine): If we're an explicit implementation, the
12048         InterfaceType may be a generic instance.
12049
12050         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
12051         (namespace_name): Call MemberName.GetName () to transform the
12052         MemberName into a string and ensure we don't have any type
12053         arguments.
12054         (type_name): Call MemberName.GetTypeExpression() to transfrom the
12055         MemberName into an expression.
12056         (method_header): Use namespace_or_type_name instead of member_name.     
12057
12058 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
12059
12060         * rootcontext.cs: Add new types to the boot resolution.
12061
12062         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
12063         MulticastDelegate is not allowed.
12064
12065         * typemanager.cs: Add new types to lookup: System.TypedReference
12066         and ArgIterator.
12067
12068         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
12069         check for TypedReference or ArgIterator, they are not allowed. 
12070
12071         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
12072         makes us properly catch 1510 in some conditions (see bug 56016 for
12073         details). 
12074
12075 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
12076
12077         * CryptoConvert.cs: update from corlib version
12078         with endian fixes.
12079
12080 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
12081
12082         * class.cs (Indexer.Define): Check indexername declaration
12083
12084 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
12085
12086         * attribute.cs (IsClsCompliant): Fixed problem with handling
12087         all three states (compliant, not-compliant, undetected).
12088
12089 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
12090
12091         * attribute.cs (Attribute): Location is now public.
12092         (Resolve): Store resolved arguments (pos_values) in attribute class.
12093         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
12094         (GetClsCompliantAttributeValue): New method that gets
12095         CLSCompliantAttribute value.
12096         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
12097         if exists else null.
12098         (AttributeTester): New class for CLS-Compliant verification routines.
12099
12100         * class.cs (Emit): Add CLS-Compliant verification.
12101         (Method.GetSignatureForError): Implemented.
12102         (Constructor.GetSignatureForError): Implemented
12103         (Constructor.HasCompliantArgs): Returns if constructor has
12104         CLS-Compliant arguments.
12105         (Constructor.Emit): Override.
12106         (Construcor.IsIdentifierClsCompliant): New method; For constructors
12107         is needed to test only parameters.
12108         (FieldBase.GetSignatureForError): Implemented.
12109         (TypeContainer): New member for storing base interfaces.
12110         (TypeContainer.FindMembers): Search in base interfaces too.
12111
12112         * codegen.cs (GetClsComplianceAttribute): New method that gets
12113         assembly or module CLSCompliantAttribute value.
12114         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
12115         for assembly.
12116         (ModuleClass.Emit): Add error 3012 test.
12117
12118         * const.cs (Emit): Override and call base for CLS-Compliant tests.
12119
12120         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
12121         state for all decl types.
12122         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
12123         if CLS-Compliant tests are required.
12124         (IsClsCompliaceRequired): New method. Analyze whether code
12125         must be CLS-Compliant.
12126         (IsExposedFromAssembly): New method. Returns true when MemberCore
12127         is exposed from assembly.
12128         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
12129         value or gets cached value.
12130         (HasClsCompliantAttribute): New method. Returns true if MemberCore
12131         is explicitly marked with CLSCompliantAttribute.
12132         (IsIdentifierClsCompliant): New abstract method. This method is
12133         used to testing error 3005.
12134         (IsIdentifierAndParamClsCompliant): New method. Common helper method
12135         for identifier and parameters CLS-Compliant testing.
12136         (VerifyClsCompliance): New method. The main virtual method for
12137         CLS-Compliant verifications.
12138         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
12139         null. I don't know why is null (too many public members !).
12140         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
12141         and get value of first CLSCompliantAttribute that found.
12142
12143         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
12144         (VerifyClsCompliance): Override and add extra tests.
12145
12146         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
12147         clscheck- disable CLS-Compliant verification event if assembly is has
12148         CLSCompliantAttribute(true).
12149
12150         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
12151         ApllyAttribute is now called in emit section as in the other cases.
12152         Possible future Emit integration.
12153         (IsIdentifierClsCompliant): New override.
12154         (VerifyClsCompliance): New override.
12155         (GetEnumeratorName): Returns full enum name.
12156
12157         * parameter.cs (GetSignatureForError): Implemented.
12158
12159         * report.cs (WarningData): New struct for Warning message information.
12160         (LocationOfPreviousError): New method.
12161         (Warning): New method. Reports warning based on the warning table.
12162         (Error_T): New method. Reports error based on the error table.
12163
12164         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
12165         verifications are done here.
12166
12167         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
12168
12169         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
12170         CLSCompliantAttribute.
12171         (all_imported_types): New member holds all imported types from other
12172         assemblies.
12173         (LoadAllImportedTypes): New method fills static table with exported types
12174         from all referenced assemblies.
12175         (Modules): New property returns all assembly modules.
12176
12177 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
12178
12179         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
12180         throwing a parser error.
12181
12182         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
12183         which removes the hardcoded get_/set_ prefixes for properties, as
12184         IL allows for the properties to be named something else.  
12185
12186         Bug #56013
12187
12188         * expression.cs: Do not override operand before we know if it is
12189         non-null.  Fix 56207
12190
12191 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12192
12193         * typemanager.cs: support for pinned variables.
12194
12195 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12196
12197         * decl.cs, typemanager.cs: Avoid using an arraylist
12198         as a buffer if there is only one result set.
12199
12200 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12201
12202         * expression.cs: Make sure you cant call a static method
12203         with an instance expression, bug #56174.
12204
12205 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
12206
12207         * class.cs (IsDuplicateImplementation): Improve error reporting to
12208         flag 663 (method only differs in parameter modifier).
12209
12210         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12211         in preprocessor directives.
12212
12213         * location.cs (LookupFile): Allow for the empty path.
12214
12215         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
12216         better approach for some of that patch, but its failing with the
12217         CharSet enumeration.  For now try/catch will do.
12218
12219         * typemanager.cs: Do not crash if a struct does not have fields.
12220         Fixes 56150.
12221
12222 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12223
12224         * expression.cs: cs0213, cant fix a fixed expression.
12225         fixes 50231.
12226
12227 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12228
12229         * cs-parser.jay: detect invalid embeded statements gracefully.
12230         bug #51113.
12231
12232 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12233
12234         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12235         As a regex:
12236         s/
12237         the invocation type may not be a subclass of the tye of the item/
12238         The type of the item must be a subclass of the invocation item.
12239         /g
12240
12241         Fixes bug #50820.
12242
12243 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
12244
12245         * attribute.cs: Added methods to get a string and a bool from an
12246         attribute. Required to information from AssemblyKeyFileAttribute,
12247         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12248         * codegen.cs: Modified AssemblyName creation to include support for
12249         strongnames. Catch additional exceptions to report them as CS1548.
12250         * compiler.csproj: Updated include CryptoConvert.cs.
12251         * compiler.csproj.user: Removed file - user specific configuration.
12252         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
12253         Mono.Security assembly. The original class is maintained and tested in
12254         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12255         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12256         like CSC 8.0 (C# v2) supports.
12257         * Makefile: Added CryptoConvert.cs to mcs sources.
12258         * rootcontext.cs: Added new options for strongnames.
12259
12260 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
12261
12262         * driver.cs: For --expect-error, report error code `2'
12263         if the program compiled with no errors, error code `1' if
12264         it compiled with an error other than the one expected.
12265
12266 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
12267
12268         * compiler.csproj: Updated for Visual Studio .NET 2003.
12269         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12270         * compiler.sln: Updated for Visual Studio .NET 2003.
12271
12272 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
12273
12274         * expression.cs: Fix bug #47234. We basically need to apply the
12275         rule that we prefer the conversion of null to a reference type
12276         when faced with a conversion to 'object' (csc behaviour).
12277
12278 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12279
12280         * statement.cs: Shorter form for foreach, eliminates
12281         a local variable. r=Martin.
12282
12283 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12284
12285         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12286         checks if we can use brtrue/brfalse to test for 0.
12287         * expression.cs: use the above in the test for using brtrue/brfalse.
12288         cleanup code a bit.
12289
12290 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12291
12292         * expression.cs: Rewrite string concat stuff. Benefits:
12293
12294         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12295         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12296         rather than a concat chain.
12297
12298         * typemanager.cs: Add lookups for more concat overloads.
12299
12300 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12301
12302         * expression.cs: Emit shorter il code for array init.
12303
12304         newarr
12305         dup
12306         // set 1
12307
12308         // set 2
12309
12310         newarr
12311         stloc.x
12312
12313         ldloc.x
12314         // set 1
12315
12316         ldloc.x
12317         // set 2
12318
12319 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
12320
12321         * statement.cs: Before, two switch blocks would be merged if the
12322         total size of the blocks (end_item - begin_item + 1) was less than
12323         two times the combined sizes of the blocks.
12324
12325         Now, it will only merge if after the merge at least half of the
12326         slots are filled.
12327
12328         fixes 55885.
12329
12330 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
12331
12332         * class.cs : csc build fix for GetMethods(). See bug #52503.
12333
12334 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
12335
12336         * expression.cs: Make sure fp comparisons work with NaN.
12337         This fixes bug #54303. Mig approved this patch a long
12338         time ago, but we were not able to test b/c the runtime
12339         had a related bug.
12340
12341 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
12342
12343         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
12344
12345 2004-03-19  Martin Baulig  <martin@ximian.com>
12346
12347         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
12348         two overloads may unify for some type parameter substitutions and
12349         report a CS0408 if appropriate.
12350
12351 2004-03-19  Martin Baulig  <martin@ximian.com>
12352
12353         * class.cs (MemberCore.IsDuplicateImplementation): Report the
12354         error here and not in our caller.
12355
12356 2004-03-19  Martin Baulig  <martin@ximian.com>
12357
12358         * interface.cs: Completely killed this file.
12359         (Interface): We're now a TypeContainer and live in class.cs.
12360
12361         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12362         argument; we're now also called for interfaces.
12363         (TypeContainer.DefineMembers): Allow this method being called
12364         multiple times.
12365         (TypeContainer.GetMethods): New public method; formerly known as
12366         Interface.GetMethod().  This is used by PendingImplementation.
12367         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12368         it's now private and non-static.
12369         (Interface): Moved this here; it's now implemented similar to
12370         Class and Struct.
12371         (Method, Property, Event, Indexer): Added `bool is_interface'
12372         argument to their .ctor's.
12373         (MemberBase.IsInterface): New public field.
12374
12375         * cs-parser.jay: Create normal Method, Property, Event, Indexer
12376         instances instead of InterfaceMethod, InterfaceProperty, etc.
12377         (opt_interface_base): Removed; we now use `opt_class_base' instead.
12378         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12379
12380 2004-03-19  Martin Baulig  <martin@ximian.com>
12381
12382         * class.cs (MethodCore.IsDuplicateImplementation): New private
12383         method which does the CS0111 checking.
12384         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12385         Use IsDuplicateImplementation().
12386
12387 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
12388
12389         * decl.cs (FindMemberToOverride): New method to find the correct
12390         method or property to override in the base class.
12391         * class.cs
12392             - Make Method/Property use the above method to find the
12393               version in the base class.
12394             - Remove the InheritableMemberSignatureCompare as it is now
12395               dead code.
12396
12397         This patch makes large code bases much faster to compile, as it is
12398         O(n) rather than O(n^2) to do this validation.
12399
12400         Also, it fixes bug 52458 which is that nested classes are not
12401         taken into account when finding the base class member.
12402
12403         Reviewed/Approved by Martin.
12404
12405 2004-03-17  Martin Baulig  <martin@ximian.com>
12406
12407         * expression.cs (MemberAccess.DoResolve): Take the parent's number
12408         of type arguments into account; use the `real_num_type_args'
12409         approach like in DoResolveAsTypeStep().
12410
12411         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
12412         nested types.
12413
12414 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
12415
12416         * interface.cs: In all interface classes removed redundant
12417         member initialization.
12418
12419 2004-03-16  Martin Baulig  <martin@ximian.com>
12420
12421         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12422
12423 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12424
12425         * decl.cs (DefineTypeAndParents): New helper method to define a
12426         type's containers before the type itself is defined;  This is a
12427         bug exposed by the recent changes to Windows.Forms when an
12428         implemented interface was defined inside a class that had not been
12429         built yet.   
12430
12431         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12432
12433         (Check): Loop correctly to report errors modifiers
12434         (UNSAFE was not in the loop, since it was the same as TOP).
12435
12436         * interface.cs: Every interface member now takes a ModFlags,
12437         instead of a "is_new" bool, which we set on the base MemberCore. 
12438
12439         Every place where we called "UnsafeOk" in the interface, now we
12440         call the proper member (InterfaceMethod.UnsafeOK) instead to get
12441         the unsafe settings from the member declaration instead of the
12442         container interface. 
12443
12444         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
12445
12446         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12447         `set_indexer_name' to the pending bits (one per type).
12448
12449         We fixed a bug today that was picking the wrong method to
12450         override, since for properties the existing InterfaceMethod code
12451         basically ignored the method name.  Now we make sure that the
12452         method name is one of the valid indexer names.
12453
12454 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
12455  
12456         * support.cs (SeekableStreamReader): Keep track of stream byte
12457         positions and don't mix them with character offsets to the buffer.
12458
12459         Patch from Gustavo Giráldez
12460
12461 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
12462
12463         * interface.cs (InterfaceSetGetBase): Removed double member
12464         initialization, base class does it as well.
12465
12466 2004-03-13  Martin Baulig  <martin@ximian.com>
12467
12468         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12469         when compiling corlib.
12470
12471 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
12472
12473         * convert.cs (ExplicitConversion): We were reporting an error on
12474         certain conversions (object_type source to a value type, when the
12475         expression was `null') before we had a chance to pass it through
12476         the user defined conversions.
12477
12478         * driver.cs: Replace / and \ in resource specifications to dots.
12479         Fixes 50752
12480
12481         * class.cs: Add check for duplicate operators.  Fixes 52477
12482
12483 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
12484
12485         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12486         that are in the middle of the statements, not only at the end.
12487         Fixes #54987
12488
12489         * class.cs (TypeContainer.AddField): No longer set the
12490         `HaveStaticConstructor' flag, now we call it
12491         `UserDefineStaticConstructor' to diferentiate the slightly
12492         semantic difference.
12493
12494         The situation is that we were not adding BeforeFieldInit (from
12495         Modifiers.TypeAttr) to classes that could have it.
12496         BeforeFieldInit should be set to classes that have no static
12497         constructor. 
12498
12499         See:
12500
12501         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12502
12503         And most importantly Zoltan's comment:
12504
12505         http://bugzilla.ximian.com/show_bug.cgi?id=44229
12506
12507         "I think beforefieldinit means 'it's ok to initialize the type sometime 
12508          before its static fields are used', i.e. initialization does not need
12509          to be triggered by the first access to the type. Setting this flag
12510          helps the JIT to compile better code, since it can run the static
12511          constructor at JIT time, and does not need to generate code to call it
12512          (possibly lots of times) at runtime. Unfortunately, mcs does not set
12513          this flag for lots of classes like String. 
12514          
12515          csc sets this flag if the type does not have an explicit static 
12516          constructor. The reasoning seems to be that if there are only static
12517          initalizers for a type, and no static constructor, then the programmer
12518          does not care when this initialization happens, so beforefieldinit
12519          can be used.
12520          
12521          This bug prevents the AOT compiler from being usable, since it 
12522          generates so many calls to mono_runtime_class_init that the AOT code
12523          is much slower than the JITted code. The JITted code is faster, 
12524          because it does not generate these calls if the vtable is type is
12525          already initialized, which is true in the majority of cases. But the
12526          AOT compiler can't do this."
12527
12528 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
12529
12530         * class.cs (MethodData.Emit): Refactor the code so symbolic
12531         information is generated for destructors;  For some reasons we
12532         were taking a code path that did not generate symbolic information
12533         before. 
12534
12535 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12536
12537         * class.cs: Create a Constructor.CheckBase method that
12538         takes care of all validation type code. The method
12539         contains some code that was moved from Define.
12540
12541         It also includes new code that checks for duplicate ctors.
12542         This fixes bug #55148.
12543
12544 2004-03-09  Joshua Tauberer <tauberer@for.net>
12545
12546         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12547         a { ... }-style array creation invokes EmitStaticInitializers
12548         which is not good for reference-type arrays.  String, decimal
12549         and now null constants (NullCast) are not counted toward
12550         static initializers.
12551
12552 2004-03-05  Martin Baulig  <martin@ximian.com>
12553
12554         * location.cs (SourceFile.HasLineDirective): New public field;
12555         specifies whether the file contains or is referenced by a "#line"
12556         directive.
12557         (Location.DefineSymbolDocuments): Ignore source files which
12558         either contain or are referenced by a "#line" directive.        
12559
12560 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
12561
12562         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12563         direct access to our parent, so check the method inline there.
12564
12565 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12566
12567         * expression.cs (Invocation.EmitCall): Miguel's last commit
12568         caused a regression. If you had:
12569
12570             T t = null;
12571             t.Foo ();
12572
12573         In Foo the implict this would be null.
12574
12575 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
12576
12577         * expression.cs (Invocation.EmitCall): If the method is not
12578         virtual, do not emit a CallVirt to it, use Call.
12579
12580         * typemanager.cs (GetFullNameSignature): Improve the method to
12581         cope with ".ctor" and replace it with the type name.
12582
12583         * class.cs (ConstructorInitializer.Resolve): Now the method takes
12584         as an argument the ConstructorBuilder where it is being defined,
12585         to catch the recursive constructor invocations.
12586
12587 2004-03-16  Martin Baulig  <martin@ximian.com>
12588
12589         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
12590         ConstructedType, call ResolveType() on it to get the type rather
12591         than just using `expr.Type'.
12592
12593 2004-03-16  Martin Baulig  <martin@ximian.com>
12594
12595         * generics.cs (ConstructedType.GetMemberAccess): Take the
12596         EmitContext instead on the TypeExpr and use
12597         ec.TypeContainer.CurrentType/ec.ContainerType.
12598
12599 2004-03-16  Martin Baulig  <martin@ximian.com>
12600
12601         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
12602         parameters before aliases.
12603
12604 2004-03-16  Martin Baulig  <martin@ximian.com>
12605
12606         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
12607         New oublic function; checks whether two generic instances may become
12608         equal under some instantiations (26.3.1).
12609
12610         * class.cs (TypeContainer.Define): Call
12611         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
12612         error.
12613
12614 2004-03-16  Martin Baulig  <martin@ximian.com>
12615
12616         * class.cs (TypeContainer.GetClassBases): Moved
12617         Error_TypeParameterAsBase() here and also check whether the base
12618         class is not an attribute.
12619
12620 2004-03-16  Martin Baulig  <martin@ximian.com>
12621
12622         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12623
12624 2004-03-16  Martin Baulig  <martin@ximian.com>
12625
12626         * class.cs (Error_TypeParameterAsBase): Use correct error number
12627         here (CS0689).  
12628
12629 2004-03-16  Martin Baulig  <martin@ximian.com>
12630
12631         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
12632         for generics.
12633
12634         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
12635         error reporting.
12636
12637 2004-03-15  Martin Baulig  <martin@ximian.com>
12638
12639         * typemanager.cs (TypeManager.GetFullName): New public method.
12640         (TypeManager.MemberLookup): Added `int_num_type_arguments'
12641         argument; only return members with the correct number of type
12642         arguments.
12643         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
12644         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
12645         whether the number of type arguments matches.
12646
12647         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
12648         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
12649
12650         * expression.cs (MemberAccess): Added public `NumTypeArguments'
12651         field; it's set by the protected .ctor when we're actually a
12652         GenericMemberAccess.
12653         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
12654         arguments and pass it to MemberLookupFinal ().
12655
12656         * ecore.cs (Expression.MemberLookup): Added `int
12657         num_type_arguments' argument; only return members with the correct
12658         number of type arguments.
12659         (Expression.MemberLookupFailed): Check whether the MemberLookup
12660         failed because we did not have the correct number of type
12661         arguments; report CS0305 in this case.
12662
12663         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
12664         `e.ResolveAsTypeTerminal()' already did so.
12665
12666 2004-03-15  Martin Baulig  <martin@ximian.com>
12667
12668         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
12669         we're a ConstructedType; in this case, the caller must report an
12670         error (for instance CS0131).
12671
12672         * generic.cs (TypeArguments): Added Location argument to the .ctor.
12673         (TypeArguments.Resolve): Actually report errors here.
12674
12675 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12676
12677         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12678         `set_indexer_name' to the pending bits (one per type).
12679
12680         We fixed a bug today that was picking the wrong method to
12681         override, since for properties the existing InterfaceMethod code
12682         basically ignored the method name.  Now we make sure that the
12683         method name is one of the valid indexer names.
12684
12685 2004-03-15  Martin Baulig  <martin@ximian.com>
12686
12687         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
12688         for generic instances.
12689
12690 2004-03-13  Martin Baulig  <martin@ximian.com>
12691
12692         * class.cs (TypeContainer.DefineType): Call
12693         TypeManager.AddUserType() immediately after creating the
12694         TypeBuilder; pass all type parameters when creating the
12695         CurrentType.
12696
12697         * decl.cs (DeclSpace.FindNestedType): New public method.
12698         (DeclSpace.FindType): Added `int num_type_args' argument; only
12699         return types with the correct number of type parameters.
12700         (DeclSpace.CountTypeParams): New public property.
12701
12702         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
12703         the number of type parameters; defaults to zero.
12704
12705         * generic.cs (TypeArguments.Count): New public property.
12706         (ConstructedType.DoResolveAsTypeStep): First call
12707         ds.FindNestedType() to find out whether we're nested in the
12708         current generic type; in this case, we inherit all type parameters
12709         from the current class.
12710
12711         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
12712         num_type_args' argument.
12713         (RootContext.LookupType): Added overloaded version which takes the
12714         number of type arguments; only return types with the correct
12715         number of type arguments.
12716
12717         * typemanager.cs (TypeManager.CheckGeneric): New public function;
12718         checks whether `Type t' has `int num_type_args'.
12719
12720 2004-03-13  Martin Baulig  <martin@ximian.com>
12721
12722         * generic.cs (GenericMethod.DefineType): New method; calls
12723         DefineType() on all the type parameters.
12724
12725         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
12726         (MethodData.Define): If we're a generic method, call
12727         GenericMethod.DefineType() to define the type parameters.       
12728
12729 2004-03-10  Martin Baulig  <martin@ximian.com>
12730
12731         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
12732         instead of IsAssignableFrom.    
12733
12734 2004-03-10  Martin Baulig  <martin@ximian.com>
12735
12736         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
12737
12738         * support.cs (ParameterData.HasArrayParameter): New property.
12739         (ReflectionParameters.ctor): Take a MethodBase instead of a
12740         ParameterInfo[].  If we have any type parameters, get the generic
12741         method definition and ask it whether we have variable arguments.
12742
12743 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
12744
12745         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12746         routines to check if a type is an enumerable/enumerator allow
12747         classes that implement the IEnumerable or IEnumerator interfaces.
12748
12749         * class.cs (Property, Operator): Implement IIteratorContainer, and
12750         implement SetYields.
12751
12752         (Property.Define): Do the block swapping for get_methods in the
12753         context of iterators.   We need to check if Properties also
12754         include indexers or not.
12755
12756         (Operator): Assign the Block before invoking the
12757         OperatorMethod.Define, so we can trigger the Iterator code
12758         replacement. 
12759
12760         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
12761         Property and Operator classes are not created when we parse the
12762         declarator but until we have the block completed, so we use a
12763         singleton SimpleIteratorContainer.Simple to flag whether the
12764         SetYields has been invoked.
12765
12766         We propagate this setting then to the Property or the Operator to
12767         allow the `yield' to function.
12768
12769 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
12770
12771         * codegen.cs: Implemented attribute support for modules.
12772         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12773         Assembly/Module functionality.
12774
12775         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12776         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12777         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12778
12779 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
12780
12781         * interface.cs (FindMembers): The operation is performed on all base
12782         interfaces and not only on the first. It is required for future CLS Compliance patch.
12783
12784 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12785
12786         * statement.cs, codegen.cs:
12787         This patch deals with patterns such as:
12788
12789         public class List : IEnumerable {
12790
12791                 public MyEnumerator GetEnumerator () {
12792                         return new MyEnumerator(this);
12793                 }
12794
12795                 IEnumerator IEnumerable.GetEnumerator () {
12796                         ...
12797                 }
12798                 
12799                 public struct MyEnumerator : IEnumerator {
12800                         ...
12801                 }
12802         }
12803
12804         Before, there were a few things we did wrong:
12805         1) we would emit callvirt on a struct, which is illegal
12806         2) we emited ldarg when we needed to emit ldarga
12807         3) we would mistakenly call the interface methods on an enumerator
12808         type that derived from IEnumerator and was in another assembly. For example:
12809
12810         public class MyEnumerator : IEnumerator
12811
12812         Would have the interface methods called, even if there were public impls of the
12813         method. In a struct, this lead to invalid IL code.
12814
12815 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
12816
12817         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12818           renamed to Emit.
12819
12820         * delegate.cs (Define): Fixed crash when delegate type is undefined.
12821
12822 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
12823
12824         * cs-parser.jay: Fix small regression: we were not testing V2
12825         compiler features correctly.
12826
12827         * interface.cs: If the emit context is null, then create one
12828
12829 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
12830
12831         * decl.cs (GetSignatureForError): New virtual method to get full name
12832           for error messages.
12833
12834         * attribute.cs (IAttributeSupport): New interface for attribute setting.
12835           Now it is possible to rewrite ApplyAttributes method to be less if/else.
12836
12837         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12838           Duplicated members and code in these classes has been removed.
12839           Better encapsulation in these classes.
12840
12841 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
12842
12843         * assign.cs (Assign.DoResolve): When dealing with compound
12844         assignments, there is a new rule in ECMA C# 2.4 (might have been
12845         there before, but it is documented here) that states that in:
12846
12847         a op= b;
12848
12849         If b is of type int, and the `op' is a shift-operator, then the
12850         above is evaluated as:
12851
12852         a = (int) a op b 
12853
12854         * expression.cs (Binary.ResolveOperator): Instead of testing for
12855         int/uint/long/ulong, try to implicitly convert to any of those
12856         types and use that in pointer arithmetic.
12857
12858         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12859         method to print information for from the type, not from the
12860         null-method we were given.
12861
12862 2004-02-01  Duncan Mak  <duncan@ximian.com>
12863
12864         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12865         parsing for cmd, fixes bug #53694.
12866
12867 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
12868
12869         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12870         in the member name duplication tests. Property and operator name duplication
12871         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12872
12873 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
12874
12875         * interface.cs (PopulateMethod): Fixed crash when interface method
12876         returns not existing type (error test cs0246-3.cs).
12877
12878 2004-02-02  Ravi Pratap M <ravi@ximian.com>
12879
12880         * cs-parser.jay (interface_accessors): Re-write actions to also
12881         store attributes attached to get and set methods. Fix spelling
12882         while at it.
12883
12884         (inteface_property_declaration): Modify accordingly.
12885
12886         (InterfaceAccessorInfo): New helper class to store information to pass
12887         around between rules that use interface_accessors.
12888
12889         * interface.cs (Emit): Apply attributes on the get and set
12890         accessors of properties and indexers too.
12891
12892         * attribute.cs (ApplyAttributes): Modify accordingly to use the
12893         right MethodBuilder when applying attributes to the get and set accessors.
12894
12895 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
12896
12897         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12898
12899 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
12900
12901         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12902
12903 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
12904
12905         * cs-parser.jay: Remove YIELD token, instead use the new grammar
12906         changes that treat `yield' specially when present before `break'
12907         or `return' tokens.
12908
12909         * cs-tokenizer.cs: yield is no longer a keyword.
12910
12911 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
12912
12913         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
12914         setting for default constructors.
12915         For default constructors are almost every time set wrong Modifier. The
12916         generated IL code has been alright. But inside mcs this values was
12917         wrong and this was reason why several of my CLS Compliance tests
12918         failed.
12919
12920 2004-02-27  Martin Baulig  <martin@ximian.com>
12921
12922         * generics.cs (ConstructedType.ResolveType): Make the nested type
12923         stuff actually work.
12924
12925 2004-02-25  Martin Baulig  <martin@ximian.com>
12926
12927         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
12928         property; returns the type parameters just from the current type,
12929         ie. with the ones from outer classes.
12930         (DeclSpace.LookupGeneric): First search in the current class, then
12931         in outer classes.
12932         (DeclSpace.initialize_type_params): When hiding a type parameter
12933         from an outer class, put it into the `type_param_list' anyways.
12934
12935         * expression.cs (MemberAccess.expr): Made this field protected.
12936
12937         * class.cs (TypeContainer.Define): The `CurrentType' just contains
12938         the type parameters from the current class.
12939
12940         * generic.cs (ConstructedType.ResolveType): Support nested generic
12941         types by taking the type parameters which we inherit from outer
12942         classes into account.
12943         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
12944         support for nested generic types.
12945
12946 2004-02-23  Martin Baulig  <martin@ximian.com>
12947
12948         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
12949         field and check whether we're nested inside a generic type.
12950         (DeclSpace.ResolveType): If we're resolving to a generic type
12951         definition, create a ConstructedType and return its resolved type.
12952         (DeclSpace.initialize_type_params): New private method;
12953         initializes the `type_param_list' field from the type parameters
12954         from this and all enclosing classes.
12955         (DeclSpace.TypeParameters): Call initialize_type_params() unless
12956         we're already initialized.
12957
12958 2004-02-23  Martin Baulig  <martin@ximian.com>
12959
12960         * class.cs (Method.Define): Create the generic method before
12961         calling DoDefine().
12962         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
12963         the TypeContainer one); we use this for generic methods.
12964
12965         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
12966         parent's TypeBuilder.
12967
12968 2004-02-18  Martin Baulig  <martin@ximian.com>
12969
12970         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
12971         to check for equality.
12972
12973 2004-02-05  Martin Baulig  <martin@ximian.com>
12974
12975         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
12976         `ec.TypeContainer.CurrentType', use it instead of
12977         `ec.ContainerType' to check whether we're in the type's ctor.
12978
12979 2004-01-29  Martin Baulig  <martin@ximian.com>
12980
12981         * expression.cs (Invocation.DoResolve): If we're a
12982         `ConstructedType', then we're actually a generic method, so
12983         rewrite the expr as a GenericMemberAccess.
12984
12985         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
12986         here; manually parse it into a string.
12987
12988 2004-01-28  Martin Baulig  <martin@ximian.com>
12989
12990         * typemanager.cs (TypeManager.IsEqual): New static method.
12991         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
12992         check for equality instead of using `=='.
12993
12994 2004-01-26  Martin Baulig  <martin@ximian.com>
12995
12996         * decl.cs (DeclSpace.CurrentType): New public field.
12997
12998         * expression.cs (This.ResolveBase): If we have an
12999         `ec.TypeContainer.CurrentType', use it instead of
13000         `ec.ContainerType'.
13001
13002         * class.cs (TypeContainer.DefineType): If we're a generic type,
13003         create the `CurrentType' (unresolved).
13004         (TypeContainer.GenericType): New private field.
13005         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
13006         it and store it in `GenericType' before creating the MemberCache.
13007         (TypeContainer.GetMembers): If we have a `GenericType', call
13008         TypeManager.FindMembers() on it.
13009
13010         * interface.cs (Interface.GenericType): New private field.
13011         (Interface.DefineType): If we're a generic type, create the
13012         `CurrentType' (unresolved).
13013         (Interface.DefineMembers): If we have a `CurrentType', resolve it
13014         and store it in `GenericType' before creating the MemberCache.
13015         (Interface.GetMembers): If we have a `GenericType', call
13016         TypeManager.FindMembers() on it.
13017
13018 2004-01-22  Martin Baulig  <martin@ximian.com>
13019
13020         * cs-parser.jay (namespace_or_type_name): Return an Expression,
13021         not a QualifiedIdentifier.  This is what `type_name_expression'
13022         was previously doing.
13023         (type_name_expression): Removed; the code is now in
13024         `namespace_or_type_name'.
13025         (qualified_identifier): Removed, use `namespace_or_type_name'
13026         instead.
13027         (QualifiedIdentifier): Removed this class.      
13028
13029 2004-01-22  Martin Baulig  <martin@ximian.com>
13030
13031         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
13032         not a string as alias name.
13033
13034 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
13035
13036         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
13037         #52730 bug, and instead compute correctly the need to use a
13038         temporary variable when requesting an address based on the
13039         static/instace modified of the field and the constructor.
13040  
13041 2004-01-21  Martin Baulig  <martin@ximian.com>
13042
13043         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
13044         class and namespace before looking up aliases.  Fixes #52517.
13045
13046 2004-01-21  Martin Baulig  <martin@ximian.com>
13047
13048         * flowanalysis.cs (UsageVector.Merge): Allow variables being
13049         assinged in a 'try'; fixes exception4.cs.
13050
13051 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13052         * class.cs : Implemented parameter-less constructor for TypeContainer
13053
13054         * decl.cs: Attributes are now stored here. New property OptAttributes
13055
13056         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
13057
13058         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
13059
13060 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13061
13062         * typemanager.cs (CSharpSignature): Now reports also inner class name.
13063           (CSharpSignature): New method for indexer and property signature.
13064
13065 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13066
13067         * pending.cs (IsVirtualFilter): Faster implementation.
13068
13069 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13070
13071         * typemanager.cs: Avoid inclusion of same assembly more than once.
13072
13073 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13074
13075         * cs-parser.jay: Fixed problem where the last assembly attribute
13076           has been applied also to following declaration (class, struct, etc.)
13077           
13078 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13079
13080         * class.cs: Added error CS0538, CS0539 reporting.
13081         Fixed crash on Microsoft runtime when field type is void.
13082
13083         * cs-parser.jay: Added error CS0537 reporting.
13084
13085         * pending.cs: Added error CS0535 reporting.
13086         Improved error report for errors CS0536, CS0534.
13087
13088 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
13089
13090         Merge a few bits from the Anonymous Method MCS tree.
13091
13092         * statement.cs (ToplevelBlock): New class for toplevel methods,
13093         will hold anonymous methods, lifted variables.
13094
13095         * cs-parser.jay: Create toplevel blocks for delegates and for
13096         regular blocks of code. 
13097
13098 2004-01-20  Martin Baulig  <martin@ximian.com>
13099
13100         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
13101         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
13102         and `NeedExplicitReturn'; added `IsLastStatement'.
13103         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
13104         have a `ReturnLabel' or we're not unreachable.
13105
13106         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
13107         child's reachability; don't just override ours with it.  Fixes
13108         #58058 (lluis's example).
13109         (FlowBranching): Added public InTryOrCatch(), InCatch(),
13110         InFinally(), InLoop(), InSwitch() and
13111         BreakCrossesTryCatchBoundary() methods.
13112
13113         * statement.cs (Return): Do all error checking in Resolve().
13114         Unless we are the last statement in a top-level block, always
13115         create a return label and jump to it.
13116         (Break, Continue): Do all error checking in Resolve(); also make
13117         sure we aren't leaving a `finally'.
13118         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
13119         statement in a top-level block.
13120         (Block.Flags): Added `IsDestructor'.
13121         (Block.IsDestructor): New public property.
13122
13123 2004-01-20  Martin Baulig  <martin@ximian.com>
13124
13125         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
13126
13127 2004-01-20  Martin Baulig  <martin@ximian.com>
13128
13129         * statement.cs (Statement.ResolveUnreachable): New public method.
13130         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
13131         (Block.Resolve): Resolve unreachable statements.
13132
13133 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13134
13135         * expression.cs: We need to fix the case where we do
13136         not have a temp variable here.
13137
13138         * assign.cs: Only expression compound assignments need
13139         temporary variables.
13140
13141 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13142
13143         * flowanalysis.cs: Reduce memory allocation in a few ways:
13144           - A block with no variables should not allocate a bit
13145             vector for itself.
13146           - A method with no out parameters does not need any tracking
13147             for assignment of the parameters, so we need not allocate
13148             any data for it.
13149           - The arrays:
13150                 public readonly Type[] VariableTypes;
13151                 public readonly string[] VariableNames;
13152             Are redundant. The data is already stored in the variable
13153             map, so we need not allocate another array for it.
13154           - We need to add alot of checks for if (params | locals) == null
13155             due to the first two changes.
13156
13157 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
13158
13159         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
13160         implement IMemoryLocation, we store a copy on a local variable and
13161         take the address of it.  Patch from Benjamin Jemlich
13162
13163         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
13164         to use a special "type_name_expression" rule which reduces the
13165         number of "QualifiedIdentifier" classes created, and instead
13166         directly creates MemberAccess expressions.
13167
13168 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
13169
13170         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
13171         that fixes #52853.  Null literal assignment to ValueType
13172
13173         * class.cs (MethodData.Emit): Instead of checking the name of the
13174         method to determine if its a destructor, create a new derived
13175         class from Method called Destructor, and test for that.  
13176
13177         * cs-parser.jay: Create a Destructor object instead of a Method.  
13178
13179         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
13180
13181         Fixes: 52933
13182
13183 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
13184
13185         * expression.cs (Binary.ResolveOperator): Perform an implicit
13186         conversion from MethodGroups to their delegate types on the
13187         Addition operation.
13188
13189         * delegate.cs: Introduce a new class DelegateCreation that is the
13190         base class for `NewDelegate' and `ImplicitDelegateCreation',
13191         factor some code in here.
13192
13193         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
13194         conversion from MethodGroups to compatible delegate types. 
13195
13196         * ecore.cs (Expression.Resolve): Do not flag error 654
13197         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
13198         we allow conversions from MethodGroups to delegate types now.
13199
13200         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
13201         assignments in v2 either.
13202
13203 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
13204
13205         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
13206         static read-only fields in ctors.
13207
13208         Applied patch from Benjamin Jemlich 
13209
13210         * expression.cs (UnaryMutator): Avoid leaking local variables. 
13211
13212 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
13213
13214         * cs-tokenizer.cs (IsCastToken): Allow the various native types
13215         here to return true, as they can be used like this:
13216
13217                 (XXX) int.MEMBER ()
13218
13219         Fixed 49836 and all the other dups
13220
13221 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
13222
13223         * driver.cs: Implement /win32res and /win32icon.
13224
13225 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
13226
13227         * cs-parser.jay: Add a rule to improve error handling for the
13228         common mistake of placing modifiers after the type.
13229
13230 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
13231
13232         * cs-parser.jay (interface_event_declaration): Catch
13233         initialization of events on interfaces, and report cs0068
13234
13235         * cs-parser.jay (interface_event_declaration): Catch
13236         initialization of events. 
13237
13238         * ecore.cs: Better report missing constructors.
13239
13240         * expression.cs (Binary.ResolveOperator): My previous bug fix had
13241         the error reporting done in the wrong place.  Fix.
13242
13243         * expression.cs (Binary.ResolveOperator): Catch the 
13244         operator + (E x, E y) error earlier, and later allow for implicit
13245         conversions in operator +/- (E e, U x) from U to the underlying
13246         type of E.
13247
13248         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
13249         52596, if the container class is abstract, the default constructor
13250         is protected otherwise its public (before, we were always public).
13251
13252         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
13253         fixed statement.
13254
13255         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
13256         Jemlich that fixes bug #52597, MCS was generating invalid code for
13257         idisposable structs.   Thanks to Ben for following up with this
13258         bug as well.
13259
13260 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
13261
13262         * driver.cs: Allow assemblies without code to be generated, fixes
13263         52230.
13264
13265 2004-01-07  Nick Drochak <ndrochak@gol.com>
13266
13267         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
13268
13269 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
13270
13271         * cs-parser.jay: Add rules to improve error reporting if fields or
13272         methods are declared at the namespace level (error 116)
13273
13274         * Add rules to catch event add/remove
13275
13276 2004-01-04  David Sheldon <dave-mono@earth.li>
13277
13278   * expression.cs: Added matching ")" to error message for 
13279   CS0077
13280
13281 2004-01-03 Todd Berman <tberman@gentoo.org>
13282
13283         * ecore.cs, attribute.cs:
13284         Applying fix from #52429.
13285
13286 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13287
13288         * ecore.cs, expression.cs, statement.cs:
13289         Total rewrite of how we handle branching. We
13290         now handle complex boolean expressions with fewer
13291         jumps. As well if (x == 0) no longer emits a ceq.
13292
13293         if (x is Foo) is much faster now, because we generate
13294         better code.
13295
13296         Overall, we get a pretty big improvement on our benchmark
13297         tests. The code we generate is smaller and more readable.
13298
13299         I did a full two-stage bootstrap. The patch was reviewed
13300         by Martin and Miguel.
13301
13302 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13303
13304         * cs-parser.jay: Make primary_expression not take a QI.
13305         we dont need this because the member_access rule covers
13306         us here. So we replace the rule with just IDENTIFIER.
13307
13308         This has two good effects. First, we remove a s/r conflict.
13309         Second, we allocate many fewer QualifiedIdentifier objects.
13310
13311 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13312
13313         * attribute.cs: Handle MarshalAs attributes as pseudo, and
13314         set the correct information via SRE. This prevents
13315         hanging on the MS runtime. Fixes #29374.
13316
13317 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13318
13319         * convert.cs: correctly handle conversions to value types
13320         from Enum and ValueType as unboxing conversions.
13321
13322         Fixes bug #52569. Patch by Benjamin Jemlich.
13323
13324 2004-01-02  Ravi Pratap  <ravi@ximian.com>
13325
13326         * expression.cs (BetterConversion): Prefer int -> uint
13327         over int -> ulong (csc's behaviour). This fixed bug #52046.
13328
13329 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13330
13331         * decl.cs (MemberCache.FindMembers): now returns a
13332         MemberInfo [].
13333
13334         * typemanager.cs: In general, go with with ^^.
13335         (CopyNewMethods): take an IList.
13336         (RealMemberLookup): Only allocate an arraylist
13337         if we copy from two sets of methods.
13338
13339         This change basically does two things:
13340         1) Fewer array lists allocated due to CopyNewMethods.
13341         2) the explicit cast in MemberList costed ALOT.
13342
13343 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
13344
13345         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
13346         a hashtable to avoid needless string allocations when an identifier is
13347         used more than once (the common case).
13348
13349 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13350
13351         * pending.cs: MS's TypeBuilder.GetInterfaces ()
13352         is broken, it will not return anything. So, we
13353         have to use the information we have in mcs to
13354         do the task.
13355
13356         * typemanager.cs: Add a cache for GetInterfaces,
13357         since this will now be used more often (due to ^^)
13358
13359         (GetExplicitInterfaces) New method that gets the
13360         declared, not effective, interfaces on a type
13361         builder (eg, if you have interface IFoo, interface
13362         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
13363         { IBar }.
13364
13365         This patch makes MCS able to bootstrap itself on
13366         Windows again.
13367
13368 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13369
13370         * expression.cs: Remove the Nop's that Miguel put
13371         in by mistake.
13372
13373 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13374
13375         * report.cs, codegen.cs: Give the real stack trace to
13376         the error when an exception is thrown.
13377
13378 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13379
13380         * decl.cs: only allocate hashtables for ifaces if 
13381         it is an iface!
13382
13383 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13384
13385         * expression.cs: fix the error from cs0121-2.cs
13386         (a parent interface has two child interfaces that
13387         have a function with the same name and 0 params
13388         and the function is called through the parent).
13389
13390 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13391
13392         * class.cs, rootcontext.cs, typmanager.cs: do not
13393         leak pointers.
13394
13395 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
13396
13397         * codegen.cs: remove stack for the ec flow branching.
13398         It is already a linked list, so no need.
13399
13400 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
13401
13402         * Makefile: Allow custom profiler here.
13403
13404 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13405
13406         * typemanager.cs (LookupType):
13407           - Use a static char [], because split takes
13408             a param array for args, so it was allocating
13409             every time.
13410           - Do not store true in a hashtable, it boxes.
13411
13412 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13413
13414         * flowanalysis.cs: bytify common enums.
13415
13416 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13417
13418         * modifiers.cs: Add a new set of flags for the
13419         flags allowed on explicit interface impls.
13420         * cs-parser.jay: catch the use of modifiers in
13421         interfaces correctly.
13422         * class.cs: catch private void IFoo.Blah ().
13423
13424         All related to bug #50572.
13425
13426 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13427
13428         * decl.cs: Rewrite the consistant accessability checking.
13429         Accessability is not linear, it must be implemented in
13430         a tableish way. Fixes #49704.
13431
13432 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13433
13434         * expression.cs: Handle negation in a checked context.
13435         We must use subtraction from zero. Fixes #38674.
13436
13437 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13438
13439         * class.cs: Ignore static void main in DLLs.
13440         * rootcontext.cs: Handle the target type here,
13441         since we are have to access it from class.cs
13442         * driver.cs: account for the above.
13443
13444 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13445
13446         * report.cs: Give line numbers and files if available.
13447
13448 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
13449
13450         * driver.cs: Implement /addmodule.
13451
13452         * typemanager.cs:  Change 'modules' field so it now contains Modules not
13453         ModuleBuilders.
13454
13455 2003-12-20  Martin Baulig  <martin@ximian.com>
13456
13457         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13458         (FieldBase.IsAssigned): Removed this field.
13459         (FieldBase.SetAssigned): New public method.
13460         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13461
13462 2003-12-20  Martin Baulig  <martin@ximian.com>
13463
13464         * expression.cs (LocalVariableReference.DoResolve): Don't set
13465         `vi.Used' if we're called from DoResolveLValue().
13466
13467         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13468         returns the usage vector it just merged into the current one -
13469         pass this one to UsageWarning().
13470         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13471         of the `EmitContext', don't call this recursively on our children.
13472
13473 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
13474
13475         * driver.cs: Implement /target:module.
13476
13477 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
13478
13479         * support.cs (CharArrayHashtable): New helper class.
13480
13481         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
13482         char arrays, not strings, so we can avoid creating a string in
13483         consume_identifier if the identifier is a keyword.
13484
13485 2003-12-16  Martin Baulig  <martin@ximian.com>
13486
13487         * statement.cs (LocalInfo.Assigned): Removed this property.
13488         (LocalInfo.Flags): Removed `Assigned'.
13489         (LocalInfo.IsAssigned): New public method; takes the EmitContext
13490         and uses flow analysis.
13491         (Block.UsageWarning): Made this method private.
13492         (Block.Resolve): Call UsageWarning() if appropriate.
13493
13494         * expression.cs (LocalVariableReference.DoResolve): Always set
13495         LocalInfo.Used here.
13496
13497 2003-12-13  Martin Baulig  <martin@ximian.com>
13498
13499         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13500         any value here; we're now using flow analysis to figure out
13501         whether a statement/block returns a value.
13502
13503 2003-12-13  Martin Baulig  <martin@ximian.com>
13504
13505         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13506         working again.
13507         (FlowBranching.MergeFinally): Don't call
13508         `branching.CheckOutParameters()' here, this is called in
13509         MergeTopBlock().
13510         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13511         when adding the `finally' vector.       
13512
13513 2003-12-13  Martin Baulig  <martin@ximian.com>
13514
13515         * flowanalysis.cs
13516         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13517         actually work and also fix #48962.
13518
13519 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
13520
13521         * decl.cs: Do not check System.Object for nested types,
13522         since we know it does not have any. Big bang for buck:
13523
13524         BEFORE:
13525            Run 1:   8.35 seconds
13526            Run 2:   8.32 seconds
13527            corlib:  17.99 seconds
13528         AFTER:
13529            Run 1:   8.17 seconds
13530            Run 2:   8.17 seconds
13531            corlib:  17.39 seconds
13532
13533 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
13534
13535         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13536         time we are returning 0 members, so we save alot here.
13537
13538 2003-12-11  Martin Baulig  <martin@ximian.com>
13539
13540         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13541         `MergeChild()', also just take the `FlowBranching' as argument;
13542         call Merge() on it and return the result.
13543         (FlowBranching.Merge): We don't need to do anything if we just
13544         have one sibling.
13545
13546 2003-12-11  Martin Baulig  <martin@ximian.com>
13547
13548         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13549         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
13550         Maurer for this idea.
13551
13552 2003-12-11  Martin Baulig  <martin@ximian.com>
13553
13554         * flowanalysis.cs (MergeResult): This class is now gone; we now
13555         use the `UsageVector' for this.  The reason for this is that if a
13556         branching just has one sibling, we don't need to "merge" them at
13557         all - that's the next step to do.
13558         (FlowBranching.Merge): We now return a `UsageVector' instead of a
13559         `MergeResult'.
13560
13561 2003-12-11  Martin Baulig  <martin@ximian.com>
13562
13563         Reworked flow analyis and made it more precise and bug-free.  The
13564         most important change is that we're now using a special `Reachability'
13565         class instead of having "magic" meanings of `FlowReturns'.  I'll
13566         do some more cleanups and optimizations and also add some more
13567         documentation this week.
13568
13569         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13570         largely reworked this class.
13571         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13572         the new `Reachability' class instead of having "magic" values here.
13573         (FlowBranching): We're now using an instance of `Reachability'
13574         instead of having separate `Returns', `Breaks' etc. fields.
13575
13576         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13577         based on flow analysis; ignore the return value of block.Emit ().
13578
13579 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
13580
13581         * driver.cs typemanager.cs: Find the mono extensions to corlib even
13582         if they are private.
13583
13584 2003-12-09  Martin Baulig  <martin@ximian.com>
13585
13586         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13587         call them directly on the UsageVector.
13588
13589 2003-12-09  Martin Baulig  <martin@ximian.com>
13590
13591         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13592         Changed return type from `FlowReturns' to `Reachability'.
13593
13594 2003-12-09  Martin Baulig  <martin@ximian.com>
13595
13596         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13597         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13598         `Reachable' fields with a single `Reachability' one.
13599
13600 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13601
13602         * class.cs (FindMembers): Remove foreach's.
13603
13604         Bootstrap times:
13605
13606         BEFORE
13607                 Run 1:   8.74 seconds
13608                 Run 2:   8.71 seconds
13609
13610         AFTER
13611                 Run 1:   8.64 seconds
13612                 Run 2:   8.58 seconds
13613
13614
13615 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13616
13617         * cs-parser.jay:
13618         * gen-treedump.cs:
13619         * statement.cs:
13620         This patch does a few things:
13621                 1. EmptyStatement is now a singleton, so it is never reallocated.
13622                 2. All blah is EmptyStatement constructs have been changed to
13623                    blah == EmptyStatement.Value, which is much faster and valid
13624                    now that EmptyStatement is a singleton.
13625                 3. When resolving a block, rather than allocating a new array for
13626                    the non-empty statements, empty statements are replaced with
13627                    EmptyStatement.Value
13628                 4. Some recursive functions have been made non-recursive.
13629         Mainly the performance impact is from (3), however (1) and (2) are needed for
13630         this to work. (4) does not make a big difference in normal situations, however
13631         it makes the profile look saner.
13632
13633         Bootstrap times:
13634
13635         BEFORE
13636         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13637         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13638         Total memory allocated: 56397 KB
13639
13640         AFTER
13641         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13642         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13643         Total memory allocated: 55666 KB
13644
13645 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13646
13647         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13648         than the hashtable in a hashtable version
13649
13650         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13651         we always end up concating a string. This results in a huge perf
13652         loss, because many strings have to be tracked by the GC. In this
13653         patch, we first use a hashtable that works with two keys, so that
13654         the strings do not need to be concat'ed.
13655
13656         Bootstrap times:
13657         BEFORE
13658                 Run 1:   8.74 seconds
13659                 Run 2:   8.71 seconds
13660
13661         AFTER
13662                 Run 1:   8.65 seconds
13663                 Run 2:   8.56 seconds
13664
13665 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13666
13667         * Makefile: Add a new target `do-time' that does a quick and simple
13668         profile, leaving easy to parse output.
13669
13670 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
13671
13672         * codegen.cs (Init): Create the dynamic assembly with 
13673         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13674
13675 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13676
13677         * support.cs: Make the PtrHashtable use only one
13678         instance of its comparer.
13679
13680 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
13681
13682         * typemanager.cs: Fix lookup of GetNamespaces.
13683
13684 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
13685
13686         * expression.cs: Removed redundant line.
13687
13688         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13689         ArrayLists, use for loops with bounds.  
13690
13691         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13692         arraylist.
13693
13694         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13695         arraylists, use for loop with bounds.
13696
13697         The above three changes give us a 0.071 second performance
13698         improvement out of 3.294 seconds down to 3.223.  On my machine
13699         the above changes reduced the memory usage by 1,387 KB during
13700         compiler bootstrap.
13701
13702         * cs-parser.jay (QualifiedIdentifier): New class used to represent
13703         QualifiedIdentifiers.  Before we created a new string through
13704         concatenation, and mostly later on, the result would be
13705         manipulated by DecomposeQI through string manipulation.
13706
13707         This reduced the compiler memory usage for bootstrapping from
13708         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13709         compile times in 0.05 seconds.
13710
13711 2003-11-28  Dick Porter  <dick@ximian.com>
13712
13713         * support.cs: Do string compares with the Invariant culture.
13714
13715         * rootcontext.cs: 
13716         * gen-treedump.cs: 
13717         * expression.cs: 
13718         * driver.cs: 
13719         * decl.cs: 
13720         * codegen.cs: 
13721         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13722         the comparison is done with the Invariant culture.
13723
13724 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
13725
13726         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13727         GetEnumerator method.
13728
13729         (ProbeCollectionType): Iterate starting at the most specific type
13730         upwards looking for a GetEnumerator
13731
13732         * expression.cs: Shift count can be up to 31 for int/uint and 63
13733         for long/ulong.
13734
13735 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
13736
13737         * statement.cs (Block.LookupLabel): Also look for the label on the
13738         children blocks.  Use a hash table to keep track of visited
13739         nodes. 
13740
13741         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13742         we actually did transform the other operand, otherwise fall back
13743         to the common codepath that casts to long.
13744
13745         * cs-tokenizer.cs: Use the same code pattern as the int case.
13746         Maybe I should do the parsing myself, and avoid depending on the
13747         Parse routines to get this done.
13748
13749 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
13750
13751         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13752         which fixes bug 51347.  This time test it.
13753
13754         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13755         attributes for example can not tell the difference between these.
13756         The difference was only a syntax feature of the language. 
13757
13758         * attribute.cs: Apply attributes to delegates.
13759
13760         * delegate.cs: Call the apply attributes method.
13761
13762 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
13763
13764         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13765         comparing 0 vs Byte.MinValue, not the value
13766
13767         (ImplicitConversionRequired): When reporting a conversion error,
13768         use error 31 to print out the constant error instead of the
13769         simpler 29.
13770
13771         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13772         which fixes bug 51347.
13773
13774 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
13775
13776         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
13777         which fixes the -warnaserror command line option.
13778
13779 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
13780
13781         * cfold.cs (DoNumericPromotions): During constant folding of
13782         additions on UIntConstant, special case intconstants with
13783         IntConstants like we do on the expression binary operator. 
13784
13785 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
13786
13787         * convert.cs (ImplicitReferenceConversion): We were missing a case
13788         (System.Enum are not value types or class types, so we need to
13789         classify them separatedly).
13790
13791         * driver.cs: We do not support error 2007.
13792
13793 2003-11-12 Jackson Harper <jackson@ximian.com>
13794
13795         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13796         system directory. Also use the full file name so users can
13797         libraries names mscorlib-o-tron.dll in a non system dir.
13798         
13799 2004-01-04  David Sheldon <dave-mono@earth.li>
13800
13801         * expression.cs: Added matching ")" to error message for CS0077.
13802
13803 2003-12-19  Martin Baulig  <martin@ximian.com>
13804
13805         * typemanager.cs (TypeManager.IsEqualGenericType): New public
13806         static method; see documentation in the method.
13807         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
13808
13809         * convert.cs (Convert.ImplicitReferenceConversion,
13810         Convert.ImplicitReferenceConversionExists): Add support for
13811         generic type declarations; see gen-36.cs.
13812
13813 2003-12-19  Martin Baulig  <martin@ximian.com>
13814
13815         * pending.cs (Pending.InterfaceMethod): Use
13816         `Type.IsAssignableFrom()' instead of `=='.
13817
13818 2003-12-18  Martin Baulig  <martin@ximian.com>
13819
13820         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
13821         byref types first.
13822
13823         * convert.cs (Convert.ImplicitStandardConversionExists): Use
13824         `expr_type.Equals (target_type)' instead of `=='.
13825
13826 2003-12-08  Martin Baulig  <martin@ximian.com>
13827
13828         * generics.cs (Constraints.Types): Removed.
13829         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
13830         to Type's.
13831         (Constraints.ResolveTypes): New public method; resolves the
13832         TypeExpr's to Type's.
13833         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
13834         longer takes the constraints.
13835         (TypeParameter.DefineMethod): Likewise.
13836         (TypeParameter.DefineType): New public method.  Calls
13837         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
13838         the constraints.
13839
13840 2003-12-08  Martin Baulig  <martin@ximian.com>
13841
13842         * convert.cs (Convert.ImplicitConversionStandard): Use
13843         `expr_type.Equals (target_type)' instead of `=='.
13844
13845 2003-12-08  Martin Baulig  <martin@ximian.com>
13846
13847         * typemanager.cs (TypeManager.GetReferenceType): Call
13848         `Type.MakeByRefType ()'.
13849
13850 2003-12-08  Martin Baulig  <martin@ximian.com>
13851
13852         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
13853         just has some special meaning in some situations.  For instance,
13854         it is allowed to use `where' as the name of a variable etc.
13855
13856 2003-12-04  Martin Baulig  <martin@ximian.com>
13857
13858         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13859         `Type.MakeArrayType()' for array types.
13860
13861 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
13862
13863         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
13864         debugging message.
13865
13866         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
13867         corlib to compile.
13868
13869 2003-11-16  Martin Baulig  <martin@ximian.com>
13870
13871         * codegen.cs (EmitContext.IsGeneric): Removed.
13872
13873         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
13874         ResolveGeneric() on the DeclSpace.
13875
13876 2003-11-16  Martin Baulig  <martin@ximian.com>
13877
13878         * generic.cs (TypeArguments.Resolve):
13879         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
13880         `ResolveType()' on it to get the Type.
13881
13882 2003-11-15  Martin Baulig  <martin@ximian.com>
13883
13884         * generic.cs (ConstructedType.GetInterfaces): Override this.
13885
13886 2003-11-14  Martin Baulig  <martin@ximian.com>
13887
13888         * interface.cs (Interface.DefineType): Define all type parameters
13889         before adding the interfaces we inherit.
13890
13891 2003-11-11  Martin Baulig  <martin@ximian.com>
13892
13893         * generic.cs (ConstructedType.ResolveType): Always call
13894         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
13895
13896 2003-11-10  Martin Baulig  <martin@ximian.com>
13897
13898         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13899         (TypeManager.InitCoreTypes): Initialize them here, but instead of
13900         calling `ResolveType()' on them, directly assign their `Type'.
13901
13902 2003-11-08  Martin Baulig  <martin@ximian.com>
13903
13904         * generic.cs (ConstructedType): Override `IsClass' etc.
13905
13906 2003-11-08  Martin Baulig  <martin@ximian.com>
13907
13908         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13909         return value and the `out parent' parameter.
13910         (TypeContainer.DefineType): Moved the CS0644 check into
13911         GetClassBases().  Don't pass the interface types to the
13912         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13913         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13914
13915         * ecore.cs (TypeExpr.IsAttribute): New property.
13916         (TypeExpr.GetInterfaces): New method.
13917
13918         * interface.cs (Interface.GetInterfaceTypeByName): Return a
13919         TypeExpr instead of a Type.
13920         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13921         (Interface.DefineType): Don't pass the interface types to the
13922         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13923         them later and then call `TypeBulider.AddInterfaceImplementation()'.
13924
13925         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13926         instead of a `Type[]'.
13927         (TypeManager.RegisterBuilder): Likewise.
13928         (TypeManager.AddUserInterface): Likewise.
13929         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13930         `Type[]' and also return a `TypeExpr[]'.
13931         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13932
13933 2003-11-08  Martin Baulig  <martin@ximian.com>
13934
13935         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13936         Expression.     
13937
13938 2003-11-08  Martin Baulig  <martin@ximian.com>
13939
13940         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
13941         TypeManager.ResolveExpressionTypes().
13942
13943         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
13944         instead of an Expression.
13945         (TypeExpr): This is now an abstract base class for `TypeExpression'.
13946         (TypeExpression): New public class; formerly known as `TypeExpr'.
13947
13948         * expression.cs (ComposedCast): Derive from TypeExpr.
13949
13950         * typemanager.cs (TypeManager.system_*_expr): These are now
13951         TypExpr's instead of Expression's.
13952         (TypeManager.ResolveExpressionTypes): New public static function;
13953         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
13954         of them.        
13955
13956 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
13957
13958         * expression.cs (New.DoResolve): Do not dereference value that
13959         might be a null return.
13960
13961         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
13962         sure that the constant value has the right type.  Fixes an
13963         unreported bug, similar to 50425.
13964
13965         * const.cs (Const.LookupConstantValue): Call
13966         ImplicitStandardConversionExists before doing a conversion to
13967         avoid havng the TypeManager.ChangeType do conversions.
13968
13969         Reduced the number of casts used
13970
13971         (Const.ChangeType): New routine to enable reuse of the constant
13972         type changing code from statement.
13973
13974         * typemanager.cs (ChangeType): Move common initialization to
13975         static global variables.
13976
13977         Fixes #50425.
13978
13979         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
13980         every value type to go through, even if it was void.  Fix that. 
13981
13982         * cs-tokenizer.cs: Use is_identifier_start_character on the start
13983         character of the define, and the is_identifier_part_character for
13984         the rest of the string.
13985
13986 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
13987
13988         * expression.cs (UnaryMutator.EmitCode): When I updated
13989         LocalVariableReference.DoResolve, I overdid it, and dropped an
13990         optimization done on local variable references.
13991
13992 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
13993
13994         * ecore.cs: Convert the return from Ldlen into an int.
13995
13996 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
13997
13998         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
13999         the accessibility, this is a special case for toplevel non-public
14000         classes (internal for instance).
14001
14002 2003-10-20  Nick Drochak <ndrochak@gol.com>
14003
14004         * ecore.cs: Fix typo and build.  Needed another right paren.
14005
14006 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
14007
14008         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
14009         `internal' case regular and protected, but not allowing protected
14010         to be evaluated later.  Bug 49840
14011
14012 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
14013
14014         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
14015         to kb.Nlast, and not the kb.nFirst to isolate the switch
14016         statement.
14017
14018         Extract the underlying type, so enumerations of long/ulong are
14019         treated like long/ulong.
14020
14021 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
14022
14023         * expression.cs (New): Overload the meaning of RequestedType to
14024         track the possible creation of the NewDelegate type, since
14025         DoResolve is invoked more than once for new constructors on field
14026         initialization.
14027
14028         See bugs: #48800 and #37014
14029
14030         * cs-parser.jay (declare_local_constants): Take an arraylist
14031         instead of a single constant.
14032
14033         (local_constant_declaration): It should take a
14034         constant_declarators, not a constant_declarator.  Fixes 49487
14035
14036         * convert.cs: Fix error report.
14037
14038 2003-10-13 Jackson Harper <jackson@ximian.com>
14039
14040         * typemanager.cs (TypeToCoreType): Add float and double this fixes
14041         bug #49611
14042         
14043 2003-11-03  Martin Baulig  <martin@ximian.com>
14044
14045         * expression.cs (ArrayAccess.GetStoreOpcode): Added
14046         `out bool has_type_arg'; if set, we need to pass the type to
14047         ig.Emit().
14048         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
14049         Stelem_Any/Ldelem_Any for generic parameters.   
14050
14051 2003-11-02  Martin Baulig  <martin@ximian.com>
14052
14053         * expression.cs (Invocation.EmitCall): Use
14054         `TypeManager.IsValueType()' to check whether it's a value type.
14055         Don't set `struct_call' when calling a method on a type parameter.
14056
14057 2003-11-02  Martin Baulig  <martin@ximian.com>
14058
14059         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
14060         and removed the TypeBuilder argument.
14061
14062         * typemanager.cs (TypeManager.IsValueType): Return
14063         `t.IsGenericParameter || t.IsValueType'.
14064
14065 2003-10-25  Martin Baulig  <martin@ximian.com>
14066
14067         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
14068         call ConstructedType.Resolve() on it.
14069
14070         * generic.cs (ConstructedType.Resolve): Set `type' on success.
14071
14072 2003-10-25  Martin Baulig  <martin@ximian.com>
14073
14074         * class.cs (TypeContainer.GetClassBases): Changed
14075         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
14076         CS8214 reporting here.
14077         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
14078         instead of a `Type' for our parent.  In case of a recursive
14079         declaration (see tests/gen-23.cs for an example), our parent is a
14080         ConstructedType and it doesn't have its type set.  So, first
14081         create our own TypeBuilder, then call constructed.Resolve() to get
14082         the parent's type and finally TypeBuilder.SetParent() it.
14083
14084         * ecore.cs (TypeExpr.Name): New public virtual property.
14085
14086         * generic.cs
14087         (ConstructedType): We're now a TypeExpr and not just an Expression.
14088         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
14089         arguments here; this is done later.
14090         (ConstructedType.Resolve): New public method to resolve the type
14091         arguments and bind them.
14092
14093 2003-10-21  Martin Baulig  <martin@ximian.com>
14094
14095         * convert.cs: Use `TypeManager.IsValueType' instead of
14096         'type.IsValueType' everywhere.
14097
14098         * typemanager.cs (TypeManager.IsValueType): Return true for type
14099         parameters.  The reason for this is that we need to box a type
14100         parameter when converting it to a reference type.
14101
14102         * cs-parser.jay: Added support for default value expressions.
14103
14104         * generics.cs (DefaultValueExpression): New public class.       
14105
14106 2003-10-17  Martin Baulig  <martin@ximian.com>
14107
14108         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
14109         TypeContainer so we can also use this for Interfaces.
14110         (TypeParameter.Resolve): Likewise.
14111
14112         * interface.cs (Interface.DefineType): Added support for generic
14113         interfaces.
14114
14115         * cs-parser.jay: Added support for generic structs and interfaces.
14116
14117 2003-10-17  Martin Baulig  <martin@ximian.com>
14118
14119         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
14120         call generic methods :-)
14121
14122 2003-10-16  Martin Baulig  <martin@ximian.com>
14123
14124         * cs-parser.jay (namespace_or_type_name): Only create a
14125         GenericMemberAccess if we actually have type arguments.
14126
14127 2003-10-13  Martin Baulig  <martin@ximian.com>
14128
14129         * class.cs (Method.Define): If we're a generic method, call
14130         TypeBuilder.DefineGenericMethod () before resolving
14131         the parameters.
14132         (MethodData): Added .ctor which takes an additional MethodBuilder
14133         argument; this is used for generic methods.
14134         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
14135         we already have a MethodBuilder.
14136
14137 2003-10-10  Martin Baulig  <martin@ximian.com>
14138
14139         * class.cs (Method): Added .ctor which takes a `GenericMethod'
14140         instead of a `DeclSpace'.  This is used for generic methods.
14141
14142         * cs-parser.jay (method_header): Added support for generic
14143         methods; create a `GenericMethod' instance and pass it to the
14144         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
14145         parameters and locals.
14146
14147         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
14148         since we already have the location.  Check whether we're a generic
14149         type declaration or a generic method and create the correct type
14150         parameter.
14151
14152         * generic.cs (TypeParameter.DefineMethod): New public method.
14153         (GenericMethod): New public class; derives from DeclSpace and is
14154         used for generic methods.       
14155
14156 2003-10-09  Martin Baulig  <martin@ximian.com>
14157
14158         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
14159         to the .ctor.
14160         (MethodCore.DoDefineParameters): Removed the TypeContainer
14161         argument; use the DeclSpace which was passed to the .ctor instead.
14162         (MethodCore.CheckParameter): Take a DeclSpace instead of a
14163         TypeContainer; we only need a DeclSpace here.
14164
14165 2003-10-09  Martin Baulig  <martin@ximian.com>
14166
14167         * class.cs (MethodData): Added additional `DeclSpace ds' argument
14168         to the .ctor.
14169         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
14170         EmitContext's .ctor.    
14171
14172 2003-10-09  Martin Baulig  <martin@ximian.com>
14173
14174         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
14175         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
14176         AsAccessible(), moved them as well.
14177
14178         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
14179
14180 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
14181
14182         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
14183         generation for >=, as spotted by Paolo, bug 48679.  
14184         Patch from David Waite.
14185
14186         * cs-tokenizer.cs: Add handling for #pragma.
14187
14188         * cs-parser.jay: Allow for both yield and yield return in the
14189         syntax.  The anti-cobolization of C# fight will go on!
14190
14191         * class.cs (TypeBuilder.DefineType): Catch error condition here
14192         (Parent.DefineType erroring out and returning null).
14193
14194         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14195         coping with enumerations variables, we were mistakenly processing
14196         them as a regular value type instead of built-in types.  Fixes the
14197         bug #48063
14198
14199         * typemanager.cs (IsBuiltinOrEnum): New method.
14200
14201 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
14202
14203         * cs-parser.jay: Upgrade: yield now needs the return clause.
14204
14205 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
14206
14207         * cs-parser.jay : Renamed yyName to yyNames related to jay.
14208
14209 2003-09-29  Martin Baulig  <martin@ximian.com>
14210
14211         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
14212         inflated generic methods.
14213
14214         * generics.cs (ConstructedType): Distinguish between open and
14215         closed constructed types; correctly resolve the arguments.
14216
14217 2003-09-22  Martin Baulig  <martin@ximian.com>
14218
14219         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
14220         all type arguments meet their constraints.
14221
14222 2003-09-19  Martin Baulig  <martin@ximian.com>
14223
14224         * decl.cs (MemberCache.SetupCacheForInterface): Take a
14225         `MemberCache parent' argument.  Normally, an interface doesn't
14226         have a parent type except System.Object, but we use this in gmcs
14227         for generic type parameters.
14228
14229 2003-09-18  Martin Baulig  <martin@ximian.com>
14230
14231         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
14232         on `type.IsInterface'; don't check whether the type has a parent
14233         to determine whether it's an interface.
14234
14235 2003-09-17  Martin Baulig  <martin@ximian.com>
14236
14237         * generic.cs (ConstructedType.ToString): Always use `name' as the
14238         type name.
14239
14240 2003-09-15  Martin Baulig  <martin@ximian.com>
14241
14242         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
14243
14244         * generic.cs (Constraints.Resolve): New public method; this is
14245         called to resolve the constraint types and to check whether all
14246         the constraints are correct.
14247         (Constraints.Types): New public property.
14248         (TypeParameter.Resolve): New public method; resolves all the
14249         type's constraints.
14250
14251         * class.cs (TypeContainer.DefineType): Call
14252         TypeParameter.Resolve() before actually defining the type.
14253
14254 2003-09-15  Martin Baulig  <martin@ximian.com>
14255
14256         * class.cs (TypeContainer.DefineType): Added an error flag to
14257         avoid reporting duplicate CS0146's ("class definition is
14258         circular.").
14259
14260         * driver.cs (Driver.MainDriver): Abort if
14261         RootContext.ResolveTree() reported any errors.
14262
14263 2003-09-07  Martin Baulig  <martin@ximian.com>
14264
14265         * report.cs (Error, Warning): Added overloaded versions which take
14266         a `params object[] args' and call String.Format().
14267
14268 2003-09-07  Martin Baulig  <martin@ximian.com>
14269
14270         * decl.cs (DeclSpace..ctor): Don't call
14271         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
14272         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
14273         (DeclSpace.RecordDecl): New method.
14274
14275         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
14276
14277 2003-09-02  Ravi Pratap  <ravi@ximian.com>
14278
14279         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
14280         value attributes to be applied to ParameterBuilders.
14281
14282         * class.cs (MethodCore.LabelParameters): Make static and more
14283         generic so that it can be used from other places - like interface
14284         methods, for instance.
14285
14286         * interface.cs (Interface.Emit): Call LabelParameters before
14287         emitting attributes on the InterfaceMethod.
14288
14289 2003-09-07  Martin Baulig  <martin@ximian.com>
14290
14291         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
14292         if the number of type parameters doesn't match.
14293
14294 2003-09-04  Martin Baulig  <martin@ximian.com>
14295
14296         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
14297         for arrays of generic type params (ie. `!0[]').
14298
14299 2003-09-04  Martin Baulig  <martin@ximian.com>
14300
14301         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
14302         for the moment.
14303
14304 2003-09-04  Martin Baulig  <martin@ximian.com>
14305
14306         * decl.cs (DeclSpace.LookupGeneric): New method.
14307         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
14308         moment.
14309
14310         * generic.cs (TypeParameterExpr): Take a TypeParameter as
14311         argument, not just a string.
14312         (TypeParameter.Define): New public method; this is called to
14313         actually define the generic parameter; after this, you can use the
14314         new `Type' property to get the type.
14315
14316 2003-09-04  Martin Baulig  <martin@ximian.com>
14317
14318         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
14319         is now an ArrayList; initialize the result of the `TypeParameters'
14320         property here.
14321         (DeclSpace.GetGenericData): Removed.
14322         (DeclSpace.LookupGeneric): Temporarily removed; we need to
14323         implement this in a different way.
14324         (DeclSpace.GetTypeParameters): Removed; there's now a
14325         `TypeParameters' property.
14326         (DeclSpace.TypeParameters): New public property.
14327
14328         * generic.cs (Constraints): Make this class public.
14329         (TypeParameter): New public class.
14330
14331 2003-09-04  Martin Baulig  <martin@ximian.com>
14332
14333         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
14334         generic parameters.
14335
14336         * class.cs (TypeContainer.DefineType): Call
14337         TypeBuilder.DefineGenericParameter () on all generic parameters if
14338         this is a generic type.
14339
14340 2003-08-28  Martin Baulig  <martin@ximian.com>
14341
14342         * sample-stack.il: Compile this with ilasm: "ilasm /dll
14343         sample-stack.il".
14344
14345         * sample-hello.cs: Compile this with gmcs: "gmcs
14346         /r:sample-stack.dll sample-hello.cs".
14347
14348 2003-08-28  Martin Baulig  <martin@ximian.com>
14349
14350         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
14351         the parameters to the generic type.
14352
14353 2003-08-28  Martin Baulig  <martin@ximian.com>
14354
14355         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
14356
14357 2003-08-28  Martin Baulig  <martin@ximian.com>
14358
14359         * cs-parser.jay (opt_type_argument_list): Use
14360         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
14361         (primary_expression): Replace `qualified_identifier' with `type_name'.
14362         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
14363
14364         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
14365         parser to check whether it is syntactically a type parameter list;
14366         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
14367         this case.
14368
14369 2003-08-26  Martin Baulig  <martin@ximian.com>
14370
14371         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
14372         resolving aliases; fixes #47927.
14373
14374 2003-08-26  Martin Baulig  <martin@ximian.com>
14375
14376         * statement.cs (Using.DoResolve): This is internally emitting a
14377         try/finally clause, so we need to set ec.NeedExplicitReturn if we
14378         do not always return.  Fixes #47681.
14379
14380 2003-08-26  Martin Baulig  <martin@ximian.com>
14381
14382         * decl.cs (MemberCore): Moved WarningNotHiding(),
14383         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
14384         into MemberBase.
14385         (AdditionResult): Make this nested in DeclSpace.
14386         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
14387         argument; call NamespaceEntry.Define() unless we're nested in a
14388         class or struct.
14389
14390         * namespace.cs (Namespace.DefineName): New public function.  This
14391         is called from DeclSpace's .ctor to add 
14392         (Namespace.Lookup): Include DeclSpaces in the lookup.
14393
14394         * class.cs (Operator): Derive from MemberBase, not MemberCore.
14395
14396         * const.cs (Const): Derive from MemberBase, not MemberCore.     
14397
14398 2003-08-25  Martin Baulig  <martin@ximian.com>
14399
14400         * convert.cs (Convert.ExplicitReferenceConversion): When
14401         converting from an interface type to a class, unbox if the target
14402         type is a struct type.  Fixes #47822.
14403
14404 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14405
14406         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
14407         #47854.
14408
14409 2003-08-22  Martin Baulig  <martin@ximian.com>
14410
14411         * class.cs (TypeManager.DefineType): When defining a nested type,
14412         call DefineType() on our parent; fixes #47801.
14413
14414 2003-08-22  Martin Baulig  <martin@ximian.com>
14415
14416         * class.cs (MethodData.Define): While checking if a method is an
14417         interface implementation, improve the test a bit more to fix #47654.
14418
14419 2003-08-22  Martin Baulig  <martin@ximian.com>
14420
14421         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
14422         correctly; fixes #47722.
14423
14424 2003-08-22  Martin Baulig  <martin@ximian.com>
14425
14426         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
14427         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
14428
14429         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
14430
14431 2003-08-22  Martin Baulig  <martin@ximian.com>
14432
14433         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
14434         can only be assigned in static constructors.  Fixes #47161.
14435
14436 2003-08-22  Martin Baulig  <martin@ximian.com>
14437
14438         Rewrote and improved the flow analysis code.
14439
14440         * flowbranching.cs (FlowBranching): Make this class abstract.
14441         (FlowBranching.CreateBranching): New static function to create a
14442         new flow branching.
14443         (FlowBranchingBlock, FlowBranchingException): New classes.
14444         (FlowBranching.UsageVector.Type): New public readonly field.
14445         (FlowBranching.UsageVector.Breaks): Removed the setter.
14446         (FlowBranching.UsageVector.Returns): Removed the setter.
14447         (FlowBranching.UsageVector): Added Break(), Return(),
14448         NeverReachable() and Throw() methods to modify the reachability.
14449         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
14450         done by FlowBranching.Merge().
14451         (FlowBranching.UsageVector.MergeChild): New method; merges the
14452         merge result into the current vector.
14453         (FlowBranching.Merge): New abstract method to merge a branching.
14454
14455 2003-08-12  Martin Baulig  <martin@ximian.com>
14456
14457         * expression.cs (Indirection.CacheTemporaries): Create the
14458         LocalTemporary with the pointer type, not its element type.
14459
14460 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
14461
14462         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
14463         token was a keyword or not.
14464
14465         Add `error' options where an IDENTIFIER was expected;  Provide
14466         CheckToken and CheckIdentifierToken convenience error reporting
14467         functions. 
14468
14469         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
14470
14471         * decl.cs: Rename `NamespaceEntry Namespace' public field into
14472         NameSpaceEntry NameSpaceEntry.
14473
14474         (LookupInterfaceOrClass): Avoid creating a full qualified name
14475         from namespace and name: avoid doing lookups when we know the
14476         namespace is non-existant.   Use new Tree.LookupByNamespace which
14477         looks up DeclSpaces based on their namespace, name pair.
14478
14479         * driver.cs: Provide a new `parser verbose' to display the
14480         exception thrown during parsing.  This is turned off by default
14481         now, so the output of a failure from mcs is more graceful.
14482
14483         * namespace.cs: Track all the namespaces defined in a hashtable
14484         for quick lookup.
14485
14486         (IsNamespace): New method
14487
14488 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
14489
14490         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
14491         we know that we need to concatenate (full typename can never be
14492         null). 
14493
14494         * class.cs: ditto.
14495
14496         * statement.cs: Use a bitfield;  Do not initialize to null things
14497         which are done by the constructor by default.
14498
14499         * cs-parser.jay: bug fix, parameter was 4, not 3.
14500
14501         * expression.cs: Just use the property;
14502
14503         * statement.cs: No need for GetVariableInfo method.
14504
14505 2003-08-08  Martin Baulig  <martin@ximian.com>
14506
14507         * flowanalysis.cs (FlowReturns): This is now nested in the
14508         `FlowBranching' class.
14509         (MyBitVector): Moved this here from statement.cs.
14510         (FlowBranching.SiblingType): New enum type.
14511         (FlowBranching.CreateSibling): Added `SiblingType' argument.
14512
14513 2003-08-07  Martin Baulig  <martin@ximian.com>
14514
14515         * flowanalysis.cs (FlowBranchingType): This is now nested in the
14516         `FlowBranching' class and called `BranchingType'.
14517
14518 2003-08-07  Martin Baulig  <martin@ximian.com>
14519
14520         * flowanalysis.cs: Moved all the control flow analysis code into
14521         its own file.
14522
14523 2003-08-07  Martin Baulig  <martin@ximian.com>
14524
14525         * assign.cs (Assign.DoResolve): `target' must either be an
14526         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
14527         #37319.
14528
14529 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
14530
14531         * expression.cs (BinaryMethod): This kind of expression is created by the
14532         Binary class if it determines that the operator has to be handled
14533         by a method.
14534
14535         (BinaryDelegate): This kind of expression is created if we are
14536         dealing with a + or - operator on delegates.
14537
14538         (Binary): remove method, argumetns, and DelegateOperator: when
14539         dealing with methods, 
14540
14541         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14542
14543         * statement.cs (Block): use bitfields for the three extra booleans
14544         we had in use.   Remove unused topblock parameter.
14545
14546         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14547
14548         * assign.cs: Drop extra unneeded tests.
14549
14550 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
14551
14552         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14553
14554         * statement.cs (Foreach): Use VariableStorage instead of
14555         LocalBuilders.   
14556
14557         * codegen.cs (VariableStorage): New class used by clients that
14558         require a variable stored: locals or fields for variables that
14559         need to live across yield.
14560
14561         Maybe provide a convenience api for EmitThis+EmitLoad?
14562
14563         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14564         these bad boys.
14565
14566 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
14567
14568         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14569         RemapParameterLValue): New methods that are used to turn a
14570         precomputed FieldInfo into an expression like this:
14571
14572                 instance.FieldInfo
14573
14574         The idea is to use this instead of making LocalVariableReference
14575         have more than one meaning.
14576
14577         * cs-parser.jay: Add error production to BASE.
14578
14579         * ecore.cs: Deal with TypeManager.GetField returning null, which
14580         is now a valid return value.
14581
14582         (FieldExprNoAddress): New expression for Fields whose address can
14583         not be taken.
14584
14585         * expression.cs (LocalVariableReference): During the resolve
14586         phases, create new expressions if we are in a remapping context.
14587         Remove code that dealt with remapping here.
14588
14589         (ParameterReference): same.
14590
14591         (ProxyInstance): New expression, like the `This' expression, but
14592         it is born fully resolved.  We know what we are doing, so remove
14593         the errors that are targeted to user-provided uses of `this'.
14594
14595         * statement.cs (Foreach): our variable is now stored as an
14596         Expression;  During resolution, follow the protocol, dont just
14597         assume it will return this.
14598
14599 2003-08-06  Martin Baulig  <martin@ximian.com>
14600
14601         * support.cs (SeekableStreamReader.cs): New public class.
14602
14603         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14604         SeekableStreamReader instead of the normal StreamReader.
14605
14606 2003-08-04  Martin Baulig  <martin@ximian.com>
14607
14608         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14609         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14610         deambiguate casts and delegate invocations.
14611         (parenthesized_expression): Use the new tokens to ensure this is
14612         not a cast of method invocation.
14613
14614         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14615         when reading a `)' and Deambiguate_CloseParens () was previously
14616         called.
14617
14618         * expression.cs (ParenthesizedExpression): New class.  This is
14619         just used for the CS0075 test.
14620         (Binary.DoResolve): Check for CS0075.   
14621
14622 2003-07-29  Ravi Pratap  <ravi@ximian.com>
14623
14624         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14625         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14626         reference comparison.
14627
14628         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14629         examine the ReturnType for equality - this is necessary in the
14630         cases of implicit and explicit operators whose signature also
14631         includes the return type.
14632
14633 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
14634
14635         * namespace.cs: Cache the result of the namespace computation,
14636         instead of computing it every time.
14637
14638 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14639
14640         * decl.cs: Use a global arraylist that we reuse over invocations
14641         to avoid excesive memory consumption.  Reduces memory usage on an
14642         mcs compile by one meg (45 average).
14643
14644         * typemanager.cs (LookupTypeReflection): In .NET pointers are
14645         private, work around that.
14646
14647 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
14648
14649         * literal.cs (IntLiteral): Define Zero and One static literals. 
14650
14651         * cs-parser.jay (integer_literal): use static literals to reduce
14652         memory usage for the most used literals (0, 1 and -1).  211kb
14653         reduced in memory usage.
14654
14655         Replace all calls to `new ArrayList' with `new
14656         ArrayList(4)' which is a good average number for most allocations,
14657         and also requires only 16 bytes of memory for its buffer by
14658         default. 
14659
14660         This reduced MCS memory usage in seven megabytes for the RSS after
14661         bootstrapping.
14662
14663 2003-07-28  Ravi Pratap  <ravi@ximian.com>
14664
14665         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14666         handle params methods the correct way by forming only one
14667         applicable set with params and normal methods in them. Earlier we
14668         were looking at params methods only if we found no normal methods
14669         which was not the correct thing to do.
14670
14671         (Invocation.BetterFunction): Take separate arguments indicating
14672         when candidate and the best method are params methods in their
14673         expanded form.
14674
14675         This fixes bugs #43367 and #46199.
14676
14677         * attribute.cs: Documentation updates.
14678
14679         (CheckAttribute): Rename to CheckAttributeTarget.
14680         (GetValidPlaces): Rename to GetValidTargets.
14681
14682         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14683         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14684
14685         Fixes bug #44468.
14686
14687 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
14688
14689         * codegen.cs: Compute IsGeneric correctly.
14690
14691         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
14692         resolution. 
14693
14694         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
14695         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
14696         regressions, and I was chasing more bugs than I required.
14697
14698         * interface.cs: Use expressions for base type names (like classes
14699         and structs have been doing for a while now), and resolve that.
14700         This patch should probably go into head as well.
14701
14702         This makes it one less user of FindType.
14703
14704 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14705
14706         This compiler can not self host currently.  Need to fix that.
14707         
14708         * Makefile: compile to `gmcs.exe'
14709
14710         * driver.cs: Turn on v2 by default on gmcs.
14711
14712         * generic.cs (ConstructedType): Does no longer take a container
14713         type argument;  That will be taken care of later.
14714
14715         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
14716         Use SimpleName to resolve for now, so we can continue the work on
14717         the parser, until we get Type.GetType that understands generics.
14718
14719         (ConstructedType.ToString): Implement
14720
14721         (TypeArguments.Resolve): Resolve the child expressions as types. 
14722         
14723         * cs-parser.jay: Rename interface_constraints to
14724         type_parameter_constraints
14725
14726         (namespace_or_type_name): Only use constructed types for the basic
14727         construction, we will deal with identifier<...> later.
14728
14729         (type/type_name): No longer call DecomposeQI, as
14730         namespace_or_type_name is always decoded now.
14731         
14732 2003-07-22  Ravi Pratap  <ravi@ximian.com>
14733
14734         * expression.cs (Invocation.OverloadResolve): Follow the spec more
14735         closely: we eliminate methods in base types when we have an
14736         applicable method in a top-level type.
14737
14738         Please see section 14.5.5.1 for an exact description of what goes
14739         on. 
14740
14741         This fixes bug #45127 and a host of other related to corlib compilation.
14742
14743         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14744         array is the method corresponding to the top-level type (this is
14745         because of the changes made to icall.c) so we change this
14746         accordingly.
14747
14748         (MethodGroupExpr.Name): This too.
14749
14750         * typemanager.cs (GetElementType): New method which does the right
14751         thing when compiling corlib. 
14752
14753         * everywhere: Make use of the above in the relevant places.
14754
14755 2003-07-22  Martin Baulig  <martin@ximian.com>
14756
14757         * cs-parser.jay (invocation_expression): Moved
14758         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14759         `cast_expression', but create a InvocationOrCast which later
14760         resolves to either an Invocation or a Cast.
14761
14762         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14763         method; call this before EmitStatement() to make sure that this
14764         expression can be used as a statement.
14765
14766         * expression.cs (InvocationOrCast): New class; resolves to either
14767         an Invocation or a Cast.
14768
14769         * statement.cs (StatementExpression): Call ResolveStatement() on
14770         the ExpressionStatement before emitting it.
14771
14772 2003-07-21  Martin Baulig  <martin@ximian.com>
14773
14774         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14775         `ref' and `out' attributes match; fixes #46220.
14776         (MemberAccess.ResolveMemberAccess): You can't reference a type
14777         through an expression; fixes #33180.
14778         (Indexers.GetIndexersForType): Don't return the indexers from
14779         interfaces the class implements; fixes #46502.
14780
14781 2003-07-21  Martin Baulig  <martin@ximian.com>
14782
14783         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14784         CS0661 checks; fixes bug #30442.
14785
14786 2003-07-21  Martin Baulig  <martin@ximian.com>
14787
14788         * decl.cs (AdditionResult): Added `Error'.
14789
14790         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14791
14792         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
14793         cs0031.cs actually work.
14794
14795  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14796  
14797         * cs-parser.jay (namespace_name): do not use
14798         namespace_or_type_name, use qualified_identifier, because
14799         namespace_or_type_name will soon return a composed expression
14800         instead of a string.
14801  
14802         (namespace_or_type_name): Instead of returning a string, now this
14803         production returns an expression.
14804  
14805         * codegen.cs (EmitContext): Setup IsGeneric property based on
14806         whether our DeclSpace is generic, our the method is generic.
14807  
14808         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
14809         the method is generic.
14810  
14811         * cs-parser.jay (type_arguments, opt_type_argument_list,
14812         type_parameters, type_parameter_list, opt_type_parameter_list,
14813         type_parameter,, opt_type_parameter_constraints_clauses,
14814         type_parameter_constraints_clauses,
14815         type_parameter_constraint_clause, type_parameter_constraint,
14816         interface_constraints): Add new production
14817  
14818         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
14819         DeclSpace is generic or not.
14820  
14821         (DeclSpace.SetParameterInfo): New routine, used to set the
14822         parameter info for a type.
14823  
14824         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
14825         returns a GenericTypeExpr
14826  
14827         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
14828         generic, lookup the generic argument.
14829  
14830         * attribute.cs: Do not allow TypeParameterExpressions in
14831         Attributes.
14832  
14833         * class.cs: Do not allow the Main method to be defined in a
14834         Generic container.
14835  
14836         * expression.cs (SizeOf): Do not allow generic types to be used as
14837         arguments to sizeof.
14838  
14839         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
14840         it: whether a type is generic or not.  Only works for types we are
14841         currently building for now.
14842         
14843 2003-07-20  Martin Baulig  <martin@ximian.com>
14844
14845         * namespace.cs: Fixed that bug which caused a crash when compiling
14846         the debugger's GUI.
14847
14848 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14849
14850         * typemanager.cs (LookupTypeReflection): Never expose types which
14851         are NotPublic, NestedPrivate, NestedAssembly, or
14852         NestedFamANDAssem.  We used to return these, and later do a check
14853         that would report a meaningful error, but the problem is that we
14854         would not get the real match, if there was a name override.
14855
14856 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
14857
14858         * namespace.cs (Namespace, Name): Do not compute the namespace
14859         name dynamically, compute it in the constructor.  This reduced
14860         memory usage by 1697 KB.
14861
14862         * driver.cs: Use --pause to pause at the end.
14863
14864 2003-07-17  Peter Williams  <peter@newton.cx>
14865
14866         * Makefile: Change the name of the test target so that it doesn't
14867         conflict with the recursive test target.
14868
14869 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
14870
14871         * expression.cs (LocalVariableReference.Emit, EmitAssign,
14872         AddressOf): Do not use EmitThis, that was wrong, use the actual
14873         this pointer.
14874
14875 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
14876
14877         * class.cs (MethodData.Define): While checking if a method is an
14878         interface implementation, improve the test: If we are not public
14879         (use new test here: use the computed MethodAttributes directly,
14880         instead of the parsed modifier flags) check if the `implementing'
14881         method comes from an interface or not.
14882
14883         * pending.cs (VerifyPendingMethods): Slightly better error
14884         message.
14885
14886         * makefile: add test target that does the mcs bootstrap.
14887
14888 2003-07-16  Ravi Pratap  <ravi@ximian.com>
14889
14890         * interface.cs (Define): Do nothing here since there are no
14891         members to populate etc. Move the attribute emission out of here
14892         since this was just totally the wrong place to put it. Attribute
14893         application happens during the 'Emit' phase, not in the 'Define'
14894         phase.
14895
14896         (Emit): Add this method and move the attribute emission here
14897
14898         * rootcontext.cs (EmitCode): Call the Emit method on interface
14899         types too.
14900
14901 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14902
14903         * expression.cs (OverloadResolve): Report error only if Location
14904         is not 'Null' which means that there was a probe going on.
14905
14906 2003-07-14  Martin Baulig  <martin@ximian.com>
14907
14908         * expression.cs (ConditionalLogicalOperator): New public class to
14909         implement user defined conditional logical operators.
14910         This is section 14.11.2 in the spec and bug #40505.
14911
14912 2003-07-14  Martin Baulig  <martin@ximian.com>
14913
14914         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14915
14916 2003-07-14  Martin Baulig  <martin@ximian.com>
14917
14918         * codegen.cs (EmitContext.InFixedInitializer): New public field.
14919
14920         * ecore.cs (IVariable.VerifyFixed): New interface method.
14921
14922         * expression.cs (Unary.ResolveOperator): When resolving the `&'
14923         operator, check whether the variable is actually fixed.  Fixes bug
14924         #36055.  Set a variable definitely assigned when taking its
14925         address as required by the spec.
14926
14927         * statement.cs (LocalInfo.IsFixed): New field.
14928         (LocalInfo.MakePinned): Set `IsFixed' to true.
14929
14930 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14931
14932         * attribute.cs (Attribute.Resolve): While doing a Member lookup
14933         for .ctors, ensure that we only ask for members declared in the
14934         attribute type (BindingFlags.DeclaredOnly).
14935
14936         Fixes bug #43632.
14937
14938         * expression.cs (Error_WrongNumArguments): Report error 1501
14939         correctly the way CSC does.
14940
14941 2003-07-13  Martin Baulig  <martin@ximian.com>
14942
14943         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14944         lookup on the fully qualified name, to make things like "X.X" work
14945         where "X.X" is a fully qualified type name, but we also have a
14946         namespace "X" in the using list.  Fixes #41975.
14947
14948 2003-07-13  Martin Baulig  <martin@ximian.com>
14949
14950         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14951         function. If we're a CompoundAssign, we need to create an embedded
14952         CompoundAssign, not an embedded Assign.
14953         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14954         Fixes #45854.
14955
14956 2003-07-13  Martin Baulig  <martin@ximian.com>
14957
14958         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14959         work to fix bug #46088.
14960
14961 2003-07-13  Ravi Pratap <ravi@ximian.com>
14962
14963         * class.cs (Operator.Emit): Do not emit attributes here - it is
14964         taken care of by the Method class that we delegate too. This takes
14965         care of bug #45876.
14966
14967 2003-07-10  Martin Baulig  <martin@ximian.com>
14968
14969         * expression.cs (TypeOfVoid): New class.
14970         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
14971
14972 2003-07-10  Martin Baulig  <martin@ximian.com>
14973
14974         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14975         bug #35957.
14976
14977 2003-07-10  Martin Baulig  <martin@ximian.com>
14978
14979         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14980         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14981
14982         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14983
14984         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14985
14986 2003-07-10  Martin Baulig  <martin@ximian.com>
14987
14988         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14989         of decimal.  Fixes #42850.
14990
14991         NOTE: I also fixed the created byte blob, but this doesn't work on
14992         the MS runtime and csc never produces any byte blobs for decimal
14993         arrays.
14994
14995 2003-07-10  Martin Baulig  <martin@ximian.com>
14996
14997         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14998         structs; fixes #32068.
14999         (Block.AddChildVariableNames): Fixed #44302.
15000
15001 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15002
15003         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
15004
15005 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
15006
15007         * attribute.cs: And this test is onger needed.
15008
15009 2003-07-08  Martin Baulig  <martin@ximian.com>
15010
15011         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
15012         inaccessible types.  Fixes #36313.
15013
15014         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
15015
15016         * namespace.cs (NamespaceEntry): Create implicit entries for all
15017         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
15018         implicit entries for N1.N2 and N1.
15019
15020 2003-07-08  Martin Baulig  <martin@ximian.com>
15021
15022         Rewrote the handling of namespaces to fix a lot of the issues
15023         wrt. `using' aliases etc.
15024
15025         * namespace.cs (Namespace): Splitted this class into a
15026         per-assembly `Namespace' and a per-file `NamespaceEntry'.
15027
15028         * typemanager.cs (TypeManager.IsNamespace): Removed.
15029         (TypeManager.ComputeNamespaces): Only compute namespaces from
15030         loaded assemblies here, not the namespaces from the assembly we're
15031         currently compiling.
15032
15033 2003-07-08  Martin Baulig  <martin@ximian.com>
15034
15035         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
15036
15037 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
15038
15039         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
15040         already fixed it.  
15041
15042         I thought about the memory savings here, but LookupTypeReflection
15043         is used under already very constrained scenarios.  Compiling
15044         corlib or mcs only exposes one hit, so it would not really reduce
15045         any memory consumption.
15046
15047 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15048
15049         * typemanager.cs: fixes bug #45889 by only adding public types from
15050         other assemblies to the list of known types.
15051
15052 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
15053
15054         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
15055         on the type we resolved.
15056
15057 2003-07-05  Martin Baulig  <martin@ximian.com>
15058
15059         * pending.cs (PendingImplementation.ParentImplements): Don't
15060         create the proxy if the parent is abstract.
15061
15062         * class.cs (TypeContainer.DefineIndexers): Process explicit
15063         interface implementations first.  Fixes #37714.
15064
15065 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
15066
15067         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
15068         defined recursively;  but since we modify the input parameters
15069         (left is set to `this' temporarily), we reset this value if the
15070         left_is_explicit is false, which gives the original semantics to
15071         the code.  
15072
15073         * literal.cs (NullPointer): new class used to represent a null
15074         literal in a pointer context.
15075
15076         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
15077         type is a pointer, use a NullPointer object instead of a
15078         NullLiteral.   Closes 43687
15079
15080         (ExplicitConversion): Convert pointer values using
15081         the conv opcode to the proper type.
15082
15083         * ecore.cs (New): change ValueTypeVariable property into a method,
15084         that returns whether the valuetype is suitable for being used.
15085
15086         * expression.cs (Binary.DoNumericPromotions): Only return if we
15087         the int constant was a valid uint, and we can return both left and
15088         right as uints.  If not, we continue processing, to trigger the
15089         type conversion.  This fixes 39018.
15090
15091         * statement.cs (Block.EmitMeta): During constant resolution, set
15092         the CurrentBlock property on the emitcontext, so that we resolve
15093         constants propertly.
15094
15095 2003-07-02  Martin Baulig  <martin@ximian.com>
15096
15097         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
15098         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
15099
15100         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
15101         than emitting it here.
15102
15103         * statement.cs: Fixed some more flow analysis bugs.
15104
15105 2003-07-02  Martin Baulig  <martin@ximian.com>
15106
15107         * class.cs (MethodData.Define): When implementing interface
15108         methods, set Final unless we're Virtual.
15109
15110         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
15111         check work for interface methods.
15112
15113 2003-07-01  Martin Baulig  <martin@ximian.com>
15114
15115         * ecore.cs (EmitContext.This): Replaced this property with a
15116         GetThis() method which takes a Location argument.  This ensures
15117         that we get the correct error location for a CS0188.
15118
15119 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
15120
15121         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
15122         ImplicitStandardConversion.
15123
15124         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
15125
15126 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
15127
15128         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
15129         optimization.
15130
15131 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
15132
15133         * class.cs (Constructor.Define): Turn off initlocals for unsafe
15134         constructors.
15135
15136         (MethodData.Define): Turn off initlocals for unsafe methods.
15137
15138 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
15139
15140         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
15141         complete;  Fixes #37521.
15142
15143         * delegate.cs: Use Modifiers.TypeAttr to compute the
15144         TypeAttributes, instead of rolling our own.  This makes the flags
15145         correct for the delegates.
15146
15147 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
15148
15149         * class.cs (Constructor.Define): Set the private flag for static
15150         constructors as well.
15151
15152         * cs-parser.jay (statement_expression): Set the return value to
15153         null, to avoid a crash when we catch an error.
15154
15155 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
15156
15157         * cs-parser.jay: Applied patch from Jackson that adds support for
15158         extern and unsafe modifiers to destructor declarations.
15159
15160         * expression.cs: Report error 21 if the user is trying to index a
15161         System.Array.
15162
15163         * driver.cs: Add an error message, suggested by the bug report.
15164
15165         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
15166         if we do not have a ": this ()" constructor initializer.  Fixes 45149
15167
15168 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
15169
15170         * namespace.cs: Add some information to reduce FAQs.
15171
15172 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
15173
15174         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
15175         underlying enumeration types.  Fixes #43915.
15176
15177         * expression.cs: Treat ushort/short as legal values to be used in
15178         bitwise operations.
15179
15180 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
15181
15182         * delegate.cs: transfer custom attributes for paramenters from
15183         the delegate declaration to Invoke and BeginInvoke.
15184
15185 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
15186
15187         * attribute.cs: handle custom marshalers and emit marshal info
15188         for fields, too.
15189
15190 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
15191
15192         * makefile.gnu: Added anonymous.cs to the compiler sources.
15193
15194 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
15195
15196         * iterators.cs: Change the name of the proxy class to include two
15197         underscores.
15198
15199         * cs-parser.jay: Update grammar to include anonymous methods.
15200
15201         * anonymous.cs: new file.
15202
15203 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
15204
15205         * class.cs (Field.Define): Add missing test for pointers and
15206         safety. 
15207
15208 2003-05-27  Ravi Pratap  <ravi@ximian.com>
15209
15210         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
15211         we use the stobj opcode.
15212
15213         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
15214         since it wasn't the correct fix. 
15215
15216         It still is puzzling that we are required to use stobj for IntPtr
15217         which seems to be a ValueType.
15218
15219 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
15220
15221         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
15222         during regular simple name resolution.   Now, the trick is that
15223         instead of returning for processing the simplename, we do a
15224         TypeManager.LookupType (ie, a rooted lookup as opposed to a
15225         contextual lookup type).   If a match is found, return that, if
15226         not, return for further composition.
15227
15228         This fixes long-standing 30485.
15229
15230         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15231         using the address to initialize an object, do an Stobj instead of
15232         using the regular Stelem.
15233
15234         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
15235         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
15236         Because if we are a BaseIndexerAccess that value will be true.
15237         Fixes 43643.
15238
15239         * statement.cs (GotoCase.Resolve): Return after reporting an
15240         error, do not attempt to continue. 
15241
15242         * expression.cs (PointerArithmetic.Emit): If our operand is a
15243         long, convert our constants to match the operand before
15244         multiplying.  Convert to I type before adding.   Fixes 43670.
15245
15246 2003-05-14  Ravi Pratap  <ravi@ximian.com>
15247
15248         * enum.cs (ImplicitConversionExists) : Rename to
15249         ImplicitEnumConversionExists to remove ambiguity. 
15250
15251         * ecore.cs (NullCast): New type of cast expression class which
15252         basically is very similar to EmptyCast with the difference being
15253         it still is a constant since it is used only to cast a null to
15254         something else
15255         (eg. (string) null)
15256
15257         * convert.cs (ImplicitReferenceConversion): When casting a null
15258         literal, we return a NullCast.
15259
15260         * literal.cs (NullLiteralTyped): Remove - I don't see why this
15261         should be around anymore.
15262
15263         The renaming (reported was slightly wrong). Corrections:
15264
15265         ConvertImplicitStandard -> ImplicitConversionStandard
15266         ConvertExplicitStandard -> ExplicitConversionStandard
15267
15268         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
15269         before passing them in !
15270
15271         * convert.cs (ImplicitConversionStandard): When comparing for
15272         equal expr and target types, ensure that expr is not a
15273         NullLiteral.
15274
15275         In general, we must not be checking (expr_type ==
15276         target_type) in the top level conversion methods
15277         (ImplicitConversion, ExplicitConversion etc). This checking is
15278         done in the methods that they delegate to.
15279
15280 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
15281
15282         * convert.cs: Move Error_CannotConvertType,
15283         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
15284         ImplicitNumericConversion, ImplicitConversionExists,
15285         ImplicitUserConversionExists, StandardConversionExists,
15286         FindMostEncompassedType, FindMostSpecificSource,
15287         FindMostSpecificTarget, ImplicitUserConversion,
15288         ExplicitUserConversion, GetConversionOperators,
15289         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
15290         TryImplicitIntConversion, Error_CannotConvertImplicit,
15291         ConvertImplicitRequired, ConvertNumericExplicit,
15292         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
15293         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
15294         its own file.
15295
15296         Perform the following renames:
15297
15298         StandardConversionExists -> ImplicitStandardConversionExists
15299         ConvertImplicit -> ImplicitConversion
15300         ConvertImplicitStandard -> ImplicitStandardConversion
15301         TryImplicitIntConversion -> ImplicitIntConversion
15302         ConvertImplicitRequired -> ImplicitConversionRequired
15303         ConvertNumericExplicit -> ExplicitNumericConversion
15304         ConvertReferenceExplicit -> ExplicitReferenceConversion
15305         ConvertExplicit -> ExplicitConversion
15306         ConvertExplicitStandard -> ExplicitStandardConversion
15307
15308 2003-05-19  Martin Baulig  <martin@ximian.com>
15309
15310         * statement.cs (TypeInfo.StructInfo): Made this type protected.
15311         (TypeInfo): Added support for structs having structs as fields.
15312
15313         * ecore.cs (FieldExpr): Implement IVariable.
15314         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
15315         VariableInfo for the field.
15316
15317 2003-05-18  Martin Baulig  <martin@ximian.com>
15318
15319         * expression.cs (This.DoResolve): Report a CS0027 if we're
15320         emitting a field initializer.
15321
15322 2003-05-18  Martin Baulig  <martin@ximian.com>
15323
15324         * expression.cs (This.ResolveBase): New public function.
15325         (This.DoResolve): Check for CS0188.
15326
15327         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
15328         This.Resolve().
15329
15330         * ecore.cs (MethodGroupExpr.DoResolve): Set the
15331         `instance_expression' to null if we don't have any non-static
15332         methods.
15333
15334 2003-05-18  Martin Baulig  <martin@ximian.com>
15335
15336         Reworked the way how local variables and parameters are handled by
15337         the flow analysis code.
15338
15339         * statement.cs (TypeInfo, VariableMap): New public classes.
15340         (VariableInfo): New public class.  This is now responsible for
15341         checking whether a variable has been assigned.  It is used for
15342         parameters and local variables.
15343         (Block.EmitMeta): Take the InternalParameters as argument; compute
15344         the layout of the flow vectors here.
15345         (Block.LocalMap, Block.ParameterMap): New public properties.
15346         (FlowBranching): The .ctor doesn't get the InternalParameters
15347         anymore since Block.EmitMeta() now computes the layout of the flow
15348         vector.
15349         (MyStructInfo): This class is now known as `StructInfo' and nested
15350         in `TypeInfo'; we don't access this directly anymore.
15351
15352         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
15353         property and removed IsAssigned(), IsFieldAssigned(),
15354         SetAssigned() and SetFieldAssigned(); we now call them on the
15355         VariableInfo so we don't need to duplicate this code everywhere.
15356
15357         * expression.cs (ParameterReference): Added `Block block' argument
15358         to the .ctor.
15359         (LocalVariableReference, ParameterReference, This): The new
15360         VariableInfo class is now responsible for all the definite
15361         assignment stuff.
15362
15363         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
15364         IsParameterAssigned, SetParameterAssigned): Removed.
15365
15366 2003-05-18  Martin Baulig  <martin@ximian.com>
15367
15368         * typemanager.cs (InitCoreTypes): Try calling
15369         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
15370         the 3-args-version.  Corlib now also needs our `void_type'.
15371         (GetMethod): Added overloaded version which takes an optional
15372         `bool report_errors' to allow lookups of optional methods.
15373
15374 2003-05-12  Martin Baulig  <martin@ximian.com>
15375
15376         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
15377         only used for locals and not for parameters.
15378
15379 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
15380
15381         * support.cs (InternalParameters.ParameterType): Return the
15382         ExternalType of the parameter.
15383
15384         * parameter.cs (Parameter.ExternalType): drop the two arguments,
15385         they were unused.
15386
15387 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
15388
15389         * class.cs (MethodData.Define): Do not set the `newslot' on
15390         interface members, if they are also flagged as "override".
15391
15392         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
15393         better code for ++i and i++.  This only works for static fields
15394         and local variables.
15395
15396         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
15397         want to pull the DeclSpace out of the builder_to_declspace instead
15398         of the TypeBuilder (like in TypeContainer.FindMembers).
15399
15400         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
15401         instead of LookupTypeContainer.  Fixes the crash on .NET for
15402         looking up interface members.
15403
15404         * const.cs: Create our own emit context during the Definition
15405         stage, so that constants are evaluated in the proper context, when
15406         a recursive definition happens.
15407
15408 2003-05-11  Martin Baulig  <martin@ximian.com>
15409
15410         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
15411         new block for a switch section.
15412         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
15413         the adding/lookup in the switch block.  Fixes #39828.
15414
15415 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
15416
15417         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
15418         functionality: I needed to convert the data after I had performed
15419         the add/sub operation into the operands type size.
15420
15421         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
15422         pass the type for the box operation, otherwise the resulting
15423         object would have been of type object.
15424
15425         (BoxedCast): Add constructor to specify the type to box as.
15426
15427 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
15428
15429         * iterators.cs: I was reusing the `count' variable inadvertently,
15430         take steps to not allow this to happen.
15431
15432 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
15433
15434         * attribute.cs (Attribute.Resolve): Params attributes are encoded
15435         by creating an array at the point where the params starts and
15436         putting all those arguments there, then adjusting the size of the
15437         array.
15438
15439 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
15440
15441         * expression.cs (New.AddressOf): Implement interface
15442         IMemoryLocation.  This is used when the `new' operator is used in
15443         the context of an invocation to a method on a value type.
15444
15445         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
15446         example. 
15447
15448         * namespace.cs: Also check the using aliases here.
15449
15450         * driver.cs: Move the test for using validity after the types have
15451         been entered, so we do a single pass that also includes the using
15452         aliases. 
15453
15454         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
15455         in the regular case.   CreateSiblingForFinally is doing extra
15456         error checking.
15457
15458         * attribute.cs (GetAttributeArgumentExpression): Store the result
15459         on an out value, and use the return value to indicate failure
15460         instead of using null (which is a valid return for Constant.GetValue).
15461
15462         * statement.cs: Perform the analysis flow for the increment
15463         portion after the statement, because this will be the real flow of
15464         execution.  Fixes #42385
15465
15466         * codegen.cs (EmitContext.EmitArgument,
15467         EmitContext.EmitStoreArgument): New helper functions when the
15468         RemapToProxy flag is set.
15469
15470         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
15471         function.
15472
15473         Add support for remapping parameters. 
15474
15475         * iterators.cs: Propagate parameter values;  Store parameter
15476         values in the proxy classes.
15477
15478 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
15479
15480         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
15481         need a proxy reference;  I do not know what I was thinking
15482
15483         * cs-parser.jay (constructor_initializer): catch another error,
15484         and display nice message.
15485
15486         (field_declaration): catch void field declaration
15487         to flag a better error. 
15488
15489         * class.cs (MemberBase.CheckBase): Report an error instead of a
15490         warning if a new protected member is declared in a struct. 
15491         (Field.Define): catch the error of readonly/volatile.
15492
15493         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
15494
15495         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
15496         volatile variable is taken
15497
15498 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
15499
15500         * statement.cs (Fixed.Resolve): Report an error if we are not in
15501         an unsafe context.
15502
15503 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
15504
15505         * typemanager.cs: reuse the code that handles type clashes for
15506         delegates and enumerations.
15507
15508         * class.cs (Report28): Always report.
15509
15510         * expression.cs (EncodeAsAttribute): Allow nulls here.
15511
15512 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
15513
15514         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
15515         the functionality for testing whether an expression is valid for
15516         an attribute here.  Also handle the case of arrays of elements
15517         being stored. 
15518
15519         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
15520         encoding a linear array into an array of objects that are suitable
15521         to be passed to an CustomAttributeBuilder.
15522
15523         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15524
15525         * ecore.cs: (FieldExpr): Handle field remapping here.
15526
15527         * iteratators.cs: Pass the instance variable (if the method is an
15528         instance method) to the constructors, so we can access the field
15529         variables on the class.
15530
15531         TODO: Test this with structs.  I think the THIS variable on
15532         structs might have to be a pointer, and not a refenrece
15533
15534 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
15535
15536         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15537         local variables to fields in a proxy class.
15538
15539         * iterators.cs (PopulateProxy): Rename our internal fields to
15540         <XXX>.  
15541         Create a <THIS> field if we are an instance method, so we can
15542         reference our parent container variables.
15543         (MapVariable): Called back from the EmitContext code to enter a
15544         new variable to field mapping into the proxy class (we just create
15545         a FieldBuilder).
15546
15547         * expression.cs
15548         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15549         for using the remapped locals to fields.
15550
15551         I placed the code here, because that gives the same semantics to
15552         local variables, and only changes the Emit code.
15553
15554         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15555         statements inside iterators.
15556         (VariableInfo): Add a FieldBuilder for the cases when we are
15557         remapping local variables to fields in a proxy class
15558
15559         * ecore.cs (SimpleNameResolve): Avoid testing two times for
15560         current_block != null.
15561
15562         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15563         not cope with strings, as it has been moved to the
15564         TableSwitchEmit.  Fixed bug in switch generation.
15565
15566         * expression.cs (New.DoResolve): Provide more context for the user
15567         when reporting an error.
15568
15569         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15570         pointers. 
15571
15572         * expression.cs (MemberAccess.DoResolve): When we get a type back,
15573         check the permissions for it.  Note than in a type-resolution
15574         context the check was already present in DeclSpace.ResolveType,
15575         but was missing from the MemberAccess.
15576
15577         (ArrayCreation.CheckIndices): warn if the user has
15578         more nested levels of expressions, but there are no more
15579         dimensions specified.  Avoids crash on bug 41906.
15580
15581 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
15582
15583         * statement.cs (Block): replace Implicit bool, for a generic
15584         flags.   
15585         New flag: `Unchecked'.  This is used during the EmitMeta phase
15586         (which is out-of-line with the regular Resolve/Emit process for a
15587         statement, as this is done ahead of time, but still gets a chance
15588         to call constant resolve).
15589
15590         (Block.Flags): new enum for adding a new flag.
15591
15592         (Block.EmitMeta): track the state of unchecked.
15593
15594         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15595         to enable constant resolution to work there as well.
15596
15597 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
15598
15599         * typemanager.cs (ienumerable_type): Also look up
15600         System.Collections.IEnumerable. 
15601
15602 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
15603
15604         TODO: Test more than one conditional per method.
15605
15606         * class.cs (Indexer.Define): Report the location where the user is
15607         referencing the unsupported feature.
15608
15609         (MethodData): Overload the use of `conditionals' to
15610         minimize the creation of needless ArrayLists.   This saves roughly
15611         212kb on my machine.
15612
15613         (Method): Implement the new IIteratorContainer interface.
15614         (Method.SetYields): Implement the method by setting the ModFlags
15615         to contain METHOD_YIELDS.
15616
15617         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15618         which just got set to null.
15619
15620         * iterators.cs: New file.
15621
15622         (Yield, YieldBreak): New statements.
15623
15624         * statement.cs (Return.Resolve): Flag an error if we are used in
15625         an iterator method.
15626
15627         * codegen.cs (InIterator): New flag set if the code is being
15628         compiled in an iterator method.
15629
15630         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
15631         internal modifier, and we just use it to avoid adding extra
15632         fields, as this is seldom used.  
15633
15634         * cs-parser.jay: Add yield_statement (yield and yield break).
15635
15636         * driver.cs: New flag -v2 to turn on version 2 features. 
15637
15638         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15639         hashtable when v2 is enabled.
15640
15641 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
15642
15643         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15644         there is already a namespace defined with this name.
15645
15646         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15647         people upgraded their corlibs.
15648
15649         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15650         always use fully qualified types, no need to use the compiler
15651         front end.
15652
15653         (TypeManager.IsNamespace): Use binarysearch.
15654
15655         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15656         AddDelegate): I did not quite use the new IsValid API properly: I
15657         have to pass the short-name and the fullname.  I was passing only
15658         the basename instead of the fullname sometimes. 
15659
15660         (TypeContainer.DefineType): call NamespaceClash.
15661
15662         * interface.cs (Interface.DefineType): use NamespaceClash before
15663         defining the type.
15664
15665         * delegate.cs (Delegate.DefineType): use NamespaceClash before
15666         defining the type.
15667
15668         * enum.cs: (Enum.DefineType): use NamespaceClash before
15669         defining the type.
15670
15671         * typemanager.cs (: 3-line patch that gives us some tasty 11%
15672         speed increase.  First, use the negative_hits cache when we get a
15673         negative.  Second, add the type with its full original name
15674         instead of the new . and + encoded name (reflection uses + to
15675         separate type from a nested type).  Use LookupTypeReflection
15676         directly which bypasses the type->name hashtable (that we already
15677         know does not contain the type.
15678
15679         * decl.cs (DeclSpace.ResolveTypeExpr): track the
15680         location/container type. 
15681
15682         * driver.cs: When passing utf8, use directly the UTF8Encoding.
15683
15684 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
15685
15686         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15687
15688         * delegate.cs (NewDelegate.Resolve): Test whether an instance
15689         method is being referenced in the method group from a static
15690         context, and report error 120 if so.
15691
15692         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15693         Error118. 
15694
15695         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15696         is created, we create the A namespace).
15697
15698         * cs-parser.jay: A namespace also introduces a DeclarationFound.
15699         Fixes #41591
15700
15701 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
15702
15703         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15704         invocation to ModuleBuilder.GetType with the same values will
15705         return a new type instance, so we need to cache its return
15706         values. 
15707
15708         * expression.cs (Binary.ResolveOperator): Only allow the compare
15709         operators on enums if they are of the same type.
15710
15711         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15712         types of ValueType on their own case.  Before we were giving them
15713         the same treatment as objects.
15714
15715         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15716         fullname.  Short name is used to compare against container name.
15717         Fullname is used to check against defined namespace names.
15718
15719         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15720         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15721
15722         (Method.CheckBase): Call parent.
15723         (MemberBase.CheckBase): Check for protected members on sealed
15724         classes.
15725         (PropertyBase.CheckBase): Call parent.
15726         (Field.Define): Call parent.
15727
15728         * report.cs: Negative error codes are now mapped to 8000 - code,
15729         so that the display is render more nicely.
15730
15731         * typemanager.cs: Do not use try/catch, instead report a regular
15732         error. 
15733
15734         (GetPointerType, GetReferenceType): These methods provide
15735         mechanisms to obtain the T* and T& from a T.  We had the code
15736         previously scattered around the code base, and it also used
15737         TypeManager.LookupType that would go through plenty of caches.
15738         This one goes directly to the type source.
15739
15740         In some places we did the Type.GetType followed by
15741         ModuleBuilder.GetType, but not in others, so this unifies the
15742         processing as well.
15743
15744         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15745         statements now that we have namespace information.
15746
15747         * typemanager.cs (IsNamespace): New method, returns whether the
15748         string presented is a namespace or not.
15749
15750         (ComputeNamespaces): New public entry point, computes the list of
15751         available namespaces, using the GetNamespaces API call in Mono, or
15752         the slower version in MS.NET.   
15753
15754         Now before we start the semantic analysis phase, we have a
15755         complete list of namespaces including everything that the user has
15756         provided.
15757
15758         Deleted old code to cache namespaces in .nsc files.
15759
15760 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
15761
15762         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15763         class/struct location definition Location for the implicit
15764         constructor location.
15765
15766         (Operator.Define): Use the location of the operator for the
15767         implicit Method definition.
15768
15769         (Constructor.Emit): use the constructor location for the implicit
15770         base initializer constructor.
15771
15772         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
15773         and the Expression class now contains two new methods:
15774
15775         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
15776         isolate type lookup from the rest of the resolution process.
15777
15778         Since we use Expressions to hold type definitions due to the way
15779         we parse the input we have historically overloaded Resolve to
15780         perform the Type lookups if a special flag is passed.  Now this is
15781         eliminated and two methods take their place. 
15782
15783         The differences in the two methods between xStep and xTerminal is
15784         that xStep is involved in our current lookup system that uses
15785         SimpleNames to compose a name, while xTerminal is used just to
15786         catch the case where the simplename lookup failed.
15787
15788 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
15789
15790         * expression.cs (ResolveMemberAccess): Remove redundant code.
15791         TypeExpr expressions are always born fully resolved.
15792
15793         * interface.cs (PopulateMethod): Do not lookup the types twice.
15794         We were doing it once during SemanticAnalysis and once during
15795         PopulateMethod.
15796
15797         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15798         in local variable type definitions, were being returned as a
15799         SimpleName (we decomposed everything into a string), that is
15800         because primary_expression was being used instead of a type in the
15801         grammar (reduce/reduce conflicts).
15802
15803         The part that was wrong is that we converted the expression into a
15804         string (an oversimplification in one hand, compounded with primary
15805         expressions doing string concatenation).
15806
15807         So things like:
15808
15809         A.B.C [] x;
15810
15811         Would return "A.B.C[]" as a SimpleName.  This stopped things like
15812         using clauses from working on this particular context.  And a type
15813         was being matched directly against "A.B.C[]".
15814
15815         We now use the correct approach, and allow for ComposedCast to be
15816         part of the unary expression.  So the "A.B.C []" become a composed
15817         cast of "A.B.C" (as a nested group of MemberAccess with a
15818         SimpleName at the end) plus the rank composition "[]". 
15819
15820         Also fixes 35567
15821
15822 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
15823
15824         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15825         for the access level checking.
15826
15827         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
15828         `TypeContainer container', because I kept getting confused when I
15829         was debugging this code.
15830
15831         * expression.cs (Indexers): Instead of tracking getters/setters,
15832         we now track them in parallel.  We create one arraylist less, but
15833         most importantly it is possible now for the LValue code to find a
15834         matching get for a set.
15835
15836         (IndexerAccess.DoResolveLValue): Update the code.
15837         GetIndexersForType has been modified already to extract all the
15838         indexers from a type.  The code assumed it did not.
15839
15840         Also make the code set the correct return type for the indexer.
15841         This was fixed a long time ago for properties, but was missing for
15842         indexers.  It used to be void_type.
15843
15844         (Binary.Emit): Test first for doubles instead of
15845         floats, as they are more common.
15846
15847         (Binary.EmitBranchable): Use the .un version of the branch opcodes
15848         when dealing with floats and the <=, >= operators.  This fixes bug
15849         #39314 
15850
15851         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15852         to load the array value by emitting a load on the foreach variable
15853         type.  This was incorrect.  
15854
15855         We now emit the code to load an element using the the array
15856         variable type, and then we emit the conversion operator.
15857
15858         Fixed #40176
15859
15860 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
15861
15862         * attribute.cs: Avoid allocation of ArrayLists in the common case.
15863
15864 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
15865
15866         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15867         test for protection before we test for signatures. 
15868
15869         (MethodSignature.ToString): implement.
15870
15871         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15872         to the case where we reduced into a LongConstant.
15873
15874         * decl.cs (CheckAccessLevel): If the type is an array, we can not
15875         depend on whether the information is acurrate, because the
15876         Microsoft runtime will always claim that the array type is public,
15877         regardless of the real state.
15878
15879         If the type is a pointer, another problem happens: the type is
15880         reported as non-public in Microsoft.  
15881
15882         In both cases we have to call CheckAccessLevel recursively with
15883         the underlying type as the argument to be tested.
15884
15885 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
15886
15887         * assign.cs (Assign.Emit): If we are dealing with a compound
15888         assignment expression, we should use the code path that stores the
15889         intermediate result in a temporary value.  This fixes #40903.
15890
15891         *expression.cs (Indirection.ToString): Provide ToString method for
15892         debugging. 
15893
15894 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
15895
15896         * class.cs: Null out fields holding references to Block objects so
15897         they can be garbage collected.
15898
15899         * expression.cs (OverloadResolve): Remove unused local.
15900
15901 2003-04-07  Martin Baulig  <martin@ximian.com>
15902
15903         * codegen.cs (EmitContext.CurrentFile): New public field.
15904         (EmitContext.Mark): Use the CurrentFile to check whether the
15905         location is in the correct file.
15906         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15907
15908 2003-04-07  Martin Baulig  <martin@ximian.com>
15909
15910         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15911
15912         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15913         location.  [FIXME: The location argument which gets passed to this
15914         method is sometimes wrong!]
15915
15916 2003-04-07  Nick Drochak <ndrochak@gol.com>
15917
15918         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15919
15920 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
15921
15922         * expression.cs (Indirection.EmitAssign): We were using the
15923         temporary, but returning immediately instead of continuing the
15924         EmitAssing flow.
15925
15926 2003-04-06  Martin Baulig  <martin@ximian.com>
15927
15928         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15929         if it's a nested child, but also deriving from the outer class.
15930         See test 190.cs.
15931
15932         * typemanager.cs (IsNestedChildOf): Make this work if it's a
15933         nested child, but also deriving from the outer class.  See
15934         test-190.cs.
15935         (FilterWithClosure): We may access private members of the outer
15936         class if we're a nested child and deriving from the outer class.
15937         (RealMemberLookup): Only set `closure_private_ok' if the
15938         `original_bf' contained BindingFlags.NonPublic.
15939
15940 2003-04-05  Martin Baulig  <martin@ximian.com>
15941
15942         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
15943         probe if its a type parameter, and if so, flag an error.
15944
15945         * decl.cs: Move here the SetParameterInfo code from class.cs.
15946         Handle IsGeneric here.
15947
15948         Handle a variety of errors in the parameter info definition.
15949
15950         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
15951         type parameters here.
15952
15953         * cs-parser.jay (class_declaration): report errors for parameters
15954         here as well.
15955
15956 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
15957
15958         * generic.cs: New file, contains support code for generics.
15959
15960         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
15961         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
15962
15963         Update parser for the above removals.
15964
15965         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
15966         now taken care of in the parser.
15967
15968 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
15969
15970         * class.cs (Event.Define): Do not allow abstract events to have
15971         initializers. 
15972
15973 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
15974
15975         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15976         block in event declarations.
15977
15978         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15979         value type, get its address.
15980
15981         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15982         leaving a class on the stack instead of a boolean value (int
15983         0/1).  Change the code so we compare against null, and then the
15984         result against zero.
15985
15986         * class.cs (TypeContainer.GetClassBases): We were checking for the
15987         parent class being sealed too late.
15988
15989         * expression.cs (Binary.Emit): For <= and >= when dealing with
15990         floating point values, use cgt.un and clt.un instead of cgt and
15991         clt alone.
15992
15993 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
15994
15995         * statement.cs: Apply the same optimization as MS: skip the 
15996         GetEnumerator returning an IEnumerator, and use the one returning a 
15997         CharEnumerator instead. This allows us to avoid the try-finally block 
15998         and the boxing.
15999
16000 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
16001
16002         * cs-parser.jay: Attributes cannot be applied to
16003                          namespaces. Fixes #40473
16004
16005 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16006
16007         * class.cs:
16008         (Add*): check if the name is valid using the full name for constants,
16009         fields, properties and events.
16010
16011 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
16012
16013         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
16014         char constants to be part of the enumeration.
16015
16016         * expression.cs (Conditional.DoResolve): Add support for operator
16017         true. Implements the missing functionality from 14.12
16018
16019         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
16020         operator true/false as required by the spec.
16021
16022         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
16023         implicit conversion to boolean.
16024
16025         * statement.cs (Statement.ResolveBoolean): A boolean expression is
16026         also one where the type implements `operator true'. 
16027
16028         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
16029         get an expression that will invoke operator true based on an
16030         expression.  
16031
16032         (GetConversionOperators): Removed the hack that called op_True
16033         here.  
16034
16035         (Expression.ResolveBoolean): Move this from Statement.
16036
16037 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
16038
16039         * ecore.cs (FieldExpr): do not allow initialization of initonly
16040         fields on derived classes
16041
16042 2003-03-13  Martin Baulig  <martin@ximian.com>
16043
16044         * statement.cs (Block.Emit): Call ig.BeginScope() and
16045         ig.EndScope() when compiling with debugging info; call
16046         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
16047
16048 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
16049
16050         * expression.cs (Indexers): Do not construct immediately, allow
16051         for new members to be appended as we go.  Fixes 38143
16052
16053 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16054
16055         * expression.cs: save/restore context when resolving an unchecked
16056         expression.
16057
16058 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
16059
16060         * cfold.cs: Catch division by zero in modulus operator during
16061         constant folding.
16062
16063 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
16064
16065         * interface.cs (Interface.DefineMembers): Avoid defining members
16066         twice. 
16067
16068 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
16069
16070         * driver.cs: handle the +/- options for -noconfig
16071
16072         * statement.cs (Unckeched.Resolve): Also track the state of
16073         unchecked in the Resolve phase.
16074
16075 2003-02-27  Martin Baulig  <martin@ximian.com>
16076
16077         * ecore.cs (Expression.MemberLookup): Don't create a
16078         MethodGroupExpr for something which is not a method.  Fixes #38291.
16079
16080 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
16081
16082         * class.cs (MemberBase.CheckParameters): Also check that the type
16083         is unmanaged if it is a pointer.
16084
16085         * expression.cs (SizeOf.Resolve): Add location information.
16086
16087         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
16088         a managed type is declared.
16089
16090         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
16091         parameter modifiers as well.  Fixes bug 38606
16092
16093         * class.cs: Very sad.  Am backing out the speed up changes
16094         introduced by the ArrayList -> Array in the TypeContainer, as they
16095         were not actually that much faster, and introduced a bug (no error
16096         reports on duplicated methods).
16097
16098         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
16099         source first, this will guarantee that we have a valid expression
16100         before calling in lower levels functions that will require a
16101         resolved object.  Then use this original_source in the
16102         target.ResolveLValue instead of the original source that was
16103         passed to us.
16104
16105         Another change.  Use target.Resolve instead of LValueResolve.
16106         Although we are resolving for LValues, we will let the Assign code
16107         take care of that (it will be called again from Resolve).  This
16108         basically allows code like this:
16109
16110         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
16111         class Y { void A (X x) { x [0] += o; }
16112
16113         The problem was that the indexer was trying to resolve for
16114         set_Item (idx, object o) and never finding one.  The real set_Item
16115         was set_Item (idx, X).  By delaying the process we get the right
16116         semantics. 
16117
16118         Fixes bug 36505
16119
16120 2003-02-23  Martin Baulig  <martin@ximian.com>
16121
16122         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
16123         while calling DoEmit ().
16124
16125         * codegen.cs (EmitContext.Mark): Don't mark locations in other
16126         source files; if you use the #line directive inside a method, the
16127         compiler stops emitting line numbers for the debugger until it
16128         reaches the end of the method or another #line directive which
16129         restores the original file.
16130
16131 2003-02-23  Martin Baulig  <martin@ximian.com>
16132
16133         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
16134
16135 2003-02-23  Martin Baulig  <martin@ximian.com>
16136
16137         * statement.cs (Block.AddChildVariableNames): We need to call this
16138         recursively, not just for our immediate children.
16139
16140 2003-02-23  Martin Baulig  <martin@ximian.com>
16141
16142         * class.cs (Event.Define): Always make the field private, like csc does.
16143
16144         * typemanager.cs (TypeManager.RealMemberLookup): Make events
16145         actually work, fixes bug #37521.
16146
16147 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
16148
16149         * delegate.cs: When creating the various temporary "Parameters"
16150         classes, make sure that we call the ComputeAndDefineParameterTypes
16151         on those new parameters (just like we do with the formal ones), to
16152         allow them to be resolved in the context of the DeclSpace.
16153
16154         This fixes the bug that Dick observed in Bugzilla #38530.
16155
16156 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
16157
16158         * expression.cs (ResolveMemberAccess): When resolving a constant,
16159         do not attempt to pull a constant if the value was not able to
16160         generate a valid constant.
16161
16162         * const.cs (LookupConstantValue): Do not report more errors than required.
16163
16164 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16165
16166         * expression.cs: fixes bug #38328.
16167
16168 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
16169
16170         * class.cs: Changed all the various members that can be part of a
16171         class from being an ArrayList to be an Array of the right type.
16172         During the DefineType type_list, interface_list, delegate_list and
16173         enum_list are turned into types, interfaces, delegates and enums
16174         arrays.  
16175
16176         And during the member population, indexer_list, event_list,
16177         constant_list, field_list, instance_constructor_list, method_list,
16178         operator_list and property_list are turned into their real arrays.
16179
16180         Although we could probably perform this operation earlier, for
16181         good error reporting we need to keep the lists and remove the
16182         lists for longer than required.
16183
16184         This optimization was triggered by Paolo profiling the compiler
16185         speed on the output of `gen-sample-program.pl' perl script. 
16186
16187         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
16188         not crash in methods like MemberLookupFailed that use this field.  
16189
16190         This problem arises when the compiler fails to resolve a type
16191         during interface type definition for example.
16192
16193 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
16194
16195         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
16196         inherit from System.Object, so we have to stop at null, not only
16197         when reaching System.Object.
16198
16199 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
16200
16201         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
16202         DeclaredOnly because the parent indexer might have had a different
16203         name, but did not loop until the top of the hierarchy was reached.
16204
16205         The problem this one fixes is 35492: when a class implemented an
16206         indexer from an interface, we were getting the interface method
16207         (which was abstract) and we were flagging an error (can not invoke
16208         abstract method).
16209
16210         This also keeps bug 33089 functioning, and test-148 functioning.
16211
16212         * typemanager.cs (IsSpecialMethod): The correct way of figuring
16213         out if a method is special is to see if it is declared in a
16214         property or event, or whether it is one of the predefined operator
16215         names.   This should fix correctly #36804.
16216
16217 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
16218
16219         The goal here is to remove the dependency on EmptyCast.Peel ().
16220         Killing it completely.
16221
16222         The problem is that currently in a number of places where
16223         constants are expected, we have to "probe" for an EmptyCast, and
16224         Peel, which is not the correct thing to do, as this will be
16225         repetitive and will likely lead to errors. 
16226
16227         The idea is to remove any EmptyCasts that are used in casts that
16228         can be reduced to constants, so we only have to cope with
16229         constants. 
16230
16231         This bug hunt was triggered by Bug 37363 and the desire to remove
16232         the duplicate pattern where we were "peeling" emptycasts to check
16233         whether they were constants.  Now constants will always be
16234         constants.
16235
16236         * ecore.cs: Use an enumconstant here instead of wrapping with
16237         EmptyCast.  
16238
16239         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
16240         throwing me off.  By handling this we can get rid of a few hacks.
16241
16242         * statement.cs (Switch): Removed Peel() code.
16243
16244 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
16245
16246         * class.cs: Location information for error 508
16247
16248         * expression.cs (New.DoResolve): Add a guard against double
16249         resolution of an expression.  
16250
16251         The New DoResolve might be called twice when initializing field
16252         expressions (see EmitFieldInitializers, the call to
16253         GetInitializerExpression will perform a resolve on the expression,
16254         and later the assign will trigger another resolution
16255
16256         This leads to bugs (#37014)
16257
16258         * delegate.cs: The signature for EndInvoke should contain any ref
16259         or out parameters as well.  We were not doing this in the past. 
16260
16261         * class.cs (Field.Define): Do not overwrite the type definition
16262         inside the `volatile' group.  Turns out that volatile enumerations
16263         were changing the type here to perform a validity test, which
16264         broke conversions. 
16265
16266 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
16267
16268         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
16269         and structs, we do not want to load the instance variable
16270
16271         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
16272         enum_type has to be handled like an object reference (implicit
16273         conversions exists from this to object), but the regular IsClass
16274         and IsValueType tests will never return true for this one.
16275
16276         Also we use TypeManager.IsValueType instead of type.IsValueType,
16277         just for consistency with the rest of the code (this is only
16278         needed if we ever use the construct exposed by test-180.cs inside
16279         corlib, which we dont today).
16280
16281 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
16282
16283         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
16284         just InternalCall.
16285
16286 2003-02-09  Martin Baulig  <martin@ximian.com>
16287
16288         * namespace.cs (Namespace..ctor): Added SourceFile argument.
16289         (Namespace.DefineNamespaces): New static public method; this is
16290         called when we're compiling with debugging to add all namespaces
16291         to the symbol file.
16292
16293         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
16294         pass it to the Namespace's .ctor.
16295
16296         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
16297         and MethodBase arguments; pass the namespace ID to the symwriter;
16298         pass the MethodBase instead of the token to the symwriter.
16299         (SymbolWriter.DefineNamespace): New method to add a namespace to
16300         the symbol file.
16301
16302 2003-02-09  Martin Baulig  <martin@ximian.com>
16303
16304         * symbolwriter.cs: New file.  This is a wrapper around
16305         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
16306         methods here in near future.
16307
16308 2003-02-09  Martin Baulig  <martin@ximian.com>
16309
16310         * codegen.cs (EmitContext.Mark): Just pass the arguments to
16311         ILGenerator.MarkSequencePoint() which are actually used by the
16312         symbol writer.
16313
16314 2003-02-09  Martin Baulig  <martin@ximian.com>
16315
16316         * location.cs (SourceFile): New public sealed class.  This
16317         contains the name and an index which is used in the location's token.
16318         (Location): Reserve an appropriate number of bits in the token for
16319         the source file instead of walking over that list, this gives us a
16320         really huge performance improvement when compiling with debugging.
16321
16322         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
16323         `SourceFile' argument instead of a string.
16324         (Driver.ProcessFile): Add all the files via Location.AddFile(),
16325         but don't parse/tokenize here, we need to generate the list of all
16326         source files before we do that.
16327         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
16328         the files.
16329
16330         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
16331         instead of a string.
16332
16333         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
16334         of a string.
16335
16336 2003-02-09  Martin Baulig  <martin@ximian.com>
16337
16338         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
16339         filename on `#line default'.
16340
16341 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
16342
16343         * statement.cs: don't clear the pinned var when the fixed statement
16344         returns from the method (fixes bug#37752).
16345
16346 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
16347
16348         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
16349         to IsValueType.
16350
16351 2003-02-07  Martin Baulig  <martin@ximian.com>
16352
16353         * driver.cs: Removed the `--debug-args' command line argument.
16354
16355         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
16356         automatically by the AsssemblyBuilder.
16357         (CodeGen.InitializeSymbolWriter): We don't need to call any
16358         initialization function on the symbol writer anymore.  This method
16359         doesn't take any arguments.
16360
16361 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
16362
16363         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
16364         from referenced assemblies as well.
16365
16366 2003-02-02  Martin Baulig  <martin@ximian.com>
16367
16368         * class.cs (MethodData.Emit): Generate debugging info for external methods.
16369
16370 2003-02-02  Martin Baulig  <martin@ximian.com>
16371
16372         * class.cs (Constructor.Emit): Open the symbol writer before
16373         emitting the constructor initializer.
16374         (ConstructorInitializer.Emit): Call ec.Mark() to allow
16375         single-stepping through constructor initializers.
16376
16377 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
16378
16379         * class.cs: Handle error 549: do not allow virtual methods in
16380         sealed classes. 
16381
16382 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
16383
16384         * decl.cs: Check access levels when resolving types
16385
16386 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
16387
16388         * statement.cs: Add parameters and locals set in catch blocks that might 
16389         return to set vector
16390
16391 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
16392
16393         * class.cs (Operator): Set the SpecialName flags for operators.
16394
16395         * expression.cs (Invocation.DoResolve): Only block calls to
16396         accessors and operators on SpecialName methods.
16397
16398         (Cast.TryReduce): Handle conversions from char constants.
16399
16400
16401 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
16402
16403         * statement.cs: small memory and time optimization in FlowBranching.
16404
16405 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
16406
16407         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
16408         problem that the last fix but in the other sid (Set).
16409
16410         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
16411         access when there is no indexer in the hierarchy.
16412
16413 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
16414
16415         * class.cs: Combine some if statements.
16416
16417 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16418
16419         * driver.cs: fixed bug #37187.
16420
16421 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
16422
16423         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
16424         any indexer, it's needed to build a list with all the indexers in the
16425         hierarchy (AllGetters), else we have problems. Fixes #35653.
16426
16427 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
16428
16429         * class.cs (MethodData.Define): It is wrong for an interface
16430         implementation to be static in both cases: explicit and implicit.
16431         We were only handling this in one case.
16432
16433         Improve the if situation there to not have negations.
16434
16435         * class.cs (Field.Define): Turns out that we do not need to check
16436         the unsafe bit on field definition, only on usage.  Remove the test.
16437
16438 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16439
16440         * driver.cs: use assembly.Location instead of Codebase (the latest
16441         patch made mcs fail when using MS assemblies).
16442
16443 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
16444
16445         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
16446         get the path to *corlib.dll.
16447
16448 2003-01-21  Nick Drochak <ndrochak@gol.com>
16449
16450         * cs-tokenizer.cs:
16451         * pending.cs:
16452         * typemanager.cs: Remove compiler warnings
16453
16454 2003-01-20  Duncan Mak  <duncan@ximian.com>
16455
16456         * AssemblyInfo.cs: Bump the version number to 0.19.
16457
16458 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16459
16460         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
16461
16462 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
16463
16464         * class.cs (Constructor::Emit): Emit debugging info for constructors.
16465
16466 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
16467
16468         * cs-parser.jay: Small fix: we were not comparing the constructor
16469         name correctly.   Thanks to Zoltan for the initial pointer.
16470
16471 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
16472
16473         * cs-tokenizer.cs: Set file name when specified with #line
16474
16475 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
16476
16477         * cs-parser.jay: Only perform the constructor checks here if we
16478         are named like the class;  This will help provider a better
16479         error.  The constructor path is taken when a type definition is
16480         not found, but most likely the user forgot to add the type, so
16481         report that rather than the constructor error.
16482
16483 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
16484
16485         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
16486         allocations.
16487
16488 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16489
16490         * cs-parser.jay: Add cleanup call.
16491
16492 2003-01-13  Duncan Mak  <duncan@ximian.com>
16493
16494         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
16495         consistent with other methods.
16496
16497 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16498
16499         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
16500
16501 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
16502
16503         * attribute.cs: only set GuidAttr to true when we have a
16504         GuidAttribute.
16505
16506 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16507
16508         * ecore.cs:
16509         * expression.cs:
16510         * typemanager.cs: fixes to allow mcs compile corlib with the new
16511         Type.IsSubclassOf fix.
16512
16513 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
16514
16515         * expression.cs (LocalVariableReference.DoResolve): Classify a
16516         constant as a value, not as a variable.   Also, set the type for
16517         the variable.
16518
16519         * cs-parser.jay (fixed_statement): take a type instead of a
16520         pointer_type, so we can produce a better error message later.
16521
16522         * statement.cs (Fixed.Resolve): Flag types that are not pointers
16523         as an error.  
16524
16525         (For.DoEmit): Make inifinite loops have a
16526         non-conditional branch back.
16527
16528         (Fixed.DoEmit): First populate the pinned variables, then emit the
16529         statement, then clear the variables.  Before I was emitting the
16530         code once for each fixed piece.
16531
16532
16533 2003-01-08  Martin Baulig  <martin@ximian.com>
16534
16535         * statement.cs (FlowBranching.MergeChild): A break in a
16536         SWITCH_SECTION does not leave a loop.  Fixes #36155.
16537
16538 2003-01-08  Martin Baulig  <martin@ximian.com>
16539
16540         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16541         lives in the same number space than `param_map'.  Fixes #36154.
16542
16543 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
16544
16545         * cs-parser.jay (constructor_declaration): Set the
16546         Constructor.ModFlags before probing for it.  This makes the
16547         compiler report 514, 515 and 132 (the code was there, but got
16548         broken). 
16549
16550         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16551         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16552         (GotoCase.Resolve): Set `Returns' to ALWAYS.
16553
16554 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16555
16556         * enum.cs: create the enum static fields using the enum type.
16557
16558 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16559
16560         * class.cs: don't try to create the ParamBuilder for the return
16561         type if it's not needed (and handle it breaking for the ms runtime
16562         anyway).
16563
16564 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16565
16566         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16567
16568 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
16569
16570         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16571         the command.   This showed up while compiling the JANET source
16572         code, which used \r as its only newline separator.
16573
16574 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
16575
16576         * class.cs (Method.Define): If we are an operator (because it
16577         reuses our code), then set the SpecialName and HideBySig.  #36128
16578
16579 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
16580
16581         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16582         exception, report error 120 `object reference required'.
16583
16584         * driver.cs: Add --pause option, used during to measure the size
16585         of the process as it goes with --timestamp.
16586
16587         * expression.cs (Invocation.DoResolve): Do not allow methods with
16588         SpecialName to be invoked.
16589
16590 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
16591
16592         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16593         number before adding it.
16594
16595 2002-12-21  Ravi Pratap  <ravi@ximian.com>
16596
16597         * ecore.cs (StandardImplicitConversion): When in an unsafe
16598         context, we allow conversion between void * to any other pointer
16599         type. This fixes bug #35973.
16600
16601 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16602
16603         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16604         is not thrown when extensionless outputs are used 
16605
16606 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16607
16608         * rootcontext.cs: fixed compilation of corlib.
16609
16610 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
16611
16612         * attribute.cs (Attributes.Contains): Add new method.
16613
16614         * class.cs (MethodCore.LabelParameters): if the parameter is an
16615         `out' parameter, check that no attribute `[In]' has been passed.
16616
16617         * enum.cs: Handle the `value__' name in an enumeration.
16618
16619 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
16620
16621         * decl.cs: Added special case to allow overrides on "protected
16622         internal" methods
16623
16624 2002-12-18  Ravi Pratap  <ravi@ximian.com>
16625
16626         * attribute.cs (Attributes.AddAttributeSection): Rename to this
16627         since it makes much more sense.
16628
16629         (Attributes.ctor): Don't require a Location parameter.
16630
16631         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16632
16633         * attribute.cs (ApplyAttributes): Remove extra Location parameters
16634         since we already have that information per attribute.
16635
16636         * everywhere : make appropriate changes.
16637
16638         * class.cs (LabelParameters): Write the code which actually
16639         applies attributes to the return type. We can't do this on the MS
16640         .NET runtime so we flag a warning in the case an exception is
16641         thrown.
16642
16643 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
16644
16645         * const.cs: Handle implicit null conversions here too.
16646
16647 2002-12-17  Ravi Pratap  <ravi@ximian.com>
16648
16649         * class.cs (MethodCore.LabelParameters): Remove the extra
16650         Type [] parameter since it is completely unnecessary. Instead
16651         pass in the method's attributes so that we can extract
16652         the "return" attribute.
16653
16654 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
16655
16656         * cs-parser.jay (parse): Use Report.Error to flag errors instead
16657         of ignoring it and letting the compile continue.
16658
16659         * typemanager.cs (ChangeType): use an extra argument to return an
16660         error condition instead of throwing an exception.
16661
16662 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
16663
16664         * expression.cs (Unary.TryReduce): mimic the code for the regular
16665         code path.  Perform an implicit cast in the cases where we can
16666         implicitly convert to one of the integral types, and then reduce
16667         based on that constant.   This fixes bug #35483.
16668
16669 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16670
16671         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16672
16673 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16674
16675         * namespace.cs: fixed bug #35489.
16676
16677 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
16678
16679         * class.cs: Remove some dead code.
16680
16681         * cs-parser.jay: Estimate the number of methods needed
16682         (RootContext.MethodCount);
16683
16684         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16685         numbers instead of StringBuilders.
16686
16687         * support.cs (PtrHashtable): Add constructor with initial size;
16688         We can now reduce reallocations of the method table.
16689
16690 2002-12-10  Ravi Pratap  <ravi@ximian.com>
16691
16692         * attribute.cs (ApplyAttributes): Keep track of the emitted
16693         attributes on a per-target basis. This fixes bug #35413.
16694
16695 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
16696
16697         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16698         default to the Windows 1252 encoding.
16699
16700         (UnixParseOption): Support version, thanks to Alp for the missing
16701         pointer. 
16702
16703         * AssemblyInfo.cs: Add nice assembly information.
16704
16705         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16706         (bug 35169).
16707
16708         * cs-parser.jay: Allow a trailing comma before the close bracked
16709         in the attribute_section production.
16710
16711         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16712         address of the instance was being taken, I will take this out,
16713         because we take the address of the object immediately here.
16714
16715 2002-12-09  Ravi Pratap  <ravi@ximian.com>
16716
16717         * typemanager.cs (AreMultipleAllowed): Take care of the most
16718         obvious case where attribute type is not in the current assembly -
16719         stupid me ;-)
16720
16721 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
16722
16723         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16724         definitions, instead of doing that afterwards.  
16725
16726         Also we use a nice little hack, depending on the constructor, we
16727         know if we are a "composed" name or a simple name.  Hence, we
16728         avoid the IndexOf test, and we avoid 
16729
16730         * codegen.cs: Add code to assist in a bug reporter to track down
16731         the source of a compiler crash. 
16732
16733 2002-12-07  Ravi Pratap  <ravi@ximian.com>
16734
16735         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16736         types have been emitted for a given element and flag an error
16737         if something which does not have AllowMultiple set is used more
16738         than once.
16739
16740         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16741         attribute types and their corresponding AllowMultiple properties
16742
16743         (AreMultipleAllowed): Check the property for a given type.
16744
16745         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16746         property in the case we have a TypeContainer.
16747
16748         (Attributes.AddAttribute): Detect duplicates and just skip on
16749         adding them. This trivial fix catches a pretty gross error in our
16750         attribute emission - global attributes were being emitted twice!
16751
16752         Bugzilla bug #33187 is now fixed.
16753
16754 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
16755
16756         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16757         instead of pp_and).
16758
16759         * expression.cs (Binary.ResolveOperator): I can only use the
16760         Concat (string, string, string) and Concat (string, string,
16761         string, string) if the child is actually a concatenation of
16762         strings. 
16763
16764 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
16765
16766         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16767         context where we need a 2-character lookahead.
16768
16769         * pending.cs (PendingImplementation): Rework so we can keep track
16770         of interface types all the time, and flag those which were
16771         implemented by parents as optional.
16772
16773 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
16774
16775         * expression.cs (Binary.ResolveOperator): Use
16776         String.Concat(string,string,string) or
16777         String.Concat(string,string,string,string) when possible. 
16778
16779         * typemanager: More helper methods.
16780
16781
16782 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16783
16784         * pending.cs: remove the bogus return from GetMissingInterfaces()
16785         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16786
16787 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16788
16789         * namespace.cs: avoid duplicated 'using xxx' being added to
16790         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16791         when we get more than one 'using' statement for the same namespace.
16792         Report a CS0105 warning for it.
16793
16794 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
16795
16796         * cs-tokenizer.cs (consume_identifier): use read directly, instead
16797         of calling getChar/putback, uses internal knowledge of it.    
16798
16799         (xtoken): Reorder tokenizer so most common patterns are checked
16800         first.  This reduces the compilation time in another 5% (from 8.11s
16801         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16802
16803         The parsing time is 22% of the compilation in mcs, and from that
16804         64% is spent on the tokenization process.  
16805
16806         I tried using a binary search for keywords, but this is slower
16807         than the hashtable.  Another option would be to do a couple of
16808         things:
16809
16810                 * Not use a StringBuilder, instead use an array of chars,
16811                   with a set value.  Notice that this way we could catch
16812                   the 645 error without having to do it *afterwards*.
16813
16814                 * We could write a hand-parser to avoid the hashtable
16815                   compares altogether.
16816
16817         The identifier consumption process takes 37% of the tokenization
16818         time.  Another 15% is spent on is_number.  56% of the time spent
16819         on is_number is spent on Int64.Parse:
16820
16821                 * We could probably choose based on the string length to
16822                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
16823                   computations. 
16824
16825         Another 3% is spend on wrapping `xtoken' in the `token' function.
16826
16827         Handle 0xa0 as whitespace (#34752)
16828
16829 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
16830
16831         * typemanager.cs (IsCLRType): New routine to tell whether a type
16832         is one of the builtin types.  
16833
16834         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
16835         typecode in more places instead of doing pointer comparissions.
16836         We could leverage some knowledge about the way the typecodes are
16837         laid out.
16838
16839         New code to cache namespaces in assemblies, it is currently not
16840         invoked, to be used soon.
16841
16842         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16843
16844         * expression.cs (Binary.ResolveOperator): specially handle
16845         strings, and do not perform user-defined operator overloading for
16846         built-in types.
16847
16848 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
16849
16850         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16851         internalcall as it is a pretty simple operation;  Avoid whenever
16852         possible to call Char.IsLetter.
16853
16854         (consume_identifier): Cut by half the number of
16855         hashtable calls by merging the is_keyword and GetKeyword behavior.
16856
16857         Do not short-circuit, because if we do, we
16858         report errors (ie, #if false && true would produce an invalid
16859         directive error);
16860
16861
16862 2002-11-24  Martin Baulig  <martin@ximian.com>
16863
16864         * expression.cs (Cast.TryReduce): If we're in checked syntax,
16865         check constant ranges and report a CS0221.  Fixes #33186.
16866
16867 2002-11-24  Martin Baulig  <martin@ximian.com>
16868
16869         * cs-parser.jay: Make this work for uninitialized variable
16870         declarations in the `for' initializer.  Fixes #32416.
16871
16872 2002-11-24  Martin Baulig  <martin@ximian.com>
16873
16874         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16875         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
16876
16877 2002-11-24  Martin Baulig  <martin@ximian.com>
16878
16879         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16880         argument; if true, we also check for user-defined conversions.
16881         This is only needed if both arguments are of a user-defined type.
16882         Fixes #30443, added test-175.cs.
16883         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16884
16885         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16886
16887 2002-11-24  Martin Baulig  <martin@ximian.com>
16888
16889         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16890         function to get the store opcode.
16891         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16892         only emit the Ldelema if the store opcode is Stobj.  You must run
16893         both test-34 and test-167 to test this.  Fixes #34529.
16894
16895 2002-11-23  Martin Baulig  <martin@ximian.com>
16896
16897         * ecore.cs (Expression.MemberLookup): Added additional
16898         `qualifier_type' argument which is used when we're being called
16899         from MemberAccess.DoResolve() and null if we're called from a
16900         SimpleName lookup.
16901         (Expression.MemberLookupFailed): New method to report errors; this
16902         does the CS1540 check and reports the correct error message.
16903
16904         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16905         argument for the CS1540 check and redone the way how we're dealing
16906         with private members.  See the comment in the source code for details.
16907         (FilterWithClosure): Reverted this back to revision 1.197; renamed
16908         `closure_start_type' to `closure_qualifier_type' and check whether
16909         it's not null.  It was not this filter being broken, it was just
16910         being called with the wrong arguments.
16911
16912         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16913         and pass it the correct `qualifier_type'; this also does the error
16914         handling for us.
16915
16916 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
16917
16918         * expression.cs (Invocation.EmitParams): If the we are dealing
16919         with a non-built-in value type, load its address as well.
16920
16921         (ArrayCreation): Use a a pretty constant instead
16922         of the hardcoded value 2.   Use 6 instead of 2 for the number of
16923         static initializers.  
16924
16925         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16926         because they are not really value types, just glorified integers. 
16927
16928         * driver.cs: Do not append .exe, the CSC compiler does not do it.
16929
16930         * ecore.cs: Remove redundant code for enumerations, make them use
16931         the same code path as everything else, fixes the casting issue
16932         with enumerations in Windows.Forms.
16933
16934         * attribute.cs: Do only cast to string if it is a string, the
16935         validation happens later.
16936
16937         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16938         people upgrade their corlibs.
16939
16940         * ecore.cs: Oops, enumerations were not following the entire code path
16941
16942 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
16943
16944         * typemanager.cs (FilterWithClosure): Commented out the test for
16945         1540 in typemanager.cs, as it has problems when accessing
16946         protected methods from a parent class (see test-174.cs). 
16947
16948         * attribute.cs (Attribute.ValidateGuid): new method.
16949         (Attribute.Resolve): Use above.
16950
16951 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
16952
16953         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16954
16955         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16956         handling for enumerations, as we only needed the TypeContainer
16957         functionality to begin with (this is required for the fix below to
16958         work for enums that reference constants in a container class for
16959         example). 
16960
16961         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16962
16963         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16964         a valid TypeBuilder to perform lookups on.o
16965
16966         * class.cs (InheritableMemberSignatureCompare): Use true in the
16967         call to GetGetMethod and GetSetMethod, because we are comparing
16968         the signature, and we need to get the methods *even* if they are
16969         private. 
16970
16971         (PropertyBase.CheckBase): ditto.
16972
16973         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16974         GotoCase.Resolve): Use Peel on EmpytCasts.
16975
16976         * ecore.cs (EmptyCast): drop child, add Peel method.
16977
16978 2002-11-17  Martin Baulig  <martin@ximian.com>
16979
16980         * ecore.cs (EmptyCast.Child): New public property.
16981
16982         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16983         label resolved to an EmptyCast.  Fixes #34162.
16984         (GotoCase.Resolve): Likewise.
16985         (Block.EmitMeta): Likewise.
16986
16987 2002-11-17  Martin Baulig  <martin@ximian.com>
16988
16989         * expression.cs (Invocation.BetterConversion): Prefer int over
16990         uint; short over ushort; long over ulong for integer literals.
16991         Use ImplicitConversionExists instead of StandardConversionExists
16992         since we also need to check for user-defined implicit conversions.
16993         Fixes #34165.  Added test-173.cs.
16994
16995 2002-11-16  Martin Baulig  <martin@ximian.com>
16996
16997         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16998         with the `true' and `false' literals.  Fixes #33151.
16999
17000 2002-11-16  Martin Baulig  <martin@ximian.com>
17001
17002         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
17003         October 22nd; don't do the cs1540 check for static members.
17004
17005         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
17006         now using our own filter here and doing the cs1540 check again.
17007
17008 2002-11-16  Martin Baulig  <martin@ximian.com>
17009
17010         * support.cs (InternalParameters): Don't crash if we don't have
17011         any fixed parameters.  Fixes #33532.
17012
17013 2002-11-16  Martin Baulig  <martin@ximian.com>
17014
17015         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
17016         when looking up static methods to make this work on Windows.
17017         Fixes #33773.
17018
17019 2002-11-16  Martin Baulig  <martin@ximian.com>
17020
17021         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
17022         a setter rather than using PropertyInfo.CanWrite.
17023
17024 2002-11-15  Nick Drochak  <ndrochak@gol.com>
17025
17026         * class.cs: Allow acces to block member by subclasses. Fixes build
17027         breaker.
17028
17029 2002-11-14  Martin Baulig  <martin@ximian.com>
17030
17031         * class.cs (Constructor.Emit): Added the extern/block check.
17032         Fixes bug #33678.
17033
17034 2002-11-14  Martin Baulig  <martin@ximian.com>
17035
17036         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
17037         iteration while looking for indexers, this is needed because the
17038         indexer may have a different name in our base classes.  Fixed the
17039         error reporting (no indexers at all, not get accessor, no
17040         overloaded match).  Fixes bug #33089.
17041         (IndexerAccess.DoResolveLValue): Likewise.
17042
17043 2002-11-14  Martin Baulig  <martin@ximian.com>
17044
17045         * class.cs (PropertyBase.CheckBase): Make this work for multiple
17046         indexers.  Fixes the first part of bug #33089.
17047         (MethodSignature.InheritableMemberSignatureCompare): Added support
17048         for properties.
17049
17050 2002-11-13  Ravi Pratap  <ravi@ximian.com>
17051
17052         * attribute.cs (Attribute.Resolve): Catch the
17053         NullReferenceException and report it since it isn't supposed to
17054         happen. 
17055
17056 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
17057
17058         * expression.cs (Binary.EmitBranchable): Also handle the cases for
17059         LogicalOr and LogicalAnd that can benefit from recursively
17060         handling EmitBranchable.  The code now should be nice for Paolo.
17061
17062 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
17063
17064         * typemanager.cs (LookupType): Added a negative-hit hashtable for
17065         the Type lookups, as we perform quite a number of lookups on
17066         non-Types.  This can be removed once we can deterministically tell
17067         whether we have a type or a namespace in advance.
17068
17069         But this might require special hacks from our corlib.
17070
17071         * TODO: updated.
17072
17073         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
17074         and double which avoids a conversion from an integer to a double.
17075
17076         * expression.cs: tiny optimization, avoid calling IsConstant,
17077         because it effectively performs the lookup twice.
17078
17079 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
17080
17081         But a bogus return here to keep the semantics of the old code
17082         until the Mono runtime is fixed.
17083
17084         * pending.cs (GetMissingInterfaces): New method used to remove all
17085         the interfaces that are already implemented by our parent
17086         classes from the list of pending methods. 
17087
17088         * interface.cs: Add checks for calls after ResolveTypeExpr.
17089
17090 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
17091
17092         * class.cs (Class.Emit): Report warning 67: event not used if the
17093         warning level is beyond 3.
17094
17095         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
17096         being a NullLiteral.
17097
17098         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
17099         specifiers. 
17100
17101         * class.cs (TypeContainer.GetClassBases): Cover a missing code
17102         path that might fail if a type can not be resolved.
17103
17104         * expression.cs (Binary.Emit): Emit unsigned versions of the
17105         operators. 
17106
17107         * driver.cs: use error 5.
17108
17109 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
17110
17111         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
17112
17113 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
17114
17115         * cs-parser.jay (switch_section): A beautiful patch from Martin
17116         Baulig that fixed 33094.
17117
17118 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
17119
17120         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
17121         Check whether the base is abstract and report an error if so.
17122
17123         * expression.cs (IndexerAccess.DoResolveLValue,
17124         IndexerAccess.DoResolve): ditto. 
17125
17126         (Invocation.DoResolve): ditto.
17127
17128         (Invocation.FullMethodDesc): Improve the report string.
17129
17130         * statement.cs (Block): Eliminate IsVariableDefined as it is
17131         basically just a wrapper for GetVariableInfo.
17132
17133         * ecore.cs (SimpleName): Use new 
17134
17135         * support.cs (ReflectionParamter.ParameterType): We unwrap the
17136         type, as we return the actual parameter ref/unref state on a
17137         different call.
17138
17139 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
17140
17141         * support.cs: Return proper flags REF/OUT fixing the previous
17142         commit.  
17143
17144         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
17145         not used to mean `ref' but `ref or out' in ParameterReference
17146
17147         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
17148         full type signature instead of calling TypeManger.CSharpName
17149         ourselves. 
17150
17151         * support.cs (InternalParameters.ParameterDesc): Do not compare
17152         directly to the modflags, because REF/OUT will actually be bitsets
17153         if set. 
17154
17155         * delegate.cs (VerifyMethod): Check also the modifiers.
17156
17157         * cs-tokenizer.cs: Fix bug where floating point values with an
17158         exponent where a sign was missing was ignored.
17159
17160         * driver.cs: Allow multiple assemblies to be specified in a single
17161         /r: argument
17162
17163 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
17164
17165         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
17166         because identifiers after a parenthesis would end up in this kind
17167         of production, and we needed to desamiguate it for having casts
17168         like:
17169
17170                 (UserDefinedType *) xxx
17171
17172 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
17173
17174         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
17175         we should set on the Bindingflags.NonPublic, but not turn on
17176         private_ok.  private_ok controls whether a Private member is
17177         returned (this is chekced on the filter routine), while the
17178         BindingFlags.NonPublic just controls whether private/protected
17179         will be allowed.   This fixes the problem part of the problem of
17180         private properties being allowed to be used in derived classes.
17181
17182         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
17183         so we can call the children DoResolveLValue method (this will
17184         properly signal errors on lvalue assignments to base properties)
17185
17186         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
17187         getter are null, and we have a property info, we know that this
17188         happened because the lookup failed, so we report an error 122 for
17189         protection level violation.
17190
17191         We also silently return if setter and getter are null in the
17192         resolve functions, this condition only happens if we have flagged
17193         the error before.  This is the other half of the problem. 
17194
17195         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
17196         not have accessibility information, that is why we were returning
17197         true in the filter function in typemanager.cs.
17198
17199         To properly report 122 (property is inaccessible because of its
17200         protection level) correctly, we report this error in ResolveAccess
17201         by failing if both the setter and the getter are lacking (ie, the
17202         lookup failed). 
17203
17204         DoResolve and DoLResolve have been modified to check for both
17205         setter/getter being null and returning silently, the reason being
17206         that I did not want to put the knowledge about this error in upper
17207         layers, like:
17208
17209         int old = Report.Errors;
17210         x = new PropertyExpr (...);
17211         if (old != Report.Errors)
17212                 return null;
17213         else
17214                 return x;
17215
17216         So the property expr is returned, but it is invalid, so the error
17217         will be flagged during the resolve process. 
17218
17219         * class.cs: Remove InheritablePropertySignatureCompare from the
17220         class, as we no longer depend on the property signature to compute
17221         whether it is possible to implement a method or not.
17222
17223         The reason is that calling PropertyInfo.GetGetMethod will return
17224         null (in .NET, in Mono it works, and we should change this), in
17225         cases where the Get Method does not exist in that particular
17226         class.
17227
17228         So this code:
17229
17230         class X { public virtual int A { get { return 1; } } }
17231         class Y : X { }
17232         class Z : Y { public override int A { get { return 2; } } }
17233
17234         Would fail in Z because the parent (Y) would not have the property
17235         defined.  So we avoid this completely now (because the alternative
17236         fix was ugly and slow), and we now depend exclusively on the
17237         method names.
17238
17239         (PropertyBase.CheckBase): Use a method-base mechanism to find our
17240         reference method, instead of using the property.
17241
17242         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
17243         routines are gone now.
17244
17245         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
17246         names, they were incorrectly named.
17247
17248         * cs-tokenizer.cs: Return are more gentle token on failure. 
17249
17250         * pending.cs (PendingImplementation.InterfaceMethod): This routine
17251         had an out-of-sync index variable, which caused it to remove from
17252         the list of pending methods the wrong method sometimes.
17253
17254 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
17255
17256         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
17257         CanWrite, because those refer to this particular instance of the
17258         property, and do not take into account the fact that we can
17259         override single members of a property.
17260
17261         Constructor requires an EmitContext.  The resolution process does
17262         not happen here, but we need to compute the accessors before,
17263         because the resolution does not always happen for properties.
17264
17265         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
17266         subclass, before we did not update this flag, but we did update
17267         bindingflags. 
17268
17269         (GetAccessors): Drop this routine, as it did not work in the
17270         presence of partially overwritten set/get methods. 
17271
17272         Notice that this broke the cs1540 detection, but that will require
17273         more thinking. 
17274
17275 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17276
17277         * class.cs:
17278         * codegen.cs:
17279         * driver.cs: issue a warning instead of an error if we don't support
17280         debugging for the platform. Also ignore a couple of errors that may
17281         arise when trying to write the symbols. Undo my previous patch.
17282
17283 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17284
17285         * driver.cs: ignore /debug switch except for Unix platforms.
17286
17287 2002-10-23  Nick Drochak  <ndrochak@gol.com>
17288
17289         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
17290
17291 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
17292
17293         * driver.cs: Do not make mcs-debug conditional, so we do not break
17294         builds that use it.
17295
17296         * statement.cs (UsageVector.MergeChildren): I would like Martin to
17297         review this patch.  But basically after all the children variables
17298         have been merged, the value of "Breaks" was not being set to
17299         new_breaks for Switch blocks.  I think that it should be set after
17300         it has executed.  Currently I set this to the value of new_breaks,
17301         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
17302         conservative, but I do not understand this code very well.
17303
17304         I did not break anything in the build, so that is good ;-)
17305
17306         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
17307
17308 2002-10-20  Mark Crichton  <crichton@gimp.org>
17309
17310         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
17311
17312 2002-10-20  Nick Drochak  <ndrochak@gol.com>
17313
17314         * cfold.cs: Fixed compile blocker.
17315
17316 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
17317
17318         * driver.cs: I was chekcing the key, not the file.
17319
17320 2002-10-19  Ravi Pratap  <ravi@ximian.com>
17321
17322         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
17323         message that we were generating - we just need to silently return
17324         a null.
17325
17326 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
17327
17328         * class.cs (Event.Define): Change my previous commit, as this
17329         breaks the debugger.  This is a temporary hack, as it seems like
17330         the compiler is generating events incorrectly to begin with.
17331
17332         * expression.cs (Binary.ResolveOperator): Added support for 
17333         "U operator - (E x, E y)"
17334
17335         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
17336         y)".
17337
17338         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
17339         init-only variables, but this path did not take into account that
17340         there might be also instance readonly variables.  Correct this
17341         problem. 
17342
17343         This fixes bug 32253
17344
17345         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
17346         delegates as well.
17347
17348         * driver.cs: Change the extension for modules to `netmodule'
17349
17350         * cs-parser.jay: Improved slightly the location tracking for
17351         the debugger symbols.
17352
17353         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
17354         modifiers that were specified instead of the hardcoded value
17355         (FamAndAssem).  This was basically ignoring the static modifier,
17356         and others.  Fixes 32429.
17357
17358         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
17359         fixed a bug in the process (32476)
17360
17361         * expression.cs (ArrayAccess.EmitAssign): Patch from
17362         hwang_rob@yahoo.ca that fixes bug 31834.3
17363
17364 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
17365
17366         * driver.cs: Make the module extension .netmodule.
17367
17368 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
17369
17370         * driver.cs: Report an error if the resource file is not found
17371         instead of crashing.
17372
17373         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
17374         false, like Emit does.
17375
17376 2002-10-16  Nick Drochak  <ndrochak@gol.com>
17377
17378         * typemanager.cs: Remove unused private member.  Also reported mcs
17379         bug to report this as a warning like csc.
17380
17381 2002-10-15  Martin Baulig  <martin@gnome.org>
17382
17383         * statement.cs (Statement.Emit): Made this a virtual method; emits
17384         the line number info and calls DoEmit().
17385         (Statement.DoEmit): New protected abstract method, formerly knows
17386         as Statement.Emit().
17387
17388         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
17389
17390 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
17391
17392         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
17393         have fixed a remaining problem: not every AddXXXX was adding a
17394         fully qualified name.  
17395
17396         Now everyone registers a fully qualified name in the DeclSpace as
17397         being defined instead of the partial name.  
17398
17399         Downsides: we are slower than we need to be due to the excess
17400         copies and the names being registered this way.  
17401
17402         The reason for this is that we currently depend (on the corlib
17403         bootstrap for instance) that types are fully qualified, because
17404         we dump all the types in the namespace, and we should really have
17405         types inserted into the proper namespace, so we can only store the
17406         basenames in the defined_names array.
17407
17408 2002-10-10  Martin Baulig  <martin@gnome.org>
17409
17410         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
17411         from bug #31834, see the bug report for a testcase which is
17412         miscompiled.
17413
17414 2002-10-10  Martin Baulig  <martin@gnome.org>
17415
17416         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
17417         flow analysis code for this.
17418
17419         * statement.cs (Do, While, For): Tell the flow analysis code about
17420         infinite loops.
17421         (FlowBranching.UsageVector): Added support for infinite loops.
17422         (Block.Resolve): Moved the dead code elimination here and use flow
17423         analysis to do it.
17424
17425 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
17426
17427         * class.cs (Field.Define): Catch cycles on struct type
17428         definitions. 
17429
17430         * typemanager.cs (IsUnmanagedtype): Do not recursively check
17431         fields if the fields are static.  We only need to check instance
17432         fields. 
17433
17434         * expression.cs (As.DoResolve): Test for reference type.
17435
17436         * statement.cs (Using.ResolveExpression): Use
17437         ConvertImplicitRequired, not ConvertImplicit which reports an
17438         error on failture
17439         (Using.ResolveLocalVariableDecls): ditto.
17440
17441         * expression.cs (Binary.ResolveOperator): Report errors in a few
17442         places where we had to.
17443
17444         * typemanager.cs (IsUnmanagedtype): Finish implementation.
17445
17446 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
17447
17448         * expression.cs: Use StoreFromPtr instead of extracting the type
17449         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
17450
17451         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
17452         an enumeration value to a System.Enum, but System.Enum is not a
17453         value type, but an class type, so we need to box.
17454
17455         (Expression.ConvertExplicit): One codepath could return
17456         errors but not flag them.  Fix this.  Fixes #31853
17457
17458         * parameter.cs (Resolve): Do not allow void as a parameter type.
17459
17460 2002-10-06  Martin Baulig  <martin@gnome.org>
17461
17462         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
17463         if it's a class type and not a struct.  Fixes #31815.
17464
17465 2002-10-06  Martin Baulig  <martin@gnome.org>
17466
17467         * statement.cs: Reworked the flow analysis code a bit to make it
17468         usable for dead code elimination.
17469
17470 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17471
17472         * cs-parser.jay: allow empty source files. Fixes bug #31781.
17473
17474 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17475
17476         * expression.cs (ComposedCast.DoResolveType): A quick workaround
17477         to fix the test 165, will investigate deeper.
17478
17479 2002-10-04  Martin Baulig  <martin@gnome.org>
17480
17481         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
17482         finally blocks actually work.
17483         (Try.Resolve): We don't need to create a sibling for `finally' if
17484         there is no finally block.
17485
17486 2002-10-04  Martin Baulig  <martin@gnome.org>
17487
17488         * class.cs (Constructor.Define): The default accessibility for a
17489         non-default constructor is private, not public.
17490
17491 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17492
17493         * class.cs (Constructor): Make AllowedModifiers public, add
17494         EXTERN.
17495
17496         * cs-parser.jay: Perform the modifiers test here, as the
17497         constructor for the Constructor class usually receives a zero
17498         because of the way we create it (first we create, later we
17499         customize, and we were never checking the modifiers).
17500
17501         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
17502         is a version of LookupTypeReflection that includes the type-name
17503         cache.  This can be used as a fast path for functions that know
17504         the fully qualified name and are only calling into *.GetType() to
17505         obtain a composed type.
17506
17507         This is also used by TypeManager.LookupType during its type
17508         composition.
17509
17510         (LookupType): We now also track the real type name, as sometimes
17511         we can get a quey for the real type name from things like
17512         ComposedCast.  This fixes bug 31422.
17513
17514         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
17515         complete type fullname, it does not have to go through the type
17516         resolution system to obtain the composed version of the type (for
17517         obtaining arrays or pointers).
17518
17519         (Conditional.Emit): Use the EmitBoolExpression to
17520         generate nicer code, as requested by Paolo.
17521
17522         (ArrayCreation.CheckIndices): Use the patch from
17523         hwang_rob@yahoo.ca to validate the array initializers. 
17524
17525 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
17526
17527         * class.cs (ConstructorInitializer.Emit): simplify code by using
17528         Invocation.EmitCall, and at the same time, fix the bugs in calling
17529         parent constructors that took variable arguments. 
17530
17531         * ecore.cs (Expression.ConvertNumericExplicit,
17532         Expression.ImplicitNumericConversion): Remove the code that
17533         manually wrapped decimal (InternalTypeConstructor call is now gone
17534         as well).
17535
17536         * expression.cs (Cast.TryReduce): Also handle decimal types when
17537         trying to perform a constant fold on the type.
17538
17539         * typemanager.cs (IsUnmanagedtype): Partially implemented.
17540
17541         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17542         that only turned off an error report, and did nothing else. 
17543
17544 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
17545
17546         * driver.cs: Handle and ignore /fullpaths
17547
17548 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
17549
17550         * expression.cs (Binary.ResolveOperator): Catch the case where
17551         DoNumericPromotions returns true, 
17552
17553         (Binary.DoNumericPromotions): Simplify the code, and the tests.
17554
17555 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
17556
17557         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17558         report error 70.
17559
17560 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
17561
17562         * ecore.cs (ConvertNumericExplicit): It is not enough that the
17563         conversion exists, but it is also required that the conversion be
17564         performed.  This manifested in "(Type64Enum) 2".  
17565
17566         * class.cs (TypeManager.AddMethod): The fix is not to change
17567         AddEnum, because that one was using a fully qualified name (every
17568         DeclSpace derivative does), but to change the AddMethod routine
17569         that was using an un-namespaced name.  This now correctly reports
17570         the duplicated name.
17571
17572         Revert patch until I can properly fix it.  The issue
17573         is that we have a shared Type space across all namespaces
17574         currently, which is wrong.
17575
17576         Options include making the Namespace a DeclSpace, and merge
17577         current_namespace/current_container in the parser.
17578
17579 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
17580
17581         * cs-parser.jay: Improve error reporting when we get a different
17582         kind of expression in local_variable_type and
17583         local_variable_pointer_type. 
17584
17585         Propagate this to avoid missleading errors being reported.
17586
17587         * ecore.cs (ImplicitReferenceConversion): treat
17588         TypeManager.value_type as a target just like object_type.   As
17589         code like this:
17590
17591         ValueType v = 1;
17592
17593         Is valid, and needs to result in the int 1 being boxed before it
17594         is assigned to the value type v.
17595
17596         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17597         to validate the enumeration name.
17598
17599         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17600         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
17601         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17602
17603         * ecore.cs (TryImplicitIntConversion): When doing an
17604         implicit-enumeration-conversion, check if the type is 64-bits and
17605         perform a conversion before passing to EnumConstant.
17606
17607 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
17608
17609         * decl.cs (Error_AmbiguousTypeReference); New routine used to
17610         report ambiguous type references.  Unlike the MS version, we
17611         report what the ambiguity is.   Innovation at work ;-)
17612
17613         (DeclSpace.FindType): Require a location argument to
17614         display when we display an ambiguous error.
17615
17616         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17617
17618         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17619
17620         * expression.cs (EmitDynamicInitializers): Apply patch from
17621         hwang_rob@yahoo.ca that fixes the order in which we emit our
17622         initializers. 
17623
17624 2002-09-21  Martin Baulig  <martin@gnome.org>
17625
17626         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17627         delegate takes no arguments.
17628
17629 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
17630
17631         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17632         from integers.
17633
17634         * expression.cs: Extract the underlying type.
17635
17636         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17637
17638         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17639
17640 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
17641
17642         * class.cs (TypeContainer.DefineType): We can not use the nice
17643         PackingSize with the size set to 1 DefineType method, because it
17644         will not allow us to define the interfaces that the struct
17645         implements.
17646
17647         This completes the fixing of bug 27287
17648
17649         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17650         means also structs.  This fixes part of the problem. 
17651         (Expresion.ImplicitReferenceConversionExists): ditto.
17652
17653         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17654         error if there were no errors reported during the type lookup
17655         process, to avoid duplicates or redundant errors.  Without this
17656         you would get an ambiguous errors plus a type not found.  We have
17657         beaten the user enough with the first error.  
17658
17659         (DeclSparce.FindType): Emit a warning if we have an ambiguous
17660         reference. 
17661
17662         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17663         during the resolution process, stop the lookup, this avoids
17664         repeated error reports (same error twice).
17665
17666         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17667
17668         * typemanager.cs (LookupType): Redo the type lookup code to match
17669         the needs of System.Reflection.  
17670
17671         The issue is that System.Reflection requires references to nested
17672         types to begin with a "+" sign instead of a dot.  So toplevel
17673         types look like: "NameSpace.TopLevelClass", and nested ones look
17674         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17675         levels. 
17676
17677 2002-09-19  Martin Baulig  <martin@gnome.org>
17678
17679         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17680         says that a method always returns or always throws an exception,
17681         don't report the CS0161.
17682
17683         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17684         set `Returns = new_returns'.
17685
17686 2002-09-19  Martin Baulig  <martin@gnome.org>
17687
17688         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17689         to an enum constant, check for a CS0176.
17690
17691 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
17692
17693         * class.cs (TypeContainer.CheckPairedOperators): Now we check
17694         for operators that must be in pairs and report errors.
17695
17696         * ecore.cs (SimpleName.DoResolveType): During the initial type
17697         resolution process, when we define types recursively, we must
17698         check first for types in our current scope before we perform
17699         lookups in the enclosing scopes.
17700
17701         * expression.cs (MakeByteBlob): Handle Decimal blobs.
17702
17703         (Invocation.VerifyArgumentsCompat): Call
17704         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17705         I thought we were supposed to always call this, but there are a
17706         few places in the code where we dont do it.
17707
17708 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
17709
17710         * driver.cs: Add support in -linkres and -resource to specify the
17711         name of the identifier.
17712
17713 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17714
17715         * ecore.cs (StandardConversionExists): Sync with the conversion
17716         code: allow anything-* to void* conversions.
17717
17718         (FindMostSpecificSource): Use an Expression argument
17719         instead of a Type, because we might be handed over a Literal which
17720         gets a few more implicit conversions that plain types do not.  So
17721         this information was being lost.
17722
17723         Also, we drop the temporary type-holder expression when not
17724         required.
17725
17726 2002-09-17  Martin Baulig  <martin@gnome.org>
17727
17728         * class.cs (PropertyBase.CheckBase): Don't check the base class if
17729         this is an explicit interface implementation.
17730
17731 2002-09-17  Martin Baulig  <martin@gnome.org>
17732
17733         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17734         different `IndexerName' attributes.
17735
17736         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17737         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17738         virtual CommonResolve().
17739
17740 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17741
17742         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17743         and convert that to the UnderlyingType.
17744
17745         * statement.cs (Foreach.Resolve): Indexers are just like variables
17746         or PropertyAccesses.
17747
17748         * cs-tokenizer.cs (consume_string): Track line numbers and columns
17749         inside quoted strings, we were not doing this before.
17750
17751 2002-09-16  Martin Baulig  <martin@gnome.org>
17752
17753         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17754         resolve it.  This is needed for the definite assignment check of the
17755         instance expression, fixes bug #29846.
17756         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17757
17758 2002-09-16  Nick Drochak  <ndrochak@gol.com>
17759
17760         * parameter.cs: Fix compile error.  Cannot reference static member
17761         from an instance object.  Is this an mcs bug?
17762
17763 2002-09-14  Martin Baulig  <martin@gnome.org>
17764
17765         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17766         multiple times.  Fixes bug #30295, added test-166.cs.
17767
17768 2002-09-14  Martin Baulig  <martin@gnome.org>
17769
17770         * statement.cs (Block.Emit): Don't emit unreachable code.
17771         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17772         `break' statements.
17773         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17774
17775 2002-09-14  Martin Baulig  <martin@gnome.org>
17776
17777         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17778         is set.
17779
17780 2002-09-14  Martin Baulig  <martin@gnome.org>
17781
17782         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17783         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17784         be false on the ms runtime.
17785
17786 2002-09-13  Martin Baulig  <martin@gnome.org>
17787
17788         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17789         the CS0038 error message.
17790
17791 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
17792
17793         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17794         constant inside, return it.
17795
17796 2002-09-12  Martin Baulig  <martin@gnome.org>
17797
17798         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17799         implicit conversion can be done between enum types.
17800
17801         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17802         check whether an implicit conversion to the current enum's UnderlyingType
17803         exists and report an error if not.
17804
17805         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17806         without debugging support.
17807
17808         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17809         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
17810
17811 2002-09-12  Martin Baulig  <martin@gnome.org>
17812
17813         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17814
17815         * ecore.cs (IMemberExpr.DeclaringType): New property.
17816         (SimpleName.SimpleNameResolve): Check whether we're accessing a
17817         nonstatic member of an outer type (CS0038).
17818
17819 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
17820
17821         * driver.cs: Activate the using-error detector at warning level
17822         4 (at least for MS-compatible APIs).
17823
17824         * namespace.cs (VerifyUsing): Small buglett fix.
17825
17826         * pending.cs (PendingImplementation): pass the container pointer. 
17827
17828         * interface.cs (GetMethods): Allow for recursive definition.  Long
17829         term, I would like to move every type to support recursive
17830         definitions, not the current ordering mechanism that we have right
17831         now.
17832
17833         The situation is this: Attributes are handled before interfaces,
17834         so we can apply attributes to interfaces.  But some attributes
17835         implement interfaces, we will now handle the simple cases
17836         (recursive definitions will just get an error).  
17837
17838         * parameter.cs: Only invalidate types at the end if we fail to
17839         lookup all types.  
17840
17841 2002-09-09  Martin Baulig  <martin@gnome.org>
17842
17843         * ecore.cs (PropertyExpr.Emit): Also check for
17844         TypeManager.system_int_array_get_length so this'll also work when
17845         compiling corlib.  Fixes #30003.
17846
17847 2002-09-09  Martin Baulig  <martin@gnome.org>
17848
17849         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17850         and throw an exception if we can't get the type's size.  Fixed #30040,
17851         added test-165.cs.
17852
17853 2002-09-09  Martin Baulig  <martin@gnome.org>
17854
17855         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17856
17857         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17858         context.  Fixes bug #30027.
17859
17860         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17861         virtual functions.  Fixes bug #30043, added test-164.cs.
17862
17863 2002-09-08  Ravi Pratap  <ravi@ximian.com>
17864
17865         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17866
17867 2002-09-08  Nick Drochak  <ndrochak@gol.com>
17868
17869         * driver.cs: Use an object to get the windows codepage since it's not a
17870         static property.
17871
17872 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
17873
17874         * statement.cs (For.Emit): for infinite loops (test == null)
17875         return whether there is a break inside, not always "true".
17876
17877         * namespace.cs (UsingEntry): New struct to hold the name of the
17878         using definition, the location where it is defined, and whether it
17879         has been used in a successful type lookup.
17880
17881         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17882         strings.
17883
17884         * decl.cs: ditto.
17885
17886 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17887
17888         * attribute.cs : Fix incorrect code which relied on catching
17889         a NullReferenceException to detect a null being passed in
17890         where an object was expected.
17891
17892 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
17893
17894         * statement.cs (Try): flag the catch variable as assigned
17895
17896         * expression.cs (Cast): Simplified by using ResolveType instead of
17897         manually resolving.
17898
17899         * statement.cs (Catch): Fix bug by using ResolveType.
17900
17901 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17902
17903         * expression.cs (BetterConversion): Special case for when we have
17904         a NullLiteral as the argument and we have to choose between string
17905         and object types - we choose string the way csc does.
17906
17907         * attribute.cs (Attribute.Resolve): Catch the
17908         NullReferenceException and report error #182 since the Mono
17909         runtime no more has the bug and having this exception raised means
17910         we tried to select a constructor which takes an object and is
17911         passed a null.
17912
17913 2002-09-05  Ravi Pratap  <ravi@ximian.com>
17914
17915         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17916         message (1502, 1503) when we can't locate a method after overload
17917         resolution. This is much more informative and closes the bug
17918         Miguel reported.
17919
17920         * interface.cs (PopulateMethod): Return if there are no argument
17921         types. Fixes a NullReferenceException bug.
17922
17923         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17924         expressions too. Previously we were checking only in one place for
17925         positional arguments leaving out named arguments.
17926
17927         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17928         type to the enum type is not allowed. Remove code corresponding to
17929         that.
17930
17931         (ConvertNumericExplicit): Allow explicit conversions from
17932         the underlying type to enum type. This precisely follows the spec
17933         and closes a bug filed by Gonzalo.
17934
17935 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17936
17937         * compiler.csproj:
17938         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17939
17940 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
17941
17942         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17943         it was important that we stored the right value after the
17944         reduction in `converted'.
17945
17946 2002-09-04  Martin Baulig  <martin@gnome.org>
17947
17948         * location.cs (Location.SymbolDocument): Use full pathnames for the
17949         source files.
17950
17951 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
17952
17953         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17954         of the expression resolve mechanism, because that will catch the
17955         SimpleName error failures.
17956
17957         (Conditional): If we can not resolve the
17958         expression, return, do not crash.
17959
17960 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17961
17962         * cs-tokenizer.cs:
17963         (location): display token name instead of its number.
17964
17965 2002-08-28  Martin Baulig  <martin@gnome.org>
17966
17967         * expression.cs (Binary.ResolveOperator): Don't silently return
17968         but return an error if an operator cannot be applied between two
17969         enum types.
17970
17971 2002-08-28  Martin Baulig  <martin@gnome.org>
17972
17973         * class.cs (Constructor.Define): Set the permission attributes
17974         correctly instead of making all constructors public.
17975
17976 2002-08-28  Martin Baulig  <martin@gnome.org>
17977
17978         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17979         for private members before reporting a CS0103; if we find anything,
17980         it's a CS0122.
17981
17982 2002-08-28  Martin Baulig  <martin@gnome.org>
17983
17984         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17985         to check whether `closure_start_type == closure_invocation_type',
17986         we also need to check whether `m.DeclaringType == closure_invocation_type'
17987         before bypassing the permission checks.  We might be accessing
17988         protected/private members from the base class.
17989         (TypeManager.RealMemberLookup): Only set private_ok if private
17990         members were requested via BindingFlags.NonPublic.
17991
17992         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17993
17994         * expression.cs (MemberAccess.ResolveMemberAccess): Set
17995         MethodGroupExpr.IsExplicitImpl if appropriate.
17996         (Invocation.DoResolve): Don't report the CS0120 for explicit
17997         interface implementations.
17998
17999 2002-08-27  Martin Baulig  <martin@gnome.org>
18000
18001         * expression.cs (Invocation.DoResolve): If this is a static
18002         method and we don't have an InstanceExpression, we must report
18003         a CS0120.
18004
18005 2002-08-25  Martin Baulig  <martin@gnome.org>
18006
18007         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
18008         `==' between a valuetype and an object.
18009
18010 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
18011
18012         * ecore.cs (TypeExpr): Provide a ToString method.
18013
18014 2002-08-24  Martin Baulig  <martin@gnome.org>
18015
18016         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
18017         now called proggie.dbg and it's a binary file.
18018
18019 2002-08-23  Martin Baulig  <martin@gnome.org>
18020
18021         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
18022
18023 2002-08-23  Martin Baulig  <martin@gnome.org>
18024
18025         * struct.cs (MyStructInfo.ctor): Make this work with empty
18026         structs; it's not allowed to use foreach() on null.
18027
18028 2002-08-23  Martin Baulig  <martin@gnome.org>
18029
18030         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
18031         writer the full pathname of the generated assembly.
18032
18033 2002-08-23  Martin Baulig  <martin@gnome.org>
18034
18035         * statements.cs (FlowBranching.UsageVector.MergeChildren):
18036         A `finally' block never returns or breaks; improved handling of
18037         unreachable code.
18038
18039 2002-08-23  Martin Baulig  <martin@gnome.org>
18040
18041         * statement.cs (Throw.Resolve): Allow `throw null'.
18042
18043 2002-08-23  Martin Baulig  <martin@gnome.org>
18044
18045         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
18046         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
18047         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
18048         MemberLookup would return a wrong event if this is an explicit
18049         interface implementation and the class has an event with the same
18050         name.
18051
18052 2002-08-23  Martin Baulig  <martin@gnome.org>
18053
18054         * statement.cs (Block.AddChildVariableNames): New public method.
18055         (Block.AddChildVariableName): Likewise.
18056         (Block.IsVariableNameUsedInChildBlock): Likewise.
18057         (Block.AddVariable): Check whether a variable name has already
18058         been used in a child block.
18059
18060         * cs-parser.jay (declare_local_variables): Mark all variable names
18061         from the current block as being used in a child block in the
18062         implicit block.
18063
18064 2002-08-23  Martin Baulig  <martin@gnome.org>
18065
18066         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
18067         find the symbol writer.
18068
18069         * driver.cs: csc also allows the arguments to /define being
18070         separated by commas, not only by semicolons.
18071
18072 2002-08-23  Martin Baulig  <martin@gnome.org>
18073
18074         * interface.cs (Interface.GetMembers): Added static check for events.
18075
18076 2002-08-15  Martin Baulig  <martin@gnome.org>
18077
18078         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
18079         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
18080
18081         * ecore.cs (Expression.MemberLookup): Added documentation and explained
18082         why the MethodData.EmitDestructor() change was necessary.
18083
18084 2002-08-20  Martin Baulig  <martin@gnome.org>
18085
18086         * class.cs (TypeContainer.FindMembers): Added static check for events.
18087
18088         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
18089
18090         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
18091         use Type.GetEvents(), not Type.FindMembers().
18092
18093 2002-08-20  Martin Baulig  <martin@gnome.org>
18094
18095         * decl.cs (MemberCache): Added a special method cache which will
18096         be used for method-only searched.  This ensures that a method
18097         search will return a MethodInfo with the correct ReflectedType for
18098         inherited methods.      
18099
18100 2002-08-20  Martin Baulig  <martin@gnome.org>
18101
18102         * decl.cs (DeclSpace.FindMembers): Made this public.
18103
18104 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18105
18106         * delegate.cs: fixed build on windows.
18107         [FIXME:  Filed as bug #29150: MCS must report these errors.]
18108
18109 2002-08-19  Ravi Pratap  <ravi@ximian.com>
18110
18111         * ecore.cs (StandardConversionExists): Return a false
18112         if we are trying to convert the void type to anything else
18113         since that is not allowed.
18114
18115         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
18116         we flag error 70 in the event an event is trying to be accessed
18117         directly from outside the declaring type.
18118
18119 2002-08-20  Martin Baulig  <martin@gnome.org>
18120
18121         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
18122         MemberCache from typemanager.cs to decl.cs.
18123
18124 2002-08-19  Martin Baulig  <martin@gnome.org>
18125
18126         * class.cs (TypeContainer): Implement IMemberContainer.
18127         (TypeContainer.DefineMembers): Create the MemberCache.
18128         (TypeContainer.FindMembers): Do better BindingFlags checking; only
18129         return public members if BindingFlags.Public was given, check
18130         whether members are static.
18131
18132 2002-08-16  Martin Baulig  <martin@gnome.org>
18133
18134         * decl.cs (DeclSpace.Define): Splitted this in Define and
18135         DefineMembers.  DefineMembers is called first and initializes the
18136         MemberCache.
18137
18138         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
18139         DefineMembers() on all our DeclSpaces.
18140
18141         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
18142         but call DefineMembers() on all nested interfaces.  We call their
18143         Define() in our new Define() function.
18144
18145         * interface.cs (Interface): Implement IMemberContainer.
18146         (Interface.Define): Moved all code except the attribute stuf to
18147         DefineMembers().
18148         (Interface.DefineMembers): Initialize the member cache.
18149
18150         * typemanager.cs (IMemberFinder): Removed this interface, we don't
18151         need this anymore since we can use MemberCache.FindMembers directly.
18152
18153 2002-08-19  Martin Baulig  <martin@gnome.org>
18154
18155         * typemanager.cs (MemberCache): When creating the cache for an
18156         interface type, add all inherited members.
18157         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
18158         to `out bool used_cache' and documented it.
18159         (TypeManager.MemberLookup): If we already used the cache in the first
18160         iteration, we don't need to do the interfaces check.
18161
18162 2002-08-19  Martin Baulig  <martin@gnome.org>
18163
18164         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
18165         here from IMemberFinder and don't implement this interface anymore.
18166         (DeclSpace.MemberCache): Moved here from IMemberFinder.
18167
18168         * typemanager.cs (IMemberFinder): This interface is now only used by
18169         classes which actually support the member cache.
18170         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
18171         since we only put DeclSpaces into this Hashtable.
18172         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
18173         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
18174
18175 2002-08-16  Martin Baulig  <martin@gnome.org>
18176
18177         * typemanager.cs (ICachingMemberFinder): Removed.
18178         (IMemberFinder.MemberCache): New property.
18179         (TypeManager.FindMembers): Merged this with RealFindMembers().
18180         This function will never be called from TypeManager.MemberLookup()
18181         so we can't use the cache here, just the IMemberFinder.
18182         (TypeManager.MemberLookup_FindMembers): Check whether the
18183         IMemberFinder has a MemberCache and call the cache's FindMembers
18184         function.
18185         (MemberCache): Rewrote larger parts of this yet another time and
18186         cleaned it up a bit.
18187
18188 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
18189
18190         * driver.cs (LoadArgs): Support quoting.
18191
18192         (Usage): Show the CSC-like command line arguments.
18193
18194         Improved a few error messages.
18195
18196 2002-08-15  Martin Baulig  <martin@gnome.org>
18197
18198         * typemanager.cs (IMemberContainer.Type): New property.
18199         (IMemberContainer.IsInterface): New property.
18200
18201         The following changes are conditional to BROKEN_RUNTIME, which is
18202         defined at the top of the file.
18203
18204         * typemanager.cs (MemberCache.MemberCache): Don't add the base
18205         class'es members, but add all members from TypeHandle.ObjectType
18206         if we're an interface.
18207         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
18208         is the current type.
18209         (MemberCache.CacheEntry.Container): Removed this field.
18210         (TypeHandle.GetMembers): Include inherited members.
18211
18212 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18213
18214         * typemanager.cs: fixed compilation and added a comment on a field that
18215         is never used.
18216
18217 2002-08-15  Martin Baulig  <martin@gnome.org>
18218
18219         * class.cs (ConstructorInitializer.Resolve): In the
18220         Expression.MemberLookup call, use the queried_type as
18221         invocation_type.
18222
18223         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
18224         declared' attribute, it's always true.
18225         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
18226         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
18227         temporary wrapper for FindMembers which tells MemberLookup whether
18228         members from the base classes are included in the return value.
18229         This will go away soon.
18230         (TypeManager.MemberLookup): Use this temporary hack here; once the
18231         new MemberCache is completed, we don't need to do the DeclaredOnly
18232         looping here anymore since the MemberCache will take care of this.
18233         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
18234         (MemberCache): When creating the MemberCache for a class, get
18235         members from the current class and all its base classes.
18236         (MemberCache.CacheEntry.Container): New field.  This is a
18237         temporary hack until the Mono runtime is fixed to distinguish
18238         between ReflectedType and DeclaringType.  It allows us to use MCS
18239         with both the MS runtime and the unfixed Mono runtime without
18240         problems and without accecting performance.
18241         (MemberCache.SearchMembers): The DeclaredOnly looping from
18242         TypeManager.MemberLookup is now done here.      
18243
18244 2002-08-14  Martin Baulig  <martin@gnome.org>
18245
18246         * statement.cs (MyStructInfo.MyStructInfo): Don't call
18247         Type.GetFields on dynamic types but get the fields from the
18248         corresponding TypeContainer.
18249         (MyStructInfo.GetStructInfo): Added check for enum types.
18250
18251         * typemanager.cs (MemberList.IsSynchronized): Implemented.
18252         (MemberList.SyncRoot): Implemented.
18253         (TypeManager.FilterWithClosure): No need to check permissions if
18254         closure_start_type == closure_invocation_type, don't crash if
18255         closure_invocation_type is null.
18256
18257 2002-08-13  Martin Baulig  <martin@gnome.org>
18258
18259         Rewrote TypeContainer.FindMembers to use a member cache.  This
18260         gives us a speed increase of about 35% for the self-hosting MCS
18261         build and of about 15-20% for the class libs (both on GNU/Linux).
18262
18263         * report.cs (Timer): New class to get enhanced profiling.  This
18264         whole class is "TIMER" conditional since it remarkably slows down
18265         compilation speed.
18266
18267         * class.cs (MemberList): New class.  This is an IList wrapper
18268         which we're now using instead of passing MemberInfo[]'s around to
18269         avoid copying this array unnecessarily.
18270         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
18271         (ICachingMemberFinder, IMemberContainer): New interface.
18272         (TypeManager.FilterWithClosure): If `criteria' is null, the name
18273         has already been checked, otherwise use it for the name comparision.
18274         (TypeManager.FindMembers): Renamed to RealMemberFinder and
18275         provided wrapper which tries to use ICachingMemberFinder.FindMembers
18276         if possible.  Returns a MemberList, not a MemberInfo [].
18277         (TypeHandle): New class, implements IMemberContainer.  We create
18278         one instance of this class per type, it contains a MemberCache
18279         which is used to do the member lookups.
18280         (MemberCache): New class.  Each instance of this class contains
18281         all members of a type and a name-based hash table.
18282         (MemberCache.FindMembers): This is our new member lookup
18283         function.  First, it looks up all members of the requested name in
18284         the hash table.  Then, it walks this list and sorts out all
18285         applicable members and returns them.
18286
18287 2002-08-13  Martin Baulig  <martin@gnome.org>
18288
18289         In addition to a nice code cleanup, this gives us a performance
18290         increase of about 1.4% on GNU/Linux - not much, but it's already
18291         half a second for the self-hosting MCS compilation.
18292
18293         * typemanager.cs (IMemberFinder): New interface.  It is used by
18294         TypeManager.FindMembers to call FindMembers on a TypeContainer,
18295         Enum, Delegate or Interface.
18296         (TypeManager.finder_to_member_finder): New PtrHashtable.
18297         (TypeManager.finder_to_container): Removed.
18298         (TypeManager.finder_to_delegate): Removed.
18299         (TypeManager.finder_to_interface): Removed.
18300         (TypeManager.finder_to_enum): Removed.
18301
18302         * interface.cs (Interface): Implement IMemberFinder.
18303
18304         * delegate.cs (Delegate): Implement IMemberFinder.
18305
18306         * enum.cs (Enum): Implement IMemberFinder.
18307
18308         * class.cs (TypeContainer): Implement IMemberFinder.
18309
18310 2002-08-12  Martin Baulig  <martin@gnome.org>
18311
18312         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
18313
18314 2002-08-12  Martin Baulig  <martin@gnome.org>
18315
18316         * ecore.cs (ITypeExpression): New interface for expressions which
18317         resolve to a type.
18318         (TypeExpression): Renamed to TypeLookupExpression.
18319         (Expression.DoResolve): If we're doing a types-only lookup, the
18320         expression must implement the ITypeExpression interface and we
18321         call DoResolveType() on it.
18322         (SimpleName): Implement the new ITypeExpression interface.
18323         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
18324         hack, the situation that we're only looking up types can't happen
18325         anymore when this method is called.  Moved the type lookup code to
18326         DoResolveType() and call it.
18327         (SimpleName.DoResolveType): This ITypeExpression interface method
18328         is now doing the types-only lookup.
18329         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
18330         (ResolveFlags): Added MaskExprClass.
18331
18332         * expression.cs (MemberAccess): Implement the ITypeExpression
18333         interface.
18334         (MemberAccess.DoResolve): Added support for a types-only lookup
18335         when we're called via ITypeExpression.DoResolveType().
18336         (ComposedCast): Implement the ITypeExpression interface.
18337
18338         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
18339         Expression.Resolve() with ResolveFlags.Type instead.
18340
18341 2002-08-12  Martin Baulig  <martin@gnome.org>
18342
18343         * interface.cs (Interface.Define): Apply attributes.
18344
18345         * attribute.cs (Attribute.ApplyAttributes): Added support for
18346         interface attributes.
18347
18348 2002-08-11  Martin Baulig  <martin@gnome.org>
18349
18350         * statement.cs (Block.Emit): Only check the "this" variable if we
18351         do not always throw an exception.
18352
18353         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
18354         whether the property has a set accessor.
18355
18356 2002-08-11  Martin Baulig  <martin@gnome.org>
18357
18358         Added control flow analysis support for structs.
18359
18360         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
18361         with control flow analysis turned off.
18362         (IVariable): New interface.
18363         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
18364         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
18365         (FieldExpr.DoResolve): Resolve the instance expression with flow
18366         analysis turned off and do the definite assignment check after the
18367         resolving when we know what the expression will resolve to.
18368
18369         * expression.cs (LocalVariableReference, ParameterReference):
18370         Implement the new IVariable interface, only call the flow analysis
18371         code if ec.DoFlowAnalysis is true.
18372         (This): Added constructor which takes a Block argument.  Implement
18373         the new IVariable interface.
18374         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
18375         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
18376         This does the definite assignment checks for struct members.
18377
18378         * class.cs (Constructor.Emit): If this is a non-static `struct'
18379         constructor which doesn't have any initializer, call
18380         Block.AddThisVariable() to tell the flow analysis code that all
18381         struct elements must be initialized before control returns from
18382         the constructor.
18383
18384         * statement.cs (MyStructInfo): New public class.
18385         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
18386         argument to this indexer.  If non-zero, check an individual struct
18387         member, not the whole struct.
18388         (FlowBranching.CheckOutParameters): Check struct members.
18389         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
18390         overloaded versions of these methods which take an additional
18391         `int field_idx' argument to check struct members.
18392         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
18393         overloaded versions of these methods which take an additional
18394         `string field_name' argument to check struct member.s
18395         (VariableInfo): Implement the IVariable interface.
18396         (VariableInfo.StructInfo): New public property.  Returns the
18397         MyStructInfo instance of the variable if it's a struct or null.
18398         (Block.AddThisVariable): New public method.  This is called from
18399         Constructor.Emit() for non-static `struct' constructor which do
18400         not have any initializer.  It creates a special variable for the
18401         "this" instance variable which will be checked by the flow
18402         analysis code to ensure that all of the struct's fields are
18403         initialized before control returns from the constructor.
18404         (UsageVector): Added support for struct members.  If a
18405         variable/parameter is a struct with N members, we reserve a slot
18406         in the usage vector for each member.  A struct is considered fully
18407         initialized if either the struct itself (slot 0) or all its
18408         members are initialized.
18409
18410 2002-08-08  Martin Baulig  <martin@gnome.org>
18411
18412         * driver.cs (Driver.MainDriver): Only report an error CS5001
18413         if there were no compilation errors.
18414
18415         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
18416         `UnsafeContext' property to determine whether the parent is in
18417         unsafe context rather than checking the parent's ModFlags:
18418         classes nested in an unsafe class are unsafe as well.
18419
18420 2002-08-08  Martin Baulig  <martin@gnome.org>
18421
18422         * statement.cs (UsageVector.MergeChildren): Distinguish between
18423         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
18424         we return.  Added test17() and test18() to test-154.cs.
18425
18426 2002-08-08  Martin Baulig  <martin@gnome.org>
18427
18428         * typemanager.cs (TypeManager.FilterWithClosure): If we have
18429         Family access, make sure the invoking type isn't a subclass of the
18430         queried type (that'd be a CS1540).
18431
18432         * ecore.cs (Expression.MemberLookup): Added overloaded version of
18433         this method which takes an additional `Type invocation_type'.
18434
18435         * expression.cs (BaseAccess.DoResolve): Use the base type as
18436         invocation and query type.
18437         (MemberAccess.DoResolve): If the lookup failed and we're about to
18438         report a CS0122, try a lookup with the ec.ContainerType - if this
18439         succeeds, we must report a CS1540.
18440
18441 2002-08-08  Martin Baulig  <martin@gnome.org>
18442
18443         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
18444         (MethodGroupExpr): Implement the IMemberExpr interface.
18445
18446         * expression (MemberAccess.ResolveMemberAccess): No need to have
18447         any special code for MethodGroupExprs anymore, they're now
18448         IMemberExprs.   
18449
18450 2002-08-08  Martin Baulig  <martin@gnome.org>
18451
18452         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
18453         Family, FamANDAssem and FamORAssem permissions.
18454         (TypeManager.IsSubclassOrNestedChildOf): New public method.
18455
18456 2002-08-08  Martin Baulig  <martin@gnome.org>
18457
18458         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
18459         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
18460         or loop block.
18461
18462 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
18463
18464         * driver.cs: implemented /resource option to embed managed resources.
18465
18466 2002-08-07  Martin Baulig  <martin@gnome.org>
18467
18468         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
18469         (FieldBase.HasFieldInitializer): New public property.
18470         (FieldBase.GetInitializerExpression): New public method.  Resolves and
18471         returns the field initializer and makes sure it is only resolved once.
18472         (TypeContainer.EmitFieldInitializers): Call
18473         FieldBase.GetInitializerExpression to get the initializer, this ensures
18474         that it isn't resolved multiple times.
18475
18476         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
18477         the resolving process (SimpleName/MemberLookup) that we're currently
18478         emitting a field initializer (which must not access any instance members,
18479         this is an error CS0236).
18480
18481         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
18482         argument, if the `IsFieldInitializer' flag is set, we must report and
18483         error CS0236 and not an error CS0120.   
18484
18485 2002-08-07  Martin Baulig  <martin@gnome.org>
18486
18487         * ecore.cs (IMemberExpr): New public interface.
18488         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
18489         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
18490         if the expression is an IMemberExpr.
18491
18492         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
18493         to be null, implicitly default to `this' if we're non-static in
18494         this case.  Simplified the code a lot by using the new IMemberExpr
18495         interface.  Also fixed bug #28176 here.
18496
18497 2002-08-06  Martin Baulig  <martin@gnome.org>
18498
18499         * cs-parser.jay (SimpleLookup): Removed.  We need to create
18500         ParameterReferences during semantic analysis so that we can do a
18501         type-only search when resolving Cast, TypeOf and SizeOf.
18502         (block): Pass the `current_local_parameters' to the Block's
18503         constructor.
18504
18505         * class.cs (ConstructorInitializer): Added `Parameters parameters'
18506         argument to the constructor.
18507         (ConstructorInitializer.Resolve): Create a temporary implicit
18508         block with the parameters.
18509
18510         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
18511         references here if we aren't doing a type-only search.
18512
18513         * statement.cs (Block): Added constructor which takes a
18514         `Parameters parameters' argument.
18515         (Block.Parameters): New public property.
18516
18517         * support.cs (InternalParameters.Parameters): Renamed `parameters'
18518         to `Parameters' and made it public readonly.
18519
18520 2002-08-06  Martin Baulig  <martin@gnome.org>
18521
18522         * ecore.cs (Expression.Warning): Made this public as well.
18523
18524         * report.cs (Report.Debug): Print the contents of collections.
18525
18526 2002-08-06  Martin Baulig  <martin@gnome.org>
18527
18528         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
18529         used to tell Resolve() which kinds of expressions it may return.
18530         (Expression.Resolve): Added overloaded version of this method which
18531         takes a `ResolveFlags flags' argument.  This can be used to tell
18532         Resolve() which kinds of expressions it may return.  Reports a
18533         CS0118 on error.
18534         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18535         ResolveFlags.SimpleName.
18536         (Expression.Error118): Added overloaded version of this method which
18537         takes a `ResolveFlags flags' argument.  It uses the flags to determine
18538         which kinds of expressions are allowed.
18539
18540         * expression.cs (Argument.ResolveMethodGroup): New public method.
18541         Resolves an argument, but allows a MethodGroup to be returned.
18542         This is used when invoking a delegate.
18543
18544         * TODO: Updated a bit.
18545
18546 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18547
18548         Fixed compilation with csc.
18549
18550         * ecore.cs: Expression.Error made public. Is this correct? Should
18551         Warning be made public too?
18552
18553         * expression.cs: use ea.Location instead of ea.loc.
18554         [FIXME:  Filed as bug #28607: MCS must report these errors.]
18555
18556 2002-08-06  Martin Baulig  <martin@gnome.org>
18557
18558         * ecore.cs (Expression.loc): Moved the location here instead of
18559         duplicating it in all derived classes.
18560         (Expression.Location): New public property.
18561         (Expression.Error, Expression.Warning): Made them non-static and
18562         removed the location argument.
18563         (Expression.Warning): Added overloaded version which takes an
18564         `int level' argument.
18565         (Expression.Error118): Make this non-static and removed the
18566         expression and location arguments.
18567         (TypeExpr): Added location argument to the constructor.
18568
18569         * expression.cs (StaticCallExpr): Added location argument to
18570         the constructor.
18571         (Indirection, PointerArithmetic): Likewise.
18572         (CheckedExpr, UnCheckedExpr): Likewise.
18573         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18574         (StringPtr): Likewise.
18575
18576
18577 2002-08-05  Martin Baulig  <martin@gnome.org>
18578
18579         * expression.cs (BaseAccess.DoResolve): Actually report errors.
18580
18581         * assign.cs (Assign.DoResolve): Check whether the source
18582         expression is a value or variable.
18583
18584         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18585         while resolving the corresponding blocks.
18586
18587         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18588         an error, don't silently return null.
18589
18590         * statement.cs (Block.AddVariable): Do the error reporting here
18591         and distinguish between CS0128 and CS0136.
18592         (Block.DoResolve): Report all unused labels (warning CS0164).
18593         (LabeledStatement): Pass the location to the constructor.
18594         (LabeledStatement.HasBeenReferenced): New property.
18595         (LabeledStatement.Resolve): Set it to true here.
18596
18597         * statement.cs (Return.Emit): Return success even after reporting
18598         a type mismatch error (CS0126 or CS0127), this is what csc does and
18599         it avoids confusing the users with any consecutive errors.
18600
18601 2002-08-05  Martin Baulig  <martin@gnome.org>
18602
18603         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18604
18605         * const.cs (Const.LookupConstantValue): Catch circular definitions.
18606
18607         * expression.cs (MemberAccess.DoResolve): Silently return if an
18608         error has already been reported.
18609
18610         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18611         error has already been reported.
18612
18613 2002-08-05  Martin Baulig  <martin@gnome.org>
18614
18615         * statement.cs (UsageVector): Only initialize the `parameters'
18616         vector if we actually have any "out" parameters.
18617
18618 2002-08-05  Martin Baulig  <martin@gnome.org>
18619
18620         * expression.cs (Binary.ResolveOperator): When combining delegates,
18621         they must have the same type.
18622
18623 2002-08-05  Martin Baulig  <martin@gnome.org>
18624
18625         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18626         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18627         work with the ms runtime and we also don't need it: if we're a
18628         PropertyBuilder and not in the `indexer_arguments' hash, then we
18629         are a property and not an indexer.
18630
18631         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18632         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18633         since the latter one doesn't work with the ms runtime.
18634
18635 2002-08-03  Martin Baulig  <martin@gnome.org>
18636
18637         Fixed bugs #27998 and #22735.
18638
18639         * class.cs (Method.IsOperator): New public field.
18640         (Method.CheckBase): Report CS0111 if there's already a method
18641         with the same parameters in the current class.  Report CS0508 when
18642         attempting to change the return type of an inherited method.
18643         (MethodData.Emit): Report CS0179 if a method doesn't have a body
18644         and it's not marked abstract or extern.
18645         (PropertyBase): New abstract base class for Property and Indexer.
18646         (PropertyBase.CheckBase): Moved here from Property and made it work
18647         for indexers.
18648         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18649         the same so we can reuse it there.
18650         (Property, Indexer): Derive from PropertyBase.
18651         (MethodSignature.inheritable_property_signature_filter): New delegate
18652         to find properties and indexers.
18653
18654         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18655         argument and improved error reporting.
18656
18657         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18658         EmptyReadOnlyParameters and made it a property.
18659
18660         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18661         version of this method which takes a `PropertyInfo indexer'.
18662         (TypeManager.RegisterIndexer): New method.
18663
18664         * class.cs: Added myself as author of this file :-)
18665
18666 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18667
18668         * class.cs: fixed compilation on windoze.
18669
18670 2002-08-03  Martin Baulig  <martin@gnome.org>
18671
18672         * interface.cs (Interface.GetInterfaceBases): Check whether all
18673         base interfaces are at least as accessible than the current one.
18674
18675         * class.cs (TypeContainer.GetClassBases): Check whether base types
18676         are at least as accessible than the current type.
18677         (TypeContainer.AsAccessible): Implemented and made non-static.
18678         (MemberBase.CheckParameters): Report errors if the accessibility
18679         checks fail.
18680
18681         * delegate.cs (Delegate.Delegate): The default visibility is
18682         internal for top-level types and private for nested types.
18683         (Delegate.Define): Report errors if the accessibility checks fail.
18684
18685         * enum.cs (Enum.Enum): The default visibility is internal for
18686         top-level types and private for nested types.
18687         (Enum.DefineType): Compute the correct visibility.
18688
18689         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18690         function which takes a `bool is_toplevel' instead of a TypeContainer.
18691
18692         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18693         builtin type.
18694
18695 2002-08-02  Martin Baulig  <martin@gnome.org>
18696
18697         * expression.cs (LocalVariableReferenc): Added constructor which
18698         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18699         (LocalVariableReference.IsReadOnly): New property.
18700         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18701         variable is readonly, use our own readonly flag to do this; you can
18702         use the new constructor to get a writable reference to a read-only
18703         variable.
18704
18705         * cs-parser.jay (foreach_statement, using_statement): Get a writable
18706         reference to the local variable.
18707
18708 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
18709
18710         * rootcontext.cs (ResolveCore): Also include System.Exception
18711
18712         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18713         we reach an EmptyStatement.
18714
18715         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18716         is also fine.
18717
18718         * expression.cs (Binary.ResolveOperator): Check error result in
18719         two places.
18720
18721         use brtrue/brfalse directly and avoid compares to null.
18722
18723 2002-08-02  Martin Baulig  <martin@gnome.org>
18724
18725         * class.cs (TypeContainer.Define): Define all nested interfaces here.
18726         Fixes bug #28407, added test-155.cs.
18727
18728 2002-08-01  Martin Baulig  <martin@gnome.org>
18729
18730         * class.cs (Event.EmitDefaultMethod): Make this work with static
18731         events.  Fixes #28311, added verify-3.cs.
18732
18733 2002-08-01  Martin Baulig  <martin@gnome.org>
18734
18735         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18736         `is_disposable' fields.
18737         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18738         `hm.is_disposable' if we're using the collection pattern.
18739         (Foreach.EmitCollectionForeach): Use the correct type for the
18740         enumerator's local variable, only emit the try/finally block if
18741         necessary (fixes #27713).
18742
18743 2002-08-01  Martin Baulig  <martin@gnome.org>
18744
18745         * ecore.cs (Expression.report118): Renamed to Error118 and made
18746         it public static.
18747
18748         * statement.cs (Throw.Resolve): Check whether the expression is of
18749         the correct type (CS0118) and whether the type derives from
18750         System.Exception (CS0155).
18751         (Catch.Resolve): New method.  Do the type lookup here and check
18752         whether it derives from System.Exception (CS0155).
18753         (Catch.CatchType, Catch.IsGeneral): New public properties.
18754
18755         * typemanager.cs (TypeManager.exception_type): Added.
18756
18757 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
18758
18759         * driver.cs: Updated About function.
18760
18761 2002-07-31  Martin Baulig  <martin@gnome.org>
18762
18763         Implemented Control Flow Analysis.
18764
18765         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18766         (EmitContext.CurrentBranching): Added.
18767         (EmitContext.StartFlowBranching): Added.
18768         (EmitContext.EndFlowBranching): Added.
18769         (EmitContext.KillFlowBranching): Added.
18770         (EmitContext.IsVariableAssigned): Added.
18771         (EmitContext.SetVariableAssigned): Added.
18772         (EmitContext.IsParameterAssigned): Added.
18773         (EmitContext.SetParameterAssigned): Added.
18774         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18775         Added control flow analysis stuff here.
18776
18777         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18778         resolve the expression as lvalue.
18779         (LocalVariableReference.DoResolve): Check whether the variable has
18780         already been assigned.
18781         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18782         the parameter as assigned here.
18783         (ParameterReference.DoResolve): Check whether the parameter has already
18784         been assigned.
18785         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18786         expression as lvalue.
18787
18788         * statement.cs (FlowBranching): New class for the flow analysis code.
18789         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18790         (LabeledStatement.IsDefined): New public property.
18791         (LabeledStatement.AddUsageVector): New public method to tell flow
18792         analyis that the label may be reached via a forward jump.
18793         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18794         flow analysis.
18795         (VariableInfo.Number): New public field.  This is used by flow analysis
18796         to number all locals of a block.
18797         (Block.CountVariables): New public property.  This is the number of
18798         local variables in this block (including the locals from all parent
18799         blocks).
18800         (Block.EmitMeta): Number all the variables.
18801
18802         * statement.cs: Added flow analysis support to all classes.
18803
18804 2002-07-31  Martin Baulig  <martin@gnome.org>
18805
18806         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18807         To get debugging messages, compile mcs with /define:MCS_DEBUG and
18808         then use this argument.
18809
18810         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18811
18812         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18813         use this to specify /define options.
18814
18815 2002-07-29  Martin Baulig  <martin@gnome.org>
18816
18817         * statement.cs (Fixed): Moved all code that does variable lookups
18818         and resolvings from Emit to Resolve.
18819
18820         * statement.cs (For): Moved all code that does variable lookups
18821         and resolvings from Emit to Resolve.
18822
18823         * statement.cs (Using): Moved all code that does variable lookups
18824         and resolvings from Emit to Resolve.
18825
18826 2002-07-29  Martin Baulig  <martin@gnome.org>
18827
18828         * attribute.cs (Attribute.Resolve): Explicitly catch a
18829         System.NullReferenceException when creating the
18830         CustromAttributeBuilder and report a different warning message.
18831
18832 2002-07-29  Martin Baulig  <martin@gnome.org>
18833
18834         * support.cs (ParameterData.ParameterName): Added method to
18835         get the name of a parameter.
18836
18837         * typemanager.cs (TypeManager.IsValueType): New public method.
18838
18839 2002-07-29  Martin Baulig  <martin@gnome.org>
18840
18841         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
18842         is a flag which specifies that it's either ref or out.
18843         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18844         the out parameter to `out Parameter.Modifier mod', also set the
18845         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18846
18847         * support.cs (InternalParameters.ParameterModifier): Distinguish
18848         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18849         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18850
18851         * expression.cs (Argument.GetParameterModifier): Distinguish
18852         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18853         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18854
18855 2002-07-29  Martin Baulig  <martin@gnome.org>
18856
18857         * expression.cs (ParameterReference.ParameterReference): Added
18858         `Location loc' argument to the constructor.
18859
18860         * cs-parser.jay: Pass location to ParameterReference.
18861
18862 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
18863
18864         * statement.cs (Try): Initialize the location.
18865
18866         * cs-parser.jay: pass location to Try.
18867
18868         * expression.cs (Unary.Reduce): Change the prototype to return
18869         whether a constant fold could be performed or not.  The result is
18870         returned in an out parameters.  In the case of Indirection and
18871         AddressOf, we want to perform the full tests.
18872
18873 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
18874
18875         * statement.cs (Statement.Emit): Flag dead code.
18876
18877 2002-07-27  Andrew Birkett  <andy@nobugs.org>
18878
18879         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18880
18881 2002-07-27  Martin Baulig  <martin@gnome.org>
18882
18883         * class.cs (MethodData.Define): Put back call to
18884         TypeManager.AddMethod(), accidentally commented this out.
18885
18886         * report.cs (Debug): New public method to print debugging information,
18887         this is `[Conditional ("DEBUG")]'.
18888
18889 2002-07-26  Martin Baulig  <martin@gnome.org>
18890
18891         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18892         (switch_statement): Push the current_block to the switch_stack and
18893         pop it again when we're done with the switch.
18894         (switch_section): The new block is a child of the current_block.
18895         Fixes bug #24007, added test-152.cs.
18896
18897 2002-07-27  Martin Baulig  <martin@gnome.org>
18898
18899         * expression.cs (Invocation.EmitArguments): When calling a varargs
18900         function with only its fixed arguments, we need to pass an empty
18901         array.
18902
18903 2002-07-27  Martin Baulig  <martin@gnome.org>
18904
18905         Mono 0.13 has been released.
18906
18907 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
18908
18909         * driver.cs: Rename --resource to --linkres, because that is what
18910         we do currently, we dont support --resource yet.
18911
18912         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18913
18914 2002-07-25  Martin Baulig  <martin@gnome.org>
18915
18916         * class.cs (MethodData): New public class.  This is a `method builder'
18917         class for a method or one accessor of a Property/Indexer/Event.
18918         (MethodData.GetMethodFlags): Moved here from MemberBase.
18919         (MethodData.ApplyAttributes): Likewise.
18920         (MethodData.ApplyObsoleteAttribute): Likewise.
18921         (MethodData.ApplyConditionalAttribute): Likewise.
18922         (MethodData.ApplyDllImportAttribute): Likewise.
18923         (MethodData.CheckAbstractAndExternal): Likewise.
18924         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18925         (MethodData.Emit): Formerly known as Method.Emit().
18926         (MemberBase): Moved everything which was specific to a single
18927         accessor/method to MethodData.
18928         (Method): Create a new MethodData and call Define() and Emit() on it.
18929         (Property, Indexer, Event): Create a new MethodData objects for each
18930         accessor and call Define() and Emit() on them.
18931
18932 2002-07-25  Martin Baulig  <martin@gnome.org>
18933
18934         Made MethodCore derive from MemberBase to reuse the code from there.
18935         MemberBase now also checks for attributes.
18936
18937         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18938         (MemberBase.GetMethodFlags): Moved here from class Method and marked
18939         as virtual.
18940         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18941         `CallingConventions cc' and `Attributes opt_attrs' arguments.
18942         (MemberBase.ApplyAttributes): New virtual method; applies the
18943         attributes to a method or accessor.
18944         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18945         (MemberBase.ApplyConditionalAttribute): Likewise.
18946         (MemberBase.ApplyDllImportAttribute): Likewise.
18947         (MemberBase.CheckAbstractAndExternal): Likewise.
18948         (MethodCore.ParameterTypes): This is now a property instead of a
18949         method, it's initialized from DoDefineParameters().
18950         (MethodCore.ParameterInfo): Removed the set accessor.
18951         (MethodCore.DoDefineParameters): New protected virtual method to
18952         initialize ParameterTypes and ParameterInfo.
18953         (Method.GetReturnType): We can now simply return the MemberType.
18954         (Method.GetMethodFlags): Override the MemberBase version and add
18955         the conditional flags.
18956         (Method.CheckBase): Moved some code from Define() here, call
18957         DoDefineParameters() here.
18958         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18959         here to avoid some larger code duplication.
18960         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18961         ensure that abstract and external accessors don't declare a body.
18962
18963         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18964         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18965         lookup in the attribute's parent classes, so we need to abort as soon
18966         as we found the first match.
18967         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18968         the attribute has no arguments.
18969
18970         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18971         of a Method.
18972
18973 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18974
18975         * cs-parser.jay: reverted previous patch.
18976
18977 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18978
18979         * cs-parser.jay: fixed bug #22119.
18980
18981 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18982
18983         * attribute.cs: fixed compilation. The error was:
18984         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
18985         be assigned to before control leaves the current method."
18986         [FIXME:  Filed as bug #28186: MCS must report this error.]
18987
18988 2002-07-25  Martin Baulig  <martin@gnome.org>
18989
18990         * attribute.cs (Attribute.Conditional_GetConditionName): New static
18991         method to pull the condition name ouf of a Conditional attribute.
18992         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18993         the obsolete message and error flag out of an Obsolete attribute.
18994
18995         * class.cs (Method.GetMethodFlags): New public method to get the
18996         TypeManager.MethodFlags for this method.
18997         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18998         private methods.
18999         (Method.Define): Get and apply the Obsolete and Conditional attributes;
19000         if we're overriding a virtual function, set the new private variable
19001         `parent_method'; call the new TypeManager.AddMethod().
19002
19003         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
19004         the MethodBuilder and the Method in a PtrHashtable.
19005         (TypeManager.builder_to_method): Added for this purpose.
19006         (TypeManager.MethodFlags): Added IsObsoleteError.
19007         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
19008         Obsolete and Conditional arguments in MethodBuilders.  If we discover
19009         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
19010         the message from the attribute.
19011
19012 2002-07-24  Martin Baulig  <martin@gnome.org>
19013
19014         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
19015         preprocessor directives, ensure that the argument to #define/#undef is
19016         exactly one identifier and that it's actually an identifier.
19017
19018         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
19019         did not work ....
19020
19021 2002-07-24  Martin Baulig  <martin@gnome.org>
19022
19023         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
19024         initialize it to TypeManager.object_type in the constructor.
19025         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
19026         of the `hm.get_current' method if we're using the collection pattern.
19027         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
19028         for the explicit conversion to make it work when we're using the collection
19029         pattern and the `Current' property has a different return type than `object'.
19030         Fixes #27713.
19031
19032 2002-07-24  Martin Baulig  <martin@gnome.org>
19033
19034         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
19035         does not match, but don't report any errors.  This method is called in
19036         order for all methods in a MethodGroupExpr until a matching method is
19037         found, so we don't want to bail out if the first method doesn't match.
19038         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
19039         matches, report the 123.  Fixes #28070.
19040
19041 2002-07-24  Martin Baulig  <martin@gnome.org>
19042
19043         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
19044         TypeManager.TypeToCoreType() to the top of the method so the
19045         following equality checks will work.  Fixes #28107.
19046
19047 2002-07-24  Martin Baulig  <martin@gnome.org>
19048
19049         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
19050         operand is of type uint, and the other operand is of type sbyte,
19051         short or int, the operands are converted to type long." -
19052         Actually do what this comment already told us.  Fixes bug #28106,
19053         added test-150.cs.
19054
19055 2002-07-24  Martin Baulig  <martin@gnome.org>
19056
19057         * class.cs (MethodBase): New abstract class.  This is now a base
19058         class for Property, Indexer and Event to avoid some code duplication
19059         in their Define() and DefineMethods() methods.
19060         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
19061         generic methods for Define() and DefineMethods().
19062         (FieldBase): Derive from MemberBase, not MemberCore.
19063         (Property): Derive from MemberBase, not MemberCore.
19064         (Property.DefineMethod): Moved all the code from this method to the
19065         new MethodBase.DefineAccessor(), just call it with appropriate
19066         argumetnts.
19067         (Property.Define): Call the new Property.DoDefine(), this does some
19068         sanity checks and we don't need to duplicate the code everywhere.
19069         (Event): Derive from MemberBase, not MemberCore.
19070         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
19071         accessors, this will also make them work with interface events.
19072         (Indexer): Derive from MemberBase, not MemberCore.
19073         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
19074         (Indexer.Define): Use the new MethodBase functions.
19075
19076         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
19077         argument to the constructor.
19078         (Interface.FindMembers): Added support for interface events.
19079         (Interface.PopluateEvent): Implemented.
19080
19081         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
19082
19083 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
19084
19085         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
19086         but this is required to check for a method name being the same as
19087         the containing class.  
19088
19089         Handle this now.
19090
19091 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19092
19093         * interface.cs: initialize variable.
19094
19095 2002-07-23  Martin Baulig  <martin@gnome.org>
19096
19097         Implemented the IndexerName attribute in interfaces.
19098
19099         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
19100         name if this is an explicit interface implementation.
19101         (Indexer.InterfaceIndexerName): New public variable.  If we're
19102         implementing an interface indexer, this is the IndexerName in that
19103         interface.  Otherwise, it's the IndexerName.
19104         (Indexer.DefineMethod): If we're implementing interface indexer,
19105         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
19106         and Pending.ImplementIndexer methods.
19107         (Indexer.Define): Also define the PropertyBuilder if we're
19108         implementing an interface indexer and this is neither an explicit
19109         interface implementation nor do the IndexerName match the one in
19110         the interface.
19111
19112         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
19113         If a method is defined here, then we always need to create a proxy
19114         for it.  This is used when implementing interface indexers.
19115         (Pending.IsInterfaceIndexer): New public method.
19116         (Pending.ImplementIndexer): New public method.
19117         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
19118         This is used when implementing interface indexers to define a proxy
19119         if necessary.
19120         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
19121         define a proxy if necessary.
19122
19123         * interface.cs (Interface.IndexerName): New public variable.
19124         (Interface.PopulateIndexer): Set the IndexerName.
19125         (Interface.DefineIndexers): New private method.  Populate all the
19126         indexers and make sure their IndexerNames match.
19127
19128         * typemanager.cs (IndexerPropertyName): Added support for interface
19129         indexers.
19130
19131 2002-07-22  Martin Baulig  <martin@gnome.org>
19132
19133         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
19134         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
19135         ret if HasReturnLabel.
19136         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
19137         variables.
19138
19139         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
19140         and set the ec.LoopBeginTryCatchLevel.
19141         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
19142         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
19143         the current ec.TryCatchLevel, the branch goes out of an exception
19144         block.  In this case, we need to use Leave and not Br.
19145
19146 2002-07-22  Martin Baulig  <martin@gnome.org>
19147
19148         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
19149         block unless the block does not always return or it is contained in
19150         another try { ... } catch { ... } block.  Fixes bug #26506.
19151         Added verify-1.cs to the test suite.
19152
19153 2002-07-22  Martin Baulig  <martin@gnome.org>
19154
19155         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
19156         then we do not always return.  Fixes bug #24985.
19157
19158 2002-07-22  Martin Baulig  <martin@gnome.org>
19159
19160         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
19161         lookup on a per-class level; ie. walk up the class hierarchy until we
19162         found at least one applicable method, then choose the best among them.
19163         Fixes bug #24463 and test-29.cs.
19164
19165 2002-07-22  Martin Baulig  <martin@gnome.org>
19166
19167         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
19168         return types of the methods.  The return type is not part of the
19169         signature and we must not check it to make the `new' modifier work.
19170         Fixes bug #27999, also added test-147.cs.
19171         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
19172
19173         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
19174         on the method's return type.
19175
19176 2002-07-21  Martin Baulig  <martin@gnome.org>
19177
19178         * assign.cs: Make this work if the rightmost source is a constant and
19179         we need to do an implicit type conversion.  Also adding a few more tests
19180         to test-38.cs which should have caught this.
19181
19182         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
19183         target in the makefile for this.  The makefile.gnu is primarily intended
19184         for end-users who don't want to debug the compiler.
19185
19186 2002-07-21  Martin Baulig  <martin@gnome.org>
19187
19188         * assign.cs: Improved the Assign class so it can now handle embedded
19189         assignments (X = Y = Z = something).  As a side-effect this'll now also
19190         consume less local variables.  test-38.cs now passes with MCS, added
19191         a few new test cases to that test.
19192
19193 2002-07-20  Martin Baulig  <martin@gnome.org>
19194
19195         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
19196         instructions.  Fixes bug #27977, also added test-146.cs.
19197
19198 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19199
19200         * cs-tokenizer.cs: fixed getHex ().
19201
19202 2002-07-19  Martin Baulig  <martin@gnome.org>
19203
19204         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
19205         not Type.GetType() to lookup the array type.  This is needed when
19206         we're constructing an array of a user-defined type.
19207         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
19208         single-dimensional arrays, but also for single-dimensial arrays of
19209         type decimal.
19210
19211 2002-07-19  Martin Baulig  <martin@gnome.org>
19212
19213         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
19214         this function is called, it's not allowed to share LocalBuilders
19215         among ILGenerators.
19216
19217 2002-07-19  Martin Baulig  <martin@gnome.org>
19218
19219         * expression.cs (Argument.Resolve): Report an error 118 when trying
19220         to pass a type as argument.
19221
19222 2002-07-18  Martin Baulig  <martin@gnome.org>
19223
19224         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
19225         Conv_R_Un for the signed `long' type.
19226
19227 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
19228
19229         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
19230         `expr' for the temporary result, as that will fail if we do
19231         multiple resolves on the same expression.
19232
19233 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
19234
19235         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
19236         ec.TypeContainer for looking up aliases. 
19237
19238         * class.cs (TypeContainer): Remove LookupAlias from here.
19239
19240         * decl.cs (DeclSpace); Move here.
19241
19242 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
19243
19244         * class.cs (FindMembers): Only call filter if the constructor
19245         bulider is not null.
19246
19247         Also handle delegates in `NestedTypes' now.  Now we will perform
19248         type lookups using the standard resolution process.  This also
19249         fixes a bug.
19250
19251         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
19252         This uses Expressions (the limited kind that can be parsed by the
19253         tree) instead of strings.
19254
19255         * expression.cs (ComposedCast.ToString): Implement, used to flag
19256         errors since now we have to render expressions.
19257
19258         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
19259         FormArrayType. 
19260
19261         * ecore.cs (SimpleName.ToString): ditto.
19262
19263         * cs-parser.jay: Instead of using strings to assemble types, use
19264         Expressions to assemble the type (using SimpleName, ComposedCast,
19265         MemberAccess).  This should fix the type lookups in declarations,
19266         because we were using a different code path for this.
19267
19268         * statement.cs (Block.Resolve): Continue processing statements
19269         even when there is an error.
19270
19271 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
19272
19273         * class.cs (Event.Define): Also remove the `remove' method from
19274         the list of pending items.
19275
19276         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
19277         generate more compact code. 
19278
19279 2002-07-17  Martin Baulig  <martin@gnome.org>
19280
19281         * const.cs (Const.LookupConstantValue): Add support for constant
19282         `unchecked' and `checked' expressions.
19283         Also adding test case test-140.cs for this.
19284
19285 2002-07-17  Martin Baulig  <martin@gnome.org>
19286
19287         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
19288         check whether mi.ReturnType implements the IEnumerator interface; the
19289         `==' and the IsAssignableFrom() will fail in this situation.
19290
19291 2002-07-16  Ravi Pratap  <ravi@ximian.com>
19292
19293         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
19294         here too.
19295
19296 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19297
19298         * expression.cs: fixed bug #27811.
19299
19300 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
19301
19302         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
19303         Molaro: when we are a ref, the value already contains a pointer
19304         value, do not take the address of it.
19305
19306 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19307         * removed mb-parser.jay and mb-tokenizer.cs
19308
19309 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19310
19311         * expression.cs: check against the building corlib void type.
19312
19313 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
19314
19315         * ecore.cs: fix for valuetype static readonly fields: when 
19316         initializing them, we need their address, not the address of a copy.
19317
19318 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
19319
19320         * typemanager.cs: register also enum_type in corlib.
19321
19322 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19323
19324         * class.cs: allow calling this (but not base) initializers in structs.
19325
19326 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
19327
19328         * ecore.cs: make sure we compare against the building base types
19329         in GetTypeSize ().
19330
19331 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
19332
19333         * typemanager.cs: fix TypeToCoreType() to handle void and object
19334         (corlib gets no more typerefs after this change).
19335
19336 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
19337
19338         * expression.cs (ArrayCreation.EmitArrayArguments): use
19339         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
19340
19341         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
19342         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
19343         array indexes, the runtime actually forbids them.
19344
19345         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
19346         for array arguments here.
19347
19348         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
19349         instead of the default for ValueTypes.
19350
19351         (New.DoEmit): Use IsValueType instead of
19352         IsSubclassOf (value_type)
19353         (New.DoResolve): ditto.
19354         (Invocation.EmitCall): ditto.
19355
19356         * assign.cs (Assign): ditto.
19357
19358         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
19359         Statements *are* currently doing part of their resolution during
19360         Emit.  
19361
19362         Expressions do always resolve during resolve, but statements are
19363         only required to propagate resolution to their children.
19364
19365 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
19366
19367         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
19368
19369         (LoadAssembly): Do not add the dll if it is already specified
19370
19371         (MainDriver): Add the System directory to the link path at the end,
19372         after all the other -L arguments. 
19373
19374         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
19375         wrong opcode for loading bytes and bools (ldelem.i1 instead of
19376         ldelem.u1) and using the opposite for sbytes.
19377
19378         This fixes Digger, and we can finally run it.
19379
19380         * driver.cs (UnixParseOption): Move the option parsing here.  
19381         (CSCParseOption): Implement CSC-like parsing of options.
19382
19383         We now support both modes of operation, the old Unix way, and the
19384         new CSC-like way.  This should help those who wanted to make cross
19385         platform makefiles.
19386
19387         The only thing broken is that /r:, /reference: and /lib: are not
19388         implemented, because I want to make those have the same semantics
19389         as the CSC compiler has, and kill once and for all the confussion
19390         around this.   Will be doing this tomorrow.
19391
19392         * statement.cs (Unsafe.Resolve): The state is checked during
19393         resolve, not emit, so we have to set the flags for IsUnsfe here.
19394
19395 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
19396
19397         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
19398         not catch the Error_ObjectRefRequired in SimpleName (as it is
19399         possible to have a class/instance variable name that later gets
19400         deambiguated), we have to check this here.      
19401
19402 2002-07-10  Ravi Pratap  <ravi@ximian.com>
19403
19404         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
19405         make static and put into Expression.
19406
19407         (Event.Define): Register the private field of the event with the 
19408         TypeManager so that GetFieldFromEvent can get at it.
19409
19410         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
19411         keep track of the private field associated with an event which
19412         has no accessors.
19413
19414         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
19415         private field.
19416
19417         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
19418
19419 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
19420
19421         * expression.cs (Binary.EmitBranchable): this routine emits the
19422         Binary expression in a branchable context.  This basically means:
19423         we need to branch somewhere, not just get the value on the stack.
19424
19425         This works together with Statement.EmitBoolExpression.
19426
19427         * statement.cs (Statement.EmitBoolExpression): Use
19428         EmitBranchable. 
19429
19430 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
19431
19432         * statement.cs (For): Reduce the number of jumps in loops.
19433
19434         (For): Implement loop inversion for the For statement.
19435
19436         (Break): We can be breaking out of a Try/Catch controlled section
19437         (foreach might have an implicit try/catch clause), so we need to
19438         use Leave instead of Br.
19439
19440         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
19441         now).  If the instace expression supports IMemoryLocation, we use
19442         the AddressOf method from the IMemoryLocation to extract the
19443         address instead of emitting the instance.
19444
19445         This showed up with `This', as we were emitting the instance
19446         always (Emit) instead of the Address of This.  Particularly
19447         interesting when This is a value type, as we dont want the Emit
19448         effect (which was to load the object).
19449
19450 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
19451
19452         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
19453
19454         * statement.cs (Checked): Set the CheckedState during the resolve
19455         process too, as the ConvCast operations track the checked state on
19456         the resolve process, and not emit.
19457
19458         * cs-parser.jay (namespace_member_declaration): Flag that we have
19459         found a declaration when we do.  This is used to flag error 1529
19460
19461         * driver.cs: Report ok when we display the help only.
19462
19463 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
19464
19465         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
19466
19467 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
19468
19469         * cs-tokenizer.cs (define): We also have to track locally the
19470         defines.  AllDefines is just used for the Conditional Attribute,
19471         but we also need the local defines for the current source code. 
19472
19473 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
19474
19475         * statement.cs (While, For, Do): These loops can exit through a
19476         Break statement, use this information to tell whether the
19477         statement is the last piece of code.
19478
19479         (Break): Flag that we break.
19480
19481         * codegen.cs (EmitContexts): New `Breaks' state variable.
19482
19483 2002-07-03  Martin Baulig  <martin@gnome.org>
19484
19485         * class.cs (TypeContainer.MethodModifiersValid): Allow override
19486         modifiers in method declarations in structs.  Otherwise, you won't
19487         be able to override things like Object.Equals().
19488
19489 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19490
19491         * class.cs (Method, Property, Indexer): Do not allow the public
19492         modifier to be used in explicit interface implementations.
19493
19494         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
19495         override modifiers in method declarations in structs
19496
19497 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
19498
19499         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
19500         integer or real overflow, report an error
19501
19502 2002-07-02  Martin Baulig  <martin@gnome.org>
19503
19504         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
19505         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
19506         to tell the runtime about our newly created System.Object and
19507         System.ValueType types.
19508
19509 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19510
19511         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
19512         struct instead of Ldarg/Starg.
19513
19514 2002-07-02  Martin Baulig  <martin@gnome.org>
19515
19516         * expression.cs (Indirection.Indirection): Call
19517         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
19518
19519 2002-07-02  Martin Baulig  <martin@gnome.org>
19520
19521         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
19522         ValueType, call TypeManager.TypeToCoreType() on it.
19523         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19524         the OpCodes.Newarr argument.
19525
19526 2002-07-02  Martin Baulig  <martin@gnome.org>
19527
19528         * expression.cs (Invocation.EmitCall): When compiling corlib,
19529         replace all calls to the system's System.Array type to calls to
19530         the newly created one.
19531
19532         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19533         System.Array methods.
19534         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19535         from the system's System.Array type which must be replaced.
19536
19537 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19538
19539         * typemanager.cs: load unverifiable_code_ctor so we can build
19540         corlib using the correct type. Avoid using GetTypeCode() with
19541         TypeBuilders.
19542         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19543         TypeManager.object_type to allow building corlib.
19544
19545 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19546
19547         * ecore.cs: handle System.Enum separately in LoadFromPtr().
19548
19549 2002-07-01  Martin Baulig  <martin@gnome.org>
19550
19551         * class.cs: Make the last change actually work, we need to check
19552         whether `ifaces != null' to avoid a crash.
19553
19554 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19555
19556         * class.cs: when we build structs without fields that implement
19557         interfaces, we need to add the interfaces separately, since there is
19558         no API to both set the size and add the interfaces at type creation
19559         time.
19560
19561 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19562
19563         * expression.cs: the dimension arguments to the array constructors
19564         need to be converted if they are a long.
19565
19566 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19567
19568         * class.cs: don't emit ldarg.0 if there is no parent constructor
19569         (fixes showstopper for corlib).
19570
19571 2002-06-29  Martin Baulig  <martin@gnome.org>
19572
19573         MCS now compiles corlib on GNU/Linux :-)
19574
19575         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19576         ie. check for MethodImplOptions.InternalCall.
19577
19578         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19579         and TypeManager.attribute_type are null, so we must explicitly check
19580         whether parent is not null to find out whether it's an attribute type.
19581         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19582         and SetBuilder, not only if the property is neither abstract nor external.
19583         This is necessary to set the MethodImplOptions on the accessor methods.
19584         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19585         SetBuilder, see Property.Emit().
19586
19587         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19588         populate "System.Object", "System.ValueType" and "System.Attribute" since
19589         they've already been populated from BootCorlib_PopulateCoreTypes().
19590
19591 2002-06-29  Martin Baulig  <martin@gnome.org>
19592
19593         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19594         is the NullLiteral, we also need to make sure that target_type is not
19595         an enum type.   
19596
19597 2002-06-29  Martin Baulig  <martin@gnome.org>
19598
19599         * rootcontext.cs (RootContext.ResolveCore): We must initialize
19600         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19601         before calling BootstrapCorlib_ResolveDelegate ().
19602
19603 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19604
19605         * statement.cs: fixed build-breaker. All tests passed ok.
19606
19607 2002-06-27  Martin Baulig  <martin@gnome.org>
19608
19609         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19610         for System.Decimal when compiling corlib.
19611
19612 2002-06-27  Martin Baulig  <martin@gnome.org>
19613
19614         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19615         switch blocks which contain nothing but a default clause.
19616
19617 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
19618
19619        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19620
19621 2002-06-27  Martin Baulig  <martin@gnome.org>
19622
19623         * ecore.cs (PropertyExpr.PropertyExpr): Call
19624         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19625
19626         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19627         is already a TypeBuilder.
19628
19629 2002-06-27  Martin Baulig  <martin@gnome.org>
19630
19631         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19632         `target_type == TypeManager.array_type', not IsAssignableFrom() in
19633         the "from an array-type to System.Array" case.  This makes it work
19634         when compiling corlib.
19635
19636 2002-06-27  Martin Baulig  <martin@gnome.org>
19637
19638         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19639         non-static PropertyExpr, set its InstanceExpression.  This makes
19640         the `ICollection.Count' property work in System/Array.cs.
19641
19642 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
19643
19644         * driver.cs: Made error handling more consistent.  Errors now
19645         tracked by Report class, so many methods which used to return int
19646         now return void.  Main() now prints success/failure and 
19647         errors/warnings message.
19648
19649         Renamed '--probe' compiler argument to '--expect-error'.  Removed
19650         the magic number return values (123 and 124).  Now, if the
19651         expected error occurs, the compiler exits with success (exit value
19652         0).  If the compilation completes without seeing that particular
19653         error, the compiler exits with failure (exit value 1).  The
19654         makefile in mcs/errors has been changed to handle the new behaviour.
19655
19656         * report.cs: Made 'expected error' number a property and renamed
19657         it from 'Probe' to 'ExpectedError'.
19658
19659         * genericparser.cs: Removed error handling support, since it is
19660         now all done by Report class.
19661
19662         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19663         class, so parse() no longer returns an int.
19664
19665         * namespace.cs: Use Report.Error instead of GenericParser.error
19666
19667 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
19668
19669         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19670         TypeContainer.AddOperator): At the front of the list put the
19671         explicit implementations, so they get resolved/defined first. 
19672
19673 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
19674
19675         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19676         interface type is implemented by this TypeContainer.  Used during
19677         explicit interface implementation.
19678
19679         (Property.Define, Indexer.Define, Method.Define): Validate that
19680         the given interface in the explicit implementation is one of the
19681         base classes for the containing type.
19682
19683         Also if we are explicitly implementing an interface, but there is
19684         no match in the pending implementation table, report an error.
19685
19686         (Property.Define): Only define the property if we are
19687         not explicitly implementing a property from an interface.  Use the
19688         correct name also for those properties (the same CSC uses,
19689         although that is really not needed).
19690
19691         (Property.Emit): Do not emit attributes for explicitly implemented
19692         properties, as there is no TypeBuilder.
19693
19694         (Indexer.Emit): ditto.
19695
19696         Hiding then means that we do not really *implement* a pending
19697         implementation, which makes code fail.
19698
19699 2002-06-22  Martin Baulig  <martin@gnome.org>
19700
19701         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19702         the return value of Object.GetType().  [FIXME: we need to do this whenever
19703         we get a type back from the reflection library].
19704
19705 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19706
19707         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19708
19709 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
19710
19711         * attribute.cs: Return null if we can not look up the type.
19712
19713         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19714         the interface types found.
19715
19716         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19717         interface types found.
19718
19719         * typemanager.cs (GetInterfaces): Make this routine returns alll
19720         the interfaces and work around the lame differences between
19721         System.Type and System.Reflection.Emit.TypeBuilder in the results
19722         result for GetInterfaces.
19723
19724         (ExpandInterfaces): Given an array of interface types, expand and
19725         eliminate repeated ocurrences of an interface.  This expands in
19726         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19727         be IA, IB, IC.
19728
19729 2002-06-21  Martin Baulig  <martin@gnome.org>
19730
19731         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19732         on System.Enum.
19733
19734 2002-06-21  Martin Baulig  <martin@gnome.org>
19735
19736         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
19737         and called with one of the core types, return the corresponding typebuilder for
19738         that type.
19739
19740         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19741         element type.
19742
19743 2002-06-21  Martin Baulig  <martin@gnome.org>
19744
19745         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19746         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19747         (Expression.ConvertReferenceExplicit): Likewise.
19748
19749         * expression.cs (ElementAccess.DoResolve): Likewise.
19750         (ElementAccess.DoResolveLValue): Likewise.
19751
19752 2002-06-10  Martin Baulig  <martin@gnome.org>
19753
19754         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19755         add the "value" parameter to the parameter list.
19756
19757         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19758         to our caller.
19759
19760 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
19761
19762         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19763         the argument to an int, uint, long or ulong, per the spec.  Also
19764         catch negative constants in array creation.
19765
19766 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19767
19768         * class.cs: do not allow the same interface to appear twice in
19769         the definition list.
19770
19771 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19772
19773         * ecore.cs: don't use ldlen with System.Array.
19774
19775 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19776
19777         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19778
19779 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19780
19781         * modifiers.cs: produce correct field attributes for protected
19782         internal. Easy fix so miguel can work on ther harder stuff:-)
19783
19784 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
19785
19786         * pending.cs: New file.  Move the code from class.cs here.
19787         Support clearning the pending flag for all methods (when not doing
19788         explicit interface implementation).
19789
19790 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19791
19792         * rootcontext.cs: added a couple more types needed to bootstrap.
19793
19794 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
19795
19796         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19797         constructor in the type, instead of any constructor in the type
19798         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
19799         a bug in the Mono runtime when applying the params attribute). 
19800
19801 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
19802         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19803
19804 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
19805
19806         * expression.cs (Unary.ResolveOperator): Use TypeManager
19807         to resolve the type.
19808
19809 2002-06-13  Ravi Pratap  <ravi@ximian.com>
19810
19811         * cs-parser.jay (enum_member_declaration): Pass in the attributes
19812         attached.
19813
19814         * enum.cs (AddEnumMember): Add support to store the attributes associated 
19815         with each member too.
19816
19817         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19818         field builders too - this takes care of the enum member case.
19819
19820 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
19821
19822         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19823         address-of operator on both value types and pointers.
19824
19825 2002-06-10  Martin Baulig  <martin@gnome.org>
19826
19827         * interface.cs (Interface.PopulateIndexer): Add the indexer's
19828         PropertyBuilder to the `property_builders' list.
19829
19830         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19831         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19832         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
19833         find any indexers which are inherited from an interface.
19834
19835 2002-06-09  Martin Baulig  <martin@gnome.org>
19836
19837         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19838         the same type as the constant if necessary.  There's also a test-130.cs
19839         for this.
19840
19841         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19842
19843         * typemanager.cs (TypeManager.ChangeType): Previously known as
19844         Enum.ChangeEnumType().
19845
19846 2002-06-09  Martin Baulig  <martin@gnome.org>
19847
19848         * expression.cs (Cast.TryReduce): Added support for consts.
19849
19850 2002-06-08  Ravi Pratap  <ravi@ximian.com>
19851
19852         * class.cs (Accessor): Hold attributes information so we can pass
19853         it along.
19854
19855         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19856         Modify to pass in attributes attached to the methods.
19857
19858         (add_accessor_declaration, remove_accessor_declaration): Ditto.
19859
19860         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19861         to handle the Accessor kind :-)
19862
19863         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19864
19865 2002-06-08  Martin Baulig  <martin@gnome.org>
19866
19867         * expression.cs (Unary.TryReduceNegative): Added support for
19868         ULongConstants.
19869
19870 2002-06-08  Martin Baulig  <martin@gnome.org>
19871
19872         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19873         name can't be found in the `defined_names' - the caller will do a
19874         MemberLookup in this case and thus find methods in System.Enum
19875         such as Enum.IsDefined().
19876
19877 2002-06-08  Martin Baulig  <martin@gnome.org>
19878
19879         * enum.cs (Enum.ChangeEnumType): This is a custom version of
19880         Convert.ChangeType() which works with TypeBuilder created types.
19881         (Enum.LookupEnumValue, Enum.Define): Use it here.
19882
19883         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19884         `TypeBuilder.BaseType != null' check.
19885         (TypeContainer.FindMembers): Only lookup parent members if we
19886         actually have a parent.
19887         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19888         (ConstructorInitializer.Resolve): Likewise.
19889
19890         * interface.cs (Interface.FindMembers): Added
19891         `TypeBuilder.BaseType != null' check.
19892
19893         * rootcontext.cs (RootContext.ResolveCore): Added
19894         "System.Runtime.CompilerServices.IndexerNameAttribute" to
19895         classes_second_stage.
19896
19897         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19898         debug_type and trace_type when compiling with --nostdlib.       
19899
19900 2002-06-07  Martin Baulig  <martin@gnome.org>
19901
19902         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19903         (AddField): Set it to true when adding a non-static field.
19904         (DefineType): Use `have_nonstatic_fields' to find out whether we
19905         have non-static fields, not `Fields != null'.
19906
19907 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
19908
19909         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19910         dereferencing a null on the static-field code path)
19911
19912 2002-05-30  Martin Baulig  <martin@gnome.org>
19913
19914         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19915         to take command line arguments.  Use reflection to call the new
19916         custom `Initialize' function on the symbol writer and pass it the
19917         command line arguments.
19918
19919         * driver.cs (--debug-args): New command line argument to pass command
19920         line arguments to the symbol writer.
19921
19922 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
19923
19924         * assign.cs (DoResolve): Forgot to do the implicit conversion to
19925         the target type for indexers and properties.  Thanks to Joe for
19926         catching this.
19927
19928 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
19929
19930         * typemanager.cs (MethodFlags): returns the method flags
19931         (Obsolete/ShouldIgnore) that control warning emission and whether
19932         the invocation should be made, or ignored. 
19933
19934         * expression.cs (Invocation.Emit): Remove previous hack, we should
19935         not do this on matching a base type, we should do this based on an attribute
19936
19937         Only emit calls to System.Diagnostics.Debug and
19938         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19939         on the command line.
19940
19941         * rootcontext.cs: Global settings for tracing and debugging.
19942
19943         * cs-tokenizer.cs (define): New utility function to track
19944         defines.   Set the global settings for TRACE and DEBUG if found.
19945
19946 2002-05-25  Ravi Pratap  <ravi@ximian.com>
19947
19948         * interface.cs (Populate*): Pass in the TypeContainer as well as
19949         the DeclSpace as parameters so that we can create EmitContexts and
19950         then use that to apply attributes etc.
19951
19952         (PopulateMethod, PopulateEvent, PopulateProperty)
19953         (PopulateIndexer): Apply attributes everywhere.
19954
19955         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19956         etc.
19957
19958         (ApplyAttributes): Update accordingly.
19959
19960         We now apply interface attributes for all members too.
19961
19962 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
19963
19964         * class.cs (Indexer.Define); Correctly check if we are explicit
19965         implementation (instead of checking the Name for a ".", we
19966         directly look up if the InterfaceType was specified).
19967
19968         Delay the creation of the PropertyBuilder.
19969
19970         Only create the PropertyBuilder if we are not an explicit
19971         interface implementation.   This means that explicit interface
19972         implementation members do not participate in regular function
19973         lookups, and hence fixes another major ambiguity problem in
19974         overload resolution (that was the visible effect).
19975
19976         (DefineMethod): Return whether we are doing an interface
19977         implementation. 
19978
19979         * typemanager.cs: Temporary hack until we get attributes in
19980         interfaces (Ravi is working on that) and we get IndexerName
19981         support in interfaces.
19982
19983         * interface.cs: Register the indexers as properties.
19984
19985         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19986         warning, I have verified that this is a bug in the .NET runtime
19987         (JavaScript suffers of the same problem).
19988
19989         * typemanager.cs (MemberLookup): When looking up members for
19990         interfaces, the parent of an interface is the implicit
19991         System.Object (so we succeed in searches of Object methods in an
19992         interface method invocation.  Example:  IEnumerable x;  x.ToString
19993         ()) 
19994
19995 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
19996
19997         * class.cs (Event): Events should also register if they do
19998         implement the methods that an interface requires.
19999
20000         * typemanager.cs (MemberLookup); use the new GetInterfaces
20001         method. 
20002
20003         (GetInterfaces): The code used to lookup interfaces for a type is
20004         used in more than one place, factor it here. 
20005
20006         * driver.cs: Track the errors at the bottom of the file, we kept
20007         on going.
20008
20009         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
20010         instance if the method we are calling is static!
20011
20012 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
20013
20014         * attribute.cs (ApplyAttributes): Make this function filter out
20015         the IndexerName attribute (as that attribute in reality is never
20016         applied) and return the string constant for the IndexerName
20017         attribute. 
20018
20019         * class.cs (TypeContainer.Emit): Validate that all the indexers
20020         have the same IndexerName attribute, and if so, set the
20021         DefaultName attribute on the class. 
20022
20023         * typemanager.cs: The return value might contain other stuff (not
20024         only methods).  For instance, consider a method with an "Item"
20025         property and an Item method.
20026
20027         * class.cs: If there is a problem with the parameter types,
20028         return. 
20029
20030 2002-05-24  Ravi Pratap  <ravi@ximian.com>
20031
20032         * ecore.cs (ImplicitConversionExists): Wrapper function which also
20033         looks at user defined conversion after making a call to 
20034         StandardConversionExists - we need this for overload resolution.
20035
20036         * expression.cs : Update accordingly the various method calls.
20037
20038         This fixes 2 bugs filed against implicit user defined conversions 
20039
20040 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
20041
20042         * statement.cs: Track the result of the assignment.
20043
20044 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
20045
20046         * expression.cs (MemberAccess): Improved error reporting for
20047         inaccessible members.
20048
20049 2002-05-22  Martin Baulig  <martin@gnome.org>
20050
20051         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
20052         itself with debugging support.
20053
20054 2002-05-22  Martin Baulig  <martin@gnome.org>
20055
20056         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
20057         Removed, this isn't needed anymore.
20058
20059 2002-05-20  Martin Baulig  <martin@gnome.org>
20060
20061         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
20062         be underlying type for an enum.
20063
20064 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
20065
20066         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
20067         that splits out the loading of just the core types.
20068
20069         * rootcontext.cs (ResolveCore): Split the struct resolution in
20070         two, so we can load the enumeration underlying types before any
20071         enums are used.
20072
20073         * expression.cs (Is): Bandaid until we fix properly Switch (see
20074         bug #24985 for details).
20075
20076         * typemanager.cs (ImplementsInterface): The hashtable will contain
20077         a null if there are no interfaces implemented.
20078
20079 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
20080
20081         * cs-parser.jay (indexer_declarator): It is fine to have array
20082         parameters
20083
20084 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
20085
20086         * typemanager.cs: (RegisterBuilder): New function used to register
20087         TypeBuilders that implement interfaces.  Since
20088         TypeBuilder.GetInterfaces (as usual) does not work with lame
20089         Reflection.Emit. 
20090         (AddUserType): register interfaces.
20091
20092         (ImplementsInterface): Use the builder_to_ifaces hash if we are
20093         dealing with TypeBuilder.  Also, arrays are showing up as
20094         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
20095         methods can not be invoked on them!
20096
20097         * ecore.cs (ExplicitReferenceConversionExists): Made public.
20098         (ImplicitReferenceConversionExists): Split out from
20099         StandardConversionExists. 
20100
20101         * expression.cs (As): We were only implementing one of the three
20102         cases for the as operator.  We now implement them all.
20103         (Is): Implement the various other cases for Is as well.
20104
20105         * typemanager.cs (CACHE): New define used to control if we want or
20106         not the FindMembers cache.  Seems to have a negative impact on
20107         performance currently
20108
20109         (MemberLookup): Nested types have full acess to
20110         enclosing type members
20111
20112         Remove code that coped with instance/static returns for events, we
20113         now catch this in RealFindMembers.
20114
20115         (RealFindMembers): only perform static lookup if the instance
20116         lookup did not return a type or an event.  
20117
20118 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
20119
20120         * assign.cs (CompoundAssign): We pass more semantic information
20121         now to Compound Assignments than we did before: now we have all
20122         the information at hand, and now we resolve the target *before* we
20123         do the expression expansion, which allows the "CacheValue" method
20124         to have the effect we intended (before, a [x] += 1 would generate
20125         two differen ArrayAccess expressions from the ElementAccess,
20126         during the resolution process).
20127
20128         (CompoundAssign.DoResolve): Resolve target and original_source here.
20129
20130 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
20131
20132         * expression.cs (ArrayAccess): dropped debugging information. 
20133
20134         * typemanager.cs: Small bug fix: I was always returning i_members,
20135         instead of one of i_members or s_members (depending on which had
20136         the content).
20137
20138         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
20139         method is invoked before any code generation takes place, and it
20140         is a mechanism to inform that the expression will be invoked more
20141         than once, and that the method should use temporary values to
20142         avoid having side effects
20143
20144         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
20145
20146         * ecore.cs (Expression.CacheTemporaries): Provide empty default
20147         implementation.
20148
20149         * expression.cs (Indirection, ArrayAccess): Add support for
20150         CacheTemporaries in these two bad boys. 
20151
20152         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
20153         ldobj or ldind_ref.  
20154         (StoreFromPtr): Handle stobj as well.
20155
20156         * expression.cs (UnaryMutator): Share more code.
20157
20158         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
20159         down: I was not tracking the Filter function as well, which
20160         was affecting the results of the cache.
20161
20162 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
20163
20164         * attribute.cs: Remove the hack to handle the CharSet property on
20165         StructLayouts. 
20166
20167 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
20168
20169         * attribute.cs (DoResolve): More uglyness, we now only try to
20170         resolve the attribute partially, to extract the CharSet
20171         information (only if we are a StructLayout attribute).  Otherwise 
20172
20173         (GetExtraTypeInfo): Add some code to conditionally kill in the
20174         future this.   I am more and more convinced that the .NET
20175         framework has special code to handle the attribute setting on
20176         certain elements.
20177
20178         * expression.cs (IsParamsMethodApplicable): Revert my previous
20179         foreach change here, it was wrong.
20180
20181 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
20182
20183         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
20184         (pp_expr): do not abort on unknown input, just return.
20185         (eval): abort if there are pending chars.
20186
20187         * attribute.cs (Attribute.Resolve): Positional parameters are
20188         optional.  Deal with that case.
20189
20190         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
20191         the Ansi/Unicode/Auto information for the type.
20192
20193         (TypeContainer.DefineType): instantiate the EmitContext here, as
20194         we will be using it during the type definition (to resolve
20195         attributes) and during the emit phase.
20196
20197         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
20198         to pull type information out of the attributes
20199
20200         (Attribute.Resolve): track the constructor builder, and allow for
20201         multiple invocations (structs and classes will use this).
20202
20203         * ecore.cs (MemberLookupFinal): new version with all the
20204         parameters customizable.
20205
20206         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
20207         constructors.  Return if the result value is null (as the error
20208         would have been flagged already by MemberLookupFinal)
20209
20210         Do not allow instances of abstract classes or interfaces to be
20211         created.
20212
20213         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
20214         We have to compare the assembly property here when dealing with
20215         FamANDAssem and Assembly access modifiers, because we might be
20216         creating an assembly from *modules* (that means that we are not
20217         getting TypeBuilders for types defined in other modules that are
20218         part of this assembly).
20219
20220         (Method.Emit): If the method is marked abstract and has a body,
20221         emit an error. 
20222
20223         (TypeContainer.DefineMembers): If both the defined member and the
20224         parent name match are methods, then do not emit any warnings: let
20225         the Method.Define routine take care of flagging warnings.  But if
20226         there is a mismatch (method overrides something else, or method is
20227         overriwritten by something, then emit warning).
20228
20229         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
20230         set to null, this means `do not check for the return type on the
20231         signature'. 
20232
20233         (Method.Define): set the return type for the method signature to
20234         null, so that we get methods with the same name and parameters and
20235         different return types.  This is used to flag warning 114 (you are
20236         hiding a method, and you probably want to use the new/override
20237         keywords instead).
20238
20239         * typemanager.cs (MemberLookup): Implemented proper access
20240         control, closing a long standing set of bug reports.  The problem
20241         was that the Framework only has two bits: Public and NonPublic,
20242         and NonPublic includes private and protected methods, but we need
20243         to enforce the FamANDAssem, FamOrAssem and Family. 
20244
20245 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
20246
20247         * statement.cs (GotoCase): Return true: Ammounts to giving up
20248         knowledge on whether we return or not, and letting the other case
20249         be responsible for it.
20250
20251 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
20252
20253         * driver.cs: Do not load directories for each file processed, only
20254         do it if there is a pattern.
20255
20256         * ecore.cs: Report readonly assigns here as well, as we might have
20257         been resolved only by MemberAccess.
20258
20259         (SimpleName.SimpleNameResolve): Also be useful for LValue
20260         resolution.   We need this to propagate assign to local readonly variables
20261
20262         * typemanager.cs: Use a ptrhashtable for the criteria, because we
20263         do not want to reuse potential criteria memory.
20264
20265         * class.cs (MyEventBuilder): Set reflected_type;
20266
20267         * ecore.cs (Constantify): Added support for constifying bools.
20268
20269         (RootContext.LookupType): Added a cache for values looked up in
20270         the declaration space.
20271
20272         * typemanager.cs (FindMembers): Now is a front-end to
20273         RealFindMembers, and provides a two-level hashtable-based cache to
20274         the request.  
20275
20276         15% performance improvement: from 22.5 to 19.2 seconds.
20277
20278         * expression.cs (IsParamsMethodApplicable): use foreach.
20279         (Invocation.DoResolve): ditto.
20280         (New.DoResolve): ditto.
20281         (ArrayCreation.DoResolve): ditto.
20282
20283         * ecore.cs (FindMostEncompassingType): use foreach.
20284
20285         * delegate.cs (NewDelegate.DoResolve): Use foreach
20286
20287         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
20288         (RemoveMethods): use foreach.
20289
20290         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
20291         nested foreach statements instead of for, and also break out of
20292         the inner loop once a match is found.
20293
20294         (Invocation.OverloadResolve): Use foreach, simplify the code. 
20295
20296 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
20297
20298         * cfold.cs (BinaryFold): During an enumeration evaluation context,
20299         we actually unwrap the expression to allow for extra information
20300         to be extracted. 
20301
20302         * expression.cs: Use Shr_Un on unsigned operations. 
20303
20304 2002-05-08  Ravi Pratap  <ravi@ximian.com>
20305
20306         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
20307         applicable operators was not being considered correctly. This closes
20308         the bug Miguel reported.
20309
20310 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
20311
20312         * attribute.cs: check that the type derives from System.Attribute
20313         and report the correct error in that case (moved the duplicate code to
20314         its own method, too).
20315
20316 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
20317
20318         * attribute.cs: lookup attribute type name as the spec says: first the
20319         bare attribute name and then name + "Attribute" (nant compiles with
20320         mcs after this fix).
20321
20322 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
20323
20324         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
20325         Because of the way we parse things, we should try to see if a
20326         UIntConstant can fit in an integer.
20327
20328 2002-05-07  Ravi Pratap  <ravi@ximian.com>
20329
20330         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
20331         when we are in an explicit context.
20332
20333         (ConvertReferenceExplicit): When converting from Iface type S to Class
20334         T make sure the rules are implemented as an OR.
20335
20336         * parameter.cs (ParameterType): Make it a property for now although the
20337         purpose really isn't anything immediate.
20338
20339         * expression.cs (Is*Applicable): Do better checking on the parameter type
20340         of a ref/out parameter. The ones from the system assemblies are already 
20341         marked with the correct type so we don't need to do any correction.
20342
20343         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
20344         the object type is standard too so include that.
20345
20346 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20347
20348         * ecore.cs (StandardConversionExists): Augment with missing code:
20349         deal with IntConstant, LongConstants and Enumerations.
20350
20351         * assign.cs: Report the error, instead of failing silently
20352
20353         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
20354         typecontainer that they are declared, because the
20355         typecontainer/namespace will have the list of using clauses that
20356         need to be applied.
20357
20358         Assembly Attributes were escaping the normal registration
20359         mechanism. 
20360
20361         (EmitCode): Apply attributes within an EmitContext that represents
20362         the container they were declared on.
20363
20364         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
20365
20366 2002-05-06  Ravi Pratap  <ravi@ximian.com>
20367
20368         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
20369         Revamp completely - make much cleaner as we now operate only
20370         on a set of Types.
20371
20372         (FindMostSpecificSource, FindMostSpecificTarget): New methods
20373         to implement the logic detailed in the spec more correctly.
20374
20375         (UserDefinedConversion): Update accordingly.
20376
20377 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20378
20379         * statement.cs: Return flow analysis information up.
20380
20381         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
20382         and the default.
20383
20384         (token): Do not consume an extra character before calling
20385         decimal_digits.
20386
20387 2002-05-06  Piers Haken <piersh@friskit.com>
20388
20389         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
20390
20391 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20392
20393         * class.cs (Constructor.Emit): Set the IsStatic flag in the
20394         EmitContext during the instance constructor initializer
20395         resolution, to stop access to instance variables.
20396
20397         This is mandated by the spec, last paragraph of the `constructor
20398         initializers' section. 
20399
20400 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
20401
20402         * cs-parser.jay, class.cs (Accessor): new class used to represent
20403         an accessor (get or set).  In the past we used `null' to represent
20404         a missing accessor.  But this is ambiguous because there was no
20405         way to tell in abstract indexers/properties if one of them was
20406         specified.
20407
20408         Now there is a way of addressing that.
20409
20410         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
20411         instead of FindMembers.
20412
20413         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
20414         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
20415
20416         * attribute.cs: Treat indexers and properties as the same in terms
20417         of applying attributes
20418
20419         * ecore.cs (FindMostEncompassedType): Use statically initialized
20420         EmptyExpressions()s like we do elsewhere to avoid creating useless
20421         objects (and we take this out of the tight loop).
20422
20423         (GetConversionOperators): Move the code to extract the actual
20424         operators to a separate routine to clean things up.
20425
20426 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
20427
20428         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
20429         events are always registered FieldBuilders.
20430
20431         * class.cs (FieldBase): New class shared by Fields 
20432
20433         * delegate.cs: If we are a toplevel delegate, use our full name.
20434         If we are a nested delegate, then only use our tail name.
20435
20436 2002-05-02  Ravi Pratap  <ravi@ximian.com>
20437
20438         * expression.cs (IsApplicable): Ensure that we add the "&" to
20439         ref/out types before comparing it with the type of the argument.
20440
20441         (IsParamsMethodApplicable): Ditto.
20442
20443         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
20444         silly me ;-)
20445
20446         * delegate.cs : Handle the case when we have more than one applicable
20447         method. Flag an error only when we finish checking all.
20448
20449 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
20450
20451         * expression.cs: Add support for boolean static initializers.
20452
20453 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
20454
20455         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
20456
20457         * parameter.cs (ComputeParameterTypes,
20458         ComputeAndDefineParameterTypes): Better error handling: now we
20459         clear the `types' cache if we fail during any of the type lookups.
20460         We also return the status code correctly to our caller
20461
20462         * delegate.cs: If we fail to define a delegate, abort the extra
20463         steps. 
20464
20465         * expression.cs (Binary.ResolveOperator): for
20466         operator==(object,object) and operator !=(object, object) we also
20467         have to verify that there is an implicit conversion from one to
20468         the other.
20469
20470         (ArrayAccess.DoResolve): Array Access can operate on
20471         non-variables. 
20472
20473 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
20474
20475         * assign.cs (CompoundAssign): A new class used as a "flag" that
20476         the assignment actually is happening as part of a compound
20477         assignment operator.
20478
20479         During compound assignment, a few new rules exist to enable things
20480         like:
20481
20482         byte b |= 1 + 2
20483
20484         From the spec:
20485
20486         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
20487         to the type of x) if y is implicitly convertible to the type of x,
20488         and the operator is a builtin operator and the return type of the
20489         operator is explicitly convertible to the type of x. 
20490
20491         * rootcontext.cs: Reset warning level to 2.  4 catches various
20492         "interesting" features in mcs, we must clean this up at some
20493         point, but currently am trying to kill other bugs ;-)
20494
20495         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
20496         in container classes as well.  
20497
20498         * expression.cs (Binary.ResolveOperator): Handle string case
20499         before anything else (as operator overloading does emit an error
20500         before doing anything else).
20501
20502         This code could go away when we move to a table driven model, but
20503         i could not come up with a good plan last night.
20504
20505 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
20506
20507         * typemanager.cs (CSharpName): reimplementation using regex.
20508         * class.cs: added null check for fields in Emit
20509         * rootcontext.cs: set warninglevel to 4
20510
20511 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
20512
20513         * typemanager.cs (CSharpName): reimplemented with Lupus
20514         suggestion.
20515
20516 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
20517
20518         * statement.cs (If): correclty implement Resolve, because we were
20519         not catching sem errors in there.  The same process is needed
20520         everywhere else. 
20521         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
20522
20523
20524         (Statement.Warning_DeadCodeFound): Factorize code.
20525         (While): Report dead code here too.
20526
20527         (Statement): Added Resolve virtual method to allow
20528         for resolution split from the emit code.
20529
20530 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20531
20532         * statement.cs (EmitBoolExpression): No longer try to resolve the
20533         expression here.    
20534         (MakeBoolean): New utility function that resolve, implicitly
20535         converts to boolean and tags the expression. 
20536
20537
20538         (If, Do): Implement dead code elimination.
20539         (While): Implement loop inversion
20540
20541         (Do, While, For, If): Resolve the expression prior to calling our
20542         code generation.
20543
20544 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
20545
20546         * class.cs:
20547           - added method Report28 (warning: program has more than one entry point)
20548           - added method IsEntryPoint, implements paragraph 10.1 of the spec
20549           - modified method Method.Define, the part at the end of the method
20550
20551         * rootcontext.cs: added static public Location EntryPointLocation;
20552           
20553         * ../errors/cs0028.cs : Add test case for the above warning.              
20554
20555         * typemanager.cs:
20556           - modified method CSharpName to allow arrays of primitive type to
20557             be printed nicely (e.g. instead of System.Int32[][] it now prints
20558             int[][])
20559           - added method CSharpSignature: returns the signature of a method
20560             in string format to be used in reporting errors, warnings, etc.
20561
20562         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20563         with String.Empty.
20564
20565 2002-04-26  Ravi Pratap  <ravi@ximian.com>
20566
20567         * delegate.cs (Define): Fix extremely silly bug where I was
20568         setting the type of the 'object' parameter of the BeginInvoke
20569         method to System.IAsyncResult instead of System.Object ;-)
20570
20571 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20572
20573         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20574         here. 
20575
20576         (Constructor.Emit): return if we fail to initialize the
20577         constructor.  Another door closed!  
20578
20579         * expression.cs (New.DoResolve): Improve error message (from -6 to
20580         1501).  Use DeclaredOnly lookup to find the exact constructor.
20581
20582         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20583         loop.  This is useful.
20584
20585         * cs-parser.jay: Adjust the default parameters so that destructors
20586         have the proper signature.
20587
20588 2002-04-26  Martin Baulig  <martin@gnome.org>
20589
20590         * driver.cs (LoadAssembly): If `assembly' contains any characters
20591         which are only valid in path names and not in assembly names
20592         (currently slash, backslash and point), use Assembly.LoadFrom ()
20593         instead of Assembly.Load () on the `assembly' (before iteration
20594         over the link_paths).
20595
20596 2002-04-26  Martin Baulig  <martin@gnome.org>
20597
20598         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20599
20600 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
20601
20602         * class.cs (Property): use the new typemanager.MemberLookup
20603
20604         (TypeContainer.MemberLookup): Implement using the
20605         TypeManager.MemberLookup now. 
20606
20607         * typemanager.cs: Make MemberLookup a function of the TypeManager,
20608         and return MemberInfos, so that these can be used without an
20609         EmitContext (what we had before).
20610
20611 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
20612
20613         * expression.cs: Fix the case where the argument to params if the
20614         type of the params.  I omitted handling this before.   Fixed
20615
20616 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20617
20618         * driver.cs: Call BootCorlib_PopulateCoreType
20619
20620         * class.cs (Property.CheckBase): Check for properties only, not
20621         for all members. 
20622
20623         * interface.cs: Temporary hack: try/catch around the
20624         CustomAttributeBuilder, because I am getting an exception that I
20625         do not understand.
20626
20627         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20628         types whose definitions are required to be there (attributes are
20629         defined before standard types).
20630
20631         Compute definitions as we boot the various types, as they are used
20632         immediately (value_type class will need object_type, but if we do
20633         not initialize object_type, we will pass a null, which will let
20634         the runtime pick the System.Object from the existing corlib, which
20635         is not what we want).
20636
20637 2002-04-22  Patrik Torstensson <totte@labs2.com>
20638
20639         * cs-tokenizer.cs: fixed a number of trim() issues.
20640
20641 2002-04-22  Ravi Pratap  <ravi@ximian.com>
20642
20643         * expression.cs (Argument.Type): Ensure that we return the correct
20644         type when we have out or ref parameters [in which case we 
20645         append a "&"].
20646
20647 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20648
20649         * class.cs (Property, Indexer): Allow extern modifier in there. 
20650
20651         * typemanager.cs (InitBaseTypes): Initializes object_type and
20652         value_type, since those will be used early on during the bootstrap
20653         process to compile corlib.
20654
20655         (InitCoreTypes): Move code from here to InitBaseTypes.
20656
20657 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
20658
20659         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20660         single-dimension arrays as using the ldlen opcode.  
20661
20662         Daniel Lewis discovered this optimization.  
20663
20664         * typemanager.cs: Add signature for System.Array::get_Length
20665
20666 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20667
20668         * statement.cs: report the error when the foreach does not apply to an
20669         array nor a collection.
20670
20671 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
20672
20673         * expression.cs: Add implicit conversions to the operator ~.
20674
20675         * constant.cs (DecimalConstant.Emit): Emit decimal value.
20676
20677         * typemanager.cs: Locate the decimal constructor.
20678
20679 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20680
20681         * attribute.cs: use the new property of TypeOf.
20682         * expression.cs: added 'get' property around typearg.
20683
20684         These changes fix a build breaker reported by NickD. Is this the
20685         correct way to fix?  If not, please, revert my changes and make it
20686         work :-).
20687
20688 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
20689
20690         * attribute.cs: Add support for typeof in attribute invocations.
20691         I am not sure that this is right though.
20692
20693 2002-04-14  Duncan Mak  <duncan@ximian.com>
20694
20695         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20696         Binary.Operator.Division case.
20697
20698 2002-04-13  Ravi Pratap  <ravi@ximian.com>
20699
20700         * class.cs (DefineType): Ensure that we do a proper check on
20701         attribute types and also register it with the TypeManager.
20702
20703         (TypeContainer.Targets): The default for attribute types is
20704         AttributeTargets.All.
20705
20706         * attribute.cs (ApplyAttributes): Registering the attribute type
20707         is done elsewhere, not when we discover we have a Usage attribute.
20708
20709 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20710
20711         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20712         and get rid of is_delegate parameter.
20713
20714         * everywhere : update.
20715
20716 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20717
20718         * cs-parser.jay (compilation_unit): Revamp completely to use
20719         some new ideas that I got from Rhys' grammar to solve the problems
20720         with assembly level attributes.
20721
20722         (outer_declaration): New grammar production.
20723
20724         (attribute_sections): Add.
20725
20726         (opt_attributes): Base on attribute_sections
20727
20728         (namespace_declaration): Allow opt_attributes to tackle the case
20729         when we have assembly level attributes - we are clever in this
20730         regard now ;-)
20731
20732         * attribute.cs (ApplyAttributes): Do not worry about assembly 
20733         attributes in the non-global context.
20734
20735         * rootcontext.cs (AddGlobalAttributes): Go back to using this
20736         instead of SetGlobalAttributes.
20737
20738         * class.cs, rootcontext.cs : Ensure we define and generate 
20739         attribute types before anything else.
20740
20741         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20742         and flag the new error -20 for the case when the attribute type
20743         does not have valid targets specified. csc does not catch this.
20744
20745         * ../errors/errors.txt : update for error # -20
20746
20747 2002-04-11  Ravi Pratap  <ravi@ximian.com>
20748
20749         * support.cs (InternalParameters.ParameterModifier): Do some null
20750         checking and return sane values.
20751
20752         * class.cs (Method.Define): If we are a PInvoke method, ensure
20753         that we are static and extern. Report error # 601
20754
20755         * ../errors/cs0601.cs : Add test case for the above error.
20756
20757 2002-04-07  Ravi Pratap  <ravi@ximian.com>
20758
20759         * rootcontext.cs (attribute_types): We need to keep type of
20760         all attribute types separately and emit code for them first.
20761
20762         (RegisterAttribute) : Implement.
20763
20764         * class.cs (DefineType): Check if the current Type is a custom
20765         attribute type and register it accordingly.
20766
20767         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20768         adding the first attribute twice and rename to
20769
20770         (SetGlobalAttributes): this.
20771
20772         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20773         lookups.
20774
20775         * attribute.cs (ApplyAttributes): Take an additional argument telling us
20776         if we are processing global arguments. Hmm, I am unsure of this.
20777
20778 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20779
20780         * expression.cs: added static array of strings to avoid calling
20781         Enum.ToString () for Operator in Binary. Significant recover of
20782         performance.
20783
20784 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
20785
20786         * class.cs (FindMembers): Allow the Builders of the various
20787         members to be null.  If they are skip them.  This only happens
20788         during the PInvoke declaration.
20789
20790 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
20791
20792         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20793         failure, so we do not keep going afterwards.
20794
20795         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20796         wanted to pass `false' as the `is_delegate' argument.  If this is
20797         the case, why not use delegate_type == null to mean `is_delegate =
20798         false' and anything else as is_delegate = true.
20799
20800 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
20801
20802         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20803         code for the section, not the beginning of the tests.
20804
20805 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
20806
20807         * cfold.cs: Handle operator + (Enum x, Underlying x) 
20808
20809         * expression.cs (Binary): same.  Warn about errors where we have
20810         Enum/Enum in operator + as well.
20811
20812 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
20813
20814         * statement.cs:
20815                 - added support for switch(bool)
20816                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20817                 - add TableSwitchEmit() to handle table-based switch statements
20818
20819 2002-04-05  Ravi Pratap  <ravi@ximian.com>
20820
20821         * expression.cs (Invocation.OverloadResolve): Factor out code which
20822         does parameter compatibility checking with arguments so that we can 
20823         re-use the code even from Delegate.VerifyApplicability
20824
20825         (VerifyArgumentsCompat): Move above code here.
20826
20827         * delegate.cs (VerifyApplicability): Get rid of duplicate code
20828         and instead make a call to the above method.
20829
20830 2002-03-31  Ravi Pratap  <ravi@ximian.com>
20831
20832         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20833         We use it to keep track of classes which are attribute types.
20834
20835 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
20836
20837         * delegate.cs (Delegate.Define): Correctly define the types in the
20838         presence of fixed and array parameters.
20839
20840         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20841         doing FindMembers.
20842
20843         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20844         include NonPublic after the first iteration.
20845
20846         * class.cs (Indexer.CheckBase): Only check if both parents are
20847         non-null. 
20848
20849         * cs-parser.jay (accessor_body): If empty, set to null.
20850
20851         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20852         same code path here to resolve constants names that we did have in
20853         MemberAccess.DoResolve.  There is too much code duplicated here.
20854
20855 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
20856
20857         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20858
20859         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20860         to MakeUnionSet.
20861
20862         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20863         tokens, numbers and strings.
20864
20865         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20866         parenthesis.
20867
20868         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20869         asyncronous parameters and the regular parameters.  
20870
20871         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20872         specify the target directory.
20873
20874         * expression.cs: (This.DoResolve): Simplify
20875         (As.Emit): Optimize, do not generate IsInst if the expression is
20876         always of the given type.
20877
20878         (Is.DoResolve): Bug fix, we were reporting both always/never for
20879         the is expression.
20880
20881         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20882         creating too many unnecessary arrays.
20883
20884 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
20885
20886         * class.cs (EmitFieldInitializer): Use Assign expression to assign
20887         fields instead of rolling our own initializer.   Takes care of all
20888         implicit conversions, and drops unnecessary static checks/argument.
20889
20890 2002-03-31  Dick Porter  <dick@ximian.com>
20891
20892         * driver.cs: use the GetDirectories() return values properly, and
20893         use "/" as path separator.
20894
20895 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
20896
20897         * expression.cs (Unary): Optimize - - expr into expr.
20898         (Binary): Optimize a + (-b) into a -b.
20899
20900         * codegen.cs (CodeGen): Made all methods static.
20901
20902 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
20903
20904         * rootcontext.cs: 
20905
20906         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20907         TypeBuilder property.
20908
20909         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20910         instead. 
20911
20912         * tree.cs: Removed the various RecordXXXX, and replaced with a
20913         single RecordDecl.  Removed all the accessor methods, and just
20914         left a single access point Type 
20915
20916         * enum.cs: Rename DefineEnum to DefineType.
20917
20918         * decl.cs: New abstract method `DefineType' used to unify the
20919         Defines for Enumerations, Interfaces, TypeContainers and
20920         Delegates.
20921
20922         (FindType): Moved LookupInterfaceOrClass here.  Moved the
20923         LookupBaseClasses method that used to live in class.cs and
20924         interface.cs here, and renamed to FindType.
20925
20926         * delegate.cs: Implement DefineType.  Take advantage of the
20927         refactored pattern for locating the parent builder without taking
20928         the parent_builder argument (which we know does not work if we are
20929         nested, and triggering a toplevel definition).
20930
20931 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20932
20933         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20934         accessibility of a member has changed during override and report
20935         an error if so.
20936
20937         * class.cs (Method.Define, Property.Define): Only complain on
20938         overrides if the method is private, any other accessibility is
20939         fine (and since we just checked the permission is the same, we are
20940         good to go).
20941
20942         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20943         and elif are processed always.  The other pre-processing
20944         directives are only processed if we are "taking" the path
20945
20946 2002-03-29  Martin Baulig  <martin@gnome.org>
20947
20948         * class.cs (Method.Emit): Only emit symbolic debugging info if the
20949         current location is not Null.
20950
20951         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20952         a separate method so we can profile it.
20953
20954         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20955         `span.Seconds' are just seconds, but no minutes or hours.
20956         (MainDriver): Profile the CodeGen.SaveSymbols calls.
20957
20958 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20959
20960         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20961         Remove the gratuitous set of Final:
20962
20963                                 // If an interface implementation, then we can set Final.
20964                                 if (((flags & MethodAttributes.Abstract) == 0) &&
20965                                     implementing.DeclaringType.IsInterface)
20966                                         flags |= MethodAttributes.Final;
20967
20968         I do not know what I was smoking when I used that.
20969
20970
20971         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20972         step into fixing the name resolution issues for delegates and
20973         unifying the toplevel name resolution.
20974
20975 2002-03-28  Martin Baulig  <martin@gnome.org>
20976
20977         * class.cs (Method.Emit): If we have a symbol writer, call its
20978         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20979         tell it about the current method.
20980
20981         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20982         writer that we're going to emit the first byte of IL code for a new
20983         statement (a new source line).
20984         (EmitContext.EmitTopBlock): If we have a symbol writer, call
20985         EmitContext.Mark() before emitting any code.
20986
20987         * location.cs (SymbolDocument): Return null when we're Null.
20988
20989         * statement.cs (Statement): Moved the `Location loc' variable here.
20990         (Statement.EmitBoolExpression): If we have a symbol writer, call
20991         ec.Mark() before emitting any code to tell it that we're at the
20992         beginning of a new statement.
20993         (StatementExpression): Added `Location' argument to the constructor.
20994         (Block): Added public readonly variable `StartLocation' and public
20995         variable `EndLocation'.  The latter is to be set using SetEndLocation().
20996         (Block): Added constructor which takes a start and end location.
20997         (Block.SetEndLocation): New method. This sets the end location.
20998         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20999         local variables we create.
21000         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
21001         each statement and do also mark the begin and end of the block.
21002
21003         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
21004         tell it the current lexer.Location, use Location.Null for the end of the
21005         block.
21006         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
21007         current block, set its end location using SetEndLocation().
21008         (statement_expression): StatementExpression constructor now takes the
21009         lexer.Location as additional argument.
21010         (for_statement, declare_local_variables): Likewise.
21011         (declare_local_variables): When creating a new implicit block, use the
21012         new Block constructor and pass it the lexer.Location.
21013
21014 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
21015
21016         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
21017         members also on the parent interfaces recursively.
21018
21019 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
21020
21021         * report.cs: Use new formats, since Gonzalo finished the missing
21022         bits. 
21023
21024         * expression.cs (Binary.ResolveOperator): added missing operator|
21025         operator& and operator^ for bool/bool.
21026
21027         * cs-parser.jay: CheckDef now takes a Location argument that is
21028         used to report errors more precisly (instead of reporting the end
21029         of a definition, we try to track something which is a lot closer
21030         to the source of the problem).
21031
21032         * cs-tokenizer.cs: Track global token use, so we can properly flag
21033         the use of #define/#undef after the first token has been seen.
21034
21035         Also, rename the reportXXXX to Error_DescriptiveName
21036
21037         * decl.cs (DeclSpace.IsTopLevel): Move property here from
21038         TypeContainer, so that Enum and Interface can use this too.
21039
21040         * class.cs (TypeContainer.LookupInterfaceOrClass,
21041         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
21042         `builder' argument.  Typically this was used to pass the parent
21043         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
21044         the definition).  
21045
21046         The problem is that a nested class could trigger the definition of
21047         a toplevel class, and the builder would be obviously wrong in that
21048         case. 
21049
21050         So we drop this argument, and we compute dynamically the
21051         TypeBuilder/ModuleBuilder (the correct information was available
21052         to us anyways from DeclSpace.Parent)
21053
21054         * interface.cs (Interface.DefineInterface): Drop builder
21055         parameter cleanup like class.cs
21056
21057         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
21058         like class.cs
21059
21060         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
21061         values. 
21062
21063         (Try.Emit): Propagate the returns value from the statement.
21064
21065         (Return.Emit): Even if we are leavning 
21066
21067         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
21068
21069         * modifiers.cs: Fix the computation of MethodAttributes flags.
21070
21071 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
21072
21073         * driver.cs: allow compilation of files that start with '/'.
21074         Add a default case when checking the argument of --target.
21075
21076 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
21077
21078         * interface.cs: Implement the same search algorithm for types in
21079         the interface code.
21080
21081         * delegate.cs: Do not allow multiple definition.
21082
21083         * Recovered ChangeLog that got accidentally amputated
21084
21085         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
21086
21087         * rootcontext.cs: Load manually enum to allow core classes to
21088         contain enumerations.
21089
21090         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
21091         Update to new static methods in TypeManager.
21092
21093         * typemanager.cs (GetMethod, GetConstructor): Use our
21094         implementation of FindMembers to find the members, since during
21095         corlib compilation, the types are TypeBuilders and GetMethod and
21096         GetConstructor do not work.
21097
21098         Make all methods in TypeManager static.
21099
21100         (InitCodeHelpers): Split the functionality from
21101         the InitCodeTypes function.
21102
21103         * driver.cs: Call InitCodeHelpers after we have populated the
21104         types. 
21105
21106         * cs-parser.jay (delegate_declaration): we did not used to compute
21107         the delegate name correctly for void delegates.
21108
21109 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
21110
21111         * rootcontext.cs (RootContext): Init the interface_resolve_order
21112         and type_container_resolve_order always.
21113
21114         (ResolveCore, BootstrapCorlib_ResolveClass,
21115         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
21116         compiler when compiling with --nostdlib
21117
21118         * class.cs (TypeContainer.DefineType): Check that our parent is
21119         not null.  This test is most important when we are bootstraping
21120         the core types.
21121
21122         * codegen.cs: Split out the symbol writing code.
21123
21124 2002-03-25  Martin Baulig  <martin@gnome.org>
21125
21126         * driver.cs (-g): Made -g an alias for --debug.
21127
21128 2002-03-24  Martin Baulig  <martin@gnome.org>
21129
21130         * codegen.cs (SymbolWriter): New public variable. Returns the
21131         current symbol writer.
21132         (CodeGen): Added `bool want_debugging_support' argument to the
21133          constructor. If true, tell the ModuleBuild that we want debugging
21134         support and ask it for the ISymbolWriter.
21135         (Save): If we have a symbol writer, call it's Close() method after
21136         saving the assembly.
21137
21138         * driver.c (--debug): New command line argument to create a
21139         debugger information file.
21140
21141         * location.cs (SymbolDocument): New public property. Returns an
21142         ISymbolDocumentWriter object for the current source file or null
21143         if we don't have a symbol writer.
21144
21145 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
21146
21147         * driver.cs (LoadAssembly): Correctly return when all the paths
21148         have been tried and not before.
21149
21150         * statement.cs (Switch.Emit): return the actual coverage for this
21151         statement (returns/not-returns)
21152
21153         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
21154         switch of the statement if we are the last switch section.  That
21155         kills two problems: try/catch problems (we used to emit an empty
21156         nop at the end) and switch statements where all branches would
21157         return. 
21158
21159 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
21160
21161         * driver.cs: Add default assemblies (the equivalent to the
21162         Microsoft CSC.RSP file)
21163
21164         * cs-tokenizer.cs: When updating `cols and setting it to zero,
21165         also update tokens_seen and set it to false.
21166
21167         * driver.cs: Implement --recurse for Mike.
21168
21169         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
21170         correctly splitting out the paths.
21171
21172 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
21173
21174         * interface.cs (Interface.PopulateProperty): Instead of using
21175         `parent' as the declaration space for the set parameters, use
21176         `this' 
21177
21178         * support.cs (InternalParameters): InternalParameters constructor
21179         takes a DeclSpace instead of a TypeContainer.
21180
21181         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
21182         types are being initialized, load the address of it before calling
21183         the function.  
21184
21185         (New): Provide a mechanism to disable the generation of local
21186         value type temporaries when the caller will be providing us with
21187         an address to store it.
21188
21189         (ArrayCreation.EmitDynamicInitializers): Use it.
21190
21191 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
21192
21193         * expression.cs (Invocation.EmitArguments): Only probe for array
21194         property if there is more than one argument.  Sorry about that.
21195
21196         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
21197         empty param arrays.
21198
21199         * class.cs (Method.LabelParameters): Fix incorrect code path that
21200         prevented the `ParamArrayAttribute' from being applied to the
21201         params attribute.
21202
21203 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
21204
21205         * support.cs (ReflectionParameters): Correctly compute whether the
21206         last argument is a params array.  Fixes the problem with
21207         string.Split ('a')
21208
21209         * typemanager.cs: Make the assemblies array always be non-null
21210         (empty, but non-null)
21211
21212         * tree.cs (RecordDecl): New function that abstracts the recording
21213         of names.  This reports error 101, and provides a pointer to the
21214         previous declaration.  Fixes a crash in the compiler.
21215
21216         * cs-parser.jay (constructor_declaration): Update to new grammar,
21217         and provide a constructor_body that can be empty.
21218
21219 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
21220
21221         * driver.cs: Add support for --resources.
21222
21223         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
21224         Make all types for the various array helper methods be integer.
21225
21226         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
21227         CheckState to ConvCast.
21228
21229         (ConvCast): Now it takes a `checked' state argument, to avoid
21230         depending on the emit context for the conversion, and just using
21231         the resolve time setting.
21232
21233         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
21234         instead of Invocation.EmitArguments.  We do not emit the original
21235         arguments, instead we emit those which have been converted to
21236         unsigned int expressions.
21237
21238         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
21239
21240         * codegen.cs: ditto.
21241
21242         * expression.cs (LocalVariableReference): Drop the use of the
21243         Store function that depended on the variable index.
21244
21245         * statement.cs (VariableInfo): Drop the `Idx' property from this
21246         class, as this is not taking into account the indexes for
21247         temporaries tat we generate during the execution, getting the
21248         indexes wrong.
21249
21250         * class.cs: First emit class initializers, then call the parent
21251         constructor. 
21252
21253         * expression.cs (Binary): Fix opcode emision.
21254         (UnaryMutator.EmitCode): Support checked code generation
21255
21256         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
21257         matches for events for both the Static and Instance scans,
21258         pointing to the same element.   Fix that.
21259
21260 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
21261
21262         * rootcontext.cs (ResolveTree): Always set the
21263         interface_resolve_order, because nested interfaces will be calling
21264         into us.
21265
21266         * class.cs (GetInterfaceOrClass): Track the same resolution
21267         process used by TypeManager.LookupType.  This fixes the nested
21268         type lookups in class declarations (separate path from
21269         LookupType). 
21270
21271         (TypeContainer.DefineType): Also define nested interfaces.
21272         (TypeContainer.RegisterOrder): New public function used to
21273         register the order in which child interfaces need to be closed.
21274
21275         Nested interfaces need to be closed after their parents have been
21276         created. 
21277
21278         * interface.cs (InterfaceAttr): Put all the logic for computing
21279         the interface attribute here. 
21280
21281         (DefineInterface): Register our interface order with the
21282         RootContext or with the TypeContainer depending on the case.
21283
21284 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
21285
21286         * cs-parser.jay: rework foreach statement to work with the new
21287         changes to the policy on SimpleNames.
21288
21289         * report.cs: support Stacktrace on warnings as well.
21290
21291         * makefile: drop --unsafe and /unsafe from the compile.
21292
21293 2002-03-13  Ravi Pratap  <ravi@ximian.com>
21294
21295         * ecore.cs (StandardConversionExists): Modify to take an Expression
21296         as the first parameter. Ensure we do null -> reference type conversion
21297         checking.
21298
21299         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
21300         temporary Expression objects.
21301
21302 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
21303
21304         * interface.cs: workaround bug in method overloading resolution
21305         (there is already a bugzilla bug for it).
21306
21307 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
21308
21309         We could also solve this problem by having a separate path for
21310         performing type lookups, instead of DoResolve, we could have a
21311         ResolveType entry point, and only participating pieces of the
21312         production (simplename, deref, array) would implement this. 
21313
21314         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
21315         signal SimpleName to only resolve type names and not attempt to
21316         resolve anything else.
21317
21318         * expression.cs (Cast): Set the flag.
21319
21320         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
21321
21322         * class.cs: Only report 108 if there is no `new' modifier.
21323
21324         * cs-parser.jay: rework foreach statement to work with the new
21325         changes to the policy on SimpleNames.
21326         
21327         * report.cs: support Stacktrace on warnings as well.
21328
21329         * makefile: drop --unsafe and /unsafe from the compile.
21330
21331 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
21332
21333         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21334         lookups here, instead of doing that at parse time.  This means
21335         that our grammar will not introduce `LocalVariableReferences' as
21336         expressions at this point.  That solves the problem of code like
21337         this:
21338
21339         class X {
21340            static void Main ()
21341            { int X = 1;
21342             { X x = null }}}
21343
21344         This is only half the fix.  The full fix requires parameters to
21345         also be handled in this way.
21346
21347         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
21348         makes the use more obvious of the DeclSpace.  The
21349         ec.TypeContainer.TypeBuilder is now only used to pull the
21350         TypeBuilder for it.
21351
21352         My theory is that I can get rid of the TypeBuilder completely from
21353         the EmitContext, and have typecasts where it is used (from
21354         DeclSpace to where it matters).  
21355
21356         The only pending problem is that the code that implements Aliases
21357         is on TypeContainer, and probably should go in DeclSpace.
21358
21359         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21360         lookups here, instead of doing that at parse time.  This means
21361         that our grammar will not introduce `LocalVariableReferences' as
21362         expressions at this point.  That solves the problem of code like
21363         this:
21364
21365         class X {
21366            static void Main ()
21367            { int X = 1;
21368             { X x = null }}}
21369
21370         This is only half the fix.  The full fix requires parameters to
21371         also be handled in this way.
21372
21373         * class.cs (Property.DefineMethod): When implementing an interface
21374         method, set newslot, when implementing an abstract method, do not
21375         set the flag (before we tried never setting it, or always setting
21376         it, which is the difference).
21377         (Indexer.DefineMethod): same.
21378         (Method.DefineMethod): same.
21379
21380         * ecore.cs: Only set the status used flag if we get back a Field.
21381
21382         * attribute.cs: Temporary hack, so Paolo can keep working.
21383
21384 2002-03-08  Ravi Pratap  <ravi@ximian.com>
21385
21386         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
21387         the unmanaged type in the case we have a MarshalAs attribute.
21388
21389         (Resolve): Handle the case when we are parsing the special MarshalAs
21390         attribute [we need to store the unmanaged type to use later]
21391
21392         * typemanager.cs (marshal_as_attr_type): Built in type for the 
21393         MarshalAs Attribute.
21394
21395         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
21396         on parameters and accordingly set the marshalling info.
21397
21398 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
21399
21400         * class.cs: Optimizing slightly by removing redundant code after
21401         we switched to the `NoTypes' return value.
21402         (Property.DefineMethod): use NoTypes here too.
21403
21404         This fixes the bug I introduced in my last batch of changes.
21405
21406 2002-03-05  Ravi Pratap  <ravi@ximian.com>
21407
21408         * tree.cs (RecordEnum): Add. We now keep track of enums too.
21409
21410         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
21411         Enums since those are types too. 
21412
21413         * cs-parser.jay (enum_declaration): Record enums as we parse them.
21414
21415         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
21416         thanks to a call during the lookup process.
21417
21418 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
21419
21420         * statement.cs (Foreach): Lots of work to accomodate a particular
21421         kind of foreach statement that I had not kept in mind.  It is
21422         possible to have foreachs on classes that provide a GetEnumerator
21423         method that return objects that implement the "pattern" for using
21424         a foreach, there is no need to support GetEnumerator
21425         specifically. 
21426
21427         This is needed to compile nant.
21428
21429         * decl.cs: Only report 114 if the member is not `Finalize' and if
21430         the warning level is at least 2.
21431
21432         * class.cs: Moved the compare function from Method to
21433         MethodSignature. 
21434
21435         (MethodSignature.InheritableMemberSignatureCompare): Add new
21436         filter function that is used to extract inheritable methods from a
21437         class. 
21438
21439         (Method.Define): Use the new `inheritable_method_signature_filter'
21440         delegate
21441
21442         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
21443         command. 
21444
21445 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
21446
21447         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
21448
21449         * cs-parser.jay: Add opt_semicolon to the interface declaration.
21450
21451         * expression.cs: Pass location information to
21452         ConvertImplicitStandard. 
21453
21454         * class.cs: Added debugging code to track return values from
21455         interfaces. 
21456
21457 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
21458
21459         * expression.cs (Is.DoResolve): If either side of the `is' is an
21460         interface, do not flag the warning.
21461
21462         * ecore.cs (ImplicitReferenceConversion): We need a separate test
21463         for interfaces
21464
21465         * report.cs: Allow for --fatal to be used with --probe.
21466
21467         * typemanager.cs (NoTypes): Move the definition for the empty Type
21468         array here. 
21469
21470         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
21471         properties. 
21472         (TypeContainer.DefineProxy): New function used to proxy to parent
21473         implementations when implementing interfaces.
21474         (TypeContainer.ParentImplements): used to lookup if our parent
21475         implements a public function that is required by an interface.
21476         (TypeContainer.VerifyPendingMethods): Hook this up.
21477
21478         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
21479         `modules' and `assemblies' arraylists into arrays.  We only grow
21480         these are the very early start up of the program, so this improves
21481         the speedof LookupType (nicely measured).
21482
21483         * expression.cs (MakeByteBlob): Replaced unsafe code with
21484         BitConverter, as suggested by Paolo.
21485
21486         * cfold.cs (ConstantFold.Binary): Special case: perform constant
21487         folding of string concatenation, but if either side is a string,
21488         and the other is not, then return null, and let the runtime use
21489         the concatenation on the string plus the object (using
21490         `Object.ToString'). 
21491
21492 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
21493
21494         Constant Folding has been implemented now.
21495
21496         * expression.cs (Unary.Reduce): Do not throw an exception, catch
21497         the error instead on types that are not supported in one's
21498         complement. 
21499
21500         * constant.cs (Constant and all children): New set of functions to
21501         perform implict and explicit conversions.
21502
21503         * ecore.cs (EnumConstant): Implement the new functions to perform
21504         conversion by proxying to the child expression.
21505
21506         * codegen.cs: (ConstantCheckState): Constant evaluation has its
21507         own separate setting that can not be turned off from the command
21508         line using --unchecked or --checked and is only controlled using
21509         the checked/unchecked statements and expressions.  This setting is
21510         used by the constant folder to flag errors.
21511
21512         * expression.cs (CheckedExpr, UncheckedExpr): Set the
21513         ConstantCheckState as well.   
21514
21515         During Resolve, they also have to flag the state, because the
21516         constant folder runs completely in the Resolve phase.
21517
21518         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
21519         well.
21520
21521 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21522
21523         * cfold.cs: New file, this file contains the constant folder.
21524
21525         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21526         argument to track whether we are using the resulting address to
21527         load or store a value and provide better error messages. 
21528
21529         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21530         new AddressOf arguments.
21531
21532         * statement.cs (Foreach.EmitCollectionForeach): Update
21533
21534         * expression.cs (Argument.Emit): Call AddressOf with proper
21535         arguments to track usage.
21536
21537         (New.DoEmit): Call AddressOf with new arguments.
21538
21539         (Unary.Emit): Adjust AddressOf call.
21540
21541 2002-03-01  Ravi Pratap  <ravi@ximian.com>
21542
21543         * cs-parser.jay (member_access): Change the case for pre-defined types
21544         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
21545         this suggestion.
21546
21547         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21548         a method body.
21549
21550         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21551         essentially like methods and apply attributes like MethodImplOptions to them too.
21552
21553         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21554         not being null.
21555
21556         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21557         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21558         is the DeclSpace.
21559
21560         * Update code everywhere accordingly.
21561
21562         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21563
21564         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21565
21566 2002-02-28  Ravi Pratap  <ravi@ximian.com>
21567
21568         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21569         try performing lookups against those instead of jumping straight into using
21570         the 'using' clauses.
21571
21572         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21573
21574         (LookupType): Perform lookups in implicit parents too.
21575
21576         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21577         sequence as RootContext.LookupType. 
21578
21579         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
21580         the various cases of namespace lookups into this method.
21581
21582 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21583
21584         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21585         in positional arguments)
21586
21587         * class.cs (Operator): Update the AllowedModifiers to contain
21588         extern. 
21589
21590         * cs-parser.jay: Update operator declaration to allow for the
21591         operator body to be empty.
21592
21593         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21594         values. 
21595
21596 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
21597
21598         * class.cs (Method.Emit): Label parameters.
21599
21600         * driver.cs: Return 1 or 0 as the program exit code.
21601
21602 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
21603
21604         * expression.cs: Special case the `null' object when trying to
21605         auto-compute the type, as anything can be explicitly converted to
21606         that. 
21607
21608         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21609         spotting this Paolo.
21610
21611         (Expression.ImplicitNumericConversion): Perform comparissions of
21612         the type using the underlying type in the case of an enumeration
21613         rather than using the enumeration type for the compare.
21614
21615         Cope with the underlying == type case, which is not possible to
21616         catch before. 
21617
21618         (Expression.ConvertNumericExplicit): Perform comparissions of
21619         the type using the underlying type in the case of an enumeration
21620         rather than using the enumeration type for the compare.
21621
21622         * driver.cs: If the user does not supply an extension, assume .exe
21623
21624         * cs-parser.jay (if_statement): Rewrote so that we can track the
21625         location for the if statement.
21626
21627         * expression.cs (Binary.ConstantFold): Only concat strings when
21628         the operation is "+", not everything ;-)
21629
21630         * statement.cs (Statement.EmitBoolExpression): Take a location
21631         argument. 
21632         (If, While, Do): Track location.
21633
21634         * expression.cs (Binary.ResolveOperator): In the object + string
21635         case, I was missing a call to ConvertImplicit
21636
21637 2002-02-25  Ravi Pratap  <ravi@ximian.com>
21638
21639         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21640         Location arguments. Ensure we use RootContext.LookupType to do our work
21641         and not try to do a direct Type.GetType and ModuleBuilder.GetType
21642
21643         * interface.cs (PopulateMethod): Handle the type of the parameter being
21644         null gracefully.
21645
21646         * expression.cs (Invocation.BetterFunction): Handle the case when we 
21647         have a params method with no fixed arguments and a call is made with no
21648         arguments.
21649
21650 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
21651
21652         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21653         the verbatim-string-literal
21654
21655         * support.cs (InternalParameters.ParameterModifier): handle null
21656         fixed parameters.
21657         (InternalParameters.ParameterType): ditto.
21658
21659         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21660         duplicating the name of the variable parameter.
21661         (GetParameterByName): Fix bug where we were not looking up array
21662         paramters if they were the only present (thanks Paolo!).
21663         (GetParameterInfo): We only have an empty set of types if both
21664         fixed and array are set to null.
21665         (GetParameterInfo-idx): Handle FixedParameter == null
21666
21667         * cs-parser.jay: Handle the case where there is no catch
21668         statements (missing null test).
21669
21670 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
21671
21672         * driver.cs (MainDriver): Be conservative on our command line
21673         handling.
21674
21675         Catch DirectoryNotFoundException when calling GetFiles.
21676
21677         (SplitPathAndPattern): Used to split the input specification into
21678         a path and a pattern that we can feed to Directory.GetFiles.
21679
21680 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
21681
21682         * statement.cs (Fixed): Implement the last case of the Fixed
21683         statement (string handling).
21684
21685         * expression.cs (StringPtr): New class used to return a char * to
21686         a string;  Used by the Fixed statement.
21687
21688         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
21689
21690         * expression.cs (Binary.ResolveOperator): Remove redundant
21691         MemberLookup pn parent type.
21692         Optimize union call, we do not need a union if the types are the same.
21693         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21694         type.
21695
21696         Specialize the use of MemberLookup everywhere, instead of using
21697         the default settings. 
21698
21699         (StackAlloc): Implement stackalloc keyword.
21700
21701         * cs-parser.jay: Add rule to parse stackalloc.
21702
21703         * driver.cs: Handle /h, /help, /?
21704
21705         * expression.cs (MakeByteBlob): Removed the hacks we had in place
21706         before we supported unsafe code.
21707
21708         * makefile: add --unsafe to the self compilation of mcs.
21709
21710 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
21711
21712         * expression.cs (PointerArithmetic): New class that is used to
21713         perform pointer arithmetic.
21714         (Binary.Resolve): Handle pointer arithmetic
21715         Handle pointer comparission.
21716         (ArrayPtr): Utility expression class that is used to take the
21717         address of an array.
21718
21719         (ElementAccess): Implement array access for pointers
21720
21721         * statement.cs (Fixed): Implement fixed statement for arrays, we
21722         are missing one more case before we are done.
21723
21724         * expression.cs (Indirection): Implement EmitAssign and set the
21725         ExprClass to Variable.  This allows pointer dereferences to be
21726         treated as variables, and to have values assigned to them.
21727
21728         * ecore.cs (Expression.StoreFromPtr): New utility function to
21729         store values dereferencing.
21730
21731 2002-02-20  Ravi Pratap  <ravi@ximian.com>
21732
21733         * expression.cs (Binary.ResolveOperator): Ensure that we are
21734         not trying to operate on a void type - this fixes the reported
21735         bug.
21736
21737         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21738         the parent implementation is sealed.
21739
21740         * ../errors/cs0239.cs : Add.
21741
21742         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21743
21744         * typemanager.cs (unverifiable_code_type): Corresponds to 
21745         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21746         which have unsafe code in them.
21747
21748         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
21749         unsafe context.
21750
21751 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
21752
21753         * cs-tokenizer.cs: Add support for @"litreal strings"
21754
21755         Make tokenizer accept pre-processor directives
21756         on any column (remove the old C-like limitation). 
21757
21758         * rootcontext.cs (EmitCode): Emit any global attributes.
21759         (AddGlobalAttributes): Used to keep track of assembly attributes. 
21760
21761         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21762
21763         * cs-parser.jay: Add support for global attributes.  
21764
21765 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
21766
21767         * expression.cs (Indirection): New helper class.  Unary will
21768         create Indirection classes to be able to implement the
21769         IMemoryLocation interface on it.
21770
21771 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
21772
21773         * cs-parser.jay (fixed_statement): reference the right statement.
21774
21775         * statement.cs (Fixed.Emit): Finish implementing the fixed
21776         statement for the &x case.
21777
21778 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
21779
21780         * class.cs (Property.Define, Method.Define): Remove newslot when
21781         `implementing'.  
21782
21783         * modifiers.cs: My use of NewSlot when `Abstract' was set was
21784         wrong.  NewSlot should only be used if the `new' keyword is present.
21785
21786         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21787         locating our system dir.  Sorry about this.
21788
21789 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21790
21791         * driver.cs (GetSystemDir): Compute correctly the location of our
21792         system assemblies.  I was using the compiler directory instead of
21793         the library directory.
21794
21795 2002-02-13  Ravi Pratap  <ravi@ximian.com>
21796
21797         * expression.cs (BetterFunction): Put back in what Miguel commented out
21798         since it is the correct fix. The problem is elsewhere ;-)
21799
21800         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21801         parameters of the parms method are themselves compatible or not !
21802
21803         (StandardConversionExists): Fix very dangerous bug where we were forgetting
21804         to check that a class implements an interface before saying that an implicit
21805         conversion was allowed. Use ImplementsInterface to do the checking.
21806
21807 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21808
21809         * class.cs (Method.Define): Track whether we are an explicit
21810         implementation or not.  And only call DefineMethodOverride if we
21811         are an explicit implementation.
21812
21813         (Property.DefineMethod): Ditto.
21814
21815 2002-02-11  Ravi Pratap  <ravi@ximian.com>
21816
21817         * expression.cs (BetterFunction): Catch hideous bug which was
21818          preventing us from detecting ambiguous calls due to implicit casts i.e
21819         cs0121.
21820
21821 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
21822
21823         * support.cs (Pair): Remove un-needed method.  I figured why I was
21824         getting the error in cs-parser.jay, the variable in a foreach loop
21825         is readonly, and the compiler does not really treat this as a variable.
21826
21827         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
21828         instead of EQUALS in grammar.  
21829
21830         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21831
21832         * expression.cs (Unary.DoResolve): Check whether the argument is
21833         managed or not.
21834
21835 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
21836
21837         * support.cs: Api for Pair to set a value.  Despite the fact that
21838         the variables are public the MS C# compiler refuses to compile
21839         code that accesses the field if the variable is part of a foreach
21840         statement. 
21841
21842         * statement.cs (Fixed): Begin implementation of the fixed
21843         statement.
21844
21845         (Block.AddVariable): Return the VariableInfo on success and null
21846         on failure instead of true/false. 
21847
21848         * cs-parser.jay (foreach): Catch errors on variables already
21849         defined (we were ignoring this value before) and properly unwind
21850         the block hierarchy
21851
21852         (fixed_statement): grammar for the fixed statement.
21853
21854 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
21855
21856         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21857         pointer types to be incretemented.
21858
21859         (SizeOf): Implement.
21860
21861         * cs-parser.jay (pointer_member_access): Implement
21862         expr->IDENTIFIER production.
21863
21864         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21865         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21866         on safe contexts.
21867
21868         (Unary): Implement indirection.
21869
21870         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21871         use in non-unsafe context).
21872
21873         (SimpleName.DoResolve): Check for pointers in field access on safe
21874         contexts. 
21875
21876         (Expression.LoadFromPtr): Factor the load-indirect code in this
21877         function.  This was duplicated in UnboxCast and ParameterReference
21878
21879 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
21880
21881         * expression.cs (ComposedCast): report an error if a pointer cast
21882         is used in a safe region.
21883
21884         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21885         pointer type casts in unsafe context.
21886
21887         * codegen.cs (EmitContext): Set up IsUnsafe.
21888
21889         * cs-parser.jay (non_expression_type): Add productions for pointer
21890         casts. 
21891
21892         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21893         code.  We should not use force into static mode if the method is
21894         not virtual.  Fixes bug in MIS
21895
21896         * statement.cs (Do.Emit, While.Emit, For.Emit,
21897         Statement.EmitBoolExpression): Add support to Do and While to
21898         propagate infinite loop as `I do return' semantics.
21899
21900         Improve the For case to also test for boolean constants.
21901
21902         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21903         to the list of attributes we can add.
21904
21905         Remove `EmitContext' argument.
21906
21907         * class.cs (Method.Define): Apply parameter attributes.
21908         (Constructor.Define): Apply parameter attributes.
21909         (MethodCore.LabelParameters): Move here the core of labeling
21910         parameters. 
21911
21912         * support.cs (ReflectionParameters.ParameterModifier,
21913         InternalParameters.ParameterModifier): Use IsByRef on the type and
21914         only return the OUT bit for these parameters instead of in/out/ref
21915         flags.
21916
21917         This is because I miss-understood things.  The ParameterInfo.IsIn
21918         and IsOut represent whether the parameter has the [In] and [Out]
21919         attributes set.  
21920
21921 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
21922
21923         * ecore.cs (FieldExpr.Emit): Release temporaries.
21924
21925         * assign.cs (LocalTemporary.Release): new function.
21926
21927         * codegen.cs (EmitContext.GetTemporaryStorage,
21928         EmitContext.FreeTemporaryStorage): Rework the way we deal with
21929         temporary storage.  Now we can "put back" localbuilders when we
21930         are done with them
21931
21932 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
21933
21934         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21935         need to make a copy of the variable to generate verifiable code.
21936
21937 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
21938
21939         * driver.cs: Compute dynamically the system directory.
21940
21941         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21942         Slower, but more generally useful.  Used by the abstract
21943         registering implementation. 
21944
21945         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21946         the rules for the special rule on Type/instances.  First check if
21947         we have the same name, and if so, try that special static path
21948         rather than the instance path.
21949
21950 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
21951
21952         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21953         for, while and if.
21954
21955         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21956         Enum, ValueType, Delegate or Array for non-corlib compiles.
21957
21958         * cs-tokenizer.cs: Catch long identifiers (645)
21959
21960         * typemanager.cs (IndexerPropetyName): Ravi never tested this
21961         piece of code.
21962
21963         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21964         fix, we were returning too early, so we were not registering
21965         pending methods from abstract classes.
21966
21967         Do not register pending methods if the class is abstract.
21968
21969         * expression.cs (Conditional.DoResolve): Report circular implicit
21970         conversions when we neecd to compute it for conditional
21971         expressions. 
21972
21973         (Is.DoResolve): If the expression is always of the provided type,
21974         flag warning 183.  If the expression can not ever be of the
21975         provided type flag warning 184.
21976
21977         * class.cs: Catch 169 as well.
21978
21979         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21980         read. 
21981
21982 2002-01-18  Nick Drochak  <ndrochak@gol.com>
21983
21984         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
21985
21986 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
21987
21988         * interface.cs: (PopulateMethod): Check for pointers being defined
21989         only if the unsafe context is active.
21990         (PopulateProperty): ditto.
21991         (PopulateIndexer): ditto.
21992
21993         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21994         specified.  If pointers are present, make sure that they are
21995         present in an unsafe context.
21996         (Constructor, Constructor.Define): ditto.
21997         (Field, Field.Define): ditto.
21998         (Property, Property.Define): ditto.
21999         (Event, Event.Define): ditto.
22000
22001         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
22002         hashtable if there are classes or structs defined.
22003
22004         * expression.cs (LocalVariableReference.DoResolve): Simplify this
22005         code, as the constant resolution moved.
22006
22007         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
22008         the metadata, so we can flag error 133. 
22009
22010         * decl.cs (MemberCore.UnsafeOK): New function to test that a
22011         pointer is being declared in an unsafe context.
22012
22013 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
22014
22015         * modifiers.cs (Modifiers.Check): Require a Location argument.
22016         Report error 227 for Unsafe use.
22017
22018         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
22019
22020         * statement.cs (For.Emit): If the test is null, then report that
22021         we do `return', as we wont reach anything afterwards.
22022
22023         (Switch.SwitchGoverningType): Track the expression that matched
22024         the conversion.
22025
22026         * driver.cs: Allow negative numbers as an error code to flag.
22027
22028         * cs-parser.jay: Handle 1551.
22029
22030         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
22031
22032 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
22033
22034         * cs-parser.jay: Report 1518 (type declaration can only contain
22035         class, struct, interface, enum or delegate)
22036
22037         (switch_label): Report 1523 (keywords `case' or `default' must
22038         preced code)
22039
22040         (opt_switch_sections): Report 1522 (empty switch)
22041
22042         * driver.cs: Report 1515 (response file specified multiple times)
22043         Report 1516 (Source file specified multiple times).
22044
22045         * expression.cs (Argument.Resolve): Signal 1510
22046
22047         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
22048         access not allowed in static code)
22049
22050 2002-01-11  Ravi Pratap  <ravi@ximian.com>
22051
22052         * typemanager.cs (IsPointerType): Utility method which we are going
22053         to need a lot.
22054
22055         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
22056         the object type, so we take care of that.
22057
22058         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
22059
22060         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
22061         added to non-params parameters :-)
22062
22063         * typemanager.cs (CSharpName): Include 'void' type too. 
22064
22065         (void_ptr_type): Include in the set of core types.
22066
22067         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
22068         duplicating code.
22069
22070         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
22071         an unsafe context.
22072
22073         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
22074         completely forgotten about it.
22075
22076 2002-01-10  Ravi Pratap  <ravi@ximian.com>
22077
22078         * cs-parser.jay (pointer_type): Add. This begins our implementation
22079         of parsing rules for unsafe code.
22080
22081         (unsafe_statement): Implement.
22082
22083         (embedded_statement): Modify to include the above.
22084
22085         * statement.cs (Unsafe): Implement new class for unsafe blocks.
22086
22087         * codegen.cs (EmitContext.InUnsafe): Add. This determines
22088         if the current context is an unsafe one.
22089
22090         * cs-parser.jay (local_variable_pointer_type): Since local variable types
22091         are handled differently, we need separate rules for them.
22092
22093         (local_variable_declaration): Update to use local_variable_pointer_type
22094         to allow variable declarations of unmanaged pointer types.
22095
22096         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
22097         in unsafe contexts.
22098
22099         * ../errors/cs0214.cs : Add.
22100
22101 2002-01-16  Nick Drochak  <ndrochak@gol.com>
22102
22103         * makefile: remove 'response' file when cleaning.
22104
22105 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
22106
22107         * cs-parser.jay: Report 1524.
22108
22109 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
22110
22111         * typemanager.cs (RegisterMethod): drop checking if we have
22112         registered this from here
22113
22114 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
22115
22116         * class.cs (Method.EmitDestructor): Implement calling our base
22117         destructor. 
22118
22119         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
22120         value of InFinally.
22121
22122         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
22123         this routine and will wrap the call in a try/catch block.  Deal
22124         with the case.
22125
22126 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
22127
22128         * ecore.cs (Expression.MemberLookup): instead of taking a
22129         parameter `same_type' that was used to tell whether we could
22130         access private members we compute our containing type from the
22131         EmitContext.
22132
22133         (FieldExpr): Added partial support for volatile fields.  This does
22134         not work for volatile fields exposed from assemblies, as I can not
22135         figure out how to extract the modreq from it.
22136
22137         Updated all the source files to use this.
22138
22139         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
22140         because it is referenced by MemberLookup very often. 
22141
22142 2002-01-09  Ravi Pratap  <ravi@ximian.com>
22143
22144         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
22145         TypeBuilder.GetCustomAttributes to retrieve what we need.
22146
22147         Get rid of redundant default_member_attr_type as this is the same as
22148         default_member_type which already exists.
22149
22150         * interface.cs, attribute.cs : Update accordingly.
22151
22152 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
22153
22154         * typemanager.cs: Enable IndexerPropertyName again.  It does not
22155         work for TYpeBuilders though.  Ravi, can you please fix this?
22156
22157         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
22158
22159         * expression.cs (Argument.Emit): Handle the case of ref objects
22160         being passed to ref functions;  
22161
22162         (ParameterReference.EmitLoad): Loads the content of the pointer
22163         without dereferencing.
22164
22165 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
22166
22167         * cs-tokenizer.cs: Implemented the pre-processing expressions.
22168
22169 2002-01-08  Ravi Pratap  <ravi@ximian.com>
22170
22171         * class.cs (Indexer.DefineMethod): Incorporate the interface
22172         type in the name of the method if we are doing explicit interface
22173         implementation.
22174
22175         * expression.cs (ConversionExists): Remove as it is completely obsolete.
22176
22177         (BetterConversion): Fix extremely trivial bug where we were referring to
22178         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
22179         again !
22180
22181         * ../errors/bug16.cs : Add although we have fixed it.
22182
22183 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
22184
22185         * expression.cs (BaseIndexer): Begin implementation.
22186
22187         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
22188
22189         * cs-parser.jay (indexer_declarator): Use qualified_identifier
22190         production directly to remove a shift/reduce, and implement
22191         explicit interface implementation.
22192
22193         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
22194         after a floating point suffix.
22195
22196         * expression.cs (DoNumericPromotions): Improved the conversion for
22197         uint/uint.  If we have a constant, we avoid doing a typecast to a
22198         larger type.
22199
22200         * class.cs (Indexer): Implement explicit interface implementation
22201         for indexers.
22202
22203 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
22204
22205         * class.cs: make the default instance constructor public and hidebysig.
22206
22207 2001-01-03  Ravi Pratap  <ravi@ximian.com>
22208
22209         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
22210         so we can call it from elsewhere.
22211
22212         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
22213         we emit it internally if the class has a defined indexer; otherwise the user
22214         emits it by decorating the class definition with the DefaultMemberAttribute.
22215
22216         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
22217         attribute is not used on a type which defines an indexer.
22218
22219         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
22220         character when we skip whitespace.
22221
22222         * ../errors/cs0646.cs : Add.
22223
22224 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
22225
22226         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
22227         again. 
22228
22229         * makefile: Add practical target `mcs3.exe' which builds the third
22230         generation compiler. 
22231
22232         * expression.cs (New): Fix structures constructor calling.
22233
22234         * class.cs (Property, Method, Indexer): Emit Final flag on the
22235         method if we are an interface implementation and we are not
22236         abstract. 
22237
22238         * ecore.cs (PropertyExpr): New public field `IsBase', tells
22239         whether this property is referencing a `base' method.
22240
22241         * expression.cs (Invocation.EmitCall): take an extra argument:
22242         is_base, this is used to determine whether the `call' or
22243         `callvirt' opcode should be used.
22244
22245
22246         * delegate.cs: update EmitCall.
22247
22248         * class.cs (Method.Define): Set NewSlot for the cases where we are
22249         not implementing an interface method.
22250
22251         (Property.Define): ditto.
22252
22253 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
22254
22255         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
22256         'r'.  Allows mcs to parse itself fully.
22257
22258 2002-01-02  Ravi Pratap  <ravi@ximian.com>
22259
22260         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
22261         of the number of initializers that require the InitializeArray method.
22262
22263         (CheckIndices): Store the Expression in all cases - not the plain value. Also
22264         update the above field where necessary.
22265
22266         (MakeByteBlob): Update accordingly.
22267
22268         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
22269         greater than 2.
22270
22271         (EmitDynamicInitializers): Update in accordance with the new optimization.
22272
22273         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
22274         same OpCode applies.
22275
22276         * cs-parser.jay : Fix some glaring errors I introduced.
22277
22278 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
22279
22280         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
22281         so that we can check for name clashes there too.
22282
22283         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
22284         for interface indexers.
22285
22286         * interfaces.cs (Define): Emit the default member attribute.
22287
22288         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
22289         variable was being referred to while setting the value ;-)
22290
22291 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
22292
22293         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
22294         byte-by-byte information when we know the data is zero.
22295
22296         Make the block always a multiple of 4, because
22297         DefineInitializedData has a bug.
22298
22299         * assign.cs: Fix, we should assign from the temporary, not from
22300         the source. 
22301
22302         * expression.cs (MakeByteBlob): Fix my incorrect code.
22303
22304 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
22305
22306         * typemanager.cs (EnumToUnderlying): This function is used to get
22307         the underlying type from an enumeration, because it does not
22308         always work. 
22309
22310         * constant.cs: Use the I4_S form for values between -128 and 127.
22311
22312         * statement.cs (Block.LookupLabel): Looks up a label.
22313         (Block): Drop support for labeled blocks.
22314
22315         (LabeledStatement): New kind of statement that represents a label
22316         only.
22317
22318         (Goto): Finally implement this bad boy.
22319
22320         * cs-parser.jay: Update to reflect new mechanism to implement
22321         labels.
22322
22323 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
22324
22325         * codegen.cs (EmitContext.This): a codegen property that keeps the
22326         a single instance of this instead of creating many different this
22327         instances. 
22328
22329         * delegate.cs (Delegate.DoResolve): Update to use the property;
22330
22331         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
22332
22333         * expression.cs (BaseAccess.DoResolve): Ditto.
22334
22335 2001-12-29  Ravi Pratap  <ravi@ximian.com>
22336
22337         * typemanager.cs (methodimpl_attr_type): Add to hold the type
22338         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
22339
22340         (InitCoreTypes): Update accordingly.
22341
22342         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
22343         so we can quickly store the state.
22344
22345         (ApplyAttributes): Set the correct implementation flags
22346         for InternalCall methods.
22347
22348 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
22349
22350         * expression.cs (EmitCall): if a method is not virtual, then do
22351         not use callvirt on it.
22352
22353         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
22354         user defined stuff) requires the use of stobj, which takes an
22355         address on the stack instead of an array and an index.  So emit
22356         the Ldelema operation for it.
22357
22358         (EmitStoreOpcode): Use stobj for valuetypes.
22359
22360         (UnaryMutator.EmitCode): Use the right 1 value depending on
22361         whether we are dealing with int64/uint64, float or doubles.
22362
22363         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
22364         constructors that I implemented last night.
22365
22366         (Constructor.IsDefault): Fix to work properly for static
22367         constructors.
22368
22369         * cs-parser.jay (CheckDef): report method signature errors.
22370         Update error number 103 to be 132.
22371
22372         * decl.cs: New AdditionResult enumeration value: MethodExists.
22373         Although we do this check for methods later on in the semantic
22374         analysis, catching repeated default constructors is so easy that
22375         we catch these here. 
22376
22377         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
22378         promotions code.
22379
22380         (ParameterReference.EmitAssign, Emit): handle
22381         bools as bytes.
22382
22383         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
22384         (ArrayAccess.EmitStoreOpcode): ditto.
22385
22386         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
22387
22388         * expression.cs (MakeByteBlob): Complete all the missing types
22389         (uint, short, ushort, byte, sbyte)
22390
22391         * class.cs: Only init instance field initializers on instance
22392         constructors. 
22393
22394         Rename `constructors' to instance_constructors. 
22395
22396         (TypeContainer.AddConstructor): Only add constructors to the list
22397         if it is not static.
22398
22399         Make sure that we handle default_static_constructor independently
22400         everywhere where we handle instance_constructors
22401
22402 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
22403
22404         * class.cs: Do not lookup or create a base initializer for a
22405         static constructor.
22406
22407         (ConstructorInitializer.Resolve): use the proper type to lookup
22408         for constructors.
22409
22410         * cs-parser.jay: Report error 1585 (modifiers between type and name).
22411
22412         * enum.cs, interface.cs: Remove CloseType, this is taken care by
22413         in DeclSpace. 
22414
22415         * decl.cs: CloseType is now an virtual method, the default
22416         implementation just closes this type.
22417
22418 2001-12-28  Ravi Pratap  <ravi@ximian.com>
22419
22420         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
22421         to PreserveSig by default. Also emit HideBySig on such methods.
22422
22423         Basically, set the defaults to standard values.
22424
22425         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
22426         argument, if candidate is better, it can't be worse than the best !
22427
22428         (Invocation): Re-write bits to differentiate between methods being
22429         applicable in their expanded form and their normal form - for params
22430         methods of course.
22431
22432         Get rid of use_standard everywhere as only standard conversions are allowed
22433         in overload resolution. 
22434
22435         More spec conformance.
22436
22437 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22438
22439         * driver.cs: Add --timestamp, to see where the compiler spends
22440         most of its time.
22441
22442         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
22443         `this' in static code.
22444
22445         (SimpleName.DoResolve): Implement in terms of a helper function
22446         that allows static-references to be passed upstream to
22447         MemberAccess.
22448
22449         (Expression.ResolveWithSimpleName): Resolve specially simple
22450         names when called by MemberAccess to implement the special
22451         semantics. 
22452
22453         (Expression.ImplicitReferenceConversion): Handle conversions from
22454         Null to reference types before others, as Null's type is
22455         System.Object. 
22456
22457         * expression.cs (Invocation.EmitCall): Handle the special case of
22458         calling methods declared on a reference type from a ValueType
22459         (Base classes System.Object and System.Enum)
22460
22461         (MemberAccess.Resolve): Only perform lookups on Enumerations if
22462         the left hand side is a TypeExpr, not on every enumeration. 
22463
22464         (Binary.Resolve): If types are reference types, then do a cast to
22465         object on operators != and == of both arguments.
22466
22467         * typemanager.cs (FindMembers): Extract instance and static
22468         members if requested.
22469
22470         * interface.cs (PopulateProperty): Use void_type instead of null
22471         as the return type for the setter method.
22472
22473         (PopulateIndexer): ditto.
22474
22475 2001-12-27  Ravi Pratap  <ravi@ximian.com>
22476
22477         * support.cs (ReflectionParameters): Fix minor bug where we
22478         were examining the wrong parameter for the ParamArray attribute.
22479
22480         Cope with requests for the type of the parameter at position
22481         greater than the params parameter's. We now return the element
22482         type of the params array as that makes more sense.
22483
22484         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
22485         accordingly as we no longer have to extract the element type
22486         ourselves.
22487
22488         (Invocation.OverloadResolve): Update.
22489
22490 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22491
22492         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
22493         against IEnumerator, test whether the return value is a descendant
22494         of the IEnumerator interface.
22495
22496         * class.cs (Indexer.Define): Use an auxiliary method to implement
22497         the other bits of the method definition.  Begin support for
22498         explicit interface implementation.
22499
22500         (Property.DefineMethod): Use TypeManager.void_type instead of null
22501         for an empty return value.
22502
22503 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
22504
22505         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
22506         dealing with a FieldExpr which is composed of a FieldBuilder, in
22507         the code path we did extract the constant, but we should have
22508         obtained the underlying value to be able to cast it (otherwise we
22509         end up in an infinite loop, this is what Ravi was running into).
22510
22511         (ArrayCreation.UpdateIndices): Arrays might be empty.
22512
22513         (MemberAccess.ResolveMemberAccess): Add support for section
22514         14.5.4.1 that deals with the special case of E.I when E is a type
22515         and something else, that I can be a reference to a static member.
22516
22517         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
22518         handle a particular array type to create byte blobs, it is just
22519         something we dont generate byteblobs for.
22520
22521         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
22522         arguments. 
22523
22524         * location.cs (Push): remove the key from the hashtable that we
22525         are about to add.   This happens for empty files.
22526
22527         * driver.cs: Dispose files after we have parsed them.
22528
22529         (tokenize): new function that only runs the tokenizer on its
22530         input, for speed testing.
22531
22532 2001-12-26  Ravi Pratap  <ravi@ximian.com>
22533
22534         * class.cs (Event.Define): Define the private field only if there
22535         are no accessors defined.
22536
22537         * expression.cs (ResolveMemberAccess): If there is no associated
22538         field with the event, that means we have an event defined with its
22539         own accessors and we should flag error cs0070 since transforming
22540         ourselves into a field is not valid in that case.
22541
22542         * ecore.cs (SimpleName.DoResolve): Same as above.
22543
22544         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22545         and charset to sane values.
22546
22547 2001-12-25  Ravi Pratap  <ravi@ximian.com>
22548
22549         * assign.cs (DoResolve): Perform check on events only if they 
22550         are being accessed outside the declaring type.
22551
22552         * cs-parser.jay (event_declarations): Update rules to correctly
22553         set the type of the implicit parameter etc.
22554
22555         (add_accessor, remove_accessor): Set current local parameters.
22556
22557         * expression.cs (Binary): For delegate addition and subtraction,
22558         cast the return value from the method into the appropriate delegate
22559         type.
22560
22561 2001-12-24  Ravi Pratap  <ravi@ximian.com>
22562
22563         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22564         of these as the workaround is unnecessary.
22565
22566         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22567         delegate data - none of that is needed at all.
22568
22569         Re-write bits to extract the instance expression and the delegate method
22570         correctly.
22571
22572         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
22573         on delegates too.
22574
22575         * attribute.cs (ApplyAttributes): New method to take care of common tasks
22576         of attaching attributes instead of duplicating code everywhere.
22577
22578         * everywhere : Update code to do attribute emission using the above method.
22579
22580 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22581
22582         * expression.cs (IsParamsMethodApplicable): if there are not
22583         parameters, return immediately.
22584
22585         * ecore.cs: The 0 literal can be implicity converted to an enum
22586         type. 
22587
22588         (SimpleName.DoResolve): First lookup the type, then lookup the
22589         members. 
22590
22591         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22592         want to get its address.  If the InstanceExpression is not
22593         addressable, store the result in a temporary variable, then get
22594         the address of it.
22595
22596         * codegen.cs: Only display 219 errors on warning level or above. 
22597
22598         * expression.cs (ArrayAccess): Make it implement the
22599         IMemoryLocation interface.
22600
22601         (Binary.DoResolve): handle the operator == (object a, object b)
22602         and operator != (object a, object b) without incurring into a
22603         BoxedCast (because 5 != o should never be performed).
22604
22605         Handle binary enumerator operators.
22606
22607         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22608         value type, otherwise use Ldelem_ref.
22609
22610         Use precomputed names;
22611
22612         (AddressOf): Implement address of
22613
22614         * cs-parser.jay (labeled_statement): Fix recursive block
22615         addition by reworking the production.
22616
22617         * expression.cs (New.DoEmit): New has a special case:
22618                 
22619                  If we are dealing with a ValueType, we have a few
22620                  situations to deal with:
22621                 
22622                     * The target of New is a ValueType variable, that is
22623                       easy, we just pass this as the variable reference
22624                 
22625                     * The target of New is being passed as an argument,
22626                       to a boxing operation or a function that takes a
22627                       ValueType.
22628                 
22629                       In this case, we need to create a temporary variable
22630                       that is the argument of New.
22631
22632
22633 2001-12-23  Ravi Pratap  <ravi@ximian.com>
22634
22635         * rootcontext.cs (LookupType): Check that current_type is not null before
22636         going about looking at nested types.
22637
22638         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22639         not implement the IAssignMethod interface any more.
22640
22641         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22642         where we tranform them into FieldExprs if they are being resolved from within
22643         the declaring type.
22644
22645         * ecore.cs (SimpleName.DoResolve): Do the same here.
22646
22647         * assign.cs (DoResolve, Emit): Clean up code considerably. 
22648
22649         * ../errors/bug10.cs : Add.
22650
22651         * ../errors/cs0070.cs : Add.
22652
22653         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22654
22655         * assign.cs : Get rid of EventIsLocal everywhere.
22656
22657 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22658
22659         * ecore.cs (ConvertIntLiteral): finished the implementation.
22660
22661         * statement.cs (SwitchLabel): Convert the value we are using as a
22662         key before looking up the table.
22663
22664 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22665
22666         * codegen.cs (EmitTopBlock): Require a Location argument now.
22667
22668         * cs-parser.jay (constructor_declarator): We need to setup
22669         current_local_parameters before we parse the
22670         opt_constructor_initializer, to allow the variables to be bound
22671         to the constructor arguments.
22672
22673         * rootcontext.cs (LookupType): First lookup nested classes in our
22674         class and our parents before we go looking outside our class.
22675
22676         * expression.cs (ConstantFold): Extract/debox the values at the
22677         beginnning. 
22678
22679         * rootcontext.cs (EmitCode): Resolve the constants first before we
22680         resolve the types.  This is not really needed, but it helps debugging.
22681
22682         * statement.cs: report location.
22683
22684         * cs-parser.jay: pass location to throw statement.
22685
22686         * driver.cs: Small bug fix.
22687
22688         * report.cs: Updated format to be 4-zero filled digits.
22689
22690 2001-12-22  Ravi Pratap  <ravi@ximian.com>
22691
22692         * expression.cs (CheckIndices): Fix minor bug where the wrong
22693         variable was being referred to ;-)
22694
22695         (DoEmit): Do not call EmitStaticInitializers when the 
22696         underlying type is System.Object.
22697
22698 2001-12-21  Ravi Pratap  <ravi@ximian.com>
22699
22700         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22701         and do the usual workaround for SRE.
22702
22703         * class.cs (MyEventBuilder.EventType): New member to get at the type
22704         of the event, quickly.
22705
22706         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22707
22708         * assign.cs (Assign.DoResolve): Handle the case when the target
22709         is an EventExpr and perform the necessary checks.
22710
22711         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22712         interface.
22713
22714         (SimpleName.MemberStaticCheck): Include check for EventExpr.
22715
22716         (EventExpr): Set the type in the constructor itself since we 
22717         are meant to be born fully resolved.
22718
22719         (EventExpr.Define): Revert code I wrote earlier.
22720                 
22721         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22722         instance expression is null. The instance expression is a This in that case
22723         or a null, depending on whether it is a static method or not.
22724
22725         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22726         refers to more than one method.
22727
22728         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22729         and accordingly flag errors.
22730
22731 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22732
22733         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22734
22735 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22736
22737         * location.cs (ToString): Provide useful rutine.
22738
22739 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22740
22741         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22742         objects, return the actual integral boxed.
22743
22744         * statement.cs (SwitchLabel): define an ILLabel for each
22745         SwitchLabel. 
22746
22747         (Switch.CheckSwitch): If the value is a Literal, extract
22748         the underlying literal.
22749
22750         Also in the unused hashtable we had, add the SwitchLabel so we can
22751         quickly look this value up.
22752
22753         * constant.cs: Implement a bunch of new constants.  Rewrite
22754         Literal based on this.  Made changes everywhere to adapt to this.
22755
22756         * expression.cs (Expression.MakeByteBlob): Optimize routine by
22757         dereferencing array only once, and also copes with enumrations.
22758
22759         bytes are two bytes wide, not one.
22760
22761         (Cast): Perform constant conversions.
22762
22763         * ecore.cs (TryImplicitIntConversion): Return literals instead of
22764         wrappers to the literals here.
22765
22766         * expression.cs (DoNumericPromotions): long literals can converted
22767         to ulong implicity (this is taken care of elsewhere, but I was
22768         missing this spot).
22769
22770         * ecore.cs (Expression.Literalize): Make the return type Literal,
22771         to improve type checking.
22772
22773         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22774
22775 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22776
22777         * literal.cs: Revert code from ravi that checked the bounds.  The
22778         bounds are sane by the definition of the type itself. 
22779
22780         * typemanager.cs: Fix implementation of ImplementsInterface.  We
22781         need to actually look up in our parent hierarchy for interfaces
22782         implemented. 
22783
22784         * const.cs: Use the underlying type for enumerations
22785
22786         * delegate.cs: Compute the basename for the delegate creation,
22787         that should fix the delegate test case, and restore the correct
22788         Type Lookup semantics in rootcontext
22789
22790         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
22791         referencing a nested type with the Reflection API is using the "+"
22792         sign. 
22793
22794         * cs-parser.jay: Do not require EOF token at the end.
22795
22796 2001-12-20  Ravi Pratap  <ravi@ximian.com>
22797
22798         * rootcontext.cs (LookupType): Concatenate type names with
22799         a '.' instead of a '+' The test suite passes again.
22800
22801         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22802         field of the enumeration.
22803
22804         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22805         the case when the member is an EventExpr.
22806
22807         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22808         static has an associated instance expression.
22809
22810         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22811
22812         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22813
22814         * class.cs (Event.Define): Register event and perform appropriate checks
22815         for error #111.
22816
22817         We define the Add and Remove methods even if the use provides none because
22818         in that case, we provide default implementations ourselves.
22819
22820         Define a private field of the type of the event. This is done by the CSC compiler
22821         and we should be doing it too ;-)
22822
22823         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22824         More methods we use in code we generate.
22825
22826         (multicast_delegate_type, delegate_type): Two separate types since the distinction
22827         is important.
22828
22829         (InitCoreTypes): Update accordingly for the above.
22830
22831         * class.cs (Event.Emit): Generate code for default accessors that we provide
22832
22833         (EmitDefaultMethod): Do the job in the above.
22834
22835         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
22836         appropriate place.
22837
22838 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22839
22840         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22841         builders even if we were missing one.
22842
22843         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22844         pass the Basename as our class name instead of the Name.  The
22845         basename will be correctly composed for us.
22846
22847         * parameter.cs (Paramters): Now takes a Location argument.
22848
22849         * decl.cs (DeclSpace.LookupType): Removed convenience function and
22850         make all the code call directly LookupType in RootContext and take
22851         this chance to pass the Location information everywhere.
22852
22853         * Everywhere: pass Location information.
22854
22855 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
22856
22857         * class.cs (Constructor.Define): Updated way of detecting the
22858         length of the parameters.
22859
22860         (TypeContainer.DefineType): Use basename as the type name for
22861         nested types.
22862
22863         (TypeContainer.Define): Do not recursively define types here, as
22864         definition is taken care in order by the RootContext.
22865
22866         * tree.cs: Keep track of namespaces in a per-file basis.
22867
22868         * parameter.cs (Parameter.ComputeSignature): Update to use
22869         DeclSpace. 
22870
22871         (Parameters.GetSignature): ditto.
22872
22873         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22874         instead of a TypeContainer.
22875
22876         (Interface.SemanticAnalysis): Use `this' instead of our parent to
22877         resolve names.  Because we need to be resolve in our context, not
22878         our parents.
22879
22880         * driver.cs: Implement response files.
22881
22882         * class.cs (TypeContainer.DefineType): If we are defined, do not
22883         redefine ourselves.
22884
22885         (Event.Emit): Emit the code for add/remove handlers.
22886         (Event.Define): Save the MethodBuilders for add/remove.
22887
22888         * typemanager.cs: Use pair here too.
22889
22890         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22891         DictionaryEntry requires the first argument to be non-null.  
22892
22893         (enum_declaration): Compute full name for registering the
22894         enumeration.
22895
22896         (delegate_declaration): Instead of using
22897         formal_parameter_list, use opt_formal_parameter_list as the list
22898         can be empty.
22899
22900         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22901         (EventParsing): New property that controls whether `add' and
22902         `remove' are returned as tokens or identifiers (for events);
22903
22904 2001-12-19  Ravi Pratap  <ravi@ximian.com>
22905
22906         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22907         use MyEventBuilder only and let it wrap the real builder for us.
22908
22909         (MyEventBuilder): Revamp constructor etc.
22910
22911         Implement all operations that we perform on EventBuilder in precisely the same
22912         way here too.
22913
22914         (FindMembers): Update to use the EventBuilder member.
22915
22916         (Event.Emit): Update accordingly.
22917
22918 2001-12-18  Ravi Pratap  <ravi@ximian.com>
22919
22920         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22921         by calling the appropriate methods.
22922
22923         (GetCustomAttributes): Make stubs as they cannot possibly do anything
22924         useful.
22925
22926         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22927
22928 2001-12-17  Ravi Pratap  <ravi@ximian.com>
22929
22930         * delegate.cs (Delegate.Populate): Check that the return type
22931         and various parameters types are indeed accessible.
22932
22933         * class.cs (Constructor.Define): Same here.
22934
22935         (Field.Define): Ditto.
22936
22937         (Event.Define): Ditto.
22938
22939         (Operator.Define): Check that the underlying Method defined itself
22940         correctly - so it's MethodBuilder should not be null.
22941
22942         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22943         expression happens to be null.
22944
22945         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22946         members but as of now we don't seem to be able to do anything really useful with it.
22947
22948         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22949         not the EventBuilder.
22950
22951 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
22952
22953         * cs-tokenizer.cs: Add support for defines.
22954         Add support for #if, #elif, #else, #endif
22955
22956         (eval_var): evaluates a variable.
22957         (eval): stubbed for evaluating functions.
22958
22959         * cs-parser.jay: Pass the defines information
22960
22961         * driver.cs: Add --define command line option.
22962
22963         * decl.cs: Move MemberCore here.
22964
22965         Make it the base class for DeclSpace.  This allows us to catch and
22966         report 108 and 109 for everything now.
22967
22968         * class.cs (TypeContainer.Define): Extract all the members
22969         before populating and emit the warning 108 (new keyword required
22970         to override) instead of having each member implement this.
22971
22972         (MemberCore.Define): New abstract method, we will be using this in
22973         the warning reporting engine in Populate.
22974
22975         (Operator.Define): Adjust to new MemberCore protocol. 
22976
22977         * const.cs (Const): This does not derive from Expression, it is a
22978         temporary object we use to create fields, it is a MemberCore. 
22979
22980         * class.cs (Method.Define): Allow the entry point to be in a
22981         specific class.
22982
22983         * driver.cs: Rewrite the argument handler to clean it up a bit.
22984
22985         * rootcontext.cs: Made it just an auxiliary namespace feature by
22986         making everything static.
22987
22988         * driver.cs: Adapt code to use RootContext type name instead of
22989         instance variable.
22990
22991         * delegate.cs: Remove RootContext argument.
22992
22993         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22994         argument. 
22995
22996         * class.cs (Event.Define): The lookup can fail.
22997
22998         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
22999
23000         * expression.cs: Resolve the this instance before invoking the code.
23001
23002 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
23003
23004         * cs-parser.jay: Add a production in element_access that allows
23005         the thing to become a "type" reference.  This way we can parse
23006         things like "(string [])" as a type.
23007
23008         Note that this still does not handle the more complex rules of
23009         casts. 
23010
23011
23012         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
23013
23014         * ecore.cs: (CopyNewMethods): new utility function used to
23015         assemble the list of methods from running FindMembers.
23016
23017         (MemberLookup): Rework FindMembers so that 
23018
23019 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
23020
23021         * class.cs (TypeContainer): Remove Delegates who fail to be
23022         defined.
23023
23024         * delegate.cs (Populate): Verify that we dont get null return
23025         values.   TODO: Check for AsAccessible.
23026
23027         * cs-parser.jay: Use basename to emit error 574 (destructor should
23028         have the same name as container class), not the full name.
23029
23030         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
23031         possible representation.  
23032
23033         Also implements integer type suffixes U and L.
23034
23035 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
23036
23037         * expression.cs (ArrayCreation.DoResolve): We need to do the
23038         argument resolution *always*.
23039
23040         * decl.cs: Make this hold the namespace.  Hold the root context as
23041         well.
23042         (LookupType): Move here.
23043
23044         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
23045
23046         * location.cs (Row, Name): Fixed the code, it was always returning
23047         references to the first file.
23048
23049         * interface.cs: Register properties defined through interfaces.
23050
23051         * driver.cs: Add support for globbing on the command line
23052
23053         * class.cs (Field): Make it derive from MemberCore as well.
23054         (Event): ditto.
23055
23056 2001-12-15  Ravi Pratap  <ravi@ximian.com>
23057
23058         * class.cs (Event::Define): Check that the type of the event is a delegate
23059         type else flag error #66.
23060
23061         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
23062         same.
23063
23064         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
23065         values of EntryPoint, CharSet etc etc.
23066
23067         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
23068
23069         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
23070         be null and we should ignore this. I am not sure if this is really clean. Apparently,
23071         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
23072         which needs this to do its work.
23073
23074         * ../errors/cs0066.cs : Add.
23075
23076 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
23077
23078         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
23079         helper functions.
23080
23081         * class.cs: (MethodSignature.MethodSignature): Removed hack that
23082         clears out the parameters field.
23083         (MemberSignatureCompare): Cleanup
23084
23085         (MemberCore): New base class used to share code between MethodCore
23086         and Property.
23087
23088         (RegisterRequiredImplementations) BindingFlags.Public requires
23089         either BindingFlags.Instace or Static.  Use instance here.
23090
23091         (Property): Refactored code to cope better with the full spec.
23092
23093         * parameter.cs (GetParameterInfo): Return an empty array instead
23094         of null on error.
23095
23096         * class.cs (Property): Abstract or extern properties have no bodies.
23097
23098         * parameter.cs (GetParameterInfo): return a zero-sized array.
23099
23100         * class.cs (TypeContainer.MethodModifiersValid): Move all the
23101         method modifier validation to the typecontainer so we can reuse
23102         this on properties.
23103
23104         (MethodCore.ParameterTypes): return an empty sized array of types.
23105
23106         (Property.Define): Test property modifier validity.
23107
23108         Add tests for sealed/override too.
23109
23110         (Method.Emit): abstract or extern methods have no bodies.
23111
23112 2001-12-14  Ravi Pratap  <ravi@ximian.com>
23113
23114         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
23115         thing.
23116
23117         (Method::Define, ::Emit): Modify accordingly.
23118
23119         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
23120
23121         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
23122
23123         * makefile: Pass in /unsafe.
23124
23125 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
23126
23127         * class.cs (MakeKey): Kill routine.
23128
23129         * class.cs (TypeContainer.Define): Correctly define explicit
23130         method implementations (they require the full interface name plus
23131         the method name).
23132
23133         * typemanager.cs: Deply the PtrHashtable here and stop using the
23134         lame keys.  Things work so much better.
23135
23136         This of course broke everyone who depended on `RegisterMethod' to
23137         do the `test for existance' test.  This has to be done elsewhere.
23138
23139         * support.cs (PtrHashtable): A hashtable that avoid comparing with
23140         the object stupid Equals method (because, that like fails all over
23141         the place).  We still do not use it.
23142
23143         * class.cs (TypeContainer.SetRequiredInterface,
23144         TypeContainer.RequireMethods): Killed these two routines and moved
23145         all the functionality to RegisterRequiredImplementations.
23146
23147         (TypeContainer.RegisterRequiredImplementations): This routine now
23148         registers all the implementations required in an array for the
23149         interfaces and abstract methods.  We use an array of structures
23150         which can be computed ahead of time to reduce memory usage and we
23151         also assume that lookups are cheap as most classes will not
23152         implement too many interfaces.
23153
23154         We also avoid creating too many MethodSignatures.
23155
23156         (TypeContainer.IsInterfaceMethod): Update and optionally does not
23157         clear the "pending" bit if we find that there are problems with
23158         the declaration.
23159
23160         (TypeContainer.VerifyPendingMethods): Update to report errors of
23161         methods that look like implementations but are not.
23162
23163         (TypeContainer.Define): Add support for explicit interface method
23164         implementation. 
23165
23166 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
23167
23168         * typemanager.cs: Keep track of the parameters here instead of
23169         being a feature of the TypeContainer.
23170
23171         * class.cs: Drop the registration of parameters here, as
23172         InterfaceMethods are also interface declarations.
23173
23174         * delegate.cs: Register methods with the TypeManager not only with
23175         the TypeContainer.  This code was buggy.
23176
23177         * interface.cs: Full registation here.
23178
23179 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
23180
23181         * expression.cs: Remove reducer for binary expressions, it can not
23182         be done this way.
23183
23184         * const.cs: Put here the code that used to go into constant.cs
23185
23186         * constant.cs: Put here the code for constants, this is a new base
23187         class for Literals.
23188
23189         * literal.cs: Make Literal derive from Constant.
23190
23191 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
23192
23193         * statement.cs (Return.Emit): Report error 157 if the user
23194         attempts to return from a finally block.
23195
23196         (Return.Emit): Instead of emitting a return, jump to the end of
23197         the function.
23198
23199         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
23200         LocalBuilder to store the result of the function.  ReturnLabel is
23201         the target where we jump.
23202
23203
23204 2001-12-09  Radek Doulik  <rodo@ximian.com>
23205
23206         * cs-parser.jay: remember alias in current namespace
23207
23208         * ecore.cs (SimpleName::DoResolve): use aliases for types or
23209         namespaces
23210
23211         * class.cs (LookupAlias): lookup alias in my_namespace
23212
23213         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
23214         aliases hashtable
23215         (LookupAlias): lookup alias in this and if needed in parent
23216         namespaces
23217
23218 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
23219
23220         * support.cs: 
23221
23222         * rootcontext.cs: (ModuleBuilder) Made static, first step into
23223         making things static.  I need this to avoid passing the
23224         TypeContainer when calling ParameterType.
23225
23226         * support.cs (InternalParameters.ParameterType): Remove ugly hack
23227         that did string manipulation to compute the type and then call
23228         GetType.  Use Parameter.ParameterType instead.
23229
23230         * cs-tokenizer.cs: Consume the suffix for floating values.
23231
23232         * expression.cs (ParameterReference): figure out whether this is a
23233         reference parameter or not.  Kill an extra variable by computing
23234         the arg_idx during emission.
23235
23236         * parameter.cs (Parameters.GetParameterInfo): New overloaded
23237         function that returns whether a parameter is an out/ref value or not.
23238
23239         (Parameter.ParameterType): The type of the parameter (base,
23240         without ref/out applied).
23241
23242         (Parameter.Resolve): Perform resolution here.
23243         (Parameter.ExternalType): The full type (with ref/out applied).
23244
23245         * statement.cs (Using.Emit, Using.EmitExpression): Implement
23246         support for expressions on the using statement.
23247
23248 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
23249
23250         * statement.cs (Using.EmitLocalVariableDecls): Split the
23251         localvariable handling of the using statement.
23252
23253         (Block.EmitMeta): Keep track of variable count across blocks.  We
23254         were reusing slots on separate branches of blocks.
23255
23256         (Try.Emit): Emit the general code block, we were not emitting it. 
23257
23258         Check the type of the declaration to be an IDisposable or
23259         something that can be implicity converted to it. 
23260
23261         Emit conversions if required.
23262
23263         * ecore.cs (EmptyExpression): New utility class.
23264         (Expression.ImplicitConversionExists): New utility function.
23265
23266 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
23267
23268         * statement.cs (Using): Implement.
23269
23270         * expression.cs (LocalVariableReference): Support read only variables.
23271
23272         * statement.cs: Remove the explicit emit for the Leave opcode.
23273         (VariableInfo): Add a readonly field.
23274
23275 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
23276
23277         * ecore.cs (ConvCast): new class used to encapsulate the various
23278         explicit integer conversions that works in both checked and
23279         unchecked contexts.
23280
23281         (Expression.ConvertNumericExplicit): Use new ConvCast class to
23282         properly generate the overflow opcodes.
23283
23284 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
23285
23286         * statement.cs: The correct type for the EmptyExpression is the
23287         element_type, not the variable type.  Ravi pointed this out.
23288
23289 2001-12-04  Ravi Pratap  <ravi@ximian.com>
23290
23291         * class.cs (Method::Define): Handle PInvoke methods specially
23292         by using DefinePInvokeMethod instead of the usual one.
23293
23294         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
23295         above to do the task of extracting information and defining the method.
23296
23297 2001-12-04  Ravi Pratap  <ravi@ximian.com>
23298
23299         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
23300         of the condition for string type.
23301
23302         (Emit): Move that here. 
23303
23304         (ArrayCreation::CheckIndices): Keep string literals in their expression
23305         form.
23306
23307         (EmitDynamicInitializers): Handle strings appropriately.
23308
23309 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
23310
23311         * codegen.cs (EmitContext): Replace multiple variables with a
23312         single pointer to the current Switch statement.
23313
23314         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
23315         EmitContext.
23316
23317 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
23318
23319         * statement.cs 
23320
23321         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
23322         default'.
23323
23324         (Foreach.Emit): Foreach on arrays was not setting
23325         up the loop variables (for break/continue).
23326
23327         (GotoCase): Semi-implented.
23328
23329 2001-12-03  Ravi Pratap  <ravi@ximian.com>
23330
23331         * attribute.cs (CheckAttribute): Handle system attributes by using
23332         Attribute.GetAttributes to examine information we need.
23333
23334         (GetValidPlaces): Same here.
23335
23336         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
23337
23338         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
23339
23340         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
23341
23342         (Method::Define): Set appropriate flags if we have a DllImport attribute.
23343
23344         (Method::Emit): Handle the case when we are a PInvoke method.
23345
23346 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
23347
23348         * expression.cs: Use ResolveWithSimpleName on compound names.
23349
23350 2001-12-02  Ravi Pratap  <ravi@ximian.com>
23351
23352         * constant.cs (EmitConstant): Make sure we resolve the associated expression
23353         before trying to reduce it.
23354
23355         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
23356
23357         * constant.cs (LookupConstantValue): Implement.
23358
23359         (EmitConstant): Use the above in emitting the constant.
23360
23361         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
23362         that are user-defined by doing a LookupConstantValue on them.
23363
23364         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
23365         too, like above.
23366
23367 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
23368
23369         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
23370
23371         (BaseAccess.DoResolve): Implement.
23372
23373         (MemberAccess.DoResolve): Split this routine into a
23374         ResolveMemberAccess routine that can be used independently
23375
23376 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
23377
23378         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
23379         As that share bits of the implementation.  Is returns a boolean,
23380         while As returns the Type that is being probed.
23381
23382 2001-12-01  Ravi Pratap  <ravi@ximian.com>
23383
23384         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
23385         instead of a Literal - much easier.
23386
23387         (EnumInTransit): Remove - utterly useless :-)
23388
23389         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
23390
23391         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
23392
23393         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
23394         chain when we have no associated expression.
23395
23396 2001-11-30  Ravi Pratap  <ravi@ximian.com>
23397
23398         * constant.cs (Define): Use Location while reporting the errror.
23399
23400         Also emit a warning when 'new' is used and there is no inherited
23401         member to hide.
23402
23403         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
23404         populated.
23405
23406         (LookupEnumValue): Implement to lookup an enum member's value and define it
23407         if necessary.
23408
23409         (Populate): Re-write accordingly to use the above routine.
23410
23411 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
23412
23413         * expression.cs (This): Fix prototype for DoResolveLValue to
23414         override the base class DoResolveLValue.
23415
23416         * cs-parser.cs: Report errors cs574 and cs575 (destructor
23417         declarations) 
23418
23419         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
23420         (we need to load the address of the field here).  This fixes
23421         test-22. 
23422
23423         (FieldExpr.DoResolveLValue): Call the DoResolve
23424         function to initialize the Instance expression.
23425
23426         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
23427         correctly the GetEnumerator operation on a value type.
23428
23429         * cs-parser.jay: Add more simple parsing error catches.
23430
23431         * statement.cs (Switch): Add support for string switches.
23432         Handle null specially.
23433
23434         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
23435
23436 2001-11-28  Ravi Pratap  <ravi@ximian.com>
23437
23438         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
23439
23440         (declare_local_constant): New helper function.
23441
23442         * statement.cs (AddConstant): Keep a separate record of constants
23443
23444         (IsConstant): Implement to determine if a variable is a constant.
23445
23446         (GetConstantExpression): Implement.
23447
23448         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
23449
23450         * statement.cs (IsVariableDefined): Re-write.
23451
23452 2001-11-27  Ravi Pratap  <ravi@ximian.com>
23453
23454         * class.cs (TypeContainer::FindMembers): Look for constants
23455         in the case when we are looking for MemberTypes.Field
23456
23457         * expression.cs (MemberAccess::DoResolve): Check that in the
23458         case we are a FieldExpr and a Literal, we are not being accessed
23459         by an instance reference.
23460
23461         * cs-parser.jay (local_constant_declaration): Implement.
23462
23463         (declaration_statement): Implement for constant declarations.
23464
23465 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
23466
23467         * statement.cs (Switch): Catch double defaults.
23468
23469         (Switch): More work on the switch() statement
23470         implementation.  It works for integral values now, need to finish
23471         string support.
23472
23473
23474 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23475
23476         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
23477         integer literals into other integer literals.  To be used by
23478         switch. 
23479
23480 2001-11-24  Ravi Pratap  <ravi@ximian.com>
23481
23482         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
23483         some memory.
23484
23485         (EmitDynamicInitializers): Cope with the above since we extract data
23486         directly from ArrayData now.
23487
23488         (ExpectInitializers): Keep track of whether initializers are mandatory
23489         or not.
23490
23491         (Bounds): Make it a hashtable to prevent the same dimension being 
23492         recorded for every element in that dimension.
23493
23494         (EmitDynamicInitializers): Fix bug which prevented the Set array method
23495         from being found.
23496
23497         Also fix bug which was causing the indices to be emitted in the reverse
23498         order.
23499
23500 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23501
23502         * expression.cs (ArrayCreation): Implement the bits that Ravi left
23503         unfinished.  They do not work, because the underlying code is
23504         sloppy.
23505
23506 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23507
23508         * cs-parser.jay: Remove bogus fixme.
23509
23510         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
23511         on Switch statement.
23512
23513 2001-11-23  Ravi Pratap  <ravi@ximian.com>
23514
23515         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
23516         the same. 
23517
23518         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
23519         parameter. Apparently, any expression is allowed. 
23520
23521         (ValidateInitializers): Update accordingly.
23522
23523         (CheckIndices): Fix some tricky bugs thanks to recursion.
23524
23525         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
23526         I was being completely brain-dead.
23527
23528         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23529         and re-write acordingly.
23530
23531         (DelegateInvocation): Re-write accordingly.
23532
23533         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23534
23535         (MakeByteBlob): Handle types more correctly.
23536
23537         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23538         initialization from expressions but it is incomplete because I am a complete
23539         Dodo :-|
23540
23541 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23542
23543         * statement.cs (If.Emit): Fix a bug that generated incorrect code
23544         on If.  Basically, we have to return `true' (ie, we do return to
23545         our caller) only if both branches of the if return.
23546
23547         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23548         short-circuit operators, handle them as short circuit operators. 
23549
23550         (Cast.DoResolve): Resolve type.
23551         (Cast.Cast): Take an expression as the target type.
23552
23553         * cs-parser.jay (cast_expression): Remove old hack that only
23554         allowed a limited set of types to be handled.  Now we take a
23555         unary_expression and we resolve to a type during semantic
23556         analysis.
23557
23558         Use the grammar productions from Rhys to handle casts (this is
23559         not complete like Rhys syntax yet, we fail to handle that corner
23560         case that C# has regarding (-x), but we will get there.
23561
23562 2001-11-22  Ravi Pratap  <ravi@ximian.com>
23563
23564         * class.cs (EmitFieldInitializer): Take care of the case when we have a
23565         field which is an array type.
23566
23567         * cs-parser.jay (declare_local_variables): Support array initialization too.
23568
23569         * typemanager.cs (MakeKey): Implement.
23570
23571         (everywhere): Use the above appropriately.
23572
23573         * cs-parser.jay (for_statement): Update for array initialization while
23574         declaring variables.
23575
23576         * ecore.cs : The error message was correct, it's the variable's names that
23577         were misleading ;-) Make the code more readable.
23578
23579         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23580         the correct type etc.
23581
23582         (ConvertExplicit): Handle Enum types by examining the underlying type.
23583
23584 2001-11-21  Ravi Pratap  <ravi@ximian.com>
23585
23586         * parameter.cs (GetCallingConvention): Always return
23587         CallingConventions.Standard for now.
23588
23589 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23590
23591         * expression.cs (Binary.ResolveOperator): Update the values of `l'
23592         and `r' after calling DoNumericPromotions.
23593
23594         * ecore.cs: Fix error message (the types were in the wrong order).
23595
23596         * statement.cs (Foreach.ProbeCollectionType): Need to pass
23597         BindingFlags.Instance as well 
23598
23599         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23600         implicit int literal conversion in an empty cast so that we
23601         propagate the right type upstream.
23602
23603         (UnboxCast): new class used to unbox value types.
23604         (Expression.ConvertExplicit): Add explicit type conversions done
23605         by unboxing.
23606
23607         (Expression.ImplicitNumericConversion): Oops, forgot to test for
23608         the target type before applying the implicit LongLiterals to ULong
23609         literal cast.
23610
23611 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
23612
23613         * cs-parser.jay (for_statement): Reworked the way For works: now
23614         we declare manually any variables that are introduced in
23615         for_initializer to solve the problem of having out-of-band code
23616         emition (that is what got for broken).
23617
23618         (declaration_statement): Perform the actual variable declaration
23619         that used to be done in local_variable_declaration here.
23620
23621         (local_variable_declaration): Do not declare anything, just pass
23622         the information on a DictionaryEntry
23623
23624 2001-11-20  Ravi Pratap  <ravi@ximian.com>
23625
23626         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23627         re-write of the logic to now make it recursive.
23628
23629         (UpdateIndices): Re-write accordingly.
23630
23631         Store element data in a separate ArrayData list in the above methods.
23632
23633         (MakeByteBlob): Implement to dump the array data into a byte array.
23634
23635 2001-11-19  Ravi Pratap  <ravi@ximian.com>
23636
23637         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23638         into CheckIndices.
23639
23640         * constant.cs (Define): Implement.
23641
23642         (EmitConstant): Re-write fully.
23643
23644         Pass in location info.
23645
23646         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23647         respectively.
23648
23649         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23650         DictionaryEntry since we need location info too.
23651
23652         (constant_declaration): Update accordingly.
23653
23654         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23655         code into another method : UpdateIndices.
23656
23657 2001-11-18  Ravi Pratap  <ravi@ximian.com>
23658
23659         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23660         some type checking etc.
23661
23662 2001-11-17  Ravi Pratap  <ravi@ximian.com>
23663
23664         * expression.cs (ArrayCreation::ValidateInitializers): Implement
23665         bits to provide dimension info if the user skips doing that.
23666
23667         Update second constructor to store the rank correctly.
23668
23669 2001-11-16  Ravi Pratap  <ravi@ximian.com>
23670
23671         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23672         and try to implement.
23673
23674         * ../errors/cs0150.cs : Add.
23675
23676         * ../errors/cs0178.cs : Add.
23677
23678 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
23679
23680         * statement.cs: Implement foreach on multi-dimensional arrays. 
23681
23682         * parameter.cs (Parameters.GetParameterByName): Also lookup the
23683         name of the params argument.
23684
23685         * expression.cs: Use EmitStoreOpcode to get the right opcode while
23686         initializing the array.
23687
23688         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23689         we can use this elsewhere.
23690
23691         * statement.cs: Finish implementation of foreach for single
23692         dimension arrays.
23693
23694         * cs-parser.jay: Use an out-of-band stack to pass information
23695         around, I wonder why I need this.
23696
23697         foreach_block: Make the new foreach_block the current_block.
23698
23699         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23700         function used to return a static Parameters structure.  Used for
23701         empty parameters, as those are created very frequently.
23702
23703         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23704
23705 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23706
23707         * interface.cs : Default modifier is private, not public. The
23708         make verify test passes again.
23709
23710 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23711
23712         * support.cs (ReflectionParameters): Fix logic to determine
23713         whether the last parameter is a params one. Test 9 passes again.
23714
23715         * delegate.cs (Populate): Register the builders we define with
23716         RegisterParameterForBuilder. Test 19 passes again.
23717
23718         * cs-parser.jay (property_declaration): Reference $6 instead
23719         of $$ to get at the location.
23720
23721         (indexer_declaration): Similar stuff.
23722
23723         (attribute): Ditto.
23724
23725         * class.cs (Property): Register parameters for the Get and Set methods
23726         if they exist. Test 23 passes again.
23727
23728         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23729         call to EmitArguments as we are sure there aren't any params arguments. 
23730         Test 32 passes again.
23731
23732         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23733         IndexOutOfRangeException. 
23734
23735         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23736         Test 33 now passes again.
23737
23738 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
23739
23740         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23741         broke a bunch of things.  Will have to come up with a better way
23742         of tracking locations.
23743
23744         * statement.cs: Implemented foreach for single dimension arrays.
23745
23746 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23747
23748         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23749         an error.  This removes the lookup from the critical path.
23750
23751         * cs-parser.jay: Removed use of temporary_loc, which is completely
23752         broken. 
23753
23754 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
23755
23756         * support.cs (ReflectionParameters.ParameterModifier): Report
23757         whether the argument is a PARAMS argument or not.
23758
23759         * class.cs: Set the attribute `ParamArrayAttribute' on the
23760         parameter argument.
23761
23762         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23763         and cons_param_array_attribute (ConstructorInfo for
23764         ParamArrayAttribute)., 
23765
23766         * codegen.cs: Emit the return using the `Return' statement, that
23767         way we can report the error correctly for missing return values. 
23768
23769         * class.cs (Method.Emit): Clean up.
23770
23771         * expression.cs (Argument.Resolve): Take another argument: the
23772         location where this argument is used.  Notice that this is not
23773         part of the "Argument" class as to reduce the size of the
23774         structure (we know the approximate location anyways).
23775
23776         Test if the argument is a variable-reference, if not, then
23777         complain with a 206.
23778
23779         (Argument.Emit): Emit addresses of variables.
23780
23781         (Argument.FullDesc): Simplify.
23782
23783         (Invocation.DoResolve): Update for Argument.Resolve.
23784
23785         (ElementAccess.DoResolve): ditto.
23786
23787         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23788         method should be virtual, as this method is always virtual.
23789
23790         (NewDelegate.DoResolve): Update for Argument.Resolve.
23791
23792         * class.cs (ConstructorInitializer.DoResolve): ditto.
23793
23794         * attribute.cs (Attribute.Resolve): ditto.
23795
23796 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
23797
23798         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23799
23800         * expression.cs (ParameterReference): Drop IStackStorage and implement
23801         IAssignMethod instead. 
23802
23803         (LocalVariableReference): ditto.
23804
23805         * ecore.cs (FieldExpr): Drop IStackStorage and implement
23806         IAssignMethod instead. 
23807
23808 2001-11-13  Miguel de Icaza <miguel@ximian.com>
23809
23810         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23811         enumerations that are used in heavily used structures derive from
23812         byte in a laughable and pathetic attempt to reduce memory usage.
23813         This is the kind of pre-optimzations that you should not do at
23814         home without adult supervision.
23815
23816         * expression.cs (UnaryMutator): New class, used to handle ++ and
23817         -- separatedly from the other unary operators.  Cleans up the
23818         code, and kills the ExpressionStatement dependency in Unary.
23819
23820         (Unary): Removed `method' and `Arguments' from this class, making
23821         it smaller, and moving it all to SimpleCall, so I can reuse this
23822         code in other locations and avoid creating a lot of transient data
23823         strucutres when not required.
23824
23825         * cs-parser.jay: Adjust for new changes.
23826
23827 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
23828
23829         * enum.cs (Enum.Populate): If there is a failure during
23830         definition, return
23831
23832         * cs-parser.jay (opt_enum_base): we used to catch type errors
23833         here, but this is really incorrect.  The type error should be
23834         catched during semantic analysis.
23835
23836 2001-12-11  Ravi Pratap  <ravi@ximian.com>
23837
23838         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23839         current_local_parameters as expected since I, in my stupidity, had forgotten
23840         to do this :-)
23841
23842         * attribute.cs (GetValidPlaces): Fix stupid bug.
23843
23844         * class.cs (Method::Emit): Perform check on applicability of attributes.
23845
23846         (Constructor::Emit): Ditto.
23847
23848         (Field::Emit): Ditto.
23849
23850         (Field.Location): Store location information.
23851
23852         (Property, Event, Indexer, Operator): Ditto.
23853
23854         * cs-parser.jay (field_declaration): Pass in location for each field.
23855
23856         * ../errors/cs0592.cs : Add.
23857
23858 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23859
23860         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23861
23862         (InitCoreTypes): Update accordingly.
23863
23864         (RegisterAttrType, LookupAttr): Implement.
23865
23866         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23867         info about the same.
23868
23869         (Resolve): Update to populate the above as necessary.
23870
23871         (Error592): Helper.
23872
23873         (GetValidPlaces): Helper to the above.
23874
23875         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23876
23877         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23878
23879 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23880
23881         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23882
23883         * ../errors/cs0617.cs : Add.
23884
23885 2001-11-11  Ravi Pratap  <ravi@ximian.com>
23886
23887         * enum.cs (Emit): Rename to Populate to be more consistent with what
23888         we expect it to do and when exactly it is called.
23889
23890         * class.cs, rootcontext.cs : Update accordingly.
23891
23892         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23893         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23894
23895         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23896
23897         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23898         of a fieldinfo using the above, when dealing with a FieldBuilder.
23899
23900 2001-11-10  Ravi Pratap  <ravi@ximian.com>
23901
23902         * ../errors/cs0031.cs : Add.
23903
23904         * ../errors/cs1008.cs : Add.
23905
23906         * ../errrors/cs0543.cs : Add.
23907
23908         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23909         enum type.
23910
23911         (FindMembers): Implement.
23912
23913         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23914         enums and delegates too.
23915
23916         (enum_types): Rename to builder_to_enum.
23917
23918         (delegate_types): Rename to builder_to_delegate.
23919
23920         * delegate.cs (FindMembers): Implement.
23921
23922 2001-11-09  Ravi Pratap  <ravi@ximian.com>
23923
23924         * typemanager.cs (IsEnumType): Implement.
23925
23926         * enum.cs (Emit): Re-write parts to account for the underlying type
23927         better and perform checking etc.
23928
23929         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23930         of the underlying type.
23931
23932         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23933         value
23934
23935         * enum.cs (error31): Helper to report error #31.
23936
23937         * cs-parser.jay (enum_declaration): Store location of each member too.
23938
23939         * enum.cs (member_to_location): New hashtable. 
23940
23941         (AddEnumMember): Update location hashtable.
23942
23943         (Emit): Use the location of each member while reporting errors.
23944
23945 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23946
23947         * cs-parser.jay: A for_initializer if is a
23948         local_variable_declaration really ammount to have an implicit
23949         block with the variable declaration and no initializer for for.
23950
23951         * statement.cs (For.Emit): Cope with null initializers.
23952
23953         This fixes the infinite loop on for initializers.
23954
23955 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
23956
23957         * enum.cs: More cleanup.
23958
23959         * ecore.cs: Remove dead code.
23960
23961         * class.cs (Property.Emit): More simplification.
23962         (Event.Emit): ditto.
23963
23964         Reworked to have less levels of indentation.
23965
23966 2001-11-08  Ravi Pratap  <ravi@ximian.com>
23967
23968         * class.cs (Property): Emit attributes.
23969
23970         (Field): Ditto.
23971
23972         (Event): Ditto.
23973
23974         (Indexer): Ditto.
23975
23976         (Operator): Ditto.
23977
23978         * enum.cs (Emit): Ditto.
23979
23980         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23981         Enums too.
23982
23983         * class.cs (Field, Event, etc.): Move attribute generation into the
23984         Emit method everywhere.
23985
23986         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23987         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23988         as we had no way of defining nested enums !
23989
23990         * rootcontext.cs : Adjust code accordingly.
23991
23992         * typemanager.cs (AddEnumType): To keep track of enum types separately.
23993
23994 2001-11-07  Ravi Pratap  <ravi@ximian.com>
23995
23996         * expression.cs (EvalConstantExpression): Move into ecore.cs
23997
23998         * enum.cs (Enum): Rename some members and make them public and readonly
23999         according to our convention.
24000
24001         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
24002         nothing else.
24003
24004         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
24005
24006         (Enum::Emit): Write a simple version for now which doesn't try to compute
24007         expressions. I shall modify this to be more robust in just a while.
24008
24009         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
24010
24011         (TypeContainer::CloseType): Create the Enum types too.
24012
24013         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
24014
24015         * expression.cs (EvalConstantExpression): Get rid of completely.
24016
24017         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
24018         user-defined values and other cases.
24019
24020         (IsValidEnumLiteral): Helper function.
24021
24022         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
24023         out there in the case we had a literal FieldExpr.
24024
24025         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
24026
24027         (Literalize): Revamp a bit to take two arguments.
24028
24029         (EnumLiteral): New class which derives from Literal to wrap enum literals.
24030
24031 2001-11-06  Ravi Pratap  <ravi@ximian.com>
24032
24033         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
24034
24035         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
24036
24037         (Resolve): Use the above to ensure we have proper initializers.
24038
24039 2001-11-05  Ravi Pratap  <ravi@ximian.com>
24040
24041         * expression.cs (Expression::EvalConstantExpression): New method to 
24042         evaluate constant expressions.
24043
24044         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
24045
24046 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
24047
24048         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
24049         in an array.
24050
24051         (Binary.ResolveOperator): Handle operator != (object a, object b)
24052         and operator == (object a, object b);
24053
24054         (Binary.DoNumericPromotions): Indicate whether the numeric
24055         promotion was possible.
24056
24057         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
24058         Implement.  
24059
24060         Made the ArrayAccess implement interface IAssignMethod instead of
24061         IStackStore as the order in which arguments are passed reflects
24062         this.
24063
24064         * assign.cs: Instead of using expr.ExprClass to select the way of
24065         assinging, probe for the IStackStore/IAssignMethod interfaces.
24066
24067         * typemanager.cs: Load InitializeArray definition.
24068
24069         * rootcontext.cs (RootContext.MakeStaticData): Used to define
24070         static data that can be used to initialize arrays. 
24071
24072 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
24073
24074         * expression.cs: Handle operator== and operator!= for booleans.
24075
24076         (Conditioal.Reduce): Implement reducer for the ?: operator.
24077
24078         (Conditional.Resolve): Implement dead code elimination.
24079
24080         (Binary.Resolve): Catch string literals and return a new
24081         concatenated string.
24082
24083         (Unary.Reduce): Implement reduction of unary expressions.
24084
24085         * ecore.cs: Split out the expression core handling here.
24086
24087         (Expression.Reduce): New method used to perform constant folding
24088         and CSE.  This is needed to support constant-expressions. 
24089
24090         * statement.cs (Statement.EmitBoolExpression): Pass true and false
24091         targets, and optimize for !x.
24092
24093 2001-11-04  Ravi Pratap  <ravi@ximian.com>
24094
24095         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
24096         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
24097         set custom atttributes.
24098
24099         * literal.cs (Literal::GetValue): New abstract method to return the actual
24100         value of the literal, cast as an object.
24101
24102         (*Literal): Implement GetValue method.
24103
24104         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
24105         expressions to the arraylist but objects of type Argument.
24106
24107         * class.cs (TypeContainer::Emit): Emit our attributes too.
24108
24109         (Method::Emit, Constructor::Emit): Ditto.
24110
24111         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
24112         to be ignoring earlier.
24113
24114 2001-11-03  Ravi Pratap  <ravi@ximian.com>
24115
24116         * attribute.cs (AttributeSection::Define): Implement to do the business
24117         of constructing a CustomAttributeBuilder.
24118
24119         (Attribute): New trivial class. Increases readability of code.  
24120
24121         * cs-parser.jay : Update accordingly.
24122
24123         (positional_argument_list, named_argument_list, named_argument): New rules
24124
24125         (attribute_arguments): Use the above so that we are more correct.
24126
24127 2001-11-02  Ravi Pratap  <ravi@ximian.com>
24128
24129         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
24130         to perform all checks for a method with a params parameter.
24131
24132         (Invocation::OverloadResolve): Update to use the above method and therefore
24133         cope correctly with params method invocations.
24134
24135         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
24136         params too.
24137
24138         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
24139         constructors in our parent too because we can't afford to miss out on 
24140         protected ones ;-)
24141
24142         * attribute.cs (AttributeSection): New name for the class Attribute
24143
24144         Other trivial changes to improve readability.
24145
24146         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
24147         use the new class names.
24148
24149 2001-11-01  Ravi Pratap  <ravi@ximian.com>
24150
24151         * class.cs (Method::Define): Complete definition for params types too
24152
24153         (Indexer::Define): Ditto.
24154
24155         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
24156         Cope everywhere with a request for info about the array parameter.
24157
24158 2001-11-01  Ravi Pratap  <ravi@ximian.com>
24159
24160         * tree.cs (RecordNamespace): Fix up to check for the correct key.
24161
24162         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
24163         local_variable_type to extract the string corresponding to the type.
24164
24165         (local_variable_type): Fixup the action to use the new helper method.
24166
24167         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
24168         go.
24169
24170         * expression.cs : Clean out code which uses the above.
24171
24172 2001-10-31  Ravi Pratap  <ravi@ximian.com>
24173
24174         * typemanager.cs (RegisterMethod): Check if we already have an existing key
24175         and bale out if necessary by returning a false.
24176
24177         (RegisterProperty): Ditto.
24178
24179         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
24180         and print out appropriate error messages.
24181
24182         * interface.cs (everywhere): Ditto.
24183
24184         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
24185         location to constructor.
24186
24187         * class.cs (Property, Event, Indexer): Update accordingly.
24188
24189         * ../errors/cs111.cs : Added.
24190
24191         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
24192         of a method, as laid down by the spec.
24193
24194         (Invocation::OverloadResolve): Use the above method.
24195
24196 2001-10-31  Ravi Pratap  <ravi@ximian.com>
24197
24198         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
24199         now take a TypeContainer and a Parameters object.
24200
24201         (ParameterData): Modify return type of ParameterModifier method to be 
24202         Parameter.Modifier and not a string.
24203
24204         (ReflectionParameters, InternalParameters): Update accordingly.
24205
24206         * expression.cs (Argument::GetParameterModifier): Same here.
24207
24208         * support.cs (InternalParameters::ParameterType): Find a better way of determining
24209         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
24210         symbol in it at all so maybe this is only for now.
24211
24212 2001-10-30  Ravi Pratap  <ravi@ximian.com>
24213
24214         * support.cs (InternalParameters): Constructor now takes an extra argument 
24215         which is the actual Parameters class.
24216
24217         (ParameterDesc): Update to provide info on ref/out modifiers.
24218
24219         * class.cs (everywhere): Update call to InternalParameters to pass in
24220         the second argument too.
24221
24222         * support.cs (ParameterData): Add ParameterModifier, which is a method 
24223         to return the modifier info [ref/out etc]
24224
24225         (InternalParameters, ReflectionParameters): Implement the above.
24226
24227         * expression.cs (Argument::ParameterModifier): Similar function to return
24228         info about the argument's modifiers.
24229
24230         (Invocation::OverloadResolve): Update to take into account matching modifiers 
24231         too.
24232
24233         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
24234         a new SetFormalParameters object which we pass to InternalParameters.
24235
24236 2001-10-30  Ravi Pratap  <ravi@ximian.com>
24237
24238         * expression.cs (NewArray): Merge into the ArrayCreation class.
24239
24240 2001-10-29  Ravi Pratap  <ravi@ximian.com>
24241
24242         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
24243         NewUserdefinedArray into one as there wasn't much of a use in having
24244         two separate ones.
24245
24246         * expression.cs (Argument): Change field's name to ArgType from Type.
24247
24248         (Type): New readonly property which returns the proper type, taking into 
24249         account ref/out modifiers.
24250
24251         (everywhere): Adjust code accordingly for the above.
24252
24253         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
24254         whether we are emitting for a ref or out parameter.
24255
24256         * expression.cs (Argument::Emit): Use the above field to set the state.
24257
24258         (LocalVariableReference::Emit): Update to honour the flag and emit the
24259         right stuff.
24260
24261         * parameter.cs (Attributes): Set the correct flags for ref parameters.
24262
24263         * expression.cs (Argument::FullDesc): New function to provide a full desc.
24264
24265         * support.cs (ParameterData): Add method ParameterDesc to the interface.
24266
24267         (ReflectionParameters, InternalParameters): Implement the above method.
24268
24269         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
24270         reporting errors.
24271
24272         (Invocation::FullMethodDesc): Ditto. 
24273
24274 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
24275
24276         * cs-parser.jay: Add extra production for the second form of array
24277         creation. 
24278
24279         * expression.cs (ArrayCreation): Update to reflect the above
24280         change. 
24281
24282         * Small changes to prepare for Array initialization.
24283
24284 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
24285
24286         * typemanager.cs (ImplementsInterface): interface might be null;
24287         Deal with this problem;
24288
24289         Also, we do store negative hits on the cache (null values), so use
24290         this instead of calling t.GetInterfaces on the type everytime.
24291
24292 2001-10-28  Ravi Pratap  <ravi@ximian.com>
24293
24294         * typemanager.cs (IsBuiltinType): New method to help determine the same.
24295
24296         * expression.cs (New::DoResolve): Get rid of array creation code and instead
24297         split functionality out into different classes.
24298
24299         (New::FormArrayType): Move into NewBuiltinArray.
24300
24301         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
24302         quite useless.
24303
24304         (NewBuiltinArray): New class to handle creation of built-in arrays.
24305
24306         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
24307         account creation of one-dimensional arrays.
24308
24309         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
24310
24311         (NewUserdefinedArray::DoResolve): Implement.
24312
24313         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
24314
24315         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
24316         we maintain inside the TypeManager. This is necessary to perform lookups on the
24317         module builder.
24318
24319         (LookupType): Update to perform GetType on the module builders too.     
24320
24321         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
24322
24323         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
24324
24325 2001-10-23  Ravi Pratap  <ravi@ximian.com>
24326
24327         * expression.cs (New::DoResolve): Implement guts of array creation.
24328
24329         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
24330
24331 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
24332
24333         * expression.cs: Fix bug I introduced lsat night that broke
24334         Delegates. 
24335
24336         (Expression.Resolve): Report a 246 error (can not resolve name)
24337         if we find a SimpleName in the stream.
24338
24339         (Expression.ResolveLValue): Ditto.
24340
24341         (Expression.ResolveWithSimpleName): This function is a variant of
24342         ResolveName, this one allows SimpleNames to be returned without a
24343         warning.  The only consumer of SimpleNames is MemberAccess
24344
24345 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
24346
24347         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
24348         might arrive here.  I have my doubts that this is correct.
24349
24350         * statement.cs (Lock): Implement lock statement.
24351
24352         * cs-parser.jay: Small fixes to support `lock' and `using'
24353
24354         * cs-tokenizer.cs: Remove extra space
24355
24356         * driver.cs: New flag --checked, allows to turn on integer math
24357         checking. 
24358
24359         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
24360         Threading.Monitor.Exit 
24361
24362 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
24363
24364         * expression.cs (IndexerAccess::DoResolveLValue): Set the
24365         Expression Class to be IndexerAccess.
24366
24367         Notice that Indexer::DoResolve sets the eclass to Value.
24368
24369 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
24370
24371         * class.cs (TypeContainer::Emit): Emit code for indexers.
24372
24373         * assign.cs (IAssignMethod): New interface implemented by Indexers
24374         and Properties for handling assignment.
24375
24376         (Assign::Emit): Simplify and reuse code. 
24377
24378         * expression.cs (IndexerAccess, PropertyExpr): Implement
24379         IAssignMethod, clean up old code. 
24380
24381 2001-10-22  Ravi Pratap  <ravi@ximian.com>
24382
24383         * typemanager.cs (ImplementsInterface): New method to determine if a type
24384         implements a given interface. Provides a nice cache too.
24385
24386         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
24387         method.
24388
24389         (ConvertReferenceExplicit): Ditto.
24390
24391         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
24392         various methods, with correct names etc.
24393
24394         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
24395         Operator.UnaryNegation.
24396
24397         * cs-parser.jay (operator_declarator): Be a little clever in the case where
24398         we have a unary plus or minus operator.
24399
24400         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
24401         UnaryMinus.
24402
24403         * everywhere : update accordingly.
24404
24405         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
24406         respectively.
24407
24408         * class.cs (Method::Define): For the case where we are implementing a method
24409         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
24410         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
24411
24412 2001-10-21  Ravi Pratap  <ravi@ximian.com>
24413
24414         * interface.cs (FindMembers): Implement to work around S.R.E
24415         lameness.
24416
24417         * typemanager.cs (IsInterfaceType): Implement.
24418
24419         (FindMembers): Update to handle interface types too.
24420
24421         * expression.cs (ImplicitReferenceConversion): Re-write bits which
24422         use IsAssignableFrom as that is not correct - it doesn't work.
24423
24424         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
24425         and accordingly override EmitStatement.
24426
24427         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
24428         using the correct logic :-)
24429
24430 2001-10-19  Ravi Pratap  <ravi@ximian.com>
24431
24432         * ../errors/cs-11.cs : Add to demonstrate error -11 
24433
24434 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
24435
24436         * assign.cs (Assign::Resolve): Resolve right hand side first, and
24437         then pass this as a hint to ResolveLValue.
24438
24439         * expression.cs (FieldExpr): Add Location information
24440
24441         (FieldExpr::LValueResolve): Report assignment to readonly
24442         variable. 
24443
24444         (Expression::ExprClassFromMemberInfo): Pass location information.
24445
24446         (Expression::ResolveLValue): Add new method that resolves an
24447         LValue. 
24448
24449         (Expression::DoResolveLValue): Default invocation calls
24450         DoResolve. 
24451
24452         (Indexers): New class used to keep track of indexers in a given
24453         Type. 
24454
24455         (IStackStore): Renamed from LValue, as it did not really describe
24456         what this did.  Also ResolveLValue is gone from this interface and
24457         now is part of Expression.
24458
24459         (ElementAccess): Depending on the element access type
24460
24461         * typemanager.cs: Add `indexer_name_type' as a Core type
24462         (System.Runtime.CompilerServices.IndexerNameAttribute)
24463
24464         * statement.cs (Goto): Take a location.
24465
24466 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24467
24468         * delegate.cs (Delegate::VerifyDelegate): New method to verify
24469         if two delegates are compatible.
24470
24471         (NewDelegate::DoResolve): Update to take care of the case when
24472         we instantiate a delegate from another delegate.
24473
24474         * typemanager.cs (FindMembers): Don't even try to look up members
24475         of Delegate types for now.
24476
24477 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24478
24479         * delegate.cs (NewDelegate): New class to take care of delegate
24480         instantiation.
24481
24482         * expression.cs (New): Split the delegate related code out into 
24483         the NewDelegate class.
24484
24485         * delegate.cs (DelegateInvocation): New class to handle delegate 
24486         invocation.
24487
24488         * expression.cs (Invocation): Split out delegate related code into
24489         the DelegateInvocation class.
24490
24491 2001-10-17  Ravi Pratap  <ravi@ximian.com>
24492
24493         * expression.cs (New::DoResolve): Implement delegate creation fully
24494         and according to the spec.
24495
24496         (New::DoEmit): Update to handle delegates differently.
24497
24498         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
24499         because of which we were printing out arguments in reverse order !
24500
24501         * delegate.cs (VerifyMethod): Implement to check if the given method
24502         matches the delegate.
24503
24504         (FullDelegateDesc): Implement.
24505
24506         (VerifyApplicability): Implement.
24507
24508         * expression.cs (Invocation::DoResolve): Update to accordingly handle
24509         delegate invocations too.
24510
24511         (Invocation::Emit): Ditto.
24512
24513         * ../errors/cs1593.cs : Added.
24514
24515         * ../errors/cs1594.cs : Added.
24516
24517         * delegate.cs (InstanceExpression, TargetMethod): New properties.
24518
24519 2001-10-16  Ravi Pratap  <ravi@ximian.com>
24520
24521         * typemanager.cs (intptr_type): Core type for System.IntPtr
24522
24523         (InitCoreTypes): Update for the same.
24524
24525         (iasyncresult_type, asynccallback_type): Ditto.
24526
24527         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24528         correct.
24529
24530         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24531         too.
24532
24533         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24534         the builders for the 4 members of a delegate type :-)
24535
24536         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24537         type.
24538
24539         * expression.cs (New::DoResolve): Implement guts for delegate creation.
24540
24541         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24542
24543 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
24544
24545         * statement.cs (Break::Emit): Implement.   
24546         (Continue::Emit): Implement.
24547
24548         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24549         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24550         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24551         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
24552         end loop
24553
24554         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24555         properties that track the label for the current loop (begin of the
24556         loop and end of the loop).
24557
24558 2001-10-15  Ravi Pratap  <ravi@ximian.com>
24559
24560         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24561         use of emitting anything at all.
24562
24563         * class.cs, rootcontext.cs : Get rid of calls to the same.
24564
24565         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24566
24567         (Populate): Define the constructor correctly and set the implementation
24568         attributes.
24569
24570         * typemanager.cs (delegate_types): New hashtable to hold delegates that
24571         have been defined.
24572
24573         (AddDelegateType): Implement.
24574
24575         (IsDelegateType): Implement helper method.
24576
24577         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24578
24579         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24580         and accordingly handle it.
24581
24582         * delegate.cs (Populate): Take TypeContainer argument.
24583         Implement bits to define the Invoke method. However, I still haven't figured out
24584         how to take care of the native int bit :-(
24585
24586         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
24587         Qualify the name of the delegate, not its return type !
24588
24589         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24590         conversion.
24591
24592         (StandardConversionExists): Checking for array types turns out to be recursive.
24593
24594         (ConvertReferenceExplicit): Implement array conversion.
24595
24596         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24597
24598 2001-10-12  Ravi Pratap  <ravi@ximian.com>
24599
24600         * cs-parser.jay (delegate_declaration): Store the fully qualified
24601         name as it is a type declaration.
24602
24603         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
24604         readonly.
24605
24606         (DefineDelegate): Renamed from Define. Does the same thing essentially,
24607         as TypeContainer::DefineType.
24608
24609         (Populate): Method in which all the definition of the various methods (Invoke)
24610         etc is done.
24611
24612         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24613         see.
24614
24615         (CloseDelegate): Finally creates the delegate.
24616
24617         * class.cs (TypeContainer::DefineType): Update to define delegates.
24618         (Populate, Emit and CloseType): Do the same thing here too.
24619
24620         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24621         delegates in all these operations.
24622
24623 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
24624
24625         * expression.cs: LocalTemporary: a new expression used to
24626         reference a temporary that has been created.
24627
24628         * assign.cs: Handle PropertyAccess back here, so that we can
24629         provide the proper semantic access to properties.
24630
24631         * expression.cs (Expression::ConvertReferenceExplicit): Implement
24632         a few more explicit conversions. 
24633
24634         * modifiers.cs: `NEW' modifier maps to HideBySig.
24635
24636         * expression.cs (PropertyExpr): Make this into an
24637         ExpressionStatement, and support the EmitStatement code path. 
24638
24639         Perform get/set error checking, clean up the interface.
24640
24641         * assign.cs: recognize PropertyExprs as targets, and if so, turn
24642         them into toplevel access objects.
24643
24644 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
24645
24646         * expression.cs: PropertyExpr::PropertyExpr: use work around the
24647         SRE.
24648
24649         * typemanager.cs: Keep track here of our PropertyBuilders again to
24650         work around lameness in SRE.
24651
24652 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
24653
24654         * expression.cs (LValue::LValueResolve): New method in the
24655         interface, used to perform a second resolution pass for LValues. 
24656
24657         (This::DoResolve): Catch the use of this in static methods.
24658
24659         (This::LValueResolve): Implement.
24660
24661         (This::Store): Remove warning, assigning to `this' in structures
24662         is 
24663
24664         (Invocation::Emit): Deal with invocation of
24665         methods on value types.  We need to pass the address to structure
24666         methods rather than the object itself.  (The equivalent code to
24667         emit "this" for structures leaves the entire structure on the
24668         stack instead of a pointer to it). 
24669
24670         (ParameterReference::DoResolve): Compute the real index for the
24671         argument based on whether the method takes or not a `this' pointer
24672         (ie, the method is static).
24673
24674         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24675         value types returned from functions when we need to invoke a
24676         method on the sturcture.
24677
24678
24679 2001-10-11  Ravi Pratap  <ravi@ximian.com>
24680
24681         * class.cs (TypeContainer::DefineType): Method to actually do the business of
24682         defining the type in the Modulebuilder or Typebuilder. This is to take
24683         care of nested types which need to be defined on the TypeBuilder using
24684         DefineNestedMethod.
24685
24686         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
24687         methods in RootContext, only ported to be part of TypeContainer.
24688
24689         (TypeContainer::GetInterfaceOrClass): Ditto.
24690
24691         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24692
24693         * interface.cs (Interface::DefineInterface): New method. Does exactly
24694         what RootContext.CreateInterface did earlier, only it takes care of nested types 
24695         too.
24696
24697         (Interface::GetInterfaces): Move from RootContext here and port.
24698
24699         (Interface::GetInterfaceByName): Same here.
24700
24701         * rootcontext.cs (ResolveTree): Re-write.
24702
24703         (PopulateTypes): Re-write.
24704
24705         * class.cs (TypeContainer::Populate): Populate nested types too.
24706         (TypeContainer::Emit): Emit nested members too.
24707
24708         * typemanager.cs (AddUserType): Do not make use of the FullName property,
24709         instead just use the name argument passed in as it is already fully
24710         qualified.
24711
24712         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24713         to TypeContainer mapping to see if a type is user-defined.
24714
24715         * class.cs (TypeContainer::CloseType): Implement. 
24716
24717         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24718         the default constructor.
24719
24720         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24721         twice.
24722
24723         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24724
24725         * interface.cs (CloseType): Create the type here.
24726
24727         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24728         the hierarchy.
24729
24730         Remove all the methods which are now in TypeContainer.
24731
24732 2001-10-10  Ravi Pratap  <ravi@ximian.com>
24733
24734         * delegate.cs (Define): Re-write bits to define the delegate
24735         correctly.
24736
24737 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
24738
24739         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24740
24741         * expression.cs (ImplicitReferenceConversion): handle null as well
24742         as a source to convert to any reference type.
24743
24744         * statement.cs (Return): Perform any implicit conversions to
24745         expected return type.  
24746
24747         Validate use of return statement.  
24748
24749         * codegen.cs (EmitContext): Pass the expected return type here.
24750
24751         * class.cs (Method, Constructor, Property): Pass expected return
24752         type to EmitContext.
24753
24754 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
24755
24756         * expression.cs: Make DoResolve take an EmitContext instead of a
24757         TypeContainer.
24758
24759         Replaced `l' and `location' for `loc', for consistency.
24760
24761         (Error, Warning): Remove unneeded Tc argument.
24762
24763         * assign.cs, literal.cs, constant.cs: Update to new calling
24764         convention. 
24765
24766         * codegen.cs: EmitContext now contains a flag indicating whether
24767         code is being generated in a static method or not.
24768
24769         * cs-parser.jay: DecomposeQI, new function that replaces the old
24770         QualifiedIdentifier.  Now we always decompose the assembled
24771         strings from qualified_identifier productions into a group of
24772         memberaccesses.
24773
24774 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
24775
24776         * rootcontext.cs: Deal with field-less struct types correctly now
24777         by passing the size option to Define Type.
24778
24779         * class.cs: Removed hack that created one static field. 
24780
24781 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24782
24783         * statement.cs: Moved most of the code generation here. 
24784
24785 2001-10-09  Ravi Pratap  <ravi@ximian.com>
24786
24787         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24788         seem very right.
24789
24790         (ElementAccess): Remove useless bits for now - keep checks as the spec
24791         says.
24792
24793 2001-10-08  Ravi Pratap  <ravi@ximian.com>
24794
24795         * expression.cs (ElementAccess::DoResolve): Remove my crap code
24796         and start performing checks according to the spec.
24797
24798 2001-10-07  Ravi Pratap  <ravi@ximian.com>
24799
24800         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24801         rank_specifiers instead.
24802
24803         (rank_specifiers): Change the order in which the rank specifiers are stored
24804
24805         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24806
24807         * expression.cs (ElementAccess): Implement the LValue interface too.
24808
24809 2001-10-06  Ravi Pratap  <ravi@ximian.com>
24810
24811         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24812         except that user defined conversions are not included.
24813
24814         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
24815         perform the conversion of the return type, if necessary.
24816
24817         (New::DoResolve): Check whether we are creating an array or an object
24818         and accordingly do the needful.
24819
24820         (New::Emit): Same here.
24821
24822         (New::DoResolve): Implement guts of array creation.
24823
24824         (New::FormLookupType): Helper function.
24825
24826 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24827
24828         * codegen.cs: Removed most of the code generation here, and move the
24829         corresponding code generation bits to the statement classes. 
24830
24831         Added support for try/catch/finalize and throw.
24832
24833         * cs-parser.jay: Added support for try/catch/finalize.
24834
24835         * class.cs: Catch static methods having the flags override,
24836         virtual or abstract.
24837
24838         * expression.cs (UserCast): This user cast was not really doing
24839         what it was supposed to do.  Which is to be born in fully resolved
24840         state.  Parts of the resolution were being performed at Emit time! 
24841
24842         Fixed this code.
24843
24844 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24845
24846         * expression.cs: Implicity convert the result from UserCast.
24847
24848 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24849
24850         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24851         prevented it from working correctly. 
24852
24853         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24854         merely ConvertImplicit.
24855
24856 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24857
24858         * typemanager.cs: Make the LookupTypeContainer function static,
24859         and not per-instance.  
24860
24861         * class.cs: Make static FindMembers (the one that takes a Type
24862         argument). 
24863
24864         * codegen.cs: Add EmitForeach here.
24865
24866         * cs-parser.jay: Make foreach a toplevel object instead of the
24867         inline expansion, as we need to perform semantic analysis on it. 
24868
24869 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24870
24871         * expression.cs (Expression::ImplicitUserConversion): Rename to
24872         UserDefinedConversion.
24873
24874         (Expression::UserDefinedConversion): Take an extra argument specifying 
24875         whether we look for explicit user conversions too.
24876
24877         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24878
24879         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24880
24881         (ExplicitUserConversion): Make it a call to UserDefinedConversion
24882         with the appropriate arguments.
24883
24884         * cs-parser.jay (cast_expression): Record location too.
24885
24886         * expression.cs (Cast): Record location info.
24887
24888         (Expression::ConvertExplicit): Take location argument.
24889
24890         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24891         to determine if we are doing explicit conversions.
24892
24893         (UserCast::Emit): Update accordingly.
24894
24895         (Expression::ConvertExplicit): Report an error if everything fails.
24896
24897         * ../errors/cs0030.cs : Add.
24898
24899 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
24900
24901         * modifiers.cs: If the ABSTRACT keyword is present, also set the
24902         virtual and newslot bits. 
24903
24904         * class.cs (TypeContainer::RegisterRequiredImplementations):
24905         Record methods we need.
24906
24907         (TypeContainer::MakeKey): Helper function to make keys for
24908         MethodBases, since the Methodbase key is useless.
24909
24910         (TypeContainer::Populate): Call RegisterRequiredImplementations
24911         before defining the methods.   
24912
24913         Create a mapping for method_builders_to_methods ahead of time
24914         instead of inside a tight loop.
24915
24916         (::RequireMethods):  Accept an object as the data to set into the
24917         hashtable so we can report interface vs abstract method mismatch.
24918
24919 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24920
24921         * report.cs: Make all of it static.
24922
24923         * rootcontext.cs: Drop object_type and value_type computations, as
24924         we have those in the TypeManager anyways.
24925
24926         Drop report instance variable too, now it is a global.
24927
24928         * driver.cs: Use try/catch on command line handling.
24929
24930         Add --probe option to debug the error reporting system with a test
24931         suite. 
24932
24933         * report.cs: Add support for exiting program when a probe
24934         condition is reached.
24935
24936 2001-10-03  Ravi Pratap  <ravi@ximian.com>
24937
24938         * expression.cs (Binary::DoNumericPromotions): Fix the case when
24939         we do a forcible conversion regardless of type, to check if 
24940         ForceConversion returns a null.
24941
24942         (Binary::error19): Use location to report error.
24943
24944         (Unary::error23): Use location here too.
24945
24946         * ../errors/cs0019.cs : Check in.
24947
24948         * ../errors/cs0023.cs : Check in.
24949
24950         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24951         case of a non-null MethodInfo object with a length of 0 !
24952
24953         (Binary::ResolveOperator): Flag error if overload resolution fails to find
24954         an applicable member - according to the spec :-)
24955         Also fix logic to find members in base types.
24956
24957         (Unary::ResolveOperator): Same here.
24958
24959         (Unary::report23): Change name to error23 and make first argument a TypeContainer
24960         as I was getting thoroughly confused between this and error19 :-)
24961
24962         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24963         (::FindMostEncompassedType): Implement.
24964         (::FindMostEncompassingType): Implement.
24965         (::StandardConversionExists): Implement.
24966
24967         (UserImplicitCast): Re-vamp. We now need info about most specific
24968         source and target types so that we can do the necessary conversions.
24969
24970         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24971         mathematical union with no duplicates.
24972
24973 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24974
24975         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24976         in order from base classes to child classes, so that we can in
24977         child classes look up in our parent for method names and
24978         attributes (required for handling abstract, virtual, new, override
24979         constructs: we need to instrospect our base class, and if we dont
24980         populate the classes in order, the introspection might be
24981         incorrect.  For example, a method could query its parent before
24982         the parent has any methods and would determine that the parent has
24983         no abstract methods (while it could have had them)).
24984
24985         (RootContext::CreateType): Record the order in which we define the
24986         classes.
24987
24988 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
24989
24990         * class.cs (TypeContainer::Populate): Also method definitions can
24991         fail now, keep track of this.
24992
24993         (TypeContainer::FindMembers): Implement support for
24994         DeclaredOnly/noDeclaredOnly flag.
24995
24996         (Constructor::Emit) Return the ConstructorBuilder.
24997
24998         (Method::Emit) Return the MethodBuilder. 
24999         Check for abstract or virtual methods to be public.
25000
25001         * rootcontext.cs (RootContext::CreateType): Register all the
25002         abstract methods required for the class to be complete and the
25003         interface methods that must be implemented. 
25004
25005         * cs-parser.jay: Report error 501 (method requires body if it is
25006         not marked abstract or extern).
25007
25008         * expression.cs (TypeOf::Emit): Implement.
25009
25010         * typemanager.cs: runtime_handle_type, new global type.
25011
25012         * class.cs (Property::Emit): Generate code for properties.
25013
25014 2001-10-02  Ravi Pratap  <ravi@ximian.com>
25015
25016         * expression.cs (Unary::ResolveOperator): Find operators on base type
25017         too - we now conform exactly to the spec.
25018
25019         (Binary::ResolveOperator): Same here.
25020
25021         * class.cs (Operator::Define): Fix minor quirk in the tests.
25022
25023         * ../errors/cs0215.cs : Added.
25024
25025         * ../errors/cs0556.cs : Added.
25026
25027         * ../errors/cs0555.cs : Added.
25028
25029 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
25030
25031         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
25032         single integer which is really efficient
25033
25034 2001-10-01  Ravi Pratap  <ravi@ximian.com>
25035
25036         *  expression.cs (Expression::ImplicitUserConversion): Use location
25037         even in the case when we are examining True operators.
25038  
25039         * class.cs (Operator::Define): Perform extensive checks to conform
25040         with the rules for operator overloading in the spec.
25041
25042         * expression.cs (Expression::ImplicitReferenceConversion): Implement
25043         some of the other conversions mentioned in the spec.
25044
25045         * typemanager.cs (array_type): New static member for the System.Array built-in
25046         type.
25047
25048         (cloneable_interface): For System.ICloneable interface.
25049
25050         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
25051         we start resolving the tree and populating types.
25052
25053         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
25054  
25055 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
25056
25057         * expression.cs (Expression::ExprClassFromMemberInfo,
25058         Expression::Literalize): Create literal expressions from
25059         FieldInfos which are literals.
25060
25061         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
25062         type casts, because they were wrong.  The test suite in tests
25063         caught these ones.
25064
25065         (ImplicitNumericConversion): ushort to ulong requires a widening
25066         cast. 
25067
25068         Int32 constant to long requires widening cast as well.
25069
25070         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
25071         for integers because the type on the stack is not i4.
25072
25073 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
25074
25075         * expression.cs (report118): require location argument. 
25076
25077         * parameter.cs: Do not dereference potential null value.
25078
25079         * class.cs: Catch methods that lack the `new' keyword when
25080         overriding a name.  Report warnings when `new' is used without
25081         anything being there to override.
25082
25083         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
25084
25085         * class.cs: Only add constructor to hashtable if it is non-null
25086         (as now constructors can fail on define).
25087
25088         (TypeManager, Class, Struct): Take location arguments.
25089
25090         Catch field instance initialization in structs as errors.
25091
25092         accepting_filter: a new filter for FindMembers that is static so
25093         that we dont create an instance per invocation.
25094
25095         (Constructor::Define): Catch errors where a struct constructor is
25096         parameterless 
25097
25098         * cs-parser.jay: Pass location information for various new
25099         constructs. 
25100
25101         * delegate.cs (Delegate): take a location argument.
25102
25103         * driver.cs: Do not call EmitCode if there were problesm in the
25104         Definition of the types, as many Builders wont be there. 
25105
25106         * decl.cs (Decl::Decl): Require a location argument.
25107
25108         * cs-tokenizer.cs: Handle properly hex constants that can not fit
25109         into integers, and find the most appropiate integer for it.
25110
25111         * literal.cs: Implement ULongLiteral.
25112
25113         * rootcontext.cs: Provide better information about the location of
25114         failure when CreateType fails.
25115
25116 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
25117
25118         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
25119         as well.
25120
25121         * expression.cs (Binary::CheckShiftArguments): Add missing type
25122         computation.
25123         (Binary::ResolveOperator): Add type to the logical and and logical
25124         or, Bitwise And/Or and Exclusive Or code paths, it was missing
25125         before.
25126
25127         (Binary::DoNumericPromotions): In the case where either argument
25128         is ulong (and most signed types combined with ulong cause an
25129         error) perform implicit integer constant conversions as well.
25130
25131 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
25132
25133         * expression.cs (UserImplicitCast): Method should always be
25134         non-null. 
25135         (Invocation::BetterConversion): Simplified test for IntLiteral.
25136
25137         (Expression::ImplicitNumericConversion): Split this routine out.
25138         Put the code that performs implicit constant integer conversions
25139         here. 
25140
25141         (Expression::Resolve): Become a wrapper around DoResolve so we can
25142         check eclass and type being set after resolve.
25143
25144         (Invocation::Badness): Remove this dead function
25145
25146         (Binary::ResolveOperator): Do not compute the expensive argumnets
25147         unless we have a union for it.
25148
25149         (Probe::Emit): Is needs to do an isinst and then
25150         compare against null.
25151
25152         (::CanConvert): Added Location argument.  If the Location argument
25153         is null (Location.Null), then we do not report errors.  This is
25154         used by the `probe' mechanism of the Explicit conversion.  We do
25155         not want to generate an error for something that the user
25156         explicitly requested to be casted.  But the pipeline for an
25157         explicit cast first tests for potential implicit casts.
25158
25159         So for now, if the Location is null, it means `Probe only' to
25160         avoid adding another argument.   Might have to revise this
25161         strategy later.
25162
25163         (ClassCast): New class used to type cast objects into arbitrary
25164         classes (used in Explicit Reference Conversions).
25165
25166         Implement `as' as well.
25167
25168         Reverted all the patches from Ravi below: they were broken:
25169
25170                 * The use of `level' as a mechanism to stop recursive
25171                   invocations is wrong.  That was there just to catch the
25172                   bug with a strack trace but not as a way of addressing
25173                   the problem.
25174
25175                   To fix the problem we have to *understand* what is going
25176                   on and the interactions and come up with a plan, not
25177                   just get things going.
25178
25179                 * The use of the type conversion cache that I proposed
25180                   last night had an open topic: How does this work across
25181                   protection domains.  A user defined conversion might not
25182                   be public in the location where we are applying the
25183                   conversion, a different conversion might be selected
25184                   (ie, private A->B (better) but public B->A (worse),
25185                   inside A, A->B applies, but outside it, B->A will
25186                   apply).
25187
25188                 * On top of that (ie, even if the above is solved),
25189                   conversions in a cache need to be abstract.  Ie, `To
25190                   convert from an Int to a Short use an OpcodeCast', not
25191                   `To convert from an Int to a Short use the OpcodeCast on
25192                   the variable 5' (which is what this patch was doing).
25193
25194 2001-09-28  Ravi Pratap  <ravi@ximian.com>
25195
25196         * expression.cs (Invocation::ConversionExists): Re-write to use
25197         the conversion cache
25198
25199         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
25200         cache all conversions done, not just user-defined ones.
25201
25202         (Invocation::BetterConversion): The real culprit. Use ConversionExists
25203         to determine if a conversion exists instead of acutually trying to 
25204         perform the conversion. It's faster too.
25205
25206         (Expression::ConvertExplicit): Modify to use ConversionExists to check
25207         and only then attempt the implicit conversion.
25208
25209 2001-09-28  Ravi Pratap  <ravi@ximian.com>
25210
25211         * expression.cs (ConvertImplicit): Use a cache for conversions
25212         already found. Check level of recursion and bail out if necessary.
25213
25214 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
25215
25216         * typemanager.cs (string_concat_string_string, string_concat_object_object):
25217         Export standard methods that we expect for string operations.
25218
25219         * statement.cs (Block::UsageWarning): Track usage of variables and
25220         report the errors for not used variables.
25221
25222         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
25223         operator. 
25224
25225 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
25226
25227         * codegen.cs: remove unnneded code 
25228
25229         * expression.cs: Removed BuiltinTypeAccess class
25230
25231         Fix the order in which implicit conversions are
25232         done.  
25233
25234         The previous fixed dropped support for boxed conversions (adding a
25235         test to the test suite now)
25236
25237         (UserImplicitCast::CanConvert): Remove test for source being null,
25238         that code is broken.  We should not feed a null to begin with, if
25239         we do, then we should track the bug where the problem originates
25240         and not try to cover it up here.
25241
25242         Return a resolved expression of type UserImplicitCast on success
25243         rather than true/false.  Ravi: this is what I was talking about,
25244         the pattern is to use a static method as a "constructor" for
25245         objects. 
25246
25247         Also, do not create arguments until the very last minute,
25248         otherwise we always create the arguments even for lookups that
25249         will never be performed. 
25250
25251         (UserImplicitCast::Resolve): Eliminate, objects of type
25252         UserImplicitCast are born in a fully resolved state. 
25253
25254         * typemanager.cs (InitCoreTypes): Init also value_type
25255         (System.ValueType). 
25256
25257         * expression.cs (Cast::Resolve): First resolve the child expression.
25258
25259         (LValue): Add new method AddressOf to be used by
25260         the `&' operator.  
25261
25262         Change the argument of Store to take an EmitContext instead of an
25263         ILGenerator, because things like FieldExpr need to be able to call
25264         their children expression to generate the instance code. 
25265
25266         (Expression::Error, Expression::Warning): Sugar functions for
25267         reporting errors.
25268
25269         (Expression::MemberLookup): Accept a TypeContainer instead of a
25270         Report as the first argument.
25271
25272         (Expression::ResolvePrimary): Killed.  I still want to improve
25273         this as currently the code is just not right.
25274
25275         (Expression::ResolveMemberAccess): Simplify, but it is still
25276         wrong. 
25277
25278         (Unary::Resolve): Catch errors in AddressOf operators.
25279
25280         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
25281         index to a byte for the short-version, or the compiler will choose
25282         the wrong Emit call, which generates the wrong data.
25283
25284         (ParameterReference::Emit, ::Store): same.
25285
25286         (FieldExpr::AddressOf): Implement.
25287
25288         * typemanager.cs: TypeManager: made public variable instead of
25289         property.
25290
25291         * driver.cs: document --fatal.
25292
25293         * report.cs (ErrorMessage, WarningMessage): new names for the old
25294         Error and Warning classes.
25295
25296         * cs-parser.jay (member_access): Turn built-in access to types
25297         into a normal simplename
25298
25299 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25300
25301         * expression.cs (Invocation::BetterConversion): Fix to cope
25302         with q being null, since this was introducing a bug.
25303
25304         * expression.cs (ConvertImplicit): Do built-in conversions first.
25305
25306 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25307
25308         * expression.cs (UserImplicitCast::Resolve): Fix bug.
25309
25310 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25311
25312         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
25313         I had introduced long ago (what's new ?).
25314
25315         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
25316         the work of all the checking. 
25317         (ConvertImplicit): Call CanConvert and only then create object if necessary.
25318         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
25319
25320         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
25321         that is the right way. 
25322
25323         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
25324         overloading resolution. Use everywhere instead of cutting and pasting code.
25325
25326         (Binary::ResolveOperator): Use MakeUnionSet.
25327
25328         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
25329         we have to convert to bool types. Not complete yet.
25330
25331 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
25332
25333         * typemanager.cs (TypeManager::CSharpName): support ushort.
25334
25335         * expression.cs (Expression::TryImplicitIntConversion): Attempts
25336         to provide an expression that performsn an implicit constant int
25337         conversion (section 6.1.6).
25338         (Expression::ConvertImplicitRequired): Reworked to include
25339         implicit constant expression conversions.
25340
25341         (Expression::ConvertNumericExplicit): Finished.
25342
25343         (Invocation::Emit): If InstanceExpression is null, then it means
25344         that we perform a call on this.
25345
25346 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
25347
25348         * expression.cs (Unary::Emit): Remove some dead code.
25349         (Probe): Implement Resolve and Emit for `is'.
25350         (Expression::ConvertImplicitRequired): Attempt to do constant
25351         expression conversions here.  Maybe should be moved to
25352         ConvertImplicit, but I am not sure.
25353         (Expression::ImplicitLongConstantConversionPossible,
25354         Expression::ImplicitIntConstantConversionPossible): New functions
25355         that tell whether is it possible to apply an implicit constant
25356         expression conversion.
25357
25358         (ConvertNumericExplicit): Started work on explicit numeric
25359         conversions.
25360
25361         * cs-parser.jay: Update operator constants.
25362
25363         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
25364         (Parameters::GetSignature): Hook up VerifyArgs here.
25365         (Parameters::VerifyArgs): Verifies that no two arguments have the
25366         same name. 
25367
25368         * class.cs (Operator): Update the operator names to reflect the
25369         ones that the spec expects (as we are just stringizing the
25370         operator names).
25371
25372         * expression.cs (Unary::ResolveOperator): Fix bug: Use
25373         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
25374         previous usage did only work for our methods.
25375         (Expression::ConvertImplicit): Handle decimal implicit numeric
25376         conversions as well.
25377         (Expression::InternalTypeConstructor): Used to invoke constructors
25378         on internal types for default promotions.
25379
25380         (Unary::Emit): Implement special handling for the pre/post
25381         increment/decrement for overloaded operators, as they need to have
25382         the same semantics as the other operators.
25383
25384         (Binary::ResolveOperator): ditto.
25385         (Invocation::ConversionExists): ditto.
25386         (UserImplicitCast::Resolve): ditto.
25387
25388 2001-09-26  Ravi Pratap  <ravi@ximian.com>
25389
25390         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
25391         operator, return after emitting body. Regression tests pass again !
25392
25393         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
25394         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
25395         (Invocation::OverloadResolve): Ditto.
25396         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
25397
25398         * everywhere : update calls to the above methods accordingly.
25399
25400 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
25401
25402         * assign.cs (Assign): Make it inherit from ExpressionStatement.
25403
25404         * expression.cs (ExpressionStatement): New base class used for
25405         expressions that can appear in statements, so that we can provide
25406         an alternate path to generate expression that do not leave a value
25407         on the stack.
25408
25409         (Expression::Emit, and all the derivatives): We no longer return
25410         whether a value is left on the stack or not.  Every expression
25411         after being emitted leaves a single value on the stack.
25412
25413         * codegen.cs (EmitContext::EmitStatementExpression): Use the
25414         facilties of ExpressionStatement if possible.
25415
25416         * cs-parser.jay: Update statement_expression.
25417
25418 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
25419
25420         * driver.cs: Change the wording of message
25421
25422 2001-09-25  Ravi Pratap  <ravi@ximian.com>
25423
25424         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
25425         the type of the expression to the return type of the method if
25426         we have an overloaded operator match ! The regression tests pass again !
25427         (Unary::ResolveOperator): Ditto.
25428
25429         * expression.cs (Invocation::ConversionExists): Correct the member lookup
25430         to find "op_Implicit", not "implicit" ;-)
25431         (UserImplicitCast): New class to take care of user-defined implicit conversions.
25432         (ConvertImplicit, ForceConversion): Take TypeContainer argument
25433
25434         * everywhere : Correct calls to the above accordingly.
25435
25436         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
25437         (ConvertImplicit): Do user-defined conversion if it exists.
25438
25439 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
25440
25441         * assign.cs: track location.
25442         (Resolve): Use implicit conversions on assignment.
25443
25444         * literal.cs: Oops.  Not good, Emit of short access values should
25445         pass (Bytes) or the wrong argument will be selected.
25446
25447         * expression.cs (Unary::Emit): Emit code for -expr.
25448
25449         (Unary::ResolveOperator): Handle `Substract' for non-constants
25450         (substract from zero from the non-constants).
25451         Deal with Doubles as well. 
25452
25453         (Expression::ConvertImplicitRequired): New routine that reports an
25454         error if no implicit conversion exists. 
25455
25456         (Invocation::OverloadResolve): Store the converted implicit
25457         expressions if we make them
25458
25459 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25460
25461         * class.cs (ConstructorInitializer): Take a Location argument.
25462         (ConstructorBaseInitializer): Same here.
25463         (ConstructorThisInitializer): Same here.
25464
25465         * cs-parser.jay : Update all calls accordingly.
25466
25467         * expression.cs (Unary, Binary, New): Take location argument.
25468         Update accordingly everywhere.
25469
25470         * cs-parser.jay : Update all calls to the above to take a location
25471         argument.
25472
25473         * class.cs : Ditto.
25474
25475 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25476
25477         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
25478         (Invocation::BetterConversion): Same here
25479         (Invocation::ConversionExists): Ditto.
25480
25481         (Invocation::ConversionExists): Implement.
25482
25483 2001-09-22  Ravi Pratap  <ravi@ximian.com>
25484
25485         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
25486         Also take an additional TypeContainer argument.
25487
25488         * All over : Pass in TypeContainer as argument to OverloadResolve.
25489
25490         * typemanager.cs (CSharpName): Update to check for the string type and return
25491         that too.
25492
25493         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
25494         a given method.
25495
25496 2001-09-21  Ravi Pratap  <ravi@ximian.com>
25497
25498         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
25499         (Invocation::BetterFunction): Implement.
25500         (Invocation::BetterConversion): Implement.
25501         (Invocation::ConversionExists): Skeleton, no implementation yet.
25502
25503         Okay, things work fine !
25504
25505 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
25506
25507         * typemanager.cs: declare and load enum_type, delegate_type and
25508         void_type. 
25509
25510         * expression.cs (Expression::Emit): Now emit returns a value that
25511         tells whether a value is left on the stack or not.  This strategy
25512         might be reveted tomorrow with a mechanism that would address
25513         multiple assignments.
25514         (Expression::report118): Utility routine to report mismatches on
25515         the ExprClass.
25516
25517         (Unary::Report23): Report impossible type/operator combination
25518         utility function.
25519
25520         (Unary::IsIncrementableNumber): Whether the type can be
25521         incremented or decremented with add.
25522         (Unary::ResolveOperator): Also allow enumerations to be bitwise
25523         complemented. 
25524         (Unary::ResolveOperator): Implement ++, !, ~,
25525
25526         (Invocation::Emit): Deal with new Emit convetion.
25527
25528         * All Expression derivatives: Updated their Emit method to return
25529         whether they leave values on the stack or not.
25530
25531         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25532         stack for expressions that are statements. 
25533
25534 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25535
25536         * expression.cs (LValue): New interface.  Must be implemented by
25537         LValue objects.
25538         (LocalVariableReference, ParameterReference, FieldExpr): Implement
25539         LValue interface.
25540
25541         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25542         interface for generating code, simplifies the code.
25543
25544 2001-09-20  Ravi Pratap  <ravi@ximian.com>
25545
25546         * expression.cs (everywhere): Comment out return statements in ::Resolve
25547         methods to avoid the warnings.
25548
25549 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25550
25551         * driver.cs (parse): Report error 2001 if we can not open the
25552         source file.
25553
25554         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25555         not resolve it.
25556
25557         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25558         object. 
25559
25560         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25561         otherwise nested blocks end up with the same index.
25562
25563         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25564
25565         * expression.cs:  Instead of having FIXMEs in the Resolve
25566         functions, throw exceptions so it is obvious that we are facing a
25567         bug. 
25568
25569         * cs-parser.jay (invocation_expression): Pass Location information.
25570
25571         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25572         Use a basename for those routines because .NET does not like paths
25573         on them. 
25574
25575         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25576         already defined.
25577
25578 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
25579
25580         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25581         are loading the correct data types (throws an exception if not).
25582         (TypeManager::InitCoreTypes): Use CoreLookupType
25583
25584         * expression.cs (Unary::ResolveOperator): return the child
25585         expression for expressions which are just +expr.
25586         (Unary::ResolveOperator): Return negative literals for -LITERAL
25587         expressions (otherwise they are Unary {Literal}).
25588         (Invocation::Badness): Take into account `Implicit constant
25589         expression conversions'.
25590
25591         * literal.cs (LongLiteral): Implement long literal class.
25592         (IntLiteral): export the `Value' of the intliteral. 
25593
25594 2001-09-19  Ravi Pratap  <ravi@ximian.com>
25595
25596         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25597
25598         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
25599         instead of 'Operator'
25600
25601         * expression.cs (Binary::ResolveOperator): Update accordingly.
25602         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25603         and 'Minus'
25604
25605         * cs-parser.jay (unary_expression): Update to use the new names.
25606
25607         * gen-treedump.cs (GetUnary): Same here.
25608
25609         * expression.cs (Unary::Resolve): Implement.
25610         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
25611         operators are found instead of making noise ;-)
25612         (Unary::ResolveOperator): New method to do precisely the same thing which
25613         Binary::ResolveOperator does for Binary expressions.
25614         (Unary.method, .Arguments): Add.
25615         (Unary::OperName): Implement.   
25616         (Unary::ForceConversion): Copy and Paste !
25617
25618         * class.cs (Operator::Define): Fix a small bug for the case when we have 
25619         a unary operator.
25620
25621         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25622         for the inbuilt operators. Only overloading works for now ;-)
25623
25624 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
25625
25626         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25627         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25628
25629         * expression.cs (This::Emit): Implement. 
25630         (This::Resolve): Implement.
25631         (TypeOf:Resolve): Implement.
25632         (Expression::ResolveSimpleName): Add an implicit this to instance
25633         field references. 
25634         (MemberAccess::Resolve): Deal with Parameters and Fields. 
25635         Bind instance variable to Field expressions.
25636         (FieldExpr::Instance): New field used to track the expression that
25637         represents the object instance.
25638         (FieldExpr::Resolve): Track potential errors from MemberLookup not
25639         binding 
25640         (FieldExpr::Emit): Implement.
25641
25642         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25643         the last instruction contains a return opcode to avoid generating
25644         the last `ret' instruction (this generates correct code, and it is
25645         nice to pass the peverify output).
25646
25647         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25648         initializer for static and instance variables.
25649         (Constructor::Emit): Allow initializer to be null in the case of
25650         static constructors.  Only emit initializer for instance
25651         constructors. 
25652
25653         (TypeContainer::FindMembers): Return a null array if there are no
25654         matches.
25655
25656         Also fix the code for the MemberTypes.Method branch, as it was not
25657         scanning that for operators (or tried to access null variables before).
25658
25659         * assign.cs (Assign::Emit): Handle instance and static fields. 
25660
25661         * TODO: Updated.
25662
25663         * driver.cs: Stop compilation if there are parse errors.
25664
25665         * cs-parser.jay (constructor_declaration): Provide default base
25666         initializer for non-static constructors.
25667         (constructor_declarator): Do not provide a default base
25668         initializers if none was specified.
25669         Catch the fact that constructors should not have parameters.
25670
25671         * class.cs: Do not emit parent class initializers for static
25672         constructors, that should be flagged as an error.
25673
25674 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25675
25676         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25677         Move back code into TypeContainer::Populate.
25678
25679 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25680
25681         * class.cs (TypeContainer::AddConstructor): Fix the check to
25682         compare against Name, not Basename. 
25683         (Operator::OpType): Change Plus and Minus to Add and Subtract.
25684
25685         * cs-parser.jay : Update accordingly.
25686
25687         * class.cs (TypeContainer::FindMembers): For the case where we are searching
25688         for methods, don't forget to look into the operators too.
25689         (RegisterMethodBuilder): Helper method to take care of this for
25690         methods, constructors and operators.
25691         (Operator::Define): Completely revamp.
25692         (Operator.OperatorMethod, MethodName): New fields.
25693         (TypeContainer::Populate): Move the registering of builders into
25694         RegisterMethodBuilder.
25695         (Operator::Emit): Re-write.
25696
25697         * expression.cs (Binary::Emit): Comment out code path to emit method
25698         invocation stuff for the case when we have a user defined operator. I am
25699         just not able to get it right !
25700
25701 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25702
25703         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25704         argument. 
25705
25706         (Expression::MemberLookup): Provide a version that allows to
25707         specify the MemberTypes and BindingFlags. 
25708
25709         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25710         so it was not fetching variable information from outer blocks.
25711
25712         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25713         Beforefieldinit as it was buggy.
25714
25715         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25716         that Ravi put here.  
25717
25718         * class.cs (Constructor::Emit): Only emit if block is not null.
25719         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25720         deal with this by semantically definining it as if the user had
25721         done it.
25722
25723         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25724         constructors as we now "emit" them at a higher level.
25725
25726         (TypeContainer::DefineDefaultConstructor): Used to define the
25727         default constructors if none was provided.
25728
25729         (ConstructorInitializer): Add methods Resolve and Emit. 
25730
25731         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25732
25733 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25734
25735         * class.cs (TypeContainer::EmitDefaultConstructor): Register
25736         the default constructor builder with our hashtable for methodbuilders
25737         to methodcores.
25738
25739         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25740         and argument_count is 0 in which case we have a match.
25741         (Binary::ResolveOperator): More null checking and miscellaneous coding
25742         style cleanup.
25743
25744 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25745
25746         * rootcontext.cs (IsNameSpace): Compare against null.
25747
25748         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25749
25750         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25751         and Unary::Operator.
25752
25753         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25754         accordingly.
25755
25756         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25757         we have overloaded operators.
25758         (Binary::ResolveOperator): Implement the part which does the operator overload
25759         resolution.
25760
25761         * class.cs (Operator::Emit): Implement.
25762         (TypeContainer::Emit): Emit the operators we have too.
25763
25764         * expression.cs (Binary::Emit): Update to emit the appropriate code for
25765         the case when we have a user-defined operator.
25766
25767 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25768
25769         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25770
25771 2001-09-16  Ravi Pratap  <ravi@ximian.com>
25772
25773         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25774         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25775         (Constructor::Emit): Implement.
25776         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25777         if we have no work to do. 
25778         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
25779         Emit method.
25780
25781         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25782         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25783
25784         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25785         of parent.parent.
25786
25787 2001-09-15  Ravi Pratap  <ravi@ximian.com>
25788
25789         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25790         in the source.
25791         (Tree::RecordNamespace): Method to do what the name says ;-)
25792         (Tree::Namespaces): Property to get at the namespaces hashtable.
25793
25794         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
25795         keep track.
25796
25797         * rootcontext.cs (IsNamespace): Fixed it :-)
25798
25799 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25800
25801         * class.cs (TypeContainer::FindMembers): Add support for
25802         constructors. 
25803         (MethodCore): New class that encapsulates both the shared aspects
25804         of a Constructor and a Method.  
25805         (Method, Constructor): Factored pieces into MethodCore.
25806
25807         * driver.cs: Added --fatal which makes errors throw exceptions.
25808         Load System assembly as well as part of the standard library.
25809
25810         * report.cs: Allow throwing exceptions on errors for debugging.
25811
25812         * modifiers.cs: Do not use `parent', instead use the real type
25813         container to evaluate permission settings.
25814
25815         * class.cs: Put Ravi's patch back in.  He is right, and we will
25816         have to cope with the
25817
25818 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25819
25820         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25821         FamORAssem, not FamANDAssem.
25822
25823 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25824
25825         * driver.cs: Added --parse option that only parses its input files
25826         and terminates.
25827
25828         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
25829         incorrect.  IsTopLevel is not used to tell whether an object is
25830         root_types or not (that can be achieved by testing this ==
25831         root_types).  But to see if this is a top-level *class* (not
25832         necessarly our "toplevel" container). 
25833
25834 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25835
25836         * enum.cs (Enum::Define): Modify to call the Lookup method on the
25837         parent instead of a direct call to GetType.
25838
25839 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25840
25841         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25842         Modifiers.TypeAttr. This should just be a call to that method.
25843
25844         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25845         object so that we can determine if we are top-level or not.
25846
25847         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
25848         TypeContainer too.
25849
25850         * enum.cs (Enum::Define): Ditto.
25851
25852         * modifiers.cs (FieldAttr): Re-write.
25853
25854         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25855         (TypeContainer::HaveStaticConstructor): New property to provide access
25856         to precisely that info.
25857
25858         * modifiers.cs (MethodAttr): Re-write.
25859         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25860
25861         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25862         of top-level types as claimed.
25863
25864 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25865
25866         * expression.cs (MemberLookup): Fruitless attempt to lookup
25867         constructors.  Maybe I need to emit default constructors?  That
25868         might be it (currently .NET emits this for me automatically).
25869         (Invocation::OverloadResolve): Cope with Arguments == null.
25870         (Invocation::EmitArguments): new function, shared by the new
25871         constructor and us.
25872         (Invocation::Emit): Handle static and instance methods.  Emit
25873         proper call instruction for virtual or non-virtual invocations.
25874         (New::Emit): Implement.
25875         (New::Resolve): Implement.
25876         (MemberAccess:Resolve): Implement.
25877         (MethodGroupExpr::InstanceExpression): used conforming to the spec
25878         to track instances.
25879         (FieldExpr::Resolve): Set type.
25880
25881         * support.cs: Handle empty arguments.
25882                 
25883         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25884         SimpleLookup): Auxiliary routines to help parse a qualifier
25885         identifier.  
25886
25887         Update qualifier_identifier rule.
25888
25889         * codegen.cs: Removed debugging messages.
25890
25891         * class.cs: Make this a global thing, this acts just as a "key" to
25892         objects that we might have around.
25893
25894         (Populate): Only initialize method_builders_to_methods once.
25895
25896         * expression.cs (PropertyExpr): Initialize type from the
25897         PropertyType. 
25898
25899         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25900         Resolve pattern.  Attempt to implicitly convert value to boolean.
25901         Emit code.
25902
25903         * expression.cs: Set the type for the int32/int32 argument case.
25904         (Binary::ResolveOperator): Set the return type to boolean for
25905         comparission operators
25906
25907         * typemanager.cs: Remove debugging print code.
25908
25909         (Invocation::Resolve): resolve type.
25910
25911         * class.cs: Allocate a MemberInfo of the correct size, as the code
25912         elsewhere depends on the test to reflect the correct contents.
25913
25914         (Method::) Keep track of parameters, due to System.Reflection holes
25915
25916         (TypeContainer::Populate): Keep track of MethodBuilders to Method
25917         mapping here.
25918
25919         (TypeContainer::FindMembers): Use ArrayList and then copy an array
25920         of the exact size and return that.
25921
25922         (Class::LookupMethodByBuilder): New function that maps
25923         MethodBuilders to its methods.  Required to locate the information
25924         on methods because System.Reflection bit us again.
25925
25926         * support.cs: New file, contains an interface ParameterData and
25927         two implementations: ReflectionParameters and InternalParameters
25928         used to access Parameter information.  We will need to grow this
25929         as required.
25930
25931         * expression.cs (Invocation::GetParameterData): implement a cache
25932         and a wrapper around the ParameterData creation for methods. 
25933         (Invocation::OverloadResolve): Use new code.
25934
25935 2001-09-13  Ravi Pratap  <ravi@ximian.com>
25936
25937         * class.cs (TypeContainer::EmitField): Remove and move into 
25938         (Field::Define): here and modify accordingly.
25939         (Field.FieldBuilder): New member.
25940         (TypeContainer::Populate): Update accordingly.
25941         (TypeContainer::FindMembers): Implement.
25942
25943 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25944
25945         * statement.cs: (VariableInfo::VariableType): New field to be
25946         initialized with the full type once it is resolved. 
25947
25948 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
25949
25950         * parameter.cs (GetParameterInfo): Use a type cache to compute
25951         things only once, and to reuse this information
25952
25953         * expression.cs (LocalVariableReference::Emit): Implement.
25954         (OpcodeCast::Emit): fix.
25955
25956         (ParameterReference::Resolve): Implement.
25957         (ParameterReference::Emit): Implement.
25958
25959         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25960         that are expressions need to stay as Expressions.
25961
25962         * typemanager.cs (CSharpName): Returns the C# name of a type if
25963         possible. 
25964
25965         * expression.cs (Expression::ConvertImplicit): New function that
25966         implements implicit type conversions.
25967
25968         (Expression::ImplicitReferenceConversion): Implements implicit
25969         reference conversions.
25970
25971         (EmptyCast): New type for transparent casts.
25972
25973         (OpcodeCast): New type for casts of types that are performed with
25974         a sequence of bytecodes.
25975
25976         (BoxedCast): New type used for casting value types into reference
25977         types.  Emits a box opcode.
25978
25979         (Binary::DoNumericPromotions): Implements numeric promotions of
25980         and computation of the Binary::Type.
25981
25982         (Binary::EmitBranchable): Optimization.
25983
25984         (Binary::Emit): Implement code emission for expressions.
25985
25986         * typemanager.cs (TypeManager): Added two new core types: sbyte
25987         and byte.
25988
25989 2001-09-12  Ravi Pratap  <ravi@ximian.com>
25990
25991         * class.cs (TypeContainer::FindMembers): Method which does exactly
25992         what Type.FindMembers does, only we don't have to use reflection. No
25993         implementation yet.
25994
25995         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25996         typecontainer objects as we need to get at them.
25997         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25998
25999         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
26000         typecontainer object.
26001
26002         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
26003         of just a Report object.
26004
26005 2001-09-11  Ravi Pratap  <ravi@ximian.com>
26006
26007         * class.cs (Event::Define): Go back to using the prefixes "add_" and
26008         "remove_"
26009         (TypeContainer::Populate): Now define the delegates of the type too.
26010         (TypeContainer.Delegates): Property to access the list of delegates defined
26011         in the type.
26012
26013         * delegates.cs (Delegate::Define): Implement partially.
26014
26015         * modifiers.cs (TypeAttr): Handle more flags.
26016
26017 2001-09-11  Ravi Pratap  <ravi@ximian.com>
26018
26019         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
26020         and not <=
26021         (Operator::Define): Re-write logic to get types by using the LookupType method
26022         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
26023         (Indexer::Define): Ditto.
26024         (Event::Define): Ditto.
26025         (Property::Define): Ditto.
26026
26027 2001-09-10  Ravi Pratap  <ravi@ximian.com>
26028
26029         * class.cs (TypeContainer::Populate): Now define operators too. 
26030         (TypeContainer.Operators): New property to access the list of operators
26031         in a type.
26032         (Operator.OperatorMethodBuilder): New member to hold the method builder
26033         for the operator we are defining.
26034         (Operator::Define): Implement.
26035
26036 2001-09-10  Ravi Pratap  <ravi@ximian.com>
26037
26038         * class.cs (Event::Define): Make the prefixes of the accessor methods
26039         addOn_ and removeOn_ 
26040
26041         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
26042         of the location being passed in too. Ideally, this should go later since all
26043         error reporting should be done through the Report object.
26044
26045         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
26046         (Populate): Iterate thru the indexers we have and define them too.
26047         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
26048         for the get and set accessors.
26049         (Indexer::Define): Implement.
26050
26051 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
26052
26053         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
26054         my previous implementation, did not work.
26055
26056         * typemanager.cs: Add a couple of missing types (the longs).
26057
26058         * literal.cs: Use TypeManager.bool_type instead of getting it.
26059
26060         * expression.cs (EventExpr): New kind of expressions.
26061         (Expressio::ExprClassFromMemberInfo): finish
26062
26063 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
26064
26065         * assign.cs: Emit stores to static fields differently.
26066
26067 2001-09-08  Ravi Pratap  <ravi@ximian.com>
26068
26069         * Merge in changes and adjust code to tackle conflicts. Backed out my
26070         code in Assign::Resolve ;-) 
26071
26072 2001-09-08  Ravi Pratap  <ravi@ximian.com>
26073
26074         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
26075         instead Report.Error and also pass in the location.
26076         (CSharpParser::Lexer): New readonly property to return the reference
26077         to the Tokenizer object.
26078         (declare_local_variables): Use Report.Error with location instead of plain 
26079         old error.
26080         (CheckDef): Ditto.
26081
26082         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
26083         (Operator.CheckBinaryOperator): Ditto.
26084
26085         * cs-parser.jay (operator_declarator): Update accordingly.
26086
26087         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
26088         (CheckBinaryOperator): Same here.
26089
26090         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
26091         on the name without any prefixes of namespace names etc. This is because we
26092         already might have something already fully qualified like 
26093         'System.Console.WriteLine'
26094
26095         * assign.cs (Resolve): Begin implementation. Stuck ;-)
26096
26097 2001-09-07  Ravi Pratap  <ravi@ximian.com>
26098
26099         * cs-tokenizer.cs (location): Return a string which also contains
26100         the file name.
26101
26102         * expression.cs (ElementAccess): New class for expressions of the
26103         type 'element access.'
26104         (BaseAccess): New class for expressions of the type 'base access.'
26105         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
26106         respectively.
26107
26108         * cs-parser.jay (element_access): Implement action.
26109         (base_access): Implement actions.
26110         (checked_expression, unchecked_expression): Implement.
26111
26112         * cs-parser.jay (local_variable_type): Correct and implement.
26113         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
26114
26115         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
26116
26117         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
26118         name and the specifiers.
26119
26120         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
26121
26122         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
26123         making them all public ;-)
26124
26125         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
26126         class anyways.
26127
26128 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
26129
26130         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
26131         PropertyExprs.
26132         (FieldExpr, PropertyExprs): New resolved expressions.
26133         (SimpleName::MemberStaticCheck): Perform static checks for access
26134         to non-static fields on static methods. Maybe this should be
26135         generalized for MemberAccesses. 
26136         (SimpleName::ResolveSimpleName): More work on simple name
26137         resolution. 
26138
26139         * cs-parser.jay (primary_expression/qualified_identifier): track
26140         the parameter index.
26141
26142         * codegen.cs (CodeGen::Save): Catch save exception, report error.
26143         (EmitContext::EmitBoolExpression): Chain to expression generation
26144         instead of temporary hack.
26145         (::EmitStatementExpression): Put generic expression code generation.
26146
26147         * assign.cs (Assign::Emit): Implement variable assignments to
26148         local variables, parameters and fields.
26149
26150 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
26151
26152         * statement.cs (Block::GetVariableInfo): New method, returns the
26153         VariableInfo for a variable name in a block.
26154         (Block::GetVariableType): Implement in terms of GetVariableInfo
26155
26156         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
26157         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
26158
26159 2001-09-06  Ravi Pratap  <ravi@ximian.com>
26160
26161         * cs-parser.jay (operator_declaration): Continue on my quest : update
26162         to take attributes argument.
26163         (event_declaration): Ditto.
26164         (enum_declaration): Ditto.
26165         (indexer_declaration): Ditto.
26166
26167         * class.cs (Operator::Operator): Update constructor accordingly.
26168         (Event::Event): Ditto.
26169
26170         * delegate.cs (Delegate::Delegate): Same here.
26171
26172         * enum.cs (Enum::Enum): Same here.
26173
26174 2001-09-05  Ravi Pratap  <ravi@ximian.com>
26175
26176         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
26177
26178         * ../tests/cs0658.cs : New file to demonstrate error 0658.
26179
26180         * attribute.cs (Attributes): New class to encapsulate all attributes which were
26181         being passed around as an arraylist.
26182         (Attributes::AddAttribute): Method to add attribute sections.
26183
26184         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
26185         (struct_declaration): Update accordingly.
26186         (constant_declaration): Update.
26187         (field_declaration): Update.
26188         (method_header): Update.
26189         (fixed_parameter): Update.
26190         (parameter_array): Ditto.
26191         (property_declaration): Ditto.
26192         (destructor_declaration): Ditto.
26193
26194         * class.cs (Struct::Struct): Update constructors accordingly.
26195         (Class::Class): Ditto.
26196         (Field::Field): Ditto.
26197         (Method::Method): Ditto.
26198         (Property::Property): Ditto.
26199         (TypeContainer::OptAttribute): update property's return type.
26200
26201         * interface.cs (Interface.opt_attributes): New member.
26202         (Interface::Interface): Update to take the extra Attributes argument.
26203
26204         * parameter.cs (Parameter::Parameter): Ditto.
26205
26206         * constant.cs (Constant::Constant): Ditto.
26207
26208         * interface.cs (InterfaceMemberBase): New OptAttributes field.
26209         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
26210         the attributes as a parameter.
26211         (InterfaceProperty): Update constructor call.
26212         (InterfaceEvent): Ditto.
26213         (InterfaceMethod): Ditto.
26214         (InterfaceIndexer): Ditto.
26215
26216         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
26217         pass the attributes too.
26218         (interface_event_declaration): Ditto.
26219         (interface_property_declaration): Ditto.
26220         (interface_method_declaration): Ditto.
26221         (interface_declaration): Ditto.
26222
26223 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
26224
26225         * class.cs (Method::Define): Track the "static Main" definition to
26226         create an entry point. 
26227
26228         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
26229         EntryPoint if we find it. 
26230
26231         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
26232         (EmitContext::ig): Make this variable public.
26233
26234         * driver.cs: Make the default output file be the first file name
26235         with the .exe extension.  
26236
26237         Detect empty compilations
26238
26239         Handle various kinds of output targets.  Handle --target and
26240         rename -t to --dumper.
26241
26242         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
26243         methods inherited from Expression return now an Expression.  This
26244         will is used during the tree rewriting as we resolve them during
26245         semantic analysis.
26246
26247         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
26248         the spec.  Missing entirely is the information about
26249         accessability of elements of it.
26250
26251         (Expression::ExprClassFromMemberInfo): New constructor for
26252         Expressions that creates a fully initialized Expression based on
26253         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
26254         a Type.
26255
26256         (Invocation::Resolve): Begin implementing resolution of invocations.
26257
26258         * literal.cs (StringLiteral):  Implement Emit.
26259
26260 2001-09-05  Ravi Pratap  <ravi@ximian.com>
26261
26262         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
26263         member.
26264
26265 2001-09-04  Ravi Pratap  <ravi@ximian.com>
26266
26267         * cs-parser.jay (attribute_arguments): Implement actions.
26268         (attribute): Fix bug in production. Implement action.
26269         (attribute_list): Implement.
26270         (attribute_target): Implement.
26271         (attribute_target_specifier, opt_target_specifier): Implement
26272         (CheckAttributeTarget): New method to check if the attribute target
26273         is valid.
26274         (attribute_section): Implement.
26275         (opt_attributes): Implement.
26276
26277         * attribute.cs : New file to handle attributes.
26278         (Attribute): Class to hold attribute info.
26279
26280         * cs-parser.jay (opt_attribute_target_specifier): Remove production
26281         (attribute_section): Modify production to use 2 different rules to 
26282         achieve the same thing. 1 s/r conflict down !
26283         Clean out commented, useless, non-reducing dimension_separator rules.
26284
26285         * class.cs (TypeContainer.attributes): New member to hold list
26286         of attributes for a type.
26287         (Struct::Struct): Modify to take one more argument, the attribute list.
26288         (Class::Class): Ditto.
26289         (Field::Field): Ditto.
26290         (Method::Method): Ditto.
26291         (Property::Property): Ditto.
26292
26293         * cs-parser.jay (struct_declaration): Update constructor call to
26294         pass in the attributes too.
26295         (class_declaration): Ditto.
26296         (constant_declaration): Ditto.
26297         (field_declaration): Ditto.
26298         (method_header): Ditto.
26299         (fixed_parameter): Ditto.
26300         (parameter_array): Ditto.
26301         (property_declaration): Ditto.
26302
26303         * constant.cs (Constant::Constant): Update constructor similarly.
26304         Use System.Collections.
26305
26306         * parameter.cs (Parameter::Parameter): Update as above.
26307
26308 2001-09-02  Ravi Pratap  <ravi@ximian.com>
26309
26310         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
26311         (TypeContainer.delegates): New member to hold list of delegates.
26312
26313         * cs-parser.jay (delegate_declaration): Implement the action correctly 
26314         this time as I seem to be on crack ;-)
26315
26316 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
26317
26318         * rootcontext.cs (RootContext::IsNamespace): new function, used to
26319         tell whether an identifier represents a namespace.
26320
26321         * expression.cs (NamespaceExpr): A namespace expression, used only
26322         temporarly during expression resolution.
26323         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
26324         utility functions to resolve names on expressions.
26325
26326 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
26327
26328         * codegen.cs: Add hook for StatementExpressions. 
26329
26330         * class.cs: Fix inverted test for static flag in methods.
26331
26332 2001-09-02  Ravi Pratap  <ravi@ximian.com>
26333
26334         * class.cs (Operator::CheckUnaryOperator): Correct error number used
26335         to make it coincide with MS' number.
26336         (Operator::CheckBinaryOperator): Ditto.
26337
26338         * ../errors/errors.txt : Remove error numbers added earlier.
26339
26340         * ../errors/cs1019.cs : Test case for error # 1019
26341
26342         * ../errros/cs1020.cs : Test case for error # 1020
26343
26344         * cs-parser.jay : Clean out commented cruft.
26345         (dimension_separators, dimension_separator): Comment out. Ostensibly not
26346         used anywhere - non-reducing rule.
26347         (namespace_declarations): Non-reducing rule - comment out.
26348
26349         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
26350         with TypeContainer::AddEnum.
26351
26352         * delegate.cs : New file for delegate handling classes.
26353         (Delegate): Class for declaring delegates.
26354
26355         * makefile : Update.
26356
26357         * cs-parser.jay (delegate_declaration): Implement.
26358
26359 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
26360
26361         * class.cs (Event::Define): Implement.
26362         (Event.EventBuilder): New member.
26363
26364         * class.cs (TypeContainer::Populate): Update to define all enums and events
26365         we have.
26366         (Events): New property for the events arraylist we hold. Shouldn't we move to using
26367         readonly fields for all these cases ?
26368
26369 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
26370
26371         * class.cs (Property): Revamp to use the convention of making fields readonly.
26372         Accordingly modify code elsewhere.
26373
26374         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
26375         the Define method of the Property class.
26376
26377         * class.cs : Clean up applied patch and update references to variables etc. Fix 
26378         trivial bug.
26379         (TypeContainer::Populate): Update to define all the properties we have. Also
26380         define all enumerations.
26381
26382         * enum.cs (Define): Implement.
26383
26384 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
26385
26386         * cs-parser.jay (overloadable_operator): The semantic value is an
26387         enum of the Operator class.
26388         (operator_declarator): Implement actions.
26389         (operator_declaration): Implement.
26390
26391         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
26392         validity of definitions.
26393         (Operator::CheckBinaryOperator): Static method to check for binary operators
26394         (TypeContainer::AddOperator): New method to add an operator to a type.
26395
26396         * cs-parser.jay (indexer_declaration): Added line to actually call the
26397         AddIndexer method so it gets added ;-)
26398
26399         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
26400         already taken care of by the MS compiler ?  
26401
26402 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
26403
26404         * class.cs (Operator): New class for operator declarations.
26405         (Operator::OpType): Enum for the various operators.
26406
26407 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
26408
26409         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
26410         ostensibly handle this in semantic analysis.
26411
26412         * cs-parser.jay (general_catch_clause): Comment out
26413         (specific_catch_clauses, specific_catch_clause): Ditto.
26414         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
26415         (catch_args, opt_catch_args): New productions.
26416         (catch_clause): Rewrite to use the new productions above
26417         (catch_clauses): Modify accordingly.
26418         (opt_catch_clauses): New production to use in try_statement
26419         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
26420         and re-write the code in the actions to extract the specific and
26421         general catch clauses by being a little smart ;-)
26422
26423         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
26424         Hooray, try and catch statements parse fine !
26425
26426 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26427
26428         * statement.cs (Block::GetVariableType): Fix logic to extract the type
26429         string from the hashtable of variables.
26430
26431         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
26432         I end up making that mistake ;-)
26433         (catch_clauses): Fixed gross error which made Key and Value of the 
26434         DictionaryEntry the same : $1 !!
26435
26436 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26437
26438         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
26439
26440         * cs-parser.jay (event_declaration): Correct to remove the semicolon
26441         when the add and remove accessors are specified. 
26442
26443 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26444
26445         * cs-parser.jay (IndexerDeclaration): New helper class to hold
26446         information about indexer_declarator.
26447         (indexer_declarator): Implement actions.
26448         (parsing_indexer): New local boolean used to keep track of whether
26449         we are parsing indexers or properties. This is necessary because 
26450         implicit_parameters come into picture even for the get accessor in the 
26451         case of an indexer.
26452         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
26453
26454         * class.cs (Indexer): New class for indexer declarations.
26455         (TypeContainer::AddIndexer): New method to add an indexer to a type.
26456         (TypeContainer::indexers): New member to hold list of indexers for the
26457         type.
26458
26459 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26460
26461         * cs-parser.jay (add_accessor_declaration): Implement action.
26462         (remove_accessor_declaration): Implement action.
26463         (event_accessors_declaration): Implement
26464         (variable_declarators): swap statements for first rule - trivial.
26465
26466         * class.cs (Event): New class to hold information about event
26467         declarations.
26468         (TypeContainer::AddEvent): New method to add an event to a type
26469         (TypeContainer::events): New member to hold list of events.
26470
26471         * cs-parser.jay (event_declaration): Implement actions.
26472
26473 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26474
26475         * cs-parser.jay (dim_separators): Implement. Make it a string
26476         concatenating all the commas together, just as they appear.
26477         (opt_dim_separators): Modify accordingly
26478         (rank_specifiers): Update accordingly. Basically do the same
26479         thing - instead, collect the brackets here.
26480         (opt_rank_sepcifiers): Modify accordingly.
26481         (array_type): Modify to actually return the complete type string
26482         instead of ignoring the rank_specifiers.
26483         (expression_list): Implement to collect the expressions
26484         (variable_initializer): Implement. We make it a list of expressions
26485         essentially so that we can handle the array_initializer case neatly too.
26486         (variable_initializer_list): Implement.
26487         (array_initializer): Make it a list of variable_initializers
26488         (opt_array_initializer): Modify accordingly.
26489
26490         * expression.cs (New::NType): Add enumeration to help us
26491         keep track of whether we have an object/delegate creation
26492         or an array creation.
26493         (New:NewType, New::Rank, New::Indices, New::Initializers): New
26494         members to hold data about array creation.
26495         (New:New): Modify to update NewType
26496         (New:New): New Overloaded contructor for the array creation
26497         case.
26498
26499         * cs-parser.jay (array_creation_expression): Implement to call
26500         the overloaded New constructor.
26501
26502 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
26503
26504         * class.cs (TypeContainer::Constructors): Return member
26505         constructors instead of returning null.
26506
26507 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
26508
26509         * typemanager.cs (InitCoreTypes): Initialize the various core
26510         types after we have populated the type manager with the user
26511         defined types (this distinction will be important later while
26512         compiling corlib.dll)
26513
26514         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
26515         on Expression Classification.  Now all expressions have a method
26516         `Resolve' and a method `Emit'.
26517
26518         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
26519         generation from working.     Also add some temporary debugging
26520         code. 
26521
26522 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
26523
26524         * codegen.cs: Lots of code generation pieces.  This is only the
26525         beginning, will continue tomorrow with more touches of polish.  We
26526         handle the fundamentals of if, while, do, for, return.  Others are
26527         trickier and I need to start working on invocations soon.
26528
26529         * gen-treedump.cs: Bug fix, use s.Increment here instead of
26530         s.InitStatement. 
26531
26532         * codegen.cs (EmitContext): New struct, used during code
26533         emission to keep a context.   Most of the code generation will be
26534         here. 
26535
26536         * cs-parser.jay: Add embedded blocks to the list of statements of
26537         this block.  So code generation proceeds in a top down fashion.
26538
26539 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
26540
26541         * statement.cs: Add support for multiple child blocks.
26542
26543 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
26544
26545         * codegen.cs (EmitCode): New function, will emit the code for a
26546         Block of code given a TypeContainer and its ILGenerator. 
26547
26548         * statement.cs (Block): Standard public readonly optimization.
26549         (Block::Block constructors): Link children. 
26550         (Block::Child): Child Linker.
26551         (Block::EmitVariables): Emits IL variable declarations.
26552
26553         * class.cs: Drop support for MethodGroups here, delay until
26554         Semantic Analysis.
26555         (Method::): Applied the same simplification that I did before, and
26556         move from Properties to public readonly fields.
26557         (Method::ParameterTypes): Returns the parameter types for the
26558         function, and implements a cache that will be useful later when I
26559         do error checking and the semantic analysis on the methods is
26560         performed.
26561         (Constructor::GetCallingConvention): Renamed from CallingConvetion
26562         and made a method, optional argument tells whether this is a class
26563         or a structure to apply the `has-this' bit.
26564         (Method::GetCallingConvention): Implement, returns the calling
26565         convention. 
26566         (Method::Define): Defines the type, a second pass is performed
26567         later to populate the methods.
26568
26569         (Constructor::ParameterTypes): implement a cache similar to the
26570         one on Method::ParameterTypes, useful later when we do semantic
26571         analysis. 
26572
26573         (TypeContainer::EmitMethod):  New method.  Emits methods.
26574
26575         * expression.cs: Removed MethodGroup class from here.
26576
26577         * parameter.cs (Parameters::GetCallingConvention): new method.
26578
26579 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
26580
26581         * class.cs (TypeContainer::Populate): Drop RootContext from the
26582         argument. 
26583
26584         (Constructor::CallingConvention): Returns the calling convention.
26585         (Constructor::ParameterTypes): Returns the constructor parameter
26586         types. 
26587
26588         (TypeContainer::AddConstructor): Keep track of default constructor
26589         and the default static constructor.
26590
26591         (Constructor::) Another class that starts using `public readonly'
26592         instead of properties. 
26593
26594         (Constructor::IsDefault): Whether this is a default constructor. 
26595
26596         (Field::) use readonly public fields instead of properties also.
26597
26598         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26599         track of static constructors;  If none is used, turn on
26600         BeforeFieldInit in the TypeAttributes. 
26601
26602         * cs-parser.jay (opt_argument_list): now the return can be null
26603         for the cases where there are no arguments. 
26604
26605         (constructor_declarator): If there is no implicit `base' or
26606         `this', then invoke the default parent constructor. 
26607
26608         * modifiers.cs (MethodAttr): New static function maps a set of
26609         modifiers flags into a MethodAttributes enum
26610         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
26611         MethodAttr, TypeAttr to represent the various mappings where the
26612         modifiers are used.
26613         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
26614
26615 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
26616
26617         * parameter.cs (GetParameterInfo): Fix bug where there would be no
26618         method arguments.
26619
26620         * interface.cs (PopulateIndexer): Implemented the code generator
26621         for interface indexers.
26622
26623 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
26624
26625         * interface.cs (InterfaceMemberBase): Now we track the new status
26626         here.  
26627
26628         (PopulateProperty): Implement property population.  Woohoo!  Got
26629         Methods and Properties going today. 
26630
26631         Removed all the properties for interfaces, and replaced them with
26632         `public readonly' fields. 
26633
26634 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
26635
26636         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26637         initialize their hashtables/arraylists only when they are needed
26638         instead of doing this always.
26639
26640         * parameter.cs: Handle refs and out parameters.
26641
26642         * cs-parser.jay: Use an ArrayList to construct the arguments
26643         instead of the ParameterCollection, and then cast that to a
26644         Parameter[] array.
26645
26646         * parameter.cs: Drop the use of ParameterCollection and use
26647         instead arrays of Parameters.
26648
26649         (GetParameterInfo): Use the Type, not the Name when resolving
26650         types. 
26651
26652 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
26653
26654         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26655         and instead use public readonly fields.
26656
26657         * class.cs: Put back walking code for type containers.
26658
26659 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
26660
26661         * class.cs (MakeConstant): Code to define constants.
26662
26663         * rootcontext.cs (LookupType): New function.  Used to locate types 
26664
26665
26666 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
26667
26668         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
26669         this System.Reflection code is.  Kudos to Microsoft
26670
26671         * typemanager.cs: Implement a type cache and avoid loading all
26672         types at boot time.  Wrap in LookupType the internals.  This made
26673         the compiler so much faster.  Wow.  I rule!
26674
26675         * driver.cs: Make sure we always load mscorlib first (for
26676         debugging purposes, nothing really important).
26677
26678         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
26679         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
26680
26681         * rootcontext.cs: Lookup types on their namespace;  Lookup types
26682         on namespaces that have been imported using the `using' keyword.
26683
26684         * class.cs (TypeContainer::TypeAttr): Virtualize.
26685         (Class::TypeAttr): Return attributes suitable for this bad boy.
26686         (Struct::TypeAttr): ditto.
26687         Handle nested classes.
26688         (TypeContainer::) Remove all the type visiting code, it is now
26689         replaced with the rootcontext.cs code
26690
26691         * rootcontext.cs (GetClassBases): Added support for structs. 
26692
26693 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
26694
26695         * interface.cs, statement.cs, class.cs, parameter.cs,
26696         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26697         Drop use of TypeRefs, and use strings instead.
26698
26699 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
26700
26701         * rootcontext.cs: 
26702
26703         * class.cs (Struct::Struct): set the SEALED flags after
26704         checking the modifiers.
26705         (TypeContainer::TypeAttr): new property, returns the
26706         TypeAttributes for a class.  
26707
26708         * cs-parser.jay (type_list): Oops, list production was creating a
26709         new list of base types.
26710
26711         * rootcontext.cs (StdLib): New property.
26712         (GetInterfaceTypeByName): returns an interface by type name, and
26713         encapsulates error handling here.
26714         (GetInterfaces): simplified.
26715         (ResolveTree): Encapsulated all the tree resolution here.
26716         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26717         types. 
26718
26719         * driver.cs: Add support for --nostdlib, to avoid loading the
26720         default assemblies.
26721         (Main): Do not put tree resolution here. 
26722
26723         * rootcontext.cs: Beginning of the class resolution.
26724
26725 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
26726
26727         * rootcontext.cs: Provide better error reporting. 
26728
26729         * cs-parser.jay (interface_base): set our $$ to be interfaces.
26730
26731         * rootcontext.cs (CreateInterface): Handle the case where there
26732         are no parent interfaces.
26733
26734         (CloseTypes): Routine to flush types at the end.
26735         (CreateInterface): Track types.
26736         (GetInterfaces): Returns an array of Types from the list of
26737         defined interfaces.
26738
26739         * typemanager.c (AddUserType): Mechanism to track user types (puts
26740         the type on the global type hash, and allows us to close it at the
26741         end). 
26742
26743 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
26744
26745         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26746         RecordInterface instead.
26747
26748         * cs-parser.jay: Updated to reflect changes above.
26749
26750         * decl.cs (Definition): Keep track of the TypeBuilder type that
26751         represents this type here.  Not sure we will use it in the long
26752         run, but wont hurt for now.
26753
26754         * driver.cs: Smaller changes to accomodate the new code.
26755
26756         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26757         when done. 
26758
26759         * rootcontext.cs (CreateInterface):  New method, used to create
26760         the System.TypeBuilder type for interfaces.
26761         (ResolveInterfaces): new entry point to resolve the interface
26762         hierarchy. 
26763         (CodeGen): Property, used to keep track of the code generator.
26764
26765 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
26766
26767         * cs-parser.jay: Add a second production for delegate_declaration
26768         with `VOID'.
26769
26770         (enum_body): Put an opt_comma here instead of putting it on
26771         enum_body or enum_member_declarations so we can handle trailing
26772         commas on enumeration members.  Gets rid of a shift/reduce.
26773
26774         (type_list): Need a COMMA in the middle.
26775
26776         (indexer_declaration): Tell tokenizer to recognize get/set
26777
26778         * Remove old targets.
26779
26780         * Re-add the parser target.
26781
26782 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26783
26784         * cs-parser.jay: Add precendence rules for a number of operators
26785         ot reduce the number of shift/reduce conflicts in the grammar.
26786
26787 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
26788
26789         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26790         and put it here.
26791
26792         Get rid of old crufty code.
26793
26794         * rootcontext.cs: Use this to keep track of the parsed
26795         representation and the defined types available to the program. 
26796
26797         * gen-treedump.cs: adjust for new convention.
26798
26799         * type.cs: Split out the type manager, and the assembly builder
26800         from here. 
26801
26802         * typemanager.cs: the type manager will live here now.
26803
26804         * cil-codegen.cs: And the code generator here. 
26805
26806 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
26807
26808         * makefile: Fixed up for easy making.
26809
26810 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26811
26812         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26813         the 
26814
26815         (unary_expression): Expand pre_increment_expression and
26816         post_decrement_expression to reduce a shift/reduce.
26817
26818 2001-07-11  Simon Cozens
26819
26820         * cs-tokenizer.cs: Hex numbers should begin with a 0.
26821
26822         Improve allow_keyword_as_indent name.
26823
26824 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
26825
26826         * Adjustments for Beta2. 
26827
26828 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
26829
26830         * decl.cs: Added `Define' abstract method.
26831         (InTransit): new property, used to catch recursive definitions. 
26832
26833         * interface.cs: Implement `Define'. 
26834
26835         * modifiers.cs: Map Modifiers.constants to
26836         System.Reflection.TypeAttribute flags.
26837
26838         * class.cs: Keep track of types and user-defined types.
26839         (BuilderInit): New method for creating an assembly
26840         (ResolveType): New function to launch the resolution process, only
26841         used by interfaces for now.
26842
26843         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26844         that are inserted into the name space. 
26845
26846 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
26847
26848         * ARGH.  I have screwed up my tree so many times due to the use of
26849         rsync rather than using CVS.  Going to fix this at once. 
26850
26851         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
26852         load types.
26853
26854 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
26855
26856         * Experiment successful: Use System.Type rather that our own
26857         version of Type.  
26858
26859 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
26860
26861         * cs-parser.jay: Removed nsAliases from here.
26862
26863         Use new namespaces, handle `using XXX;' 
26864
26865         * namespace.cs: Reimplemented namespace handling, use a recursive
26866         definition of the class.  Now we can keep track of using clauses
26867         and catch invalid using clauses.
26868
26869 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
26870
26871         * gen-treedump.cs: Adapted for all the renaming.
26872
26873         * expression.cs (Expression): this class now has a Type property
26874         which returns an expression Type.
26875
26876         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26877         `Type', as this has a different meaning now in the base
26878
26879 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
26880
26881         * interface.cs, class.cs: Removed from all the sources the
26882         references to signature computation, as we can not do method
26883         signature computation during the parsing time, as we are not
26884         trying to solve at that point distinguishing:
26885
26886         class X {
26887                 void a (Blah x) {}
26888                 void a (NS.Blah x) {}
26889         }
26890
26891         Which depending on the context might be valid or not, as we do not
26892         know if Blah is the same thing as NS.Blah at that point.
26893
26894         * Redid everything so the code uses TypeRefs now instead of
26895         Types.  TypeRefs are just temporary type placeholders, that need
26896         to be resolved.  They initially have a pointer to a string and the
26897         current scope in which they are used.  This is used later by the
26898         compiler to resolve the reference to an actual Type. 
26899
26900         * DeclSpace is no longer a CIR.Type, and neither are
26901         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
26902         are all DeclSpaces, but no Types. 
26903
26904         * type.cs (TypeRefManager): This implements the TypeRef manager,
26905         which keeps track of all the types that need to be resolved after
26906         the parsing has finished. 
26907
26908 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
26909
26910         * ARGH.  We are going to have to store `foreach' as a class rather
26911         than resolving it, as we need to verify error 1579 after name
26912         resolution.   *OR* we could keep a flag that says `This request to
26913         IEnumerator comes from a foreach statement' which we can then use
26914         to generate the error.
26915
26916 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
26917
26918         * class.cs (TypeContainer.AddMethod): we now add methods to the
26919         MethodGroup instead of the method hashtable.  
26920
26921         * expression.cs: Add MethodGroup abstraction, which gets us one
26922         step closer to the specification in the way we handle method
26923         declarations.  
26924
26925         * cs-parser.jay (primary_expression): qualified_identifier now
26926         tried to match up an identifier to a local variable reference or
26927         to a parameter reference.
26928
26929         current_local_parameters is now a parser global variable that
26930         points to the current parameters for the block, used during name
26931         lookup.
26932
26933         (property_declaration): Now creates an implicit `value' argument to
26934         the set accessor.
26935
26936 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
26937
26938         * parameter.cs: Do not use `param' arguments as part of the
26939         signature, per the spec.
26940
26941 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
26942
26943         * decl.cs: Base class for classes, structs and interfaces.  This
26944         is the "Declaration Space" 
26945
26946         * cs-parser.jay: Use CheckDef for checking declaration errors
26947         instead of having one on each function.
26948
26949         * class.cs: Factor out some code for handling error handling in
26950         accordance to the "Declarations" section in the "Basic Concepts"
26951         chapter in the ECMA C# spec.
26952
26953         * interface.cs: Make all interface member classes derive from
26954         InterfaceMemberBase.
26955
26956 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
26957
26958         * Many things: all interfaces are parsed and generated in
26959         gen-treedump.  Support for member variables, constructors,
26960         destructors, properties, constants is there.
26961
26962         Beginning of the IL backend, but very little done, just there for
26963         testing purposes. 
26964
26965 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
26966
26967         * cs-parser.jay: Fix labeled statement.
26968
26969         * cs-tokenizer.cs (escape): Escape " and ' always.
26970         ref_line, ref_name: keep track of the line/filename as instructed
26971         by #line by the compiler.
26972         Parse #line.
26973
26974 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
26975
26976         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26977         to match the values in System.CodeDOM.
26978
26979         Divid renamed to Divide.
26980
26981         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26982         statements. 
26983         (Statements.set): remove.
26984
26985         * System.CodeDOM/CodeCatchClause.cs: always have a valid
26986         statements. 
26987
26988         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26989         falseStatements always have valid values. 
26990
26991         * cs-parser.jay: Use System.CodeDOM now.
26992